Skip to content

[Bug] ev3-micropython V2 does not auto register EV3-color-sensor  #102

@BertLindeman

Description

@BertLindeman

Describe the bug
On ev3-micropython (the system) EV3 and NXT color sensors are not auto-detected.
Hope I am entering this on the correct github repository.
And hope this is not too much info

To reproduce
Steps to reproduce the behavior:

  1. Running ev3-micropython 2.0
  2. on a terminal type the command "dmesg -w"
  3. connect the colorsensor to a sensor port, e.g. S3
  4. Look at the dmesg output of switching varipus color sensors (last is nxt-color sensor:
    [Sat Jul 18 00:23:13 2020] lego-port port2: Removed device 'ev3-ports:in3:ev3-uart-host'
    [Sat Jul 18 00:23:28 2020] lego-port port2: Added new device 'ev3-ports:in3:ev3-uart-host'
    [Sat Jul 18 00:23:50 2020] lego-port port2: Removed device 'ev3-ports:in3:ev3-uart-host'
    [Sat Jul 18 00:23:55 2020] lego-port port2: Added new device 'ev3-ports:in3:ev3-uart-host'
    [Sat Jul 18 00:24:00 2020] lego-port port2: Removed device 'ev3-ports:in3:ev3-uart-host'
    [Sat Jul 18 00:24:03 2020] lego-port port2: Added new device 'ev3-ports:in3:lego-nxt-color'

Note missing: "lego-sensor sensor2: Registered 'lego-ev3-color' on 'ev3-ports:in3'"

  1. ls -l /sys/class/lego-sensor/
    and see no new sensor has been registered there.

Expected behavior
See the color sensor in the /sys/ filesystem AND have the sensor connected in my micropython program

Screenshots
not now

Desktop:

  • OS and version: [Windows 10 Home 1909]
  • Connection Type: [Wi-Fi]
  • Software: [Visual Studio Code and PuTTY]

Robot:

  • Device: EV3
  • Versions:
    Image file: ev3-micropython-v2.0.0-sd-card-image
    Kernel version: 4.14.117-ev3dev-2.3.5-ev3
    Brickman: 0.10.3
    BogoMIPS: 148.88
    Bluetooth: 4.0
    Board: board0
    BOARD_INFO_HW_REV=7
    BOARD_INFO_MODEL=LEGO MINDSTORMS EV3
    BOARD_INFO_ROM_REV=6
    BOARD_INFO_SERIAL_NUM=0016535166E2
    BOARD_INFO_TYPE=main

debugging done so far
Switched back to ev3dev with the same sensors / motors on the same ports:
Welcome to ev3dev GNU/Linux 9.12 (stretch) GNU/Linux
Kernel: 4.14.117-ev3dev-2.3.5-ev3 armv5tejl
EV3DEV image: ev3dev-stretch-ev3-generic-2018-11-13
and did the same with success.
dmesg tail:
[Fri Jul 17 20:19:53 2020] lego-port port2: Added new device 'ev3-ports:in3:ev3-uart-host'
[Fri Jul 17 20:19:56 2020] lego-sensor sensor2: Registered 'lego-ev3-color' on 'ev3-ports:in3'.

and:
showsensors:
/sys/class/lego-sensor/sensor2
sensor 1 driver_name: lego-ev3-color on port ev3-ports:in3
address: ev3-ports:in3
mode: COL-REFLECT
modes: COL-REFLECT COL-AMBIENT COL-COLOR REF-RAW RGB-RAW COL-CAL
commands:
decimals: 0
num_values: 1
value0: 1
units: pct
uevent:
LEGO_DRIVER_NAME=lego-ev3-color
LEGO_ADDRESS=ev3-ports:in3

Background Information
Trying to program the advanced color sorter of MOC-5615 - Optimized Colour Sorter
The color sensor (both EV3 and NXT) are recognized as seen in dmesg, but not instantiated in the /sys/ filesystem.
And thus not found by micropython. (My conclusion)

The same does work on ev3dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked: upstreamThis issue is with a 3rd-party project and is out of scope of Pybricksplatform: EV3Issues related to LEGO MINDSTORMS EV3supportRequest for technical support for a problem that is not a bug or feature requesttopic: sensorsIssues involving sensors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions