QUERY · ISSUE
esp32/machine_pin: ESP32-P4 pin 54 can't be set to output
bugport-esp32
Port, board and/or hardware
esp32 port, generic ESP32-P4 board
MicroPython version
MicroPython v1.27.0 on 2025-12-09; Generic ESP32P4 module with ESP32P4
Reproduction
MicroPython v1.27.0 on 2025-12-09; Generic ESP32P4 module with ESP32P4
Type "help()" for more information.
>>> import machine
>>> machine.Pin(53, machine.Pin.OUT)
Pin(53)
>>> machine.Pin(54, machine.Pin.OUT)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: pin can only be input
Expected behaviour
machine.Pin(54, machine.Pin.OUT) should work, because all GPIO pins on the ESP32-P4 are output capable.
Observed behaviour
machine.Pin(54, machine.Pin.OUT) states pin can only be input, which is false.
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree
CANDIDATE · ISSUE
`AttributeError: 'Pin' object has no attribute 'on'`
port-esp32
On my ESP32, this happens:
>>> import machine
>>> p = machine.Pin(2, machine.Pin.OUT)
>>> p.on()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Pin' object has no attribute 'on'
Even though the docs say that the Pin.on method works.