I'm trying to integrate with Pluto a serial device with 14 digital IO channels (it's a Weeder board , see www.weedtech.com
The simplest way should be to create a GSD (Generic Serial Device) and to write some ruby snippets to manage what to send over rs232 to drive such board.
I've been told that this should be a very trivial task (no programming skill required, maybe a couple of hours job).
So you can immagine how ... ehm ... :oops: ... I feel now, because after a couple of days reading docs and making several attempts my board sadly refuses to work with pluto.
In the beginning I was thinking about a possible hw failure (maybe the device, maybe serial port) but some of the tests I've made are totally excluding this option.
So I will write here what I've made so far, hoping that some of you experienced guys may give me a hint.
The device is quite simple, there are channels from A to N that can be driven as input or output by sending/reading proper strings over serial line.
This kind of devices are stackable, so every command has to start with device ID (using letter from A to P and from a to p).
So a typical command to switch off channel A on device A will require sending the following string:
ALA (A=device, L=low, A=channel).
If I connect my weeder board on my pluto box serial port and from a text console I issue "echo ALA > /dev/ttyS0", I actually get that channel A is switched off. So serial port, serial driver, serial cable and external device are OK.
To make this working on pluto I've made the following:
- created a device template (following this http://plutohome.com/support/index.php?section=document&docID=113
- defined a couple of commands (On_A and Off_A) just to test
- added Ruby Internal Commands (as per this doc http://plutohome.com/support/index.php?section=document&docID=206
- defined proper serial parameters (dev/ttyS0, 9600 8N1)
- saved the new template
- added a child device to core (where my board is plugged in)
- on Wizard -> Devices - Generic Serial Devices I selected to edit Ruby Source Code
- in the box related to Off_A I added the code
- then I pushed Test Code to see if something happens
Unfortunately nothing happens. No data are transferred to serial device, even after a quick router reload and a full reboot.
In the log dir there is no trace of new device log (it should be something like 38671_Generic_Serial_Device), and in pluto.log I could't find trace about something related to this.
I also added a Lighting scenario, with a button that should fire the command On_A, but also here no result.
Surely I'm missing something. Is there anyone that can help me to figure out what?