Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UART sensors broken in ev3dev-2.3.3 kernel #1249

Closed
dlech opened this issue Apr 13, 2019 · 19 comments

Comments

@dlech
Copy link
Member

commented Apr 13, 2019

Describe the bug
After upgrading to 4.14.111-ev3dev-2.3.3-ev3 kernel, EV3 UART sensors are no longer detected.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade kernel to 4.14.111-ev3dev-2.3.3-ev3
  2. Reboot
  3. Plug in a UART sensor
  4. No sensor appears

Expected behavior
Sensor should work like previous versions

Robot (please complete the following information):

Image file:         ev3dev-stretch-ev3-generic-2018-06-13
Kernel version:     4.14.111-ev3dev-2.3.3-ev3
Brickman:           0.10.0
BogoMIPS:           148.88
Bluetooth:          2.1
Board:              board0
BOARD_INFO_HW_REV=7
BOARD_INFO_MODEL=LEGO MINDSTORMS EV3
BOARD_INFO_ROM_REV=6
BOARD_INFO_SERIAL_NUM=0016533F4838
BOARD_INFO_TYPE=main

Additional context

dmesg shows...

[    2.228164] lego-port port1: Added new device 'ev3-ports:in3:ev3-uart-host'
[   51.547561] Registered EV3 UART sensor line discipline. (29)

so we are getting part of the way there.

Also reported by CocoaGeek: on IRC.

@dlech dlech added this to the ev3dev-stretch milestone Apr 13, 2019

@dlech dlech self-assigned this Apr 13, 2019

@dlech

This comment has been minimized.

Copy link
Member Author

commented Apr 13, 2019

Regression probably due to ev3dev/lego-linux-drivers@2ce65b0

dlech added a commit to ev3dev/lego-linux-drivers that referenced this issue Apr 13, 2019

sensors: ev3_uart_sensor_ld: fix sensor not enumerating
This fixes a regression caused by 81480d8. We still need to set
port->sensor.mode in EV3_UART_MSG_TYPE_INFO because it is
used later during other sensor info commands.

Issue: ev3dev/ev3dev#1249
@DJuego

This comment has been minimized.

Copy link

commented Apr 21, 2019

I think I have this problem! :-O

DJuego

@Chickenboy445

This comment has been minimized.

Copy link

commented Apr 22, 2019

How can I have my sensors working? Should I download an older version of the kernel? If so, which one should I pick?

@JorgePe

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2019

ev3dev released with LEGO Education EV3 MicroPython seems to works fine:

Image file:         ev3-micropython-v1.0.0-sd-card-image
Kernel version:     4.14.96-ev3dev-2.3.2-ev3

the kernel is from Jan 27 so is recent

@dlech

This comment has been minimized.

Copy link
Member Author

commented Apr 22, 2019

Try this:

sudo flash-kernel --force 4.14.96-ev3dev-2.3.2-ev3
sudo reboot
@Chickenboy445

This comment has been minimized.

Copy link

commented Apr 22, 2019

That worked! Thank you so much for your help. I have a pretty tough project to do with this and without sensors it would have been impossible. Thanks!

@sdebaerd

This comment has been minimized.

Copy link

commented May 4, 2019

I'm experiencing the same problem, but it's not resolved after flashing the older kernel (and rebooting).
The sensor page remains empty, also when trying to use the java lang, the jar crashes with the following stack:

Exception in thread "main" java.lang.RuntimeException: The path doesn't exist: /sys/class/lego-sensor
at ev3dev.utils.Sysfs.getElements(Sysfs.java:107)
at ev3dev.hardware.EV3DevDevice.detect(EV3DevDevice.java:57)
at ev3dev.hardware.EV3DevSensorDevice.(EV3DevSensorDevice.java:40)
at ev3dev.sensors.BaseSensor.(BaseSensor.java:22)
at ev3dev.sensors.ev3.EV3ColorSensor.(EV3ColorSensor.java:48)
at example.programming.SimpleWebServer.(SimpleWebServer.java:41)
at example.programming.SimpleWebServer.main(SimpleWebServer.java:166)

When using the "old" lejos image or standard mindstorms firmware, the sensor is recognized.

dmesg is though showing the correct details.

[ 1160.090079] lego-port port0: Added new device 'ev3-ports:in1:ev3-uart-host'

@salamanders

This comment has been minimized.

Copy link

commented May 7, 2019

+1 vote, new install (new user!)
linux-image-ev3dev-ev3 is already the newest version (54.1).

Exception in thread "main" java.lang.RuntimeException: The path doesn't exist: /sys/class/lego-sensor
	at ev3dev.utils.Sysfs.getElements(Sysfs.java:107)
	at ev3dev.hardware.EV3DevDevice.detect(EV3DevDevice.java:57)
	at ev3dev.hardware.EV3DevSensorDevice.<init>(EV3DevSensorDevice.java:40)
	at ev3dev.sensors.BaseSensor.<init>(BaseSensor.java:22)
	at ev3dev.sensors.ev3.EV3UltrasonicSensor.<init>(EV3UltrasonicSensor.java:58)

