Chat freely about anything...

User avatar
By StupidSaurus-Rex
#23331 Please forgive me for my naivete, it seems that the pin names that are referenced on projects do not match the GPIO pin labels on the board. I have searched with my 15+ years of scouring the internet for answers, and I have not found anything directly referencing the correlation. Perhaps it is simply the fact that I have chosen (what seems to be) the LEAST common module out there (to me it seems like the best of the breed, it's cheap, has the ext_ant connector, and all of the GPIO pins available... Am I missing something)...

So, as an example, I am attempting to use the ESP8266 as a solitary controller for some motion based LED's I plan to install in my hallway. Unfortunately nobody has the capacity to turn off the lights down here, despite my efforts, and even having installed additional switches at every room/entrance (3 bedrooms, a bathroom, a laundry room, and the stairway, which has two switches) with access to the hallway, and still, the lights stay on...

Anyhow, my solution is to use an inexpensive controller to monitor 3 PIR motion sensors in the hall, when one is triggered it will kick over a relay to power on a few strips of LED's. Unfortunately, down to my issue, the code I have found to work from has:

Code: Select alloutpin=3
gpio.mode(outpin,gpio.OUTPUT)

inpin=6
gpio.mode(inpin,gpio.INT,gpio.PULLUP)

function motion()
print("MOTION DETECTED")
gpio.write(outpin,gpio.HIGH)
tmr.delay(5000000)
gpio.write(outpin,gpio.LOW)
end

gpio.trig(6,"up",motion)


Unfortunately I do not know how the pin numbers correspond to the GPIO labels. If anybody can help me with this it would be GREATLY appreciated!

I apologize for the long post, I just really prefer to be detailed in my descriptions of my intentions, observations and issues so as to prevent any confusion... Hopefully I nailed it all, if not I will happily answer any relevant, necessary questions.

THANK YOU!!!
User avatar
By kolban
#23336 See the ESP-07 diagrams on this page:

wiki/doku.php?id=esp8266-module-family

I think I'm probably not getting the core point ... it appears that the physical pins on the breakout board are labeled clearly ... so I'm guessing I'm missing something obvious.
User avatar
By StupidSaurus-Rex
#23474 Apologies for the delay.

As you can see here:

Code: Select alloutpin=3
gpio.mode(outpin,gpio.OUTPUT)

inpin=6
gpio.mode(inpin,gpio.INT,gpio.PULLUP)


The pins on the module are labeled as 16, 14, 12, 13, 05, 04, 0, 02, 15

My question is which pins are being referenced in the code by "outpin=3/inpin=6"...

Given that there is neither a GPIO3 nor a GPIO6...

Thank you again for your time!