Now this is a mower
What trundle wants to be when it grows up
August 4, 2008March 4, 2008A little knowledge is a dangerous thingI like to think I know a little bit about most things surrounding the Internet, and whilst not claiming to be an expert I like to think I’m at least competent in most things I turn my hand to. But every now and then I get caught out, and reminded how dangerous it can be to tinker with things you don’t fully understand - there are some people out there with far too much time on their hands. As part of my Trundle project, I attempted to make a webserver running on the beast’s eventual operating system available to the public Internet - not for public consumption mind, but so I can see it when I’m out and about. Now I didn’t want to put the whole thing on a public IP address, just a little bit of it - and apart from anything else I’ve already got an externally available webserver on my Internet connection. So my idea was to use mod_rewrite to proxy a set of urls to the internal server’s private IP address. I’m sure it’s something I’ve done before in other Apache instances, and it sounded feasible, but for once Ubuntu fought back a bit. Still, I felt I’d prevailed. Now it turns out I’d opened up a vulnerability to someone, somewhere, to do something with my network. It was cunningly disguised in that the traffic wasn’t enough to be hugely obvious, but I was playing with awstats and got curious about some odd traffic. It turns out I’d unintentionally configured my webserver to allow anyone to use it to proxy requests to anywhere else. Short of cloaking the eventual source (or destination?) of the traffic I can’t see what was gained - the requests seem mostly to have been for banners or clickthrus in flash game sites. I wasn’t hosting the files so nothing was gained in terms of bandwidth, and it doesn’t seem like a ddos attack. Anyway, I’ve disabled the proxying functionality now, and checking the logs although I’m still getting the requests they now get a 403 response. I hope they’ll die out eventually, or will I have to get my fixed IP address changed do you think? Postscript RESOLUTION? use ProxyPass directive December 30, 2007It Trundles!Success came about 4pm last night, when I finally managed to get my stripped down electric wheelchair not only moving forwards, but also backwards under control of the PIC microcontroller. Today I took it for a walk around the garden on a log serial lead. Perhaps I should call it Fido? So what do we have? We start off with a small Visual C++ app which reads a standard PC joystick, and sends the values read as a string down COM1 serial port. A PIC24F 16 bit microcontroller mounted on an Explorer 16 demo board receives that data, does a quick calculation to turn speed and steering information into differential speed and direction data, and uses this to control the duty cycle of two PWM outputs and matching digital outputs for direction. The PWM output for each wheel is fed into a 4QD VTX-40 motor controller - the direction signal is amplified by a transistor and fed in place of the reverse switch. The rest is the original wheelchair - two 12V batteries feeding 24V to the controllers, and two geared 24V DC motors. Next step - replace RS232 wired communications with ethernet, and get this going over wifi so the vehicle is literally wireless. December 23, 2007Trundle firmware almost readyA few weeks back I craked getting Visual C++ to read joystick data and send it down a serial stream. Today I’ve run first tests with the Explorer 16 board using the PIC24 device to receive and parse that data from one of the UARTs, apply a differential steering equation, then use the calculated value as the duty cycle of tow channels of PWM ready to be connected to the motor controllers. So far, I’m on course to achieve my first goal of having a joystick connected to a PC controlling the wheelchair rather than the dedicated controller, hopefully in the first couple of weeks in January. All that’s stopping me now is wiring, mechanics, and whatever gremlins I’ve not anticipated. December 6, 2007Learning to fly the PIC24
In another life I did a fair bit of PIC programming - on 8 bit devices - but I have to admit I’ve probably forgotten most of it, I worked in assembler, and I know little about the 16 bit RISC architecture let alone programming it in C. So I do what I normally do when I’m breaking new territory - buy a good book or two. I’ll own up now that I’ve only read the back cover, the introduction and the first chapter (the obligatory hello world!) but I can already tell I’m going to like it - it’s speaking my language. Lucio is a private pilot, and the book’s subtitle relates to the way he describes the process of developing in aviation terms; and I think it works well - flight plan, preflight checklist, the flight, post flight briefing and references. The topics cover are mostly directly relevant to me too - from initial familiarisation with the various environments, references and techniques, through key topics such as I/O, interrupts, A/D, Async comms and for good measure using the onboard LCD display. Yes it’s going to be a real drag stopping myself from jumping into the fun of later topics, but I know from previous experience that time spent in fundamentals pay dividends down the line. December 4, 2007I take it back (sorry!)Further to my rash proclamation that I hate Windows programming! I have to humbly issue a retraction (lest the machines drive me mad) It turns out that I’m just too lazy and impatient to RTFM. Having stepped back a bit, dug out some old books and done a bit of Googling, I’m getting it under control and one of the main driving factors of this project is coming into play - i.e. it’s a big learning experience in an arena that I have had not enough exposure to. My demands on the Windows development aspect of it are not enough to warrant my tirade - since that impetuous posting I’ve actually got on quite well and have serial communication starting to happen. What’s holding me back currently is my inadequacies in C (let alone C++) programming but I will have to sort that out as I currently intend to use C to program the Microchip devices. So where did I stash my old Uni textbooks? I know I’ve got kernighan and ritchie somehwere! December 1, 2007I hate Windows programming!It’s been a good few years since I tried in earnest to write anything for the Windows environment, but a day wrestling with Visual C++ and it all comes flooding back. Why is everything so flaming complicated? It may seem to be easy to do relatively simple things like designing dialogs and laying things out in a window, but when it comes to tying it all together and doing something useful with the app - and bear in mind that I tend to do I/O or other such functionality - it’s a bleeding nightmare. So I’m sat here frustrated when I start remembering how much more satisfying I found Java when I was developing neural networks and genetic algorithms. ‘Can I talk to serial interfaces and read from joysticks?’ I wonder, and a quick bit of Googling and I’ve found a few references to potentially useful iraries and I have to say it looks hopeful. So before I fully commit to the hateful slog that will be Visual C++ development, I might spend a few hours seeing if my forehead will have less brick imprints if I build usingJava instead. It certainly would have a nicer feel to it. November 24, 2007Long term backupsI’ve been digging out all the old boxes figuring out what I’ve got and what I did last time with Trundle. Ah the memories, but faded and incomplete. If only I’d kept better records!
I’m not even sure when I did this thing - it seems to be somewhere in the region 1998 - 2002 - certainly before I got my current desktop computer, and I haven’t still got the machine I was working on in the original state, even if I could remember which of many I’ve had in the past I was working on at the time. I must have made backups of this stuff I spent so much time on? Apparently not! I’ve got a corrupt CD saying ‘pre Linux big backup 26/7/01‘ which sounds hopeful as one of the contender machines got reformatted with FreeBSD. I also found a ZIP disk with a backup of my htdocs folders from the websites I was running then, including several development projects alas not including trundle. So it looks like I’ve lost the sourcecode - apart from a dusty manky remins of the vehicle all I have to show for it is a faded Polaroid photo. The moral of this story - keep backups, and preferably in a format you can get to them again in the future - and your best chance is if you publish stuff to the web. November 18, 2007Trundle IIEver since I started playing with batteries and wires - and my folks will tell you I was very little when that started - I’ve been tinkering with all sorts of robotic vehicles. As time, and knowledge, and resources increased they got increasingly complex, but somehow I never got round to building anything really satisfying. The last machine was quite cool - the original ‘trundle’ - never quit got to be a robot was but was quite good as a remotely operated vehicle. Two geared motors on a disk of MDF, a PIC microcontroller and crude motor controller, mono ccd camera and all power and data coming down a bundle of cables. At the other end another microcontroller and two joysticks, an LCD monitor and crude power supply. It ‘trundled’ quite well within range of the umbilical and fun was had. That was quite a few years ago now and has been accumulating dust since then - the excuse has always been that I need a more substantial chassis to carry more gear to keep the results coming that I need to keep myself enthused.
Through a happy series of circumstances I’m now the proud owner of an old battery powered wheelchair, in full working order. That’s given me two 24V DC geared motors and wheels, two 12V 33Ah sealed batteries, a battery charger, and a metal tubular chassis to hold it all together. Currently I’ve also got the controller unit but that’s probably got to be the first thing to be replaced with one I can talk to digitally. Over the intervening years I’ve also accumulated a load of other useful stuff: old laptops, a flux gate compass module, ultrasonic range finders, wifi equipment, other microcontroller gear, and although time might be a bit tight right now I would like to think I’ve got more ‘resource’ available than at any time in the past. So what is my ultimate goal for Trundle II? I’d like to build a semi-autonomus roving vehicle, like the Mars rover. Being fed the odd instruction from home base,and reporting back where it is and what it’s doing, but on the whole having to fend for itself in the ‘real’ world (e.g. my garden) First target I think is to get the chassis under computer control, so whereas it’s now moving around via a joystick on the dedicated controller, let’s define success as controlling it via a PC joystick plugged into a laptop? That’ll take me a month or two! |