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
Tag: pyserial
How to run periodic serial communication in a separate thread in python
I am programming a GUI with tkinter that controls the communication to multiple motor controllers that are connected serially via RS485. I have a function (get_status()) that requests the status (motor running, motor position, position reached, …) of the controllers via pySerial and displays the uptated status on the UI. I want to run this funktion every second. The problem
Can’t stop thread at all (unless I cause an exception)
So I am working on a GUI (PyQt5) and I am multi-threading to be able to do data acquisition and real-time plotting concurrently. Long story short, all works fine apart from stopping the thread that handles the data acquisition, which loops continuously and calls PySerial to read the com port. When a button on the GUI is pressed, I want
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
How does pySerial implement the “with” statement without __enter__ and __exit__?
pySerial can be used with Python’s with statement like this: I tried to see exactly what it is pySerial does to make this work, but I couldn’t find an __enter__ or __exit__ function anywhere! I ran grep -e ‘(__enter__)|(__exit__)’ *.py from the pySerial directory, and grep didn’t find either function. How does pySerial do it? Edit: I also tried the
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]:
Is there a way to “compile” Python code onto an Arduino (Uno)?
I have a robotics type project with an Arduino Uno, and to make a long story short, I am experimenting with some AI algorithms. However, I need to implement some high level matrix algorithms that would be quite simple using NumPy/SciPy, but they are an utter nightmare in C or C++. Even with the libraries out there, this is just