08-01-2022, 03:11 PM
Hi,
I successfully implemented a solution for having an "after power loss" feature on my rockpro64.
I use an esp8266 with a relay shield, connected to the rpi connector. 5V is provided through the rpi connector as soon as the 12v DC plug provides power
3.3v pin is connected to a GPIO of the esp8266. The pin is to 0v if the RockPro64 is off.
If the rockpro64 is off the esp8266 detect that the 3.3v pin is down and it turn on the relay for 1s.
I use esphome to configure my esp8266.
I successfully implemented a solution for having an "after power loss" feature on my rockpro64.
I use an esp8266 with a relay shield, connected to the rpi connector. 5V is provided through the rpi connector as soon as the 12v DC plug provides power
3.3v pin is connected to a GPIO of the esp8266. The pin is to 0v if the RockPro64 is off.
If the rockpro64 is off the esp8266 detect that the 3.3v pin is down and it turn on the relay for 1s.
I use esphome to configure my esp8266.
Code:
switch:
- platform: gpio
id: rp64_switch
name: "rp64_switch"
pin: D1
binary_sensor:
- platform: gpio
id: rp64on
filters:
- delayed_off: 10s
pin:
number: D5
mode:
input: true
on_state:
then:
- if:
condition:
binary_sensor.is_off: rp64on
then:
- switch.turn_on: rp64_switch
- delay: 1s
- switch.turn_off: rp64_switch