Disable WiFi in Tasmota

1,952 views
Skip to first unread message

Peter Buijsman

unread,
Jun 28, 2018, 6:03:33 PM6/28/18
to sonof...@googlegroups.com

Hi,
I've got a Sonoff TH set up with GPIO and serial to control remote lights. As the Sonoff is connected to an ESP32 with LORA for long distance reception, I don't need the wifi of the Sonoff.
Is there a command or option to completely disable the built-in wifi? Currently the sonoff keeps trying to connect to a wifi network and eventually when this is not possible the sonoff will reboot or something causing the relay to also do a quick off/on. Not good.
I don't see such a command listed in the obvious places.
Thanks!

Philip Knowles

unread,
Jun 28, 2018, 6:27:53 PM6/28/18
to Peter Buijsman, SonoffUsers

I couldn't find anything either. I suppose you could buy a cheap wifi ap and log it into that bitbpointless but if it stops the reboots...


On Jun 28, 2018 11:03 PM, "Peter Buijsman" <peter.b...@gmail.com> wrote:

Hi,
I've got a Sonoff TH set up with GPIO and serial to control remote lights. As the Sonoff is connected to an ESP32 with LORA for long distance switching, so I don't need the wifi of the Sonoff.
Is there a command or option to completely disable the built-in wifi? Currently the sonoff keeps trying to connect to a wifi network and eventually when this is not possible the sonoff will reboot or something causing the relay to also do a quick off/on. Not good.
I don't see such a command listed in the obvious places.
Thanks!

--
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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/sonoffusers.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/d0c63a52-e82e-492e-a300-95fd2c07644f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Colin Law

unread,
Jun 29, 2018, 3:24:16 AM6/29/18
to SonoffUsers
On 28 June 2018 at 23:03, Peter Buijsman <peter.b...@gmail.com> wrote:
>
> Currently the sonoff keeps trying to connect to a wifi network and
> eventually when this is not possible the sonoff will reboot or something

In user_config.h (or the override) set WIFI_CONFIG_TOOL to WIFI_WAIT.
Then if it can't connect to the wifi it just waits rather than
re-booting. WAIT doesn't mean it holds other things up while it
waits, of course, it means the wifi code just does nothing unless the
SSID appears.

This has an advantage over disabling the wifi that if you have the
ability to setup a wifi hotspot on a laptop, for example, you can put
that SSID into the device and then if you ever do need to connect you
can take the laptop along, setup the hotspot, and the Sonoff will
connect so you can configure it or whatever.

Colin

Eugene Christopher

unread,
Jun 29, 2018, 8:45:25 AM6/29/18
to Colin Law, SonoffUsers
Nice idea Colin.

Peter, can you please explain how you got LORA connected with the Sonoff? I am also interested in such  integration to enable me achieve long distance with the Sonoff.

I will appreciate your insight


--
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.

Peter Buijsman

unread,
Jun 29, 2018, 9:32:11 AM6/29/18
to eugen...@gmail.com, sonof...@googlegroups.com
Hi,

Sure! I got myself 2 ESP32 boards with a LORA chip on it. I created 2 sketches, one sender and one receiver. The sender board is connected via WiFi to a MQTT server (already running). The sender-ESP32 is the link between the MQTT server and the lora transmitter. The other ESP32 simply listens for incoming commands over lora. I created a very simple command structure, where on means on and off means off. :) Simplest option to proceed from there is to use the Sonoff TH10 where you cut of the remote sensor. That sensor cable is holds 3.3V, ground and 2 GPIO pins. Feed the power to the ESP32 and connect 1 pin to an output port of the ESP32. You now have a connection between the ESP with lora and Sonoff. Now in Tasmota, configure the GPIO pin as a switch and off you go.

So, again but high level: I turn on a 'switch' in my HomeAssistant that is configured as an MQTT switch. This is picked up by the ESP32 that I configured as sender and translated in a command that is send over lora. The command is received by the other ESP32 that in my case is 100 meters away. This ESP validates the command and puts a certain digitalpin HIGH or LOW. This pin is connected to the Sonoff that is configured to consider the signal a remote switch.

Does this help?

Eugene Christopher

unread,
Jun 29, 2018, 9:46:38 AM6/29/18
to Peter Buijsman, sonof...@googlegroups.com
Awesome! thanks Peter.
Looking up ESP32 board now
Can this integration not also work with Sonoff Pow R2? why the choice of Sonoff TH?

Peter Buijsman

unread,
Jun 29, 2018, 10:09:37 AM6/29/18
to Eugene Christopher, sonof...@googlegroups.com
Make sure you look at ESP32 boards with lora chips on it, they come in many flavours.

Any Sonoff will work I guess, but the cool thing about the TH is that it has an external connector so it requires no soldering inside the sonoff.

Eugene Christopher

unread,
Jun 29, 2018, 2:11:36 PM6/29/18
to Peter Buijsman, SonoffUsers
oh i see. I will be trying it out with Pow mainly because of the metering feature.
much thanks

IDDQD IDKFA

unread,
Jun 30, 2018, 2:52:48 AM6/30/18
to SonoffUsers
Unless things have changed its not a good idea to connect any devices to Pow GPIO. Because of the way the circuit is designed the GPIO devices can be exposed to mains high voltage.

Ryan

homme...@gmail.com

unread,
Jul 2, 2018, 11:25:17 AM7/2/18
to SonoffUsers
Hello Colin, Can this WIFI_WAIT been set with a QMTT command? I do not like to get both my 4 ch from the wall and reflash them.


Op vrijdag 29 juni 2018 09:24:16 UTC+2 schreef Colin Law:

Colin Law

unread,
Jul 2, 2018, 12:33:12 PM7/2/18
to SonoffUsers
On 2 July 2018 at 16:25, <homme...@gmail.com> wrote:
Hello Colin, Can this WIFI_WAIT been set with a QMTT command? I do not like to get both my 4 ch from the wall and reflash them.

No idea.  I flash all mine and keep the sources in branches on a git repo so I know what is in each one and can easily flash a new one if necessary.

You can reflash them OTA, but you do need a wifi connection to do that.  For mine that are out of range of normal wifi, when I want to flash them I set my laptop up as a wifi hotspot and have the Sonoffs configured to connect to that if it is available.  Then to flash them I take along the laptop, enable the hotspot, and update OTA.
 
Colin

Patrick Miller

unread,
Jul 2, 2018, 10:56:20 PM7/2/18
to SonoffUsers
Colin,

When I set WIFI_CONFIG_TOOL to WIFI_WAIT, the serial terminal outputs the following repeatedly...
00:05:06 WIF: Connect failed with AP timeout
00:05:29 WIF: Connect failed with AP timeout
00:05:30 WIF: Connecting to AP1  in mode 11N as sonoff-4653...
00:05:53 WIF: Connect failed with AP timeout
00:06:16 WIF: Connect failed with AP timeout
00:06:17 WIF: Connecting to AP1  in mode 11N as sonoff-4653...

Is there a way to disable the Wifi and AP?

Thanks
Reply all
Reply to author
Forward
0 new messages