Tag,
This sounds perfect. I really should move over to your code rather than continue to use Michael's. His was a great learning experience, but I think I need to use code that is in active development. Time to do some more homework....
EDIT: Tag, I continue to have an error running your code unmodified. It is (verbose logging):
18:08:09.894 VERBOSE Just Queued Message to send: 255,0,255,165,10,16,34,209,1,12,1,191
18:08:09.901 VERBOSE Done queueing messages to retrieve Custom Names and Circuit Names
18:08:09.931 VERBOSE Wrote 255,0,255,165,10,16,34,202,1,0,1,172 and # of bytes undefined Error?: null
/home/pi/pool2/index.js:590
if (b.data
== 0) {
^
TypeError: Cannot read property '0' of undefined
at SerialPort.<anonymous> (/home/pi/pool2/index.js:590:35)
at SerialPort.emit (events.js:95:17)
at Object.module.exports.raw [as parser] (/home/pi/pool2/node_modules/serialport/lib/parsers.js:7:13)
at SerialPort.settings.dataCallback (/home/pi/pool2/node_modules/serialport/lib/serialport.js:147:14)
at SerialPort._emitData (/home/pi/pool2/node_modules/serialport/lib/serialport.js:350:18)
at SerialPort.<anonymous> (/home/pi/pool2/node_modules/serialport/lib/serialport.js:330:14)
at SerialPort.<anonymous> (/home/pi/pool2/node_modules/serialport/lib/serialport.js:343:7)
at Object.wrapper [as oncomplete] (fs.js:466:17)
pi@raspberrypi ~/pool2 $
Not able to run your code as is, I have made numerous attempts to strip out all code not related to talking to the pump, and it then runs without error, but does nothing. On the http debug screen, nothing is shown when I select listen. In silly logging mode, it shows no communications at all with my Pump. Yet od -x < /dev/ttyUSB0 shows correct traffic signatures. I also tried to talk to the program via http://localhost:3000/circuit/1/toggle or http://localhost:3000/pump. They do show a response, with blank with no data.
Any ideas on how to debug this? The only difference is that I do not have a standard controller. My controller is the Intermatic which acts like the IntelliComII, but keeping the pump always in remote mode. It would be great if there was a way that your code would work with only a pump and a IntelliComII controller, which is pretty much what I have.