Hugh Blemings's Blog
   


About
Hugh Blemings's Blog, A Diary and Miscellaneous ramblings


Views
PDA Friendly View

Sections

  • Everything
  • Diary
  • Hacking
  • Music
  • HPV
  • Motorbikes
  • Random
  • Links
    Some random (and not so random) links.

  • Homepage
  • Pictures
  • Weather

  •        
    Sat, 09 May 2009

    First Free-DMX-RX Code Drop

    For the last few months I've been working sporadically on an Arduino/ATMega168 based DMX dimmer project. Going to plan, the end result will be a compact (~50mm x 22mm) PCB that provides four PWM based dimmer circuits (think 1 Watt RGBW LEDs...) with the firmware and hardware design released under the GPL and TAPR OHL respectively.

    There were a few DMX Transmitter/controller projects out there but I'd not been able to find a receiver that was both an open design and physically small. So figured would be fun to build one myself and learn the gEDA tools along the way. Was also rather inspired by what Bdale and Keith and friends are up to even if the end result is quite different!

    I'm still finalising both the hardware/PCB layout and the software but what I've dropped today ought be enough to allow those interested to tinker. At this stage the plan is that free-dmx-rx will be one of the projects in Practical Arduino. Will blog new code drops as I do them in the meantime.

    [/hacking] permanent link

    Thu, 24 Jul 2008

    Ottawa Linux Symposium Presentation

    Thankyou to the folk that attended my presentation at OLS this afternoon, a good crowd and some excellent suggestions from the audience.

    As I mentioned in the talk, I've put my slides up here and have made some additions based on discussions during and after the session. Starting to think this might be worth putting in a Wiki or sommet like that.

    Thanks again to the folk here at the conference, those around the OzLabs lunch table and from elsewhere that contributed :)

    [/hacking] permanent link

    Mon, 23 Jun 2008

    fdupes

    Stop me if you've heard this one...

    fdupes is one of those delightful utilities that you quickly wonder how you got along without. "All" it does is, given a directory or set of directories, tells you what files are duplicates. Firstly by an md5 sum then for matches by a byte by byte comparison.

    In my case I needed to rationalise our photo collection a bit as I had too many directories named things like sort-later-dont-delete/ which contained photos already dealt with. Of course as fdupes makes use of md5 sums I would also catch photos that had been renamed.

    It's got some nice options for dealing with symbolic and hard links (optimise your kernel trees anyone ?) and appears to handle large file sets efficiently. Team it with xargs and you've got a pretty formidable little tool (or an unintentionally empty home directory if you're careless I guess :)

    [/hacking] permanent link

    Tue, 15 Jan 2008

    Detaching Kernel Drivers w/libusb

    Done some tinkering with libusb this last week or so in order to get the USBmicro boards that Jeremy and I bought going.

    More on the reason for the tinkering later but in the process I discovered the kernels HID driver happily seizes the device on plugin - not unreasonable as the device identifies itself as a HID device.

    After unsuccessfully going down the route of trying to tell the kernel HID driver to ignore it, I found that libusb has a couple of functions that are intended to deal with this very situation.

    It may be poor reading of the docs or search skills on my part, but I wasn't able to find a definitive reference on how to actually use them, so here's the sequence that worked for me, edited for brevity:

        struct usb_bus          *bus_list;
        struct usb_device       *dev = NULL;
        struct usb_dev_handle   *handle;
    
    
            /* Look for the first u4xx device we can find then try and open */
        if((dev = find_u4xx(bus_list)) == NULL) {
            return NULL; 
        }
    
            /* Try and get a handle to the device */
        if((handle = usb_open(dev)) == NULL) {
            return NULL;
        }
    
            /* The kernel's HID driver will seize the USBMicro device as it
               says it's a HID device - we need to tell the kernel to 
               let go of it */
        if (usb_detach_kernel_driver_np(handle, 0) < 0) {
              /* If this fails, usually just means that no kernel driver
                 had attached itself to the device so just ignore/warn */
        }
        
            /* Set the configuration */
        if(usb_set_configuration(handle, 1) != 0) {
            usb_close(handle);
            return NULL;
        }
      
            /* Clain interface - gather would need to this for each
               interface if the device has more than one */
        if (usb_claim_interface(handle, 0) != 0) {
            usb_close(handle);
            return NULL;
        }
    
        /* etc. etc. */
    
    

    I'll post the actual code shortly, want to clean it up a wee bit first. It'll end up here but I'll post to that effect when it's up.

    [/hacking] permanent link

    Tue, 04 Oct 2005

    Block with Bandwidth

    About a year ago we bought a 16 acre block of land in Carwoola, about 10 minutes from Queanbeyan. Lu and I have long liked the idea of living out of town a bit and having space set up so that we can invite friends, family, colleagues etc. out to stay in a guest house. Idea is to set it up sorta like a retreat so folk can come and stay and have time out, watch the world go by and relax and, in the case of many of the people I know, have decent bandwidth as well so that patch can still be submitted :)

    Friends of ours live about 400m away and we've got pretty clear line of site to their place. As of about six months ago they also got ADSL - the RIM at the end of the road was upgraded. I gave Chris a hand with getting it set up and we installed a Linksys ADSL Modem/Router to feed the local network.

    A bit of browsing of their website and a few emails back and forth with the guys at Freenet Antennas confirmed my thoughts that a link between the two sites would be a no-brainer.

    At Chris' end there's a Minitar access point in one of Freenets' Rootenna enclosures that has space for the AP at the back and a 14dBi directional antenna at the front. The advantage here being that you have a very short run for RF (20cm) as the AP is right up next to the antenna. Instead you send ethernet and power up to the far end which you can do over a few tens of metres without ado, unlike 2.4GHz RF. Took some photos of all this starting here.

    Network wise, the AP at Chris' end plugs into a small DMZ so it can see the ADSL connection, but not the home network.

    The other end of the link uses a 14dBi yagi also from Freenet with a short length of coax to plug into the back of a second Minitar AP. The APs are configured in point to point mode. For now it's (obviously) a portable setup - AP runs off a 12V Gel cel and ethernet goes directly into back of my Thinkpad. Some shots of the setup used for the "First Post" entry are here.

    On the basis of the tests on the weekend it works quite nicely, indeed we were able to bring the link up by pointing the yagi away from the AP and using a signal reflected off the side of the hill. On rough calculations the antenna gain available should be good for a couple of km - I took the view that I'd rather have the extra gain to obviate any potential problems with rain and/or trees in the path

    Next steps are to get the remote end a bit better integrated (portable mast of some kind, cigarette lighter adapter for AP etc.) and then we'll be set for next time we go camping out there.

    In the meantime, if you fancy doing your next commit from among the gum trees get in touch :)

    [/hacking] permanent link

    Sun, 02 Oct 2005

    First Post

    With much assistance from Chris, first post from Jaralah :)

    More to follow...

    [/hacking] permanent link

    Mon, 11 Apr 2005

    Make Magazine

    Received my copy of Make magazine a few weeks back which I've slowly been working though. Style wise it reminds me a bit of Wired but not in a bad way - better S/NR for a start!

    There are some pretty cool ideas in there, nothing revolutionary but interesting none the less - it's not going to put Circuit Cellar out of business for example. There was a cartoon at the end that had a nice simple idea for building an electric motor around a C cell battery which I figure I'll try with Rachael. Personally I like dead tree versions of things like this but YMMV, suggest you borrow a copy before signing up.

    [/hacking] permanent link

    Sun, 06 Mar 2005

    Pockettrack

    Have managed to clean up the transmit signal by relocating some of the internal wiring in the enclosure so it's a bit further from the transmitter PCB. Also re-routed the coax to the TX antenna and GPS antenna so they're as far apart as possible. Ran for about half an hour today and every transmission sounded clean and was picked up by the APRS network. Promising.

    Enlisted Rachaels help and we finished off the wiring harness and LED assembly which I've just put on the bike. Have managed to locate it so its in my normal field of view but not to the point of being a nuisance. Few photos starting here. Will see how it all goes on the ride in to work tomorrow, all going well you'll be able to track me here.

    [/hacking/ham] permanent link

    Sat, 05 Mar 2005

    Pockettrack

    Have had the PocketTracker off the Trike for the last month or so. Trial runs I did back in February went well so all that remained was to finish putting bits together properly. The time to do so was elusive however!

    I put together a battery pack out of 6 NiMH AA cells, 2300mA capacity should allow for around 20 hours continuous operation. This ought to be enough for a normal weeks worth of commuting between charges. Battery pack has a resettable thermal fues in line to protect against shorts - don't fancy things getting too hot...

    A waterproof multi pin connector allows for charging the battery without removing it from the trike as well as configure the Pockettrack unit via a serial port. A switch adjacent to the connector switches the Pockettrack between the serial port and the GPS module.

    A 3.3V rail is continually powered from the battery pack to provide a backup supply to the GPS module. This allows it to retain ephemeris data and keep the real time clock running for a faster restart/relock when power comes back up. Since this only needed to be a few uA I was going to just use a zener and a current limiting resistor but after talking to Gavin, a longtime friend and electronics/firmware/software hacker extraordinare, I went for an ultra low standby current 3 terminal regulator instead.

    Final bit of circuitry was a switch to allow the status LEDs to be either dimmed or switched off. The need for this became clear after being all but blinded by them on an after dark ride one time :)

    Last night I put it all together - bolting the connectors, switches and battery pack in to the box and wiring it all up. Quick test on the bench looked encouraging and continued pottering with it this afternoon. Put some photos up to this point starting here.

    Michael dropped over as I was bolting the unit back on, and we wheeled the Trike outside to do some real world tests.

    Unfortunately it seems there is some RF feedback or distortion of the transmitted signal so need to do a bit of digging into that. This had occured once before and was able to cure it with internal shielding so fairly sure can be sorted. Following a hunch of Michaels am suspecting RF is being coupled in through the GPS antenna cable as it was in close proximity to the transmit antenna coax.

    Aside from sorting out said interference all that remains is putting together a more permanent wiring harness for the status LEDs, hoping to enlist Rachael's help with that again so she gets some soldering practice :)

    [/hacking/ham] permanent link

    Sun, 27 Feb 2005

    Wyong

    Last weekends trip to Wyong was fun, felt varying degrees of blah thanks to the aforementioned cold but that was forgotten for the most part courtesy of the fun had. Bought a few bits and pieces (read: junk) and after some deliberation, rather to Michael's amusement I think, a new radio for the shack at home. Had done quite a bit of reading up of the reviews at eham.net on the Yaesu FT-897 and when the vendors had them discounted by AU$300 seemed too good an opportunity to miss.

    One of the attractions of the FT-897 is that it has a very similar menuing system/UI to the FT-817 that I already own. Main differences being rather higher output power (100W on HF, 50W on 2m and 20W on 70cm) and, basically, more knobs and buttons to make it easier to drive quickly. Picked up a 13.8V/20A switchmode power supply to run it as well as some Anderson "Powerpole" connectors so can have some sort of order in my DC connections. All works nicely nicely, talked to two stations in the Ukraine this afternoon (UX0IB and UR0MC) on 20m (14MHz) with 70W into the vertical on the roof.

    Have been tending to leave the rig scanning the local 2m and 70cm repeaters when I'm in the office so have had a few nice chats with local ham friends too. Nice to be back on air :)

    [/hacking/ham] permanent link

    Sat, 19 Feb 2005

    Off to Wyong

    Heading off this afternoon with Michael to the Central Coast Amateur Radio Club Field Day, better known colloquially as Wyong Field Day This is by far the largest Amateur Radio meet/field day/junk sale in Australia - first time I've got organised to go. Will be cool to do a road trip too :)

    [/hacking/ham] permanent link

    Half Life 2/Upgrading Portnoy

    I've long been wanting to upgrade my home desktop machine, portnoy. The old configuration (ABit BP6 Motherboard, Dual Celeron 400 CPUs and 768M of RAM) had served me well but an update was in order. I'd had a lot of fun playing Return to Castle Wolfenstein and had decided that I'd wait until Half Life 2 was released and get something that would run it decently.

    Quite a bit of reading and research later I've ended up with an AMD64 system - wanted to go 64 bit and PCI-Express to get some amount of future proofing. Went for a Socket 939 3200+ Athlon 64, 1GB of Dual channel RAM, an ASUS A8V-E Deluxe Motherboard and a XFXForce XFX 6600GT video card.

    On the software side have basically ended up running a x86-32 Debian installation for now as there are issues with the XServer for x86-64 which I couldn't be bothered dealing with for now - downside of running fairly bleeding edge hardware. What is working nicely is Transgamings Cedega software to allow me to run an unmodified HL2 binary under Linux. I get a few artifacts with the graphics/fonts which am working on but the game is completely playable - getting around 50fps at 1280x1024 with the majority of the graphics options set to "High". Still tinkering basically

    Half Life 2 is just amazing and am looking forward to playing some Counter Strike with Cam on Monday too!

    [/hacking] permanent link

    Thu, 03 Feb 2005

    Pockettrack

    Some further reading and research brought me to the conclusion that all that had happened on Monday was the GPS hadn't got a fix and so stopped outputting data after a timeout. There seems to be a facility to set this with the configuration tool for the module. In the meantime the solution is simply to give it a few minutes while getting ready to lock up. Suspect adding the aforementioned backup supply will help a lot as module can then do a warm start instead. Hoping to do the backup supply and real battery pack on the weekend.

    Did the run with the mob yesterday morning and system worked really nicely. The ride home similarly worked well. Bucketed down rain though so filed that under "Character Building"

    [/hacking/ham] permanent link

    Mon, 31 Jan 2005

    Hardware Wierdness

    Ride home didn't fare so well, checked the unit half way home and no LEDs lit at all. Further investigation once home suggested that the GPS module may never have got a fix and so the PocketTrack gave up and shut itself down thinking something was amiss. Lack of standby supply means GPS unit has to do a cold start - has no idea of time or previous location and this takes longer if antenna is moving. Have some bits arriving tomorrow to rectify this so will see how that goes.

    Well chuffed with results from this morning though, if nothing else transmitter and antenna are doing the trick :)

    [/hacking/ham] permanent link

    Encouraging results

    Ride in this morning went well, good coverage on route through the back of Cook - down Heart Break Hill, will see how things go this afternoon on the route through the ANU and AIS.

    [/hacking/ham] permanent link

    Sun, 30 Jan 2005

    PocketTracker setup taking shape

    Spent some time working on the PocketTracker setup this afternoon. Made good progress and was even more enjoyable for Rachael helping out with some of it. She can now fairly claim to have stripped some Cat5 cable, soldered LEDs and have a rudimentary understanding of how it all fits together (little antenna gets position from satellites, bigger antenna transmits a signal saying where I am etc.)

    About a week back I'd mounted a commercially made ground independent antenna on the back of the trike. The one I'm using is of Australian design and manufacture an RFIndustries CD28-37. Have added a bit of bright orange surveyors tape to top so it can do double duty as a second flag :)

    Today was basically finishing up the elecronics package to connect to the antenna. Took a sequence of photos starting here which gives a pretty good guide to what I've ended up with.

    Assuming it runs well this week, final steps will be to mount the batteries in the lid of the waterproof enclosure, rig up the status LEDs so they're visible while riding and wire up the multipin connector to allow the batteries to be charged and unit to be programmed without removing it from the bike. Once again, more to follow!

    [/hacking/ham] permanent link

    Tue, 25 Jan 2005

    Where did that disk space go ?

    Like many people I invariably find myself running out of disk space, or perhaps more accurately accumulating data to fill that available. I've long thought some sort of graphical tool to let you see where you're using space would be handy. Last time I looked (a couple of years ago I guess) there was nothing out there and I baulked at writing my own, simpler to get a bigger disk :)

    Things were again reaching crisis point on the Thinkpad so went looking again, and sure enough, there is this great utility for KDE called filelight It gives you a very easy to grasp graphical display of space usage for an arbitrary directory using sectors of concentric circles. As you hover over them you get stats for the specific area and can decend into directories by clicking. It's way easier to use than describe actually, a screenshot from my mail directory is shown below.

    So... apt-get install filelight :)

    [/hacking] permanent link

    Thu, 20 Jan 2005

    Update on the Pockettracker

    Pockettracker rig I mentioned earlier seemed to work quite well which is pleasing.

    Have dissassembled the system and over the last week bought various bits and pieces to allow a more permanent installation. More to follow!

    [/hacking/ham] permanent link

    Thu, 13 Jan 2005

    Pockettracker System Integration (!)

    Couple of nights back Michael dropped over and we great evening chatting and doing some electronics hacking. I think we concluded it was the first time in about ten years we'd done that kinda thing so was well overdue :)

    Spent a couple of hours fitting the Pockettrack PCB into the die cast enclosure I'd put a GPS receiver module in about a year ago. Bit of a squeeze but went in ok. Initial tests before closing the lid seemed encouraging, module quickly aquired the SVs and we were off and running getting good APRS signals into the local iGate.

    Final checkout wasn't so promising, most transmissions sounded "dirty" like there was some RF feedback or such. Further investigation this evening confirmed that when the two boards (GPS and Pockettrack) were within a few mm of each other the RF output went noisy. Found a suitable sized piece of copper shield (plastic coated) on an old floppy drive PCB and shoehorned that in over the transmitter and soldered it to the PCB groundplane. Bingo! Clean as a whistle.

    Will try it out on the trike tomorrow so hopefully you'll see me riding in to work around 8am here

    [/hacking/ham] permanent link

    Mon, 10 Jan 2005

    First Tracking Test Results

    First go with the rather jury-rigged APRS tracking arrangement described yesterday seemed to work quite well, here is some output from FindU from the ride home

    Also found that the FindU site will let you pass a scaling parameter to the query so you get a more useful level of detail. Here is the "breadcrumb" track and last known location displays scaled so you can see more of the city area.

    [/hacking/ham] permanent link

    Sun, 09 Jan 2005

    TiVo

    Was able to spend the hour or so necessary to do the hardware mods on the TiVo I brought back from the US to make it work here in Oz. Standard PAL/Tuner modification and added an ethernet card. Moved our hard disk over from the borrowed unit we've been running for the last few months (Thanks Tridge!) and things were up and running nicely nicely. Can give Tridge his spare back now :)

    [/hacking] permanent link

    PocketTracker

    Back when we were in Austin I ordered a pair of PocketTracker kits. The intention being to use one as a portable tracking unit (along with a GPS receiver module I already had) and the other to transmit weather data from the block. The only difference between them is the firmware in one of the PIC microcontrollers. The units transmit APRS data at low power in the 2m (VHF) Ham band and are quite compact.

    Completed assembly of the tracking board this weekend. Was quite fun, Rachael helped by placing some components and applying solder as required. Nice to be able to do a bit of hardware hacking for a change too. Pleasingly the unit fired up first go with a nice clean transmit signal on the local frequency.

    The various configuration options are set with a little (freeware) PalmOS application called pTTConfig. Duly configured I gave it an on-air test and with assistance from Michael, VK1TMS a few kilometers away, was able to confirm that the signal was reasonable. A bit more tweaking of the digipeating path brought it up on FindU via the local iGate. iGate is a system that takes off air APRS data and sends it to a central server on the 'net.

    Spent a couple of hours jury rigging it up on the trike using my Garmin handheld for a GPS. Permanent arrangement will be more black box style and involve less gaffa tape :) Took the temporary setup out for a quick spin just now, light setup on GT3 worked nicely, and thus encouraged will give it a go on the way to work tomorrow. With any luck you'll be able to follow my progress here

    [/hacking/ham] permanent link

    Thu, 28 Oct 2004

    VoIP adventures

    Australian Personal Computer magazine this month are running a feature on Voice over IP which caught my interest. Thus inspired I visited the OzVoip website and arranged to buy a Sipura SPA-2000 ATA unit. This is a black (well silver) box that connects up to two conventional voice phones to ethernet. Signed up with SIPPhone as a trial which allows me to call US toll free numbers at literally no charge.

    Tried it this morning to call into a work teleconference and worked a charm. Only glitch was that the call dropped out after about half an hour, at this stage I'm suspecting a configuration error on my part.

    Next step will be to get it going with Asterisk a fully open source PBX system. This coupled with a card to connect to the PSTN (regular phone network) should allow us to seemlessly make VoIP or PSTN calls from any phone in the house. Neato!

    [/hacking] permanent link