Ser2net tries to start before WiFi is initialized

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
scubanarc
New user
Posts: 2
Joined: 29 Jul 2022, 00:01

Ser2net tries to start before WiFi is initialized

#1 Post by scubanarc » 29 Jul 2022, 00:05

I'm having trouble getting Ser2net to work. I have it set up as the first task. When I reboot the device I get the following:

Code: Select all

INIT : Booting version: HEAD_56d3225 (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)
181 : Info   : INIT : Free RAM:30056
182 : Info   : INIT : Soft Reboot #80 - Restart Reason: Software/System restart
183 : Info   : FS   : Mounting...
208 : Info   : FS   : Mount successful, used 76053 bytes of 957314
310 : Info   : FS   : Success garbage collection
327 : Info   : CRC  : SecuritySettings CRC   ...OK
329 : Info   : INIT : I2C
330 : Info   : INIT : SPI not enabled
342 : Info   : Time set to 84559.000 Time adjusted by 84558659.00 msec. Wander: 0.000 msec/second Source: RTC at boot
343 : Info   : Current Time Zone: STD time start: 1970-10-25 03:00:00 offset: 0 min
345 : Info   : Local time: 1970-01-01 23:29:19
357 : Info   : WiFi : Start network scan all channels
369 : Info   : INIT : Free RAM:26976
387 : Info   : Ser2net   : WiFi server closed
605 : Info   : INFO : Plugins: 79 [Normal] [Testing] [TEST_A] (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)
606 : Info   : EVENT: System#Wake
616 : Info   : Cache rules event: rules1.txt pos: 0 on Clock#Time=All,00:30 do
618 : Info   : Cache rules event: rules1.txt pos: 44 on Clock#Time=All,12:30 do
706 : Info   : Webserver: start
718 : Info   : EVENT: System#Boot
732 : Info   : EVENT: Time#Initialized
798 : Info   : EVENT: TaskInit#lcd=1,0
845 : Info   : EVENT: TaskInit#motion=2,1
879 : Info   : EVENT: motion#motion=1
1546 : Info   : EVENT: Clock#Time=Thu,23:29
2079 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 19232 WiFiStatus 0 ESPeasy internal wifi status: DISCONNECTED
2758 : Info   : WiFi : Scan finished, found: 3
2761 : Info   : WiFi : Best AP candidate: xxx 74:AC:B9:xx:xx:xx Ch:11 (-48dBm) WPA2/PSK
2762 : Info   : WIFI : Connecting xxx 74:AC:B9:xx:xx:xx Ch:11 (-48dBm) WPA2/PSK attempt #0
2764 : Info   : IP   : Static IP : 192.168.0.43 GW: 192.168.0.1 SN: 255.255.255.0 DNS: 8.8.8.8
3735 : Info   : WIFI : Connected! AP: xxx (74:AC:B9:xx:xx:xx) Ch: 11 Duration: 970 ms
3736 : Info   : WIFI : Static IP: 192.168.0.43 (test) GW: 192.168.0.1 SN: 255.255.255.0   duration: 2 ms
The thing that stands out to me is this:

Code: Select all

387 : Info   : Ser2net   : WiFi server closed
It does not appear to be listening because I cannot connect to it.

How do I get the Ser2net plugin to wait until the WiFi is connected?

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

Re: Ser2net tries to start before WiFi is initialized

#2 Post by TD-er » 29 Jul 2022, 00:44

You can enable and disable a task from within rules
So what you could do is to act on the WiFi#connected event (or WiFi#disconnected) and then enable the task.

It is not how it should be done, but for now I think it is a nice work-around as it should be possible to do this on current builds.

See: https://espeasy.readthedocs.io/en/lates ... l-commands
for TaskEnable and TaskDisable

scubanarc
New user
Posts: 2
Joined: 29 Jul 2022, 00:01

Re: Ser2net tries to start before WiFi is initialized

#3 Post by scubanarc » 29 Jul 2022, 01:32

I was going to test this, so I grabbed a random NodeMCU to test it on (other one is already deployed), and I didn't even need to try your workaround... Ser2net just worked fine out of the box. It has a different build on it. So now I'm assuming that there is something wrong in the newer build.

Ser2Net does not work: ESP_Easy_mega_20220616_test_A_ESP8266_4M1M

Ser2Net does work: ESP_Easy_mega_20211105_normal_ESP8266_4M1M

UPDATE: I just tried the 20220616_normal build and it works fine. It seems like there's something in the _test build that is making Ser2Net not work for me. I also discovered that the _normal build has the plugins that I need, so my problem is solved. Thanks for your help!

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests