Spark cli on OpenBSD

Hi,

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?

Regards

Robert

Spark-cli is written on Node.js and the serialport module is used to access the core via Serial.

Is your core in Serial mode or DFU mode somehow?

List out all the USB devices to see if the :spark: core is showing up on the machine as a COM port or DFU device.

Hi,

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?

Regards

Robert

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?

Regards

Robert

I think that’s like a OpenBSD command line question.

The code you posted above is meant to filter the Serial ports hoping that it does not cause more confusion to users of Spark-CLI.

Seems like the :spark: core is appearing with a different device id in OpenBSD…

You can try to uncomment the if statement and see if the core gets listed.

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.

2 Likes

Great input over here @blacqui :smile:

I’m sure @Dave would like to know about this :smiley:

2 Likes

Heya!

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*. :slight_smile:

Thanks!
David

1 Like