I’ve been trying to get the spark cli to work with the serial port on OpenBSD (current (5.5)). But it fails to locate serial port on OpenBSD. I’me not sure its spark-cli node.js issue or the serialport implementation of the npm serial port module being not aware of serial port name calling on OpenBSD.
/dev/cuaU0 would be the first usb serial port on OpenBSD.
Where can i find/start with debugging this? I searched quickly thru the code to locate some serial defines or a like. Found a mention of /dev/ttyACM but linking this to the actual /dev/cuaU0 did not work.
How does node,js, spark-cli access the serial interfaces and how can I debug it so a patch/change request can be made to the community?
I’me not sure. I can connect to the core using cu -l /dev/cuaU0 -s 9600. And on MacOSX i get with spark serial list the core listed. So the core is with spark -cli viewable on MacOSX but not on OpenBSD. I suspect naming conventions (usb devs, vendor ids etc). As i checked the source I see SerialCommands,js does call function findCores (line 97 of SerialCommands.js) and few lines below:
//not trying to be secure here, just trying to be helpful.
if ((port.manufacturer && port.manufacturer.indexOf("Spark") >= 0) ||
(port.pnpId && port.pnpId.indexOf("Spark_Core") >= 0)) {
cores.push(port);
}
May be this is where its fails to “find” the cores?
Just a other quick question for debuging. How can i check the pnpId or manufacturer of the serial ports. I am not yet any node.js script/programmer, Is there a small program available runable to list the port information available?
The spark serial wifi /dev/cuaU0 and spark serial monitor /dev/cuaU0 seem to work. But list and identify fail. It seems serial I/O using node.js on OpenBSD is not yet fully supported. If I find anything I’ll report it here.
The different USB virtual serial drivers use different defaults, and I know on Ubuntu the typical manufacturer identification stuff doesn’t work as expected, so we have a hardcoded check for /dev/ttyACM* if no other ports are found, so I’ll add a similar default check for /dev/cuaU*.