TINI from Mac OS X
Still experimenting with the “master” portion of Ifos (the device itself being a Modbus slave), looking to replace/simplify the current communication path:
PC → USB-to-Serial (RS232) cable →my RS232-to-RS485 converter → Ifos
(The RS232-to-RS485 converter is described elsewhere.) The great advantage of this is unlimited flexibility; I can use just about any method to send data directly to the device, then process the response in myriad ways. Ruby has been the real workhorse here, and I rely on
irb and my tiny Modbus master for most of this communication and control.
Practically speaking, though, an Ethernet connection would be more user-friendly. Ifos doesn’t have one of its own because I thought that would be overkill. The slaves are supposed to be cheap and simple, and you can’t get much simpler than basic serial connections. (Well, ok. RS232 is simpler than RS485, but it can only connect two devices together, and RS422 is limited to 10.) Using a PC as the master has been fine for development, but the plan has always been to have a small, web-server-capable device provide the interface between Ifos and the rest of the world.
Enter the TINI® network microcontroller. A while ago I spent about $100 on the DS80C400 Evaluation Kit, and though I didn’t do much with it at the time, it was clear that building an Ifos master on the TINI platform would be possible. Unfortunately, I’ve since started a love affair with a new iMac, and the TINI development environment is PC-based. I had already updated the TINI firmware from the PC, but I’d really like to use the Mac going forward.
Problem 1: No drivers for my USB-to-Serial cable
Though TINI supports TCP/IP over Ethernet, its IP address and submask must be configured first. TINI has a control serial port, but the new iMac didn’t support my old RadioShack USB-to-Serial cable. Using USB Prober (Developer » Applications » Utilities » USB Prober), however, I was able to determine it used a Prolific chipset:
A Google search led to an Apple support page discussing the PL2303 chip, which led to a driver project on SourceForge. I didn’t have any proof that this was the correct Prolific chip, but I took a chance and installed it anyway. Worked great!
Problem 2: No HyperTerminal on Mac
Turns out this is a non-issue, since OS X provides an actual terminal program (Applications » Utilities » Terminal). I used
screen to connect to the appropriate tty at the appropriate baud rate (TINI uses 115200 by default):
I powered up the TINI, and voilà!
Problem 3: TBD, but I’m sure I’ll run into something
Still, I’m happy with small successes. Next step, write a light-weight Modbus controller for TINI (or maybe just use jamod) and a REST web service to wrap it.