Does anyone know if it’s possible to get BJS to communicate with an Arduino over a serial port, and separately, a motion control board over USB? I want wired connections, rather than wireless ones so there’s no WiFi setup or complications.
With respect to Arduino comms over serial, I can only find Node.js serial port examples - I’m not sure how to get this working with BJS.
With respect to the moco board over USB, I’ve got no idea where to start.
Hello! It is possible to connect BJS with Arduino over a serial port using Node JS. You could use node-serialport package (About SerialPort | Node Serialport), it is easy to understand. Node-serialport will allow you to send and recieve data from arduino to node js. You will also need to socket.io to stream your data from the serial port into your BJS page. I hope it helps you.
@PirateJC It was your YouTube video that inspired me! Thank you for that. I looked at the Arduino Robot Arm example, but couldn’t figure it out as there are lots of files and bits and bobs.
@benrigby Knockout! I’ll take a look at your work for sure.
@ilhamachmada Thank you for pointers for serial port use - this helps a lot.