« first day (1842 days earlier)      last day (1514 days later) » 

1:31 PM
this python code using pyserial package is giving error i want to listen to the serial port `/dev/hidraw1`
import serial
with serial.Serial('/dev/hidraw1', 9600) as ser:
x = ser.read()
s = ser.read(10)
line = ser.readline()

this is the error:
Traceback (most recent call last):
File "sensor.py", line 2, in <module>
with serial.Serial('/dev/hidraw1', 9600) as ser:
File "/home/manik/.local/lib/python3.6/site-packages/serial/serialutil.py", line 240, in __init__
self.open()
File "/home/manik/.local/lib/python3.6/site-packages/serial/serialposix.py", line 272, in open
 
 
2 hours later…
3:06 PM
1 message moved from Python
 
 
1 hour later…
4:24 PM
this python code using pyserial package is giving error i want to get input data from the serial port /dev/hidraw1:
import serial
with serial.Serial('/dev/hidraw1', 9600) as ser:
line = ser.readline()
 
@Manik keep trying (you can edit messages for 2 minutes)
 
this is the error:
Traceback (most recent call last):
File "sensor.py", line 2, in <module>
with serial.Serial('/dev/hidraw1', 9600) as ser:
File "/home/manik/.local/lib/python3.6/site-packages/serial/serialutil.py", line 240, in __init__
self.open()
File "/home/manik/.local/lib/python3.6/site-packages/serial/serialposix.py", line 272, in open
self._reconfigure_port(force_update=True)
File "/home/manik/.local/lib/python3.6/site-packages/serial/serialposix.py", line 326, in _reconfigure_port
raise SerialException("Could not configure port: {}".format(msg))
 
*sigh*
 
@Manik you need to practice more in sandbox
 
can you tell me the mistake in my formatting?
it seems correct to me
 
4:30 PM
@Manik as mentioned before, you need to make sure to copy your code indented correctly before pressing on CTRL + A and CTRL + K
 
oh ok i get it now obviously!
 
4:48 PM
11 messages moved from Python
 

« first day (1842 days earlier)      last day (1514 days later) »