I would not be surprised if the developers used a regular arduino and a pc to develop the bridge.
I gave it a try with a Duemilanove (I have no Uno) and a Leonardo.
When compiled for the Leonardo, the bridge library uses Serial1 (the uart), so you have to hook up a serial to usb converter to the tx (1) and rx (0) pins. Communication with the bridge goes via this extra converter. But the upside is that you have Serial free for println debugging.
When compiled for the Duemilanove, the bridge library automatically uses Serial, so communication goes via the (only) usb cable.
As suggested elsewhere in this forum I added the possibility to start the bridge with a specified baudrate. In Bridge.h I made this change:
class SerialBridgeClass : public BridgeClass {
...
void begin(unsigned long baud = 250000) {
serial.begin(baud);
BridgeClass::begin();
}
I feel more comfortable with 115200 as baudrate, so in the ConsoleRead sketch:
Bridge.begin(115200);
Upload e.g. the ConsoleRead sketch to the Duemilanove, Leonardo....
The bridge library does not set the baud rate, so you should do that yourself:
stty -F /dev/ttyUSB0 115200
Get the YunBrigde source from Arduino's git hub repository.
The avr on the Yun fires up the bridge on linino by itself, but for experimentation on the pc you can just start it manually. e.g. for the Duemilanove:
python bridge.py </dev/ttyUSB0 >/dev/ttyUSB0
The bridge will try to run the scripst /usr/bin/blink-start and /usr/bin/blink-stop. You might comment this out in packet.py, but I just installed two dummy scripts on my pc and made them executable:
#!/bin/sh
echo "$0" 1>&2
In the scripts, make sure not to echo stuff (for debugging) on stdout because it will be sent to the arduino, messing up the bridge communictaion. That is what the 1>&2 is for: it makes sure echo's output ends up on stderr. Likewise if you want to do 'printf debugging' from the python scripts, don't use print, but use:
from sys import stderr
...
stderr.write("some string\n").
The arduino may kick out the python script by sending it the 'XXXXX' command. Just start it again or ignore the command in bridge.py.
Now, in another terminal window, say telnet localhost 6571 and you should see 'Hi, what's your name?'
I did not yet manage to make it run smoothly though. If I type my name, it takes several seconds till I see 'Hi peter! Nice to meet you!'
It looks as if for every send from the arduino to the pc, there is a latency of a second or so. I want to figure out where this comes from...I have no Yun, so I don't know whether it runs smoother on a Yun. I see no reason why it would. On the Yun, there is no usb to serial converter involved but that should not be a bottle neck?. Maybe I did not yet find the magic stty settings?.