My mistake. I had disabled the libpruio-lkm service while trying to 
troubleshoot the issue I'm having with the serial port. Sorry about that.

My adc measurements are good and stable. My only issue now is that I can't 
seem to enable the serial port under libpruio. I'll post my code here:

# serial_demo.py

from libpruio import *
import serial

io = pruio_new(PRUIO_ACT_FREMUX + PRUIO_ACT_ADC, 16, 0x98, 0)
IO = io.contents

if IO.Errr:
    raise AssertionError("pruio_new failed (%s)" % IO.Errr)
    
if (IO.setPin(io, P9_24, 0)):
    raise AssertionError("P9_24 configuration failed (%s)" % IO.Errr)
    
if (IO.setPin(io, P9_26, 0)):
    raise AssertionError("P9_26 configuration failed (%s)" % IO.Errr)

if (pruio_config(io, 1, 0x1FE, 0, 4)):
    raise AssertionError("config failed (%s)" % IO.Errr)

ser = serial.Serial('/dev/ttyS1', 9600)

When I try to run this code, I get an input/output error:
(env) debian@beaglebone:~/src/virtual_sensor$ python serial_demo.py
Traceback (most recent call last):
  File 
"/home/debian/src/virtual_sensor/env/lib/python3.5/site-packages/serial/serialposix.py"
, line 323, in _reconfigure_port
    orig_attr = termios.tcgetattr(self.fd)
termios.error: (5, 'Input/output error')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "serial_demo.py", line 19, in <module>
    ser = serial.Serial('/dev/ttyS1', 9600)
  File 
"/home/debian/src/virtual_sensor/env/lib/python3.5/site-packages/serial/serialutil.py"
, line 240, in __init__
    self.open()
  File 
"/home/debian/src/virtual_sensor/env/lib/python3.5/site-packages/serial/serialposix.py"
, line 272, in open
    self._reconfigure_port(force_update=True)
  File 
"/home/debian/src/virtual_sensor/env/lib/python3.5/site-packages/serial/serialposix.py"
, line 326, in _reconfigure_port
    raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (5, 'Input/output 
error')


I get a similar error if I try to open the serial port from picocom:
debian@beaglebone:~$ picocom /dev/ttyS1
picocom v1.7

...

FATAL: failed to add device /dev/ttyS1: Filedes is not a tty

debian@beaglebone:~$ ls -l /dev/ttyS*
crw--w---- 1 root tty     4, 64 Aug 20 18:03 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Aug 20 18:03 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 Aug 20 18:03 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 Aug 20 18:03 /dev/ttyS3
crw-rw---- 1 root dialout 4, 68 Aug 20 18:03 /dev/ttyS4
crw-rw---- 1 root dialout 4, 69 Aug 20 18:03 /dev/ttyS5

debian@beaglebone:~$ groups
debian adm kmem dialout cdrom floppy audio dip video plugdev users 
systemd-journal 
input bluetooth netdev pruio cloud9ide xenomai weston-launch tisdk docker 
i2c iio spi admin remoteproc eqep pwm gpio

I tried every mode from 0 to 7 and got the same result.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/9849648f-358f-487e-bf8e-af0724271cc9o%40googlegroups.com.

Reply via email to