How to define the GPIOs at a ESP8266 in Tasmota?

92 views
Skip to first unread message

Guido Sauer

unread,
Feb 1, 2019, 8:35:44 AM2/1/19
to sonof...@googlegroups.com
Hello,

I'm very new in the Tasmota firmware.

Before that I used EasyESP, but this was more complicated concerning MQTT for ioBroker.

So I flashed Sonoff Tasmota to an ESP.
In my case I have this LUANI HVIO module.

But I do not understand the settings.

In Tasmota wiki is explained button and switch.

In the SW setting the switch starts with Switch3. What does it means? What is "i" and "n" Where is it described?
What's about Relay, LED and so on?
What about the numbers in the brackets?

How can I set all GPIOs of the ESP?



Maybe I have the wrong description, but I know just the Wiki of Tasmote Github.

Thank you!


Phil

unread,
Feb 1, 2019, 10:21:38 AM2/1/19
to SonoffUsers
Hi,  if your device isnt a listed module select the generic type 18 module in the module config selection and test it out..

to test i make 2 assumptions, gpio0 and the TX/Rx lines will not be used for a relay.. so i set everything else as relay1,2,3,4,5,6,7,8.....

(the 'i' after a relay indicates an Inverse relay ie one that is set high to turn off rather than set high to turn on..  )

save wait for it to restart, and then click /toggle each button 1 to 8 in turn and listen for the relay click or plug in a lamp and see which gpio does switch the relay.. 

one the relay gpio is determined you can then test for the button in the same way if it is not on Gpio0....

its a minor pita but only needs doing once for each module type you have..  

Philip Knowles

unread,
Feb 1, 2019, 10:25:57 AM2/1/19
to Phil, SonoffUsers

Well done t’other Phil. The only bit you missed was the n on a Switch which is a normally closed rather than normally open.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Michael Ingraham

unread,
Feb 1, 2019, 11:27:28 AM2/1/19
to SonoffUsers
Travis (Digiblur) recently had a live stream on his YouTube channel walking through the process. These are the notes I captured:
  • Set every GPIO (excluding, at first,  "dedicated" like Tx/Rx & GPIO0/GPIO2) to relays. Save configuration. Use web GUI toggles to find which GPIO control relays and LEDs. If unable to find relays and LEDs, set the "dedicated" GPIO and retry. Set the "active" GPIO to associate them with the RelayX or LEDX. Operation may dictate regular or inverted (RelayXi/LEDXi).
  • Set every remaining GPIO (excluding, at first,  "dedicated" like Tx/Rx & GPIO0/GPIO2) to Switches. Save configuration. Display Status 8 (sensors) in the Console to see the current state of the GPIO. Then, while pressing the button(s), display Status 8 again. Whichever GPIO changes state is the GPIO tied to the button. If none change state, then configure the "dedicated" GPIO and retry. Change the GPIO to a Button (may need to determine whether the internal pull-up is used or not - ButtonXn for no pull-up or normally-closed). If you want to use short-press/long-press, configure the button as a Switch instead.
  • Set remaining GPIO to None

Guido Sauer

unread,
Feb 13, 2019, 12:16:34 PM2/13/19
to SonoffUsers
Sorry, I was in vacation.

My question still is, what does button1, button 2, button3 and so on means?

What is the difference between Button1 and Button2 what I can select?


Or where is it described in the Wiki?

 

Phil

unread,
Feb 13, 2019, 12:30:58 PM2/13/19
to SonoffUsers
they are options,  you could conceivably connect upto 8x relays to the set of exposed gpio on a wemos d1 or esp8266-12 module, similarly you could connect upto 8x buttons  or 8x digital sensors... or any combination of h/w that suits your requirements..

so if you connect a button upto gpio4 and a relay upto gpio2 for example you use the configure module interface to tell tasmota what it has and where it is.  if you dont connect anything leave all blank..  

btw the "I" in the labels for relayXi indicates an inverted relay ie one that is normally closed rather than normally open.

Michael Ingraham

unread,
Feb 13, 2019, 12:57:52 PM2/13/19
to GS...@web.de, SonoffUsers
Guido,

A device can have one or more inputs such as a push button. Many times a device has "free" GPIO with which one can customize with additional circuitry (i.e., relays, push buttons, switches, sensors, etc.). The ESP8266/ESP8285 has 11 usable GPIO. Depending on the device, fewer (or none) may be available for device "customization". Thus, a device may have one or more push buttons. When configuring such a device, assign the first push button to Button1 or Button1i, the second pushbutton to Button2, etc. Assigning a numbered Button to each input then allows you to read that input and take actions based on ButtonX commands. Likewise, assign the first switch as Switch1, etc. To be clear, it is best to start enumerating each type of channel on a device with #1. In other words, the first relay you assign should be #1, the next relay, #2, etc. Then, the first button you assign should be #1; the first switch on the same device should be #1. As Phil mentioned, you can assign up to eight (8) of any one type (Relay/Button/Switch).

What makes it a bit confusing is that there are times when you may want to assign a push button as a Switch. This page and the examples on the Rules page provide some reasons for the alternatives.

Mike

P.S. A more detailed Generic Module configuration based on Digilur's tutorial is now located here. Also note that device template command has been recently added if to specify a device configuration with a single entry rather than the web GUI configuration dialog.


--

Guido Sauer

unread,
Feb 13, 2019, 2:18:09 PM2/13/19
to SonoffUsers
Ah, ok, it's just a naming reason!

Thank you

 
Reply all
Reply to author
Forward
0 new messages