Serial communication between Python and off-board Arduino


I'm working on a project that involves two Arduinos implemented off-board receiving serial data from a computer.

Currently I've got the project receiving the data from the MIDI output on my Firebox, which works great (inexplicably - didn't use an optoisolator and it doesn't like to receive MIDI data from any other devices). What I'd like to do is use my Arduino board (ATmega-less) for its USB-Serial chip and communicate directly Python -> ATmegas.

I'm concerned that there's some sort of message mismatch, maybe bytes or something.

On the Arduino, this is what I'm doing:

byte incomingByte;
incomingByte =;
if (Serial.available() > 0) {
    incomingByte =;
    if (incomingByte== 176){
    else if ( (action==1)&&(controller==0) ){
    }else if ( (action==1)&&(controller!=0) ){
      writeLights(controller, value);

and this is what I was doing with Python:

ser = serial.Serial("/dev/tty.usbserial-A6008hrf", 31250)

def sendMidi(status, controller, value):

def main():
    sendMidi(176, 37, 127)

Now I was hoping that I could just connect the Serial RX pin on the Arduino board (ATmega-less) to the Serial RX pin on my off-board Arduino. This didn't work. The board's Rx LED lit up, so it's receiving something... I'm just not entirely sure how to troubleshoot this. I would love to know the actual bytes coming off the Arduino, but I don't have an LCD...

Why are you doing a before checking to see if there is any data to be read?

Err that'd be a typo. It's not there in my real code.