sensor port 1 does not work
Closed this issue · 5 comments
I tried to call the "test_lego_touch_sensor.py" test with a TouchSensor in all of the sensor ports.
For port 1:
root@idefix:~/test# ./test_lego_touch_sensor.py
Attach a TouchSensor then continue
E
======================================================================
ERROR: test_touch_sensor (__main__.TestTouchSensor)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./test_lego_touch_sensor.py", line 9, in test_touch_sensor
d = TouchSensor()
File "build/bdist.linux-armv5tejl/egg/ev3/lego.py", line 7, in __init__
Msensor.__init__(self, port, type_id=16, name='lego-ev3-touch')
File "build/bdist.linux-armv5tejl/egg/ev3/ev3dev.py", line 240, in __init__
raise NoSuchSensorError(port, type_id, name)
NoSuchSensorError: No such sensor port=-1 type_id=16 name=lego-ev3-touch
----------------------------------------------------------------------
Ran 1 test in 0.534s
FAILED (errors=1)
For port 2 (similar output with ports 3 and 4):
root@idefix:~/test# ./test_lego_touch_sensor.py
Attach a TouchSensor then continue
test pushed
False
TOUCH
.
----------------------------------------------------------------------
Ran 1 test in 2.352s
OK
If I boot the EV3 Brick without the SD card and use one of the builtin demo programms I can see the state of the TouchSensor in port 1. Do you have any idea why this isn't working with the python-ev3 library? I'm using following egg: "python_ev3-0.0.2.4-py2.7.egg" on kernel version: "3.14.7-1-ev3dev".
You need to check https://github.com/ev3dev/ev3dev/wiki/Frequently-Asked-Questions How do I use the serial console on input port 1?
It seems the port 1 is open as a serial debug port on your brick.
Please reopen the ticket if not the case.
First of all thanks for the fast answer.
root@idefix:~/test# cat /etc/modprobe.d/ev3dev-ports.conf
# Uncomment the following line to enable serial port debugging
#options legoev3_ports disable_in_port=1
As you can see port 1 is not open as a serial debug port. I also checked 1. and 2. of the FAQ tutorial. They are both disabled.
When the touch sensor is connected to input port 1, is there a sensor at /sys/class/msensor
? If there is, does cat /sys/class/msensor/sensor<N>/port_name
return in1
?
touch sensor in port 1:
root@idefix:/# ls -l sys/class/msensor/
total 0
touch sensor in port 2:
root@idefix:/# ls -l sys/class/msensor/
total 0
lrwxrwxrwx 1 root root 0 Jan 1 05:18 sensor2 -> ../../devices/platform/legoev3-ports/in2/in2:ev3-analog-sensor/msensor/sensor2
root@idefix:/# cat /sys/class/msensor/sensor3/port_name
in2
Then this is an ev3dev bug, not a python-ev3 bug. I would normally tell you to open an issue at https://github.com/ev3dev/ev3dev/issues, but I am preparing to do a kernel release that has major changes to some of the drivers that will break some things, so it will be better to wait until after that.