python serial communication problem

XBee projects like the adapter, xBee tutorials, tweetawatt/wattcher, etc. from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
braselectron
 
Posts: 3
Joined: Mon Nov 28, 2011 1:41 pm

Re: python serial communication problem

Post by braselectron »

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.

riro424
 
Posts: 2
Joined: Mon Nov 19, 2012 12:51 pm

Re: python serial communication problem

Post by riro424 »

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

Dazheng
 
Posts: 1
Joined: Sat Mar 09, 2013 1:06 am

Re: python serial communication problem

Post by Dazheng »

That solves my problem too, thanks.

Locked
Please be positive and constructive with your questions and comments.

Return to “XBee products (discontinued)”