You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS: Ubuntu 22.04.3 LTS x86_64
recently installed pyserial
worked fine with windows but not work in linux
even arduino serial working well
I know that only 1 application can use a serial at a time
i arduino IDE it shows it is connected at /dev/ttyACM0
even i gave all the permission
Exception has occurred: PortNotOpenError
Attempting to use a port that is not open
File "/home/gokul/Desktop/Yolo-ARM/Code/useless/check.py", line 14, in base_turn
connection.write(data.encode())
File "/home/gokul/Desktop/Yolo-ARM/Code/useless/check.py", line 39, in
base_turn(90)
serial.serialutil.PortNotOpenError: Attempting to use a port that is not open
code :
importserial# Replace '/dev/ttyUSB0' with the appropriate serial port on your Linux systemport='/dev/ttyACM0'try:
connection=serial.Serial(port, 9600)
print(f"Serial {port} is working well")
defbase_turn(ang):
rounded_ang=round(ang)
data=f"b{rounded_ang}"connection.write(data.encode())
defshoulder(ang):
rounded_ang=round(ang) +60data=f"s{rounded_ang}"connection.write(data.encode())
defelbow(ang):
rounded_ang=round(ang) +34data=f"e{rounded_ang}"connection.write(data.encode())
defgripper(ang):
rounded_ang=round(ang)
data=f"h{rounded_ang}"connection.write(data.encode())
exceptserial.SerialExceptionase:
print(f"Failed to open serial port {port}: {e}")
# Add error handling and close the serial connection when donefinally:
if'connection'inlocals() andconnection.is_open:
connection.close()
base_turn(90)
The text was updated successfully, but these errors were encountered:
OS: Ubuntu 22.04.3 LTS x86_64
recently installed pyserial
worked fine with windows but not work in linux
even arduino serial working well
I know that only 1 application can use a serial at a time
i arduino IDE it shows it is connected at /dev/ttyACM0
even i gave all the permission
Exception has occurred: PortNotOpenError
Attempting to use a port that is not open
File "/home/gokul/Desktop/Yolo-ARM/Code/useless/check.py", line 14, in base_turn
connection.write(data.encode())
File "/home/gokul/Desktop/Yolo-ARM/Code/useless/check.py", line 39, in
base_turn(90)
serial.serialutil.PortNotOpenError: Attempting to use a port that is not open
code :
The text was updated successfully, but these errors were encountered: