Repository navigation
Open
Labels
platform: EV3Issues related to LEGO MINDSTORMS EV3platform: NXTIssues related to LEGO MINDSTORMS NXTsoftware: pybricks-micropythonIssues with Pybricks MicroPython firmware (or EV3 runtime)
Description
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:
- Connect an EV3 (v4.1.0) with an NXT SoundSensor on Port.S1
- Reboot the EV3 and run test program (below)
- See First two sound sensor testruns OK
- See the sound sensor EPERM error after the
TemperatureSensor OSError: 116 - 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.
Metadata
Metadata
Assignees
Labels
platform: EV3Issues related to LEGO MINDSTORMS EV3platform: NXTIssues related to LEGO MINDSTORMS NXTsoftware: pybricks-micropythonIssues with Pybricks MicroPython firmware (or EV3 runtime)
Activity
laurensvalk commentedon Oct 20, 2026
Thank you. The I2C sensors like the Temperature sensor definitely need some work.
BertLindeman commentedon Oct 20, 2026
No hurry needed.
There is a circumvention.