Skip to main content
Topic: Pybuspirate scripts give error on windows (Read 2027 times) previous topic - next topic

Pybuspirate scripts give error on windows

Tried looking at the Pybuspirate scripts today but I didn't get far.

Code: [Select]
select.select([], [], [], timeout)

I get a select error on Windows.

I don't know much about serial comms at the momment so I had a question.

Because there isn't anything in brackets does this mean you are using the select call just for timing - not actually for waiting?

I put something in the brackets based on something I read in another thread and didn't get the error anymore but I did fail to connect so it prolly messed up the timing part?

I am keen to use python to drive a Rainbowduino with I2C and a few BlinkMs too.

Re: Pybuspirate scripts give error on windows

Reply #1
I think you need to give it some extra params. I don't know python but I found this one for you:
http://bytes.com/topic/python/answers/4 ... erial-port

i think you need this:
Code: [Select]
import serial

ser = serial.Serial('COM1', 115200, timeout=1)


the pyserial documentation is here : http://pyserial.sourceforge.net/


edit: buspirate operates at 115200baud off course

Re: Pybuspirate scripts give error on windows

Reply #2
Thanks for your reply.

Code: [Select]
ser = serial.Serial('COM1', 115200, timeout=1)

I'm pretty sure I tried that amongst a few other things. Bascially what I found is that Python on windows does not like the select.select call. From what I read on forums I might have to find another mechanism to replace that call to get this script working, on windows.

When I get home today I'm going to try that line again just in case I messed something else up when I tried it the first time.

Controlling the BlinkM and Rainbowduino via i2c worked just fine using the BP terminal interface. So now I am keen to get python sending i2c commands.

Re: Pybuspirate scripts give error on windows

Reply #3
Please keep us updated. I don't have a lot of experience with Python on Windows, if you locate an issue please let me know so I can get it updated in the python library.
Got a question? Please ask in the forum for the fastest answers.