Arduino Serial Monitor

I'm using python, on OSX, to send the Arduino some simple characters that only get received
if the serial monitor window is open in the Arduino app.

import serial
ser = serial.Serial(port='/dev/tty.usbmodemfd541', baudrate=9600)

ser.write('b')

Is there any way around that so I don't have to leave the Arduino app running?

Many thanks,

Carl

hi..

I dont know anything about OSX (MAC)...

but perhaps its because the Arduino is resetting upon serial 'open' in your script.. and you are sending the data 'too' fast? (before the Arduino is fully booted?)

I have done 'similar' on a PC using PHP (Flash GUI/front end with WAMP server installed locally) to send some serial data to be parsed by the Arduino..

and I either had to pause the script a bit before I sent any serial data.. 'or' manually disable the REST with a resistor on the Aruino board.. so that it doesnt reset upon serial open/close..

hth..

Spot on. time.sleep(2) after you open the serial port usually does the trick.

-br

thanks! :slight_smile: