pybricks / support

Pybricks support and general discussion
MIT License
107 stars 6 forks source link

EV3 Ultrasonic sensor does not work on PUP Hub #115

Open GianCann opened 4 years ago

GianCann commented 4 years ago

I tried to read an EV3 Ultrasonic sensor values with LUMPDevice class but I get:

Traceback (most recent call last):
  File "main.py", line 15, in <module>
OSError: [Errno 19] ENODEV: 

A sensor or motor is not connected to the specified port:
--> Check the cables to each motor and sensor.
--> Check the port settings in your script.
--> Check the line in your script that matches
    the line number given in the 'Traceback' above.
GianCann commented 4 years ago

Note: the Spike Prime Ultrasonic sensor works well.

dlech commented 4 years ago

It used to work - at least with EV3 Gryo sensor.

GianCann commented 4 years ago

I can confirm that the LUMPDevice works well also with the EV3 Color sensor, but not with the EV3 Ultrasonic sensor. Here you can find the UART "presentation data" from the sensor: https://docs.google.com/spreadsheets/d/1fvs8xxCo_nJxBvKCv8mM_bAbfHo4EMdF1gnez5ICaSE/edit?usp=sharing

dlech commented 4 years ago

@GianCann, can you use your logic analyzer to capture the communications between a Powered Up hub with Pybricks firmware and the EV3 Ultrasonic sensor and post the results here?

GianCann commented 4 years ago

@dlech here the file! EV3UltrasonicSensor.zip

dlech commented 4 years ago

What software is needed to view the file?

GianCann commented 4 years ago

@dlech use this: https://sigrok.org/wiki/PulseView

dlech commented 4 years ago

thanks!

GianCann commented 4 years ago

Tell me if you need more test ;)

laurensvalk commented 6 months ago

We could enable this if/when we have sensor modes.

At the moment this won't work because the device manager doesn't recognize EV3 sensors, so never enters LPF2 UART mode.

Also, when skipping the connection manager and going straight to the UART process, something also doesn't work. It just keeps waiting for the sync byte forever.

laurensvalk commented 6 months ago

I don't necessarily see this as a requirement for Powered Up, but it's a good test case for https://github.com/pybricks/pybricks-micropython/pull/241:

If EV3 sensors work with modern Pybricks drivers on Powered Up, then they will work on EV3 once we implement the UART drivers with GPIOs to control the buffers.