Skip to content
Advertisement

Tag: pyserial

Sleep/block/wait unitil serial data is incoming

I have some live data which is streamed from a microcontroller via serial port to a Raspberry Pi (or for doing prototyping maybe to a PC) with Linux as OS. The data comes roughly every 100 ms. I want to process this data, after receiving (checking of correctness and doing some calculation with some python scripts). However, I didn’t find

Why won’t pySerial write inside of my program?

So I have a program set up on my arduino nano which reads a single byte from the serial port and turns on an LED depending on whether or not the byte received was 1 or 0. I thoroughly tested this program, both on the Serial monitor and with pySerial in the python 3 shell, and it worked fine. But

PySerial [Error 5] Access is Denied

I am trying to write a program in Python that will loop to keep checking the serial port (COM4) and print out a message when the character “1” is read from the serial port. I want to send “1” over the serial port from an Arduino gadget upon the push of a button. However, I get the error “[Error 5]:

Advertisement