My problem started with the fact that I was using an old Arduino from the great guys at Seeed Studio: nothing wrong with the board, I used is for so many projects and I will keep using it, but in this case it turns out it wasn't a good idea to try to make it work. I connected it to my Linux Mint laptop and tried the first small sample code from node-ardx: nothing - the code would start, detect the Arduino on /dev/ttyUSB0 sit there for a while and then time out. Searched a lot left and write and found a lot of ideas on the github johnny-five issues list but nothing worked (used cu to set the speed, installed an older Firmata 2.2, and many more tries). I knew node-red has an Arduino node (using arduino-firmata) so I tried it as well on my laptop without any success (getting errors like serial port not found, post closed and others). Since I knew node-red can work with Arduino on a Raspberry Pi because I was able to make it work very easily a while back during a hackathon, I connected my Arduino to my B+ RasPi and gave it a try with node-red: it worked from the first try. However, johnny-five still didn't work on the RasPi.
This was getting frustrating so following one of the issues on johnny-five repo mentioning problems with Duemilanove Arduinos I decided to use a different board: I have a SparkFun RedBoard around so installed Firmata on it, connected it to my Linux Mint laptop and guess what: johnny-five worked immediately. I was a bit surprised when I saw johnny-five identified the port as /dev/ttyUSB0 because I thought RedBoard is basically a Uno and according to the list found in this stackoverflow issue it should have been /dev/ttyACM0 (as the first Arduino I tried with node-red on RasPi at the hackathon); the list by the way says:
- Duemilanove - Serial chip: FTDI FT232RL; Serial port: /dev/ttyUSB0
- Uno - Serial chip: Atmel ATmega16U2 (or 8U2 on older boards); Serial port: /dev/ttyACM0
- Leonardo - Serial chip: Atmel ATmega32U4 (built-in); Serial port: /dev/ttyACM0
For now, my lesson is that Duemilanove Arduinos may have problems talking to node.js so I decided to stick with the RedBoard (or one of the Leonardos I have around) and keep the older Seeeduino board with the bluetooth module for communication with my Android phone (which works great by the way, using the Amarino library but that is subject for some future post).
No comments:
Post a Comment