Wow, I haven’t been in this mode for years, and I feel rusty! Downloading libraries, reading documentation, defining data structures, parsing strings, and even sketching a retro flowchart or two… this is definitely Good Times, but man, am I ever out of shape. But still, hot on the heels of installing Zen Cart for local development under MAMP and firing up a server on the Technologic TS-7200 ARM Linux board, my current plunge into Arduino development is like coming full circle and landing again in micro-land. That’s where I most enjoy frolicking… where I can feel the bits between my toes, there is no vertigo in the address space, and raw I/O is just a statement away.
The workspace is artificially clean now, but that won’t last long. This is the warm spot in the lab where I’ll be doing all the embedded electronics and software, and before long there will be a big folding console in the midst of it, with dangling umbilici creating a trip hazard and exposed electronics rendering the space off-limits to Java-the-cat, who is drawn to warm novel nap sites.
The first node in the shipnet is SEWAGE, a good choice since it is both useful and easy. It has ten electronically-trivial sensor inputs, including magnetic sensors on the stopcocks for thru-hulls and tank vent, a flooding sensor, electrical observation of the macerator pump circuit, Lavac head pump-stroke counter, cabin and head compartment doors, and a hack into the commercial tank level sensor (which it reads by pretending to push the button and observing the LEDs). One of its important jobs is blinking a warning if the pump circuit breaker is on and the blackwater stopcock and vent are not open… and if a careless human persists and actually fires up the powerful macerator, a buzzer will scream loudly and the node will call the Hub for reinforcements. The problem is that this can create a catastrophic mess, ranging from a damaged valve to explosive decompression of raw sewage.
The node’s routine activity is to collect simple data from those points and return it whenever requested by the hub, whereupon the values join the vast sensor map of the boat. From there it is databased with time stamps, used to answer queries from any of the comm channels, and presented graphically on the ship web server. This is one of about a dozen Arduino-based nodes, and they are joined by other data sources including the NMEA 2000 network and the Outback power system.
Here is the “hello, world” of simple I/O – a flooding sensor dangling temporarily off the Adafruit prototyping shield atop the board, with an LED reflecting the state of the magnetic reed switch. Trivial program, but that means everything in the chain is working… and is the first hurdle in getting familiar with new tools:
The next step is to cobble together a simulator for all the I/O the node will encounter, and write the program. This includes some string processing to deal with a small repertoire of 8 commands, but of course I first have to get clear on some fundamentals to streamline things at the other end (like slurping it tidily into the database). The first question, which occupied me for much of this exciting Saturday night in the lab, was whether to use key-value pairs or comma-delimited sentences reminiscent of NMEA 0183. I seriously considered fixed-format point IDs like the PGNs in NMEA 2000 (and may still), but in a small system like this I am fond of having everything human-readable. I want to be able to type a command from a terminal and see understandable text… not have to use a reference manual to translate numeric addresses into names of valves, or count commas to find the number I want.
As this shapes up, the trade-offs will settle out, but none of this is an immediate impediment to bringing the first node online.
I have still not made a final choice on the always-on computer that will talk to all these little guys while also acting as ship’s server, archivist, and general apps engine. As I mentioned in a previous posting, my first aesthetic choice would be a Mac Mini, though they do draw about 20 watts (and I was most disappointed to not see a rumored new model announced at MacWorld). I’ve also been growing very intrigued with a low-power Ubuntu Linux machine (which I won’t name just yet, but very likely soon), and that got me thinking about a role for the Technologic TS-7200 acquired for the original Shacktopus system:
This is a sweet board, currently sitting beside me on the bench running Apache. It is hilarious to FTP to it from the Mac and realize it feels and acts just like a distant server, yet only draws 400 mA of 5 volts. It would never stand up to a slashdotting, of course, but in this context it is surprisingly robust. The ship does need a “back door” node, reachable from the Net and empowered to answer queries and perform maintenance on the main system… I had considered the Make Controller for that, but it has no file system, network services, or USB host port. So this may yet find itself integrated into the nautical reincarnation of Shacktopus.
The Boat Hacking Emporium
A room full of merchandise may sound like an anchor for one who is trying to get nomadic, but I’m making good progress on the new online store… and have even lined up some excellent dealerships. My intent, of course, is to render the physical side of this business clearly defined enough that it can be handled by a manager, helping to amortize the expense of keeping home base operational while we’re gallivanting about. Besides, like most folks, I’ve been hammered by the economy… I need to deploy more nickel generators while I can!
The puzzle now is where in my tangled namespace this should live. Not including domains I maintain for non-technical friends and a few strays unrelated to boat geekery, I have these:
- BOATHACKING.COM – for the new book and maybe the store
- DATAWAKE.COM – the streaming data-collection project
- GONZOENGINEERING.COM – too nice to pass up
- MICROSHIP.COM – my front door
- MICROSHIP.NET – defensive position
- MICROSHIP.ORG – defensive position
- NOMADICRESEARCHLABS.COM – company name, but too long
- NOMADNESS.COM – the boat!
- RIGNEXUS.COM – part of Shacktopus
- SHACK2GO.COM – a fleeting product name idea, also related to Shacky
- SHACKTOGO.COM – variant on above
- SHACKTOPUS.COM – bringing this back to life as part of the ship
- SHOALDRAFT.COM – silly idea over a beer one night
- TECHNOMADIC.COM – small store for spin-off products
I’ve already let a couple go (at $15 each per year, it adds up) – Pedarka and Kayaktopus were never going to be as useful as I thought during that first neologistic buzz, though Shacktogo is cute for a portable ham-radio station. But what I really need to figure out is where to best place a store… and I’m assuming that is not in a subdirectory of another site, even though my two main ones have very nice page rank.
If someone has been through this exercise and would like to share a few thoughts, I’d appreciate it. My current thought is to use boathacking.com for that, and give it a subdirectory for material related to the new book.
Back to it! I feel the urge to twiddle some bits… but first, speaking of learning curves, Erik Satie is wonderful… here I am playing Gnossienne #3 and #4: