← index #18982Issue #4816
Off-topic · high · value 1.774
QUERY · ISSUE

esp32/machine_pin: ESP32-P4 pin 54 can't be set to output

openby sfe-SparkFroopened 2026-03-23updated 2026-03-23
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'`

closedby cool-RRopened 2019-05-27updated 2020-10-21
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.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied