Please login or register.

Login with username, password and session length
 

News:

Latest updates at DangerousPrototypes.com.


Author Topic: Pybuspirate scripts give error on windows  (Read 184 times)

vicx

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Pybuspirate scripts give error on windows
« on: January 31, 2010, 10:07:52 AM »
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.

Sjaak

  • Fellow
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +263/-0
  • Überprutser
    • View Profile
Re: Pybuspirate scripts give error on windows
« Reply #1 on: January 31, 2010, 03:39:02 PM »
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/453772-accessing-windows-serial-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

vicx

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Pybuspirate scripts give error on windows
« Reply #2 on: January 31, 2010, 07:36:39 PM »
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.


ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2898
  • Karma: +61/-0
    • View Profile
Re: Pybuspirate scripts give error on windows
« Reply #3 on: February 01, 2010, 02:02:27 AM »
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.