So lets get blinky installed on the arbotix from the Raspberry Pi. To avoid repeating all the build parameter for the target board model and the serial interface we add a ino.ini file with the following configuration.
board-model = arbotix
serial-port = /dev/ttyUSB0
Use the dmesg command to figure out where your serial interface ends up. This is also safer as now we don't have to remember to add the flags which could have sad result if we accidentally build a Uno target and try to send that to the ArbotiX. Next we clean the previous build stuff to be sure we have the right. As the documentation for ino is a bit light outside the getting started I resorted to looking up the commands directory in the python code that was a bit more forth coming. I could verify that there is indeed a clean command and that it basically just wipes the .build folder that can easily be overlooked as it is hidden by default due to the . in front of the name. So lets execute:
$ ino clean
Build again, relying on the ino.ini to set the board model and serial port to use.
$ ino build
Then we upload to the device.
$ ino upload
That produces lots of rapid green light blinking and finally a happy 'avrdude done. Thank you.' message in console and a steady blinking light on the arbotix. Seems like the mission is a success. We have a successful upload of firmware from a Raspberry Pi using the USB FTDI serial interface to the ArbotiX robot controller using command line.
Before I declare victory I try out the serial communications and create a new empty ino sketch.
$ mkdir serios
$ cd serios
$ ino init
$ nano src/sketch.ino
paste the serial code from the ino getting started replacing all the contents.
then I copy the ino.ini file from the blinky project over and build
$ cp ,,/blinky/ino.ini .
$ ino build
$ ino upload
Then I attempted to connect to the serial port using ino
$ ino serial
That failed as ino could not locate the picocom program it uses for the serial communications. Thankfully that was readily available via apt-get
$ sudo apt-get install picocom
After that things worked out better and I got a steady steam of millisecond readouts. Ctrl-A, Ctrl-X killed the session and normality was restored once more.
Next I will try to build the arbotix_ros firmware and see where that gets me. But that is a different story for later.
No comments:
Post a Comment