No wifi AP with custom build

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
djelau
Normal user
Posts: 45
Joined: 08 Nov 2019, 15:33
Location: France

No wifi AP with custom build

#1 Post by djelau » 26 Oct 2023, 09:32

Hello,

I start from the beginning with platformio:
1st, I erase flash and I follow instructions in Custom-sample.h:
  • 1) rename this file to "Custom.h" (It is ignored by Git)
    2) define your own settings below : only define some plugin (USES_P001) and controller (USES_C008)
    3) define USE_CUSTOM_H as a build flags. ie : export PLATFORMIO_BUILD_FLAGS="'-DUSE_CUSTOM_H'" => In Windows environment : set PLATFORMIO_BUILD_FLAGS="'-DUSE_CUSTOM_H'"
Then I upload with the "arrow button" at the bottom edge of Platformio. No problem with compilation and uploading.

But I dont have AP wifi availabke once ESP8266 starts. Did I miss something ?

Serial monitoring:

Code: Select all

INIT : Booting version: ESP_Easy_mega_20231026_custom_ESP8266_4M1M, (Self built) My Build: Oct 26 2023 09:03:32 (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)
599 : Info   : INIT : Free RAM:29400
600 : Info   : INIT : Manual Reboot #14 - Restart Reason: External System
601 : Info   : FS   : Mounting...
627 : Info   : FS   : �osing ESPEasySerial
653 : Info   : ESPEasy console using ESPEasySerial
654 : Info   : INIT : I2C
655 : Info   : INIT : SPI not enabled
655 : Info   : Set Network mode: WiFi
760 : Info   : WIFI : Set WiFi to STA
928 : Info   : Setup: Scan all channels
3115 : Info   : ESPEasy ��3118 : Info   : ESPEasy console using ESPEasySerial
3119 : Info   : INFO : Plugins: 2 [No Debug Log] (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)
5309 : Info   : Webserver: start
6654 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 23528 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
36648 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 23528 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED

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

Re: No wifi AP with custom build

#2 Post by TD-er » 26 Oct 2023, 10:01

Hmm that's strange, especially since you stated the flash was erased.
Did you maybe also disable some "WEBSERVER" like defines?

You can override this part of accessing via the web interface by giving the following commands via the serial terminal you use to see the logs. (No way to correct typo's, so maybe copy/paste commands one by one from a notepad?)

Code: Select all

wifissid,MyWiFiNetworkName
wifikey,MyTopSecretWiFiPassword
save
Maybe you also need to give the command wifidisconnect to trigger a full reset of the WiFi radio and start scanning again. (after setting the WiFi credentials)

djelau
Normal user
Posts: 45
Joined: 08 Nov 2019, 15:33
Location: France

Re: No wifi AP with custom build

#3 Post by djelau » 26 Oct 2023, 11:47

If I don't erase flash (thus I keep previous Wifi parameter of my own wifi network in the flash when I uploaded the Normal firmware), then it works correctly (it connect to wifi STA with my home ssid).
I made the test on 2 esp8266 (wemos mini D1 board) => same issue on both, no AP after full erase.
I don't disable any "WEBSERVER". Actually, I don't modify anything except renaming Custom.h and define USES_P001 and USES_C008. If I don't define any plugin/controller, I've got errors when compiling, is it normal ?

Defining my wifi credential in the Custom.h doesn't give me a positive result: it doesn't connect neither by STA nor by AP.

(I ll try your proposal at the end of the day)

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

Re: No wifi AP with custom build

#4 Post by TD-er » 26 Oct 2023, 12:13

The default WiFi credentials in the Custom.h will only be used when generating a new settings file.
This only happens when you perform a factory reset, or start from a fully wiped flash (thus writing a blank bin file to the flash)

djelau
Normal user
Posts: 45
Joined: 08 Nov 2019, 15:33
Location: France

Re: No wifi AP with custom build

#5 Post by djelau » 26 Oct 2023, 22:17

Feedback of my tentatives by chronology:
1) Load a blank bin => After uploading a custom fw without my own wifi credential, it doesn't start the AP (anormal behavior)
2) Enter your 3 command in the terminal (1 by 1), the STA restart and connect to my wifi (normal behavior)
3) Load a blank bin => After uploading a custom fw with my own wifi credential, it starts the STA and connect to my network (normal behavior)
4) Erase flash with platformio => After uploading a custom fw with my own wifi credential, it starts the STA without connectig to my network (anormal behavior)
5) Enter your 3 command in the terminal (1 by 1), the STA restart and connect to my wifi (normal behavior)
6) I connect to web interface and perform 'wifi credential clear' => On the serial interface, STA is stopped and AT is started (normal behavior)
7) Load a blank bin => After uploading a custom fw without my own wifi credential, now it starts the AP (normal behavior): So previous test seems to unlock something in configuration register of ESP.

Further, need to try with the 2nd ESP that I ve (to test command wifidisconnect). ...
Last edited by djelau on 27 Oct 2023, 08:38, edited 2 times in total.

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

Re: No wifi AP with custom build

#6 Post by TD-er » 26 Oct 2023, 22:31

wifidisconnect is just doing what the command suggests.
However sometimes the WiFi radio may end up in some kind of limbo state after performing a scan.
And somehow triggering a disconnect command does pull the WiFi radio out of this undefined state and starts acting normal again.

djelau
Normal user
Posts: 45
Joined: 08 Nov 2019, 15:33
Location: France

Re: No wifi AP with custom build

#7 Post by djelau » 27 Oct 2023, 08:37

Once again, on the 2nd ESP, after uploading a blank bin + upload my custom files, the esp only activated STA.

Code: Select all

wifidisconnect 
command had no positive effect.

Now that I learn it was possible to send command with serial interface, I try with

Code: Select all

allowapmode 
command, Then it started AT mode and I succeeded to connect to this AP. I cleared wifi credential through web interface, and after reboot, it automatically started AP.

The problem was quite strange but anyway, thanks to your help, it solves my issue. thank you TD-er !

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests