Re: Pyserial Error Programming Software Development by woooee PySerial finds the port by he offset so the first port …) Take a look at the intro docs [Click Here](http://pyserial.sourceforge.net/shortintro.html) and try python -m serial.tools… PySerial Programming Software Development by markfw Hi I'm trying to use PySerial and I'm getting "Access Denied". I don'…t know if this is a bug from PySerial library or I'm doing something totally stupid :-) Specification: Windows… XP pro SP3 PySerial-2.5.win32 (Installed from binary) Python 2.7.1… Pyserial output does not change Programming Software Development by bryanleo … port. The output is then displayed in Python using Pyserial or the hyperterminal, the former is more important When …time in hyper terminal. But In the case of the pyserial module, even though you touch the input pins, the…print('Tactile Sensing Feedback for Medical Palpation in MIS\n Pyserial Testing Module\n') ch= raw_input("Enter a to… Re: Pyserial output does not change Programming Software Development by bryanleo … print('Tactile Sensing Feedback for Medical Palpation in MIS\n Pyserial Testing Module\n') ch= raw_input("Enter a to initialize…, b to quit:") if ch == 'a': print 'Initializing Pyserial module' ser = serial.Serial(0,baudrate=57600,timeout=0,xonxoff=… Re: Pyserial output does not change Programming Software Development by jlm699 … print('Tactile Sensing Feedback for Medical Palpation in MIS\n Pyserial Testing Module\n') ch= raw_input("Enter a to initialize…, b to quit:") if ch == 'a': print 'Initializing Pyserial module' ser = serial.Serial(0,baudrate=57600,timeout=0,xonxoff=… Re: Pyserial output does not change Programming Software Development by bryanleo … CPU to read the contents of the Input buffer 2. Pyserial was reading the data in the input buffer way too… pyserial code not working as a saved script Programming Software Development by kishoreinme hello there Iam using python 2.5.4 pyserial 2.4 pywin32-214 on windows 7 i hav a … PySerial and Step Motor and Linux Programming Software Development by die_windoze … to control it with Python and I started with the PySerial module. So far I've been able to connect to… Re: PySerial and Step Motor and Linux Programming Software Development by die_windoze reading about PyUSB now... This motor uses a ribbon connection to a box with an ethernet and USB ports on it. I'v been thinking of it as a serial-to-USB but perhaps it isn't.... however, I see Arduino pple using PySerial and I'd bet this motor uses something Arudion-ish to make the programming interace so easy... Pyserial Error Programming Software Development by entropicII … using python to try and talk to my Arduino with pyserial. The code should wait for an input from COM5, (the… Re: Pyserial Error Programming Software Development by sneekula Strange, pyserial has a class Serial() Did you accidentally save your code file as serial.py? Re: PySerial Programming Software Development by Tech B I don't know what your trying to connect to, but here is an example to open a COM, receive data, send data and close. [CODE] import serial #Use the COM port you are trying to use #also set the baud at object creation ser = serial.Serial('COM8', baudrate=19200) #treat like a file object #can read and readline from data = ser.read() #show what we… Re: PySerial Programming Software Development by markfw Hi Tech B, Thanks for your reply. I've been using serial for around 6 months. The example I showed above is just possibly demonstrating a bug. The scenario is this: 1. Open the serial port (either with your way or just create Serial() object and then assign the port number) 2. Do the read, write or both 3. Use the Try-Except block to try to … Re: PySerial Programming Software Development by Tech B Looks like I misread your post. Do you get the same error if you try opening the port my way? If you do, try closing the port in the exception. I googled a bit, try opening the terminal/cmdprompt with root/admin privs. Let me know how it goes. Re: PySerial Programming Software Development by markfw Hi Thanks for your quick response. I tried this code (As you said close the port in exception): [CODE] from serial import Serial, SerialException class Test(object): def __init__(self): pass def tst_serial(self): port = Serial() port.port = 3 port.baudrate = 19200 port.open()… Re: PySerial Programming Software Development by Tech B What are you trying to connect to? It might be the other device refusing repetitive connections. Try time.sleep() for a second or two and try again. Also, maybe try putting all the port info in the __init__() method, like the timeout and port number and all. Re: PySerial Programming Software Development by markfw Hi Thanks for your reply. I tried what you said and still getting the same error [CODE] from serial import Serial, SerialException from time import sleep class Test(object): def __init__(self): self.port = Serial() self.port.port = 3 self.port.baudrate = 19200 self.port.timeout = 1 def re_init(self): … Re: PySerial Programming Software Development by Tech B Can you post the entire trace-back, also add some print statements in each of the try/excepts so we can verify what it is doing. Something like: [CODE] try: self.port.open() print "port open" except SerialException: self.port.close() print "port closed" [/CODE] Re: PySerial Programming Software Development by markfw Hi [CODE] from serial import Serial, SerialException from time import sleep class Test(object): def __init__(self): print "__init__ called" print "Creating new Serial Object..." self.port = Serial() print "Done" print "Configuring … Re: PySerial Programming Software Development by Matzek Hi all, I'd like to join your discussion: I experienced exactely the same behaviour, but in your last post, Mark, both methods: t.tst_serial() and t.tst_serial_1() returned the described error message (could not open port COM2: when testing COM1). Can't help it, I'd be thankful on further explanation. Greets, Re: PySerial Programming Software Development by TrippySquidsman Hi everyone, I'd also like to participate. I'm currently communicating with an Arduino - I'm very new to Python and Processing codes, so please don't rely solely on my code. I think that the problem lies in the hardware end of the setup. If you configure the serial ports to open later via the python shell; [icode] >>> ser = … Re: PySerial Programming Software Development by JoshuaBurleson Matzek, so you know people are much less likely to respond to an old thread, it's advised to start your own. Re: PySerial Programming Software Development by feurig the article may be dead but the issue has not been resolved. Re: PySerial Programming Software Development by meistervision I get the access denied for opening a port in python if I don't run the python script as root. sudo python program.py Not sure if this applies/works for everybody, but it solved my problem. ON my linux machine (Raspberry Pi) you need root access to open a port up in python (correct me if I'm wrong). noobish question regarding pyserial Programming Software Development by iwanttolearnc …() ser.close() [/CODE] i then checked the pyserial api documentation and found that readline is of the …class FileLike [URL="http://pyserial.sourceforge.net/pyserial_api.html#serial.FileLike.readline"…;]http://pyserial.sourceforge.net/pyserial_api.html#serial.FileLike.readline[/… Re: noobish question regarding pyserial Programming Software Development by richieking yep... because pyserial has included it. example.,,,,[CODE] import serial ser = serial.Serial (0 , baudrate = 57600 , timeout = 1) #open serial port (1) - 1 line = ser.readline() ## will get the implementation of FileList method readline() if you dont have a local readline() method define ser.close() [/CODE] Problem reading data from serial port (COM3) using pyserial module on Windows XP Programming Software Development by imperialguy … Port: COM3 OS: WinXP Python Version: Activestate Python 2.7 pyserial version: 2.5 Python recognized this serial port and had… opening it. I am new to python as well as pyserial. I couldn't figure out how exactly can I read… on my computer. How can I read this data using pyserial? Re: Pyserial output does not change Programming Software Development by jlm699 Please use code tags. They work like this: [noparse][code=<language>] My Code goes here! [/code][/noparse] Where <language> is any of the languages on DaniWeb (C, Perl, Python, HTML, PHP, etc.) Re: Pyserial output does not change Programming Software Development by jlm699 [QUOTE=bryanleo;697101]We have actually noticed that python records and prints the input to the pins of the microcontroller before the code is executed in python. Hence, it does not record and print new inputs once the code was been executed.[/QUOTE] I'm kinda confused by that statement... could you explain a little further, maybe provide an … Re: Pyserial output does not change Programming Software Development by woooee Possibly, one hundred loops of a for() statement happens so fast that it is done before any other data is received. Try this example which sleeps for half of a second and see if the data changes.[CODE]for x in range (0,100): s = ser.readline() print x, repr(s) time.sleep(0.5)[/CODE]