python serial communication problem
Moderators: adafruit_support_bill, adafruit

Re: python serial communication problem

by braselectron on Mon Nov 28, 2011 2:42 pm

meridia wrote:Yes, indeed.
I found the reason why the python script doesn't work.
In the codes as I posted before, the following line should be modified as follows.

-------------------------------------------------------------
ser = serial.Serial(SERIALPORT, BAUDRATE)
ser.open()

-->

ser = serial.Serial(SERIALPORT, BAUDRATE)
#ser.open()
--------------------------------------------------------------

ser.open() makes the access denying error becuse ser = serial.Serial(SERIALPORT, BAUDRATE) already open the port.


After many hours testing all the hardware and trying to debug the python codes, this fix was the answer!

My system is a ASUS TUV4x, 1GHz Pentium III with 1.5GB DRAM, Windows XP SP3, NVidia GeForce FX5500.
The feedback on the net and here was very misleading at first.
braselectron
 
Posts: 2
Joined: Mon Nov 28, 2011 1:41 pm

Re: python serial communication problem

by riro424 on Sat Dec 15, 2012 8:31 pm

-------------------------------------------------------------
ser = serial.Serial(SERIALPORT, BAUDRATE)
ser.open()

-->

ser = serial.Serial(SERIALPORT, BAUDRATE)
#ser.open()
--------------------------------------------------------------


This worked for me as well. Thanks!

Running Python 2.5.1 on Windows Vista SP2 32-bit for the Tweet-A-Watt.
riro424
 
Posts: 2
Joined: Mon Nov 19, 2012 12:51 pm

Re: python serial communication problem

by Dazheng on Sat Mar 09, 2013 1:09 am

That solves my problem too, thanks.
Dazheng
 
Posts: 1
Joined: Sat Mar 09, 2013 1:06 am



cron