Is there a workaround, or is there a release we should be watching? Thanks!

@dlech

This comment has been minimized.

Copy link
Member Author

commented May 7, 2019

workaround: #1249 (comment)

@sdebaerd

This comment has been minimized.

Copy link

commented May 7, 2019

Hi

For me the workaround is not fully working, as the registration of the uart is not appearing in the dmesg, also the sensor screen remains blank. I have followed all steps in the workaround, but still no joy.

If you need more information, please let me know.

Thanks in advance.

@dlech

This comment has been minimized.

Copy link
Member Author

commented May 7, 2019

Can you confirm the kernel version that is actually running on your EV3?

@sdebaerd

This comment has been minimized.

Copy link

commented May 7, 2019

I've executed the workaround you provided, but I will get the details by Thursday, as I'm currently abroad.

@salamanders

This comment has been minimized.

Copy link

commented May 8, 2019

trying sudo flash-kernel 4.14.96-ev3dev-2.3.2-ev3

Nope. Odd. I still get Exception in thread "main" java.lang.RuntimeException: The path doesn't exist: /sys/class/lego-sensor at ev3dev.utils.Sysfs.getElements(Sysfs.java:107)

But the path does exist.

robot@ev3dev:~$ ls -la /sys/class/lego*
/sys/class/lego-port:
total 0
drwxr-xr-x  2 root root 0 May  8 00:56 .
drwxr-xr-x 48 root root 0 May  8 00:56 ..
lrwxrwxrwx  1 root root 0 May  8 00:56 port0 -> ../../devices/platform/ev3-ports/ev3-ports:in1/lego-port/port0
lrwxrwxrwx  1 root root 0 May  8 00:56 port1 -> ../../devices/platform/ev3-ports/ev3-ports:in2/lego-port/port1
lrwxrwxrwx  1 root root 0 May  8 00:56 port2 -> ../../devices/platform/ev3-ports/ev3-ports:in3/lego-port/port2
lrwxrwxrwx  1 root root 0 May  8 00:56 port3 -> ../../devices/platform/ev3-ports/ev3-ports:in4/lego-port/port3
lrwxrwxrwx  1 root root 0 May  8 00:56 port4 -> ../../devices/platform/ev3-ports/ev3-ports:outA/lego-port/port4
lrwxrwxrwx  1 root root 0 May  8 00:56 port5 -> ../../devices/platform/ev3-ports/ev3-ports:outB/lego-port/port5
lrwxrwxrwx  1 root root 0 May  8 00:56 port6 -> ../../devices/platform/ev3-ports/ev3-ports:outC/lego-port/port6
lrwxrwxrwx  1 root root 0 May  8 00:56 port7 -> ../../devices/platform/ev3-ports/ev3-ports:outD/lego-port/port7

/sys/class/lego-sensor:
total 0
drwxr-xr-x  2 root root 0 May  8 00:56 .
drwxr-xr-x 48 root root 0 May  8 00:56 ..
@dlech

This comment has been minimized.

Copy link
Member Author

commented May 8, 2019

If uname -r shows the correct kernel version, then you should bring up the issue in the ev3dev-lang-java project.

@salamanders

This comment has been minimized.

Copy link

commented May 8, 2019

Good call - it still shows 4.14.111-ev3dev-2.3.3-ev3.
Happy to blow the whole thing away if it would be easier to reflash from the older version...
Oh hey. Need --force
ooos. Stuff showing up in lego-sensor. This is good.

@sdebaerd

This comment has been minimized.

Copy link

commented May 8, 2019

Makes sense, since we need to flash a lower version, forgot about this option. Can't wait to get back home to test it. I will let you know the outcome.

@salamanders

This comment has been minimized.

Copy link

commented May 8, 2019

My sensors work, this workaround fixed it for me, thank you!

@sdebaerd

This comment has been minimized.

Copy link

commented May 9, 2019

Got home at last. When I try to flash the old version, with --force, it keeps mentioning that the 111 is the newer release and it's ignoring it, when using the following command:
sudo flash-kernel 4.14.96-ev3dev-2.3.2-ev3 --force
sudo reboot

I then moved the --force flag and it started to deploy the old kernel:
sudo flash-kernel --force 4.14.96-ev3dev-2.3.2-ev3
sudo reboot

Thanks both of you for your help, I'm glad I have it working!

@dlech

This comment has been minimized.

Copy link
Member Author

commented May 9, 2019

Fix released in ev3dev-2.3.4 kernel

@dlech dlech closed this May 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.