Power up Pin

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
simon2023
New user
Posts: 4
Joined: 18 Aug 2023, 19:43

Power up Pin

#1 Post by simon2023 » 24 Aug 2023, 11:53

I am trying to simply power a Pin of the ESP8266.
I thought it would be rather easy, but it does not seem to work for me.

My rule:

Code: Select all

On startup_NAS do 
  logentry,"The power button is now virtually hit. Pin is powered "
  Publish %sysname%/startup_NAS=1
  GPIO,D1,1
  timerSet,1,10 //timer 1 set for 1 sec
endon

On hardreset_NAS do 
  logentry,"The power button is now virtually hit for longer time. Pin is powered"
  Publish %sysname%/hardreset_NAS=1
  GPIO,D1,1
  timerSet,1,10 //timer 1 set for 1 sec
endon


on Rules#Timer=1 do
 GPIO,D1,0
logentry,"The power button is now released"
endon

This is the log:

Code: Select all

299739: HTTP: event,startup_NAS
299837: EVENT: startup_NAS
299841: ACT : logentry,'The power button is now virtually hit. Pin is powered '
299843: The power button is now virtually hit. Pin is powered
299849: ACT : Publish ESP8266_NAS/startup_NAS=1
299872: ACT : GPIO,1,1
299874: GPIO : port#1: set to 1
299876: ACT : timerSet,1,10
303228: ADC : Analog value: 0 = 0.00
303241: EVENT: send2#Analog=2.00
304597: WD : Uptime 5 ConnectFailures 0 FreeMem 20128 WiFiStatus 3 ESPeasy internal wifi status: Conn. IP Init
309878: EVENT: Rules#Timer=1,1
309884: ACT : GPIO,1,0
309886: GPIO : port#1: set to 0
309888: ACT : logentry,'The power button is now released'
309890: The power button is now released
I measured different Pins from D0 to D3 to ground (connect multimeter with ground, other side with Pins), but none of them had some voltage > 0.
D4 had a voltage of 3,35V to ground.

What does the line GPIO : port#1: set to 1 mean? Which one is port#1 ?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Power up Pin

#2 Post by TD-er » 24 Aug 2023, 12:14

I think the confusion of the name 'port' comes from using shared code for both the internal GPIOs and the supported GPIO extender chips.
You can use multiple of those GPIO extender chips, so the numbering of those is slightly different from the internal GPIOs.

But I agree there are better words for this.

With the GPIO command you must use the GPIO numbers, not the D0..D16 numbers someone once introduced for NodeMCU boards.
See here for a conversion of those D-names to GPIO numbers and also which pins you can use.
https://espeasy.readthedocs.io/en/lates ... on-esp8266

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests