| |
December 23, 2007
A 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 4, 2007
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, 2007
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, 2007
I’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’ve got the original vehicle, but bits of the control system have been removed, and I can’t seem to find all I think I should. Never mind, the bit I really want is the original firmware - but where would that be?
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 3, 2007
It’s not often I come across something that solves a need so completely - but it happened yesterday when I renewed my acquaintance with PRTG Traffic Grapher.
The situation: We have two networks behind a firewall - our Internal ‘trusted’ network and a DMZ for dev servers. There can be around 50 people in the office daily - that adds up to probably 100+ devices all chatting away to each other and the Internet.
Our network has grown slowly over time as the Company has expanded, but we’ve tried to keep up with things and maintain stability and performance. There’s as solid a backbone as we can get without a major restructuring, with as little ‘daisy chaining’ of switches etc as we can arrange, and things are as logical and tidy as is feasible in a ‘real’ environment with things moving all the time.
Most of the time things are tickety-boo, but every now and again things grind to a sticky mess - like when I went in yesterday morning to cries of ‘where’s the Internet?’ and ‘Why can’t I get my email?’. After a process of elimination and some realitively crude diagnostics (unplugging things to see if there’s an improvement) it was tracked down to a single machine, that either had a dodgy network card, or the cabling from the patch panel to the machine was dodgy.
Next thing that happened was the Internet started slowing down, and looking at the bandwidth stats on the Firewall showed that we were pulling almost all of our 2mbps bandwidth constantly. No idea what it’s doing or who’s doing it, but it’s going into the ‘trusted’ network somewhere.
Every time this happens I resolve to find a monitoring solution to give more visibility of what’s happening on the network, so we have advance waring of problems, and the fault finding is more scientific.
We’ve tried various SNMP tools in the past but haven’t been able to get really useful results out of the mass of irrelevant data. We’re currently also using Nagios to monitor things, but again SNMP isn’t quite as useful as one might think to see where traffic is in a network. It also cannot distinguish between traffic inside the network (e.g. accessing network shares) and that leaving the network (e.g. downloading off the Internet)
Then I stumbled across PRTG, and if it did what the site said it did it sounded ideal, so fighting to get a bit of bandwidth (it took almost half an hour to download a 13MB file!) I installed it and started playing. First thing to set up was packet sniffing, which is great in that it breaks down all traffic on a monitored network interface into protocols and graphs it.
The problem is that in a switched network the only traffic getting to my machine (doing the monitoring) is that intended for my machine, or broadcast packets. Then I remember that our Netgear ‘Smart Switches’ have a monitoring function where all traffic to one port can be mirrored to another. So I set it up to send everything that goes to the uplink port to the one my machine is connected to - bingo! I can see all traffic leaving my switch.
What I then do is install the software on a server on the same switch as the link out of the network to the firewall, and that allows monitoring of all traffic into and out of the network. With a quick few filters to ignore connections between devices inside the network, or between trusted and optional, it leaves the stuff that in all likelihood is going to be leaving the network, and there’s a fantastic graph showing what’s going on, and giving information on what connections are using the most bandwidth. No pulling out patch cables until the bandwidth stops - this shows what it is and lets us decide if it’s legit traffic and there are just too many users sharing a single internet connection, or if someone is being greedy.
Yes it does SNMP too, which I’ve started configuring to monitor traffic between switches to check our backbone is OK, but I’ve got a very useful tool now for my biggest headache - ‘Who’s using all our bandwidth?’
October 19, 2007
I’ve been off on holiday for almost two weeks now - last week was ‘real’ holiday - totally disconnected. I didn’t even have my phone on! This week I had to succumb and have been tinkering.
I’ve got some plans coming up that need me to have my Linux skills a bit more polished than they are currently so I thought I’d take the opportunity of some playtime to get back in practice.I dug out my various old boxes to see if I could get one or two working, and then started thinking about what flavour Linux to go for.
Historically, I’ve always used whatever I’ve been using in production environments. Firstly FreeBSD many (many) moons ago when I was hosted with Donhost, more recently Red Hat Fedora as most boxes I look after are with Rackspace (love them!) and run Red Hat ES3. But neither distro has really clicked with me as they’re both a bit of a pain.
In my own tinkerings I got heavily into Debian based distros when I was trying to set up a wireless network mesh before it was announced that my village would get Broadband in a sensible period of time (hence all the boxes I have kicking around) and I’ve blogged previously about trials with Gentoo. This time, I thought I’d give Ubuntu a go and so downloaded the 7.04 Server CD (I thought support would be better than Gutsy Gibbon) .
I’ve got two systems installed fine - one to play with as a dev box and one as something more stable. I want another one as I want to play with clustering, but I’m running out of decent spec hardware - I’m currently fighting to install on a K6-2 machine with 96MB RAM (all I can scrounge!) but it keeps constantly rebooting after the install but I know why - I’m writing this while I wait for ’sudo apt-get install linux-image-386′ to finish whirring. [Postscript - can't do this with only 96MB RAM - but 128MB is enough! Oh, I wish I knew where all those SIMMs I'd been keeping are!]
What else is new - thanks to Mat’s suggestion in a comment on an earlier posting I tried installing Xubuntu on a retired laptop, but I fear the spec is a bit too lowly - again I can only scrape 96MB of RAM together and even trying to install off the Alternate CD it ends up stalling. I did get a command line install running (took a couple of hours to install!) but it’s not much fun. Back to Win Me methinks.
And one of the reasons for all this - my realisation that as good as the NSLU2 might be for acting as a backup filesystem, it’s not up to much for network services - it’s sooooo slooooow!
Anyway, I can see why many people who’s opinion I trust rave about Ubuntu - it’s slick, straightforward, and … works!
September 23, 2007
We treated ourselves to a new telly, and I brought home a 32″ LG LCD.
“It’s got a PC input!” I thought, and a possible change in plan came into my head. The better half has been using an old laptop running Windows ME for some time to check email, play solitaire, and buy ’stuff’ on eBay - but it has been getting increasingly slow and temperamental and we were going to replace it. “Let’s build a media centre PC instead” I thought.
So I start window shopping - for me a very mixed experience; half pleasure, half pain. So many choices, so much to think about. I wanted to keep the budget under control, wanted a good looking functional bit of kit that Mel could use happily, it needed to be relatively fast to be future resitant, but it didn’t need to be too high spec as we wouldn’t be pushing it.
I found the Elonex Artisan LX barebones case on ebuyer which seemed like a good bit of kit and good value, so planning started on that. Next choice - processor. Now this is not the most current case, and the motherboard it comes with only supports specific processors (90nm skt 775 Pentium 4) and they’re a bit hard to get hold of now. I sound like I know what I’m talking about, and I may do now as I learned to tell my 65nm P4 from my 90nm, but at the start I couldn’t tell you much about even what a skt 775 motherboard was. So that was a problem - do I try and dig up an awkward processor and take the risk, or replace the motherboard with a newer, better supported one?
I’ll cut a long boring geeky story short - I stuck with the Elonex motherboard, found a 3GHz P4 on eBay, and we now have a swanky machine sat under our LCD TV running Windows XP, and all is great. Almost.
You see PC monitors are fine when they’re a foot or two from your face - I’ve not got the world’s best eyesight but I’m quite happy using a monitor at highest resolution. But a TV is quite a few feet away, and reading small text is a chore. So much so that we had to drop the resolution down from the max 1380×768 to a paltry 800×600 - and then you still have to strain. So no problems when watching video clips or playing spider solitaire, but reading email or web pages …
And I got a wireless keyboard with built in touchpad thingy - great, but it’s weird using that on your lap like a laptop, but the screen is a mile away and looking from one to the other ends up giving you a stiff neck.
The moral of this story - media centre PCs are different from normal ones in that you have to use them differently - lower screen resolution and different user interface. I’m glad I built it though - it’s a good bit of kit, but couldn’t replace a proper desktop or laptop.
August 24, 2007
I’ve been meaning to get around to making sure all my good files (mainly photos and some crucial documents) are properly backed up for some time - I even played with getting an old machine running as an rsync server - but it was too noisy and … crap.
So I finally got around to buying something proper, and after some research into Network Attached Storage settled on a Linksys NSLU2 with a Buffalo DriveStation 500GB USB hard drive - expandable flexible storage, and I thought there would be some fun to be had with various open source firmware available for the ’slug’.
Day 1 - install the thing in my network, get the drive formatted, set up users, get things going ‘out of the box’. Great, does what it says on the tin, I’m a happy bunny, time for bed.
Day 2 - do I quit while I’m ahead? No.
I’ve been reading up on the unslung firmware and it sounds easy, and a lot of fun. Perhaps I can get it acting as a Subversion repository, streaming media to remote iTunes etc. - all the things I don’t need but will be great to tinker with. So I get the latest release of the software, fully digest all the instructions, including the warnings, and following the process to the absolute letter (apart from ensuring I can RedBoot because I’m an optimist) I proceed to upload the .bin file through the web interface at the right moment. “Can take 5 minutes or more …” it says “… do not turn off the power while upgrading!” it says.
One hour and 5 minutes later it’s still blinking, and I’m now pretty convinced I’ve got a nicely styled plastic brick. What do I do? Should I leave it running all night in the pathetic hope that the pixies will sprinkle their magic dust and it will have sorted itself in the morning, or should I do the thing I’ve been told not to and turn it off to try and follow the process to un-brick it? Why didn’t I leave well alone?
To cut a long, boring story short, I finally managed to get into the RedBoot prompt, reading through the instructions on what to do next made me chicken out of going that route - with my luck I’d permanently screw something up. So I found a bit about using the Sercomm Updater (I only had a Windows machine to hand) - and it worked an absolute treat upgrading to the unslung firmware (brave decision - I was a gnats’ away from going back to the Linksys) Why isn’t that the first suggestion rather than teasing the unsuspecting with talk of trying to catch a 2 second telnet window with a Vulcan nerve grip keyboard maneouver?
I’ve now got an unslung NSLU2 with all the original Linksys web interface still working - when I’ve regained my composure I may see if I can figure out another way to brick the thing.
August 10, 2007
Found this app which really makes me wish my phone was 3G with a bigger screen - MGMaps - it’s a Java app that runs on most mobile phones (those supprting J2ME at any rate) and allows you to access Google Maps Yahoo! Maps.
Runs on my K750i but it’s painfully slow loading the bitmapped images. Once it does though it’s a nice interface. Very useful if you’re stuck without a map - if you know where you are (?)
Now all I need is a phone with 3G and GPS - hmmm. a Nokia N95 perhaps?
Postscript: Following instructions on mgmaps and markus.brosch.net I got mgmaps going on my PocketLoox PocketPC - and in the process got the IBM J9 Java/Midlet runtime going on Windows Mobile 5 - what fun!
July 22, 2007
I’ve been a bit lax with techy posts recently, so I thought I’d jot down some things I’ve been working on of late.
Playing with Flash Media Server and video encoding, but nothing conclusive to write about yet so watch this space.
What I have had some success with though is handling large file uploads in PHP. It’s something I’ve come across in the past that you soon hit upload_max_filesize or max_execution_time when making web apps to allow upload of files into the megabytes and the slippery slope that is increasing either or both php.ini setting in response to client requests and against better judgement.
In the past I used to set up ftp accounts and say ‘use a proper protocol to transfer files - duh!’ but that’s not exactly user friendly.
So last weekend I went on a hunt for a better solution, and particularly any client-side file upload tools - came across a few that were contenders, and finally settled on JUpload as an interim solution, saving having to code something from scratch.
I’ve previously blogged about my love/hate relationship with Open Source software - here’s one that goes down in my book as a goodie.
It took a bit of fiddling to get the demo code working - it helps if you check out the SVN head - the release package wasn’tquite working. It also took a bit of hunting to find the JUpload PHP class in the wiki which saved me a lot of time writing my own (and reinventing the wheel). It wasn’t handed on a plate how to get it working, but it also wasn’t too hard to figure out.
So I’ve got it breaking everything down into 1MB chunks, and uploads are a whole lot more reliable than just using one big fat HTTP file upload. Whether the applet will survive as is or be modified, or if I will develop something bespoke based perhaps on its core concepts only time will tell, but for now I’ve got bigger fish to tickle.
« Previous Page — Next Page »
|
|