All,
This is how I got Serial working over USB on my Ubuntu 12.10 PC, at least for receiving data (I have not cracked sending data yet).
I was hoping, correctly, that the spark would show up as a device of some kind such as /dev/ttyXYZ123
With the Spark unplugged, I typed the following into a terminal session:
ls /dev/ > ~/before.txt
Then I plugged the Spark in, waited for the cyan breathing, then typed:
ls /dev/ > ~/after.txt
This captured the list of all devices before and then after plugging in. So what differences were there?
sdiff ~/before.txt ~/after.txt
The above command compares the 2 files and lists them line-by-line, side-by-side and indicates where there are differences. I found two new devices, one simply called “serial” (not sure about that), the other called “ttyACM0” (more like what I was expecting).
Next, I knew I needed to set the baud rate for the device to the same rate set with the Serial.Begin() command in my firmware:
stty -F /dev/ttyACM0 9600
Finally, I could view the data arriving over the USB with the command:
cat /dev/ttyACM0
This continues to echo data until you press ctrl-C.
Home this helps someone!
Paul