Skip to content

[Bug] EV3: NXT TemperatureSensor timeout leaves port unusable until reboot #2859

Open

Description

@BertLindeman

Describe the bug
After probing a sensor port (S1) for an nxt TemperatureSensor the port returns an EPERM on a nxt sound sensor.
The S1 port gets only usable again after a reboot.

To reproduce
Steps to reproduce the behavior:

  1. Connect an EV3 (v4.1.0) with an NXT SoundSensor on Port.S1
  2. Reboot the EV3 and run test program (below)
  3. See First two sound sensor testruns OK
  4. See the sound sensor EPERM error after the TemperatureSensor OSError: 116
  5. A second run without a reboot shows the S1 port is usable after an nxt UltraSonic sensor probe until after the TemperatureSensor probe.

Expected behavior
The nxt soundsensor to be instantiated normally without a reboot after any probe for that port.

Test program
from pybricks import version
print(f"Pybricks version: {version}\n")
from uerrno import ENODEV, ETIMEDOUT
from pybricks.parameters import Color, Direction, Port, Stop
from pybricks.nxtdevices import SoundSensor, TemperatureSensor, EnergyMeter, VernierAdapter, UltrasonicSensor

def try_soundsensor():
    try:
        ss = SoundSensor(Port.S1)
        try:
            print(f"ss.intensity(audible_only=False) {ss.intensity(audible_only=False)}")
            print(f"ss.intensity(audible_only=True)  {ss.intensity(audible_only=True)}")
        except Exception as ex:
            print(f"\tException on SoundSensor         \t{ex}\n")
    except OSError as ex:
        if ex.args[0] != ENODEV:
            print(f"\tNo SoundSensor available or different device on Port.S1 \t{ex}\n")
        else:
            print(f"\tNo SoundSensor attached on Port.S1\n")
    except Exception  as ex:
        print(f"\tNot supported: SoundSensor         \t{ex}\n")

try_soundsensor()

print()

try:
    UltrasonicSensor(Port.S1).distance()   # ETIMEDOUT (errno 116)
except OSError as ex:
    print("UltrasonicSensor OSError:", ex.args[0])

print()

try_soundsensor()

print()

try:
    TemperatureSensor(Port.S1).temperature()   # ETIMEDOUT (errno 116)
except OSError as ex:
    print("TemperatureSensor OSError:", ex.args[0])

print()

try_soundsensor()
Test output after a reboot
Pybricks version: ('ev3', '4.1.0', 'ci-release-112-v4.1.0 on 2026-10-12')

ss.intensity(audible_only=False) 0
ss.intensity(audible_only=True)  0

UltrasonicSensor OSError: 19

ss.intensity(audible_only=False) 0
ss.intensity(audible_only=True)  0

TemperatureSensor OSError: 116

        No SoundSensor available or different device on Port.S1         [Errno 1] EPERM: 

The requested operation is not valid in the current state:
--> Check the documentation for required conditions.
--> Check the line in your script that matches
    the line number given in the 'Traceback' above.
Second test output WITHOUT a reboot
Pybricks version: ('ev3', '4.1.0', 'ci-release-112-v4.1.0 on 2026-10-12')

        No SoundSensor available or different device on Port.S1         [Errno 1] EPERM: 

The requested operation is not valid in the current state:
--> Check the documentation for required conditions.
--> Check the line in your script that matches
    the line number given in the 'Traceback' above.


UltrasonicSensor OSError: 19

ss.intensity(audible_only=False) 0
ss.intensity(audible_only=True)  0

TemperatureSensor OSError: 116

        No SoundSensor available or different device on Port.S1         [Errno 1] EPERM: 

The requested operation is not valid in the current state:
--> Check the documentation for required conditions.
--> Check the line in your script that matches
    the line number given in the 'Traceback' above.

Activity

  1. added
    triage
    on Oct 15, 2026
  2. added
    platform: EV3
    platform: NXT
    software: pybricks-micropython
    and removed
    triage
    on Oct 20, 2026
  3. added theissue type on Oct 20, 2026
  4. laurensvalk commented on Oct 20, 2026

    @laurensvalk
    Member

    Thank you. The I2C sensors like the Temperature sensor definitely need some work.

  5. BertLindeman commented on Oct 20, 2026

    @BertLindeman
    Author

    No hurry needed.
    There is a circumvention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: EV3platform: NXTsoftware: pybricks-micropython

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions