Pages: [1]   Go Down
Author Topic: Arduino Serial Monitor  (Read 497 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1243
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..

Logged


0
Offline Offline
God Member
*****
Karma: 39
Posts: 988
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

-br
Logged

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1243
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks!  smiley
Logged


Pages: [1]   Go Up
Jump to: