wiseman / arduino-serial

Python port of Tod E. Kurt's arduino-serial.c for communicating with an Arduino over a serial port..
MIT License
68 stars 22 forks source link

getting error message every time #2

Open VinceLewis opened 5 years ago

VinceLewis commented 5 years ago

Hi,

Am using your library with an arduino uno. Have set baud rate same between arduino and my pc

Have made tiny change in arduinoserial.py as per below to get it to run on python3: Line 116 was: buf = buf + n

and is now buf = buf + str(n)

but I always get this error: File "/home/vince/ArduinoPython/arduinoserial.py", line 111, in read_until n = os.read(self.fd, 1) BlockingIOError: [Errno 11] Resource temporarily unavailable

I'm sure that the arduino is sending as I've tried the serialmonitor on it

Any ideas? Vince

ashrafulkhn commented 4 years ago

I think you have kept your Arduino IDE open where the UART port already communicating with your system. So it is showing the resources as busy. First try to stop the Arduino IDE and try the code. It should work. Let me know your findings.

ashrafulkhn commented 4 years ago

Could you solve your problem. Please update. It helps a lot for me to become confirmed on it.

VinceLewis commented 4 years ago

yes, tested this, it is fixed now Thanks! Vince

On Sun, 3 May 2020 at 22:13, ASHRAFUL HUSSAIN KHAN notifications@github.com wrote:

Could you solve your problem. Please update. It helps a lot for me to become confirmed on it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wiseman/arduino-serial/issues/2#issuecomment-623183080, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVOPU4AXYPWIHXR5ZMIOJLRPXM57ANCNFSM4GHSITIA .

LinyeNinja commented 2 years ago

Hello, I'm having this issue but there is nothing else talking to the arduino, and pyserial and the serialmonitor seem to communicate with it just fine. Any idea how I could solve it? Thanks in advance. (I'm under linux mint and with python 3.8)

sdrabb commented 2 years ago

Getting the same error...

Medeirox commented 1 year ago

me too. can't connect to serial port. Important to say that I'm trying to connect to a virtual serial port created by a USB 4G modem. Minicom, pyserial, echo works ok.

ashrafulkhn commented 1 year ago

Please note that the Serial port will be opened only in one place. i.e Arduino IDE, Putty, Minicom, etc., or any other serial terminals you might have. If the serial port is open() ed by any of the serial terminals you will not get access to it unless you properly close the serial connection. Case 1: In case you are using Minicom or any other Unix terminal-based serial monitor then there might be chances that you have not closed the terminal properly. You might have pressed the Ctrl + C or Ctrl + X or Ctrl + Z etc which doesn't close the serial terminal application properly. Instead, use the proper method to close the terminal. For Example: For Minicom use Ctrl + A, then press X to close the terminal. Case 2: You are using pyserial in python or any other serial library based on your choice of programming language. Most probably you have not closed the port properly and trying to open it again. I can comment on this if you could share your code. I can review C, C++, Python, and Rust. But the concept lies the same for all languages. FYI: close() function be used when you open a port.

Bottomline: Use only one application to use the port. Either it is your custom application or a Serial Monitor.