Friday, October 17, 2014

Spent way too many hours fighting with two different Flea3 cameras from Point Grey lately. All the software is hidden behind a login page, and they'll spam you if you sign up. Lots of different obscure and unhelpful error messages, and one of the cameras bricked when I tried a firmware upgrade.

It's not too much to ask for a machine vision camera that:
- Works with linux
- Has Open Source software that I can "apt-get install"

Wednesday, October 01, 2014

I picked up a IOIO board from SparkFun. I want to control its PWM channels from my Ubuntu workstation (no android involved). Fortunately, I work near Ytai, so I was able to pick his brain when I got stuck!

This was a reasonable place to start, and helped me get my udev rule set up so that I saw /dev/IOIO0 when I plugged in the board:
https://github.com/ytai/ioio/wiki/Using-IOIO-With-a-PC

It also reminded me to set the switch on "A" instead of "H".

Next I downloaded App-IOIO504.zip from here:
https://github.com/ytai/ioio/wiki/Downloads

We hypothesized that it didn't like the -D at the end, so we tried again with different argument order, and that got us a little farther:
$ java -Dioio.SerialPorts=ACM0 -jar HelloIOIOSwing.jar
[D/IOIOConnectionRegistry] Successfully added bootstrap class: ioio.lib.pc.SerialPortIOIOConnectionBootstrap
[D/SerialPortIOIOConnectionBootstrap] Adding serial port ACM0
[D/IOIOImpl] Waiting for IOIO connection
[V/IOIOImpl] Waiting for underlying connection

...

Ytai had me install screen and run $ screen /dev/IOIO0, and we verified that it got back some printable data from IOIO when it started up, so we knew the board was alive. Next we checked what firmware revision was on the board using ioiodude (also from the downloads page above).

We also downloaded the latest version of the firmware, App-IOIO0500.ioioapp, by clicking on the QR code next to the link to the .zip file.

$ unzip IOIODude-0102.zip

$ ./ioiodude --port=/dev/IOIO0 versions

IOIO Application detected.

Hardware version: SPRK0020

Bootloader version: IOIO0400

Application version: IOIO0330

We rebooted the IOIO otg in bootloader mode so that it could be reflashed. That involved jumpering the "boot" pin to ground while powering up the board. Then we could reflash it:

I want to make a simple app to control PWM channels on the IOIO board, and I'm not an eclipse user, so Ytai showed me how to extract and create the appropriate .jar files. First I unpacked the HelloIOIOSwing app:

$ mkdir unpacked

$ cd unpacked/

$ jar -xvf ../HelloIOIOSwing.jar

Then he had me delete the ioio/examples directory and make a jar file for the IOIO framework:

$ cd ioio

$ rm -rf examples/

$ cd ..

$ jar -cvf ioio.jar ioio

ioio.jar, jna-4.0.0.jar and purejavacomm-0.0.21.jar should then suffice to let me build my own app.

I put the three jarfiles in a clean directory, then I downloaded HelloIOIOConsole.java from here: