ESP32Radio-V2 icon indicating copy to clipboard operation
ESP32Radio-V2 copied to clipboard

Fails Setting Up Access Point

Open wa8lbz opened this issue 3 years ago • 43 comments

I purchased a new ESP32 DOIT DEVKIT. Used the pio run -t upload and pio run -t uploadfs commands to upload the current sketch and preferences. Both were successful. Nothing was connected to the ESP32 except power, a capacitor from ESP32 EN pin to ground and USB cable to computer COM7. It's not working. See attached file... Power Up Serial Monitor 2.txt

wa8lbz avatar Apr 04 '22 23:04 wa8lbz

Do you see the ESRadio access point? If so, connect to it and go to http://192.168.4.1. Then configure your WiFi network. For Nextion: Check if the baudrate is 115200.

Edzelf avatar Apr 05 '22 05:04 Edzelf

No I do not see the access point (AP). Yes, the baud rate is 115200. I could see the AP before the March 26 code update.

wa8lbz avatar Apr 05 '22 18:04 wa8lbz

Then show the complete logging.

Edzelf avatar Apr 05 '22 22:04 Edzelf

Here is all logging. Upload, uploadfs and debug. Uploaad.txt Uploadfs.txt Debug.txt

wa8lbz avatar Apr 05 '22 23:04 wa8lbz

NVS is still empty, but you should see the AP. Otherwise the ESP32 is defective.

Edzelf avatar Apr 06 '22 05:04 Edzelf

Now I am really confused. The pio run -t uploadfs command was successful, but no AP. I have three ESP32 DOIT DEVKIT modules, one brand new, all giving the same results.

wa8lbz avatar Apr 06 '22 18:04 wa8lbz

Below is my defaultprefs.txt file, in the data directory, that was uploaded. Is there anything wrong with it? Defaultprefs.txt

wa8lbz avatar Apr 06 '22 18:04 wa8lbz

In the last message, the part about the missing spiffs.bin file is in error. The file is there. My mistake. But I am still concerned about the terminal logging for the pio run -t uploadfs command. You said the NVS was empty and I am trying to find out why. And I want to know what the "keys" are that are going into the NVS.

wa8lbz avatar Apr 07 '22 23:04 wa8lbz

Is there anything wrong with theplatformio.ini file: Platformio dot ini.txt

wa8lbz avatar Apr 08 '22 03:04 wa8lbz

Defaultprefs.txt is not needed at all. It is just a help to fill NVS after you have AP running. Also uploadfs is not vital. The first thing that is important is the AP. If you cannot get AP to work, you can not proceed with the radio.

Edzelf avatar Apr 08 '22 05:04 Edzelf

NVS contains the configuration parameters. Examples are the presets, volume, wifi credential. Read the documentation for details. NVS will be filled using the config page of the web interface.

Edzelf avatar Apr 08 '22 07:04 Edzelf

I understand that if you cannot get the AP to work, I can't proceed with the radio. I was able to get the AP until the code changed to fix the Nextion problem. After that, no AP. I have tried three ESP32 DOIT DEVKIT boards all with the same results. I have tried every thing I know to do but cannot solve the no AP problem. I get the same result using the Arduino IDE. What can I check next to solve the no AP problem? You say the NVS contains the configuration parameters and you also said my NVS is empty. I don't know what else to do. Do you want to see more logging outputs?

wa8lbz avatar Apr 09 '22 18:04 wa8lbz

Again, step 1 is to have AP working. Don't mind NVS or defaultprefs.txt.

Edzelf avatar Apr 09 '22 18:04 Edzelf

Sometimes it helps to erase the flash completely and then install SPIFS and sketch again.

Edzelf avatar Apr 09 '22 20:04 Edzelf

I will try anything to get the AP to work. Will the command )pio run erase -target) erase the flash? If not, how do I erase the flash?

wa8lbz avatar Apr 10 '22 19:04 wa8lbz

The command is pio run -t erase. You can also find the command in the left pane if you select the pio icon: image

Edzelf avatar Apr 10 '22 20:04 Edzelf

Still no AP. Here is the debug logging after performing these commands: pio run -t erase; pio run -t upload; and pio run -t uploadfs. All completed successfully. Could there be something wrong in the platformio.ini file or some other platform specific files? Debug Logging.txt

wa8lbz avatar Apr 11 '22 17:04 wa8lbz

The debug shows an error in the serial communication (PlatformIO to ESP32). So the platformIO crashes, not the ESP32. Maybe the serial chip on the devkit fails. It seems that the crash happens at the moment the WiFi of the ESP32 is switched on. Are you sure you have a good power supply (at least 1 Amp) for the ESP32 connected to "VIN"? If you only connect via the USB of a PC/laptop there may be insufficient power. I always use a USB hub with external powe rsupply.

Edzelf avatar Apr 12 '22 09:04 Edzelf

Good thought. I am in the process of getting a powered USB hub. Today for the first time I received this error message: Never seen this before

wa8lbz avatar Apr 12 '22 19:04 wa8lbz

Hi I got the same problem. In my case I got debug message:

D: Connect to WiFi
D: WiFi Failed!  Trying to setup AP with name ESP32-Radio and password ESP32-Radio.
D: IP = 0.0.0.0

When I use the old build (https://github.com/Edzelf/ESP32-Radio) then the AP works fine. Therefore, I think there's something messed up with the libs or dependencies. I don't know what, though. Thanks for hard work Ed, by the way!

Pawel.

Lesior avatar Apr 13 '22 17:04 Lesior

This is not an error message.  The IP address should be 192.168.4.1 and the AP will be available.

Edzelf avatar Apr 13 '22 17:04 Edzelf

Exactly, I got IP address 192.168.4.1 when I use the old ESP-Radio version. I disconnected all the peripherals and even created a new project in PlatformIO from scratch. Effect is that I can connect to the AP with WiFi, but the index.html page can't be displayed. And again when I do the same with the old version of the ESP-Radio I can connect and the index.html is displayed correctly. Additionally, in the Debug line I got error message: [E][AsyncTCP.cpp:729] connect(): error: -16

Lesior avatar Apr 13 '22 18:04 Lesior

You probably forgot to upload the webpages to SPIFFS. Can you ping to 192.168.4.1? Try to disconnect your PC from all other networks before connecting 192.168.4.1.

Edzelf avatar Apr 13 '22 18:04 Edzelf

I am now using a powered USB hub. Voltage measured at Vin in on ESP32 is 4.34 VDC and on 3V3 pin 3.37 VDC. So, the 3.3V regulator on the ESP32 board is functioning properly. Still no AP. Same results with three different ESP32 DOIT DEVKIT V1 boards. Was able to get an AP with the old code but not with the new code. I used a separate sketch I acquired and it established an AP (192.168.1.4), with two way communications, with no problem. There must be something wrong with the main.cpp file, one of the libraries, a platformIO specific file or platformIO itself. I have no more Ideas. I now see someone else is having the same problem of not being able establish an AP.

wa8lbz avatar Apr 14 '22 03:04 wa8lbz

i actually have the same issue.

i run the arduino sketch to set the preference. in v1 it set the value. in v2 it is not.

after run the sketch, i upload the firmware, connect to station 192.168.4.1. open the config page and it is asking to create new default config. endup i manually fill up the config in v2.

in v1 all preferences was set once firmware was uploaded.

tsctrl avatar Apr 14 '22 05:04 tsctrl

@wa8lbz , that issue shows if you install vs with client installer. need host installer to work with pio. and not related to the wifi issue

@Lesior you need to use spiff upload tools to upload the data folder to your esp spiffs partition.

i did have wifi connection issue on v1. there is some issue with the wifi library need to have it to be initialize with some additional commands. maybe wifi.disconnect() or something i cant recall.

tsctrl avatar Apr 14 '22 05:04 tsctrl

I have added the configuration parameter FIXEDWIFI in config.h. You also need the latest main.cpp for this feature. This will simplify the WiFi set-up. You may specify your WiFi SSID and password here. So it is not longer necessary to fight with the ESP32 Access Point.

Edzelf avatar Apr 14 '22 09:04 Edzelf

The latest change which Ed implemented works in regards of connecting to the WiFi network. However, even though the connection is established and IP is provided by my router's DHCP, when I connect to this IP, ESP32-Radio shows website with simple, but straight info: "sorry". Additionally, ESP32-Radio does not connect to the internet ratio.

..
 IP = 192.168.0.131
D: Start server for commands
D: Network found. Starting mp3 client, mqtt and OTA
D: MDNS responder started
D: Rotary encoder is disabled (-1/-1/-1)
D: Radiofuncs cmd is 1
D: Host selected is 2:
D: Connect to host
D: Connect to  on port 80, extension /
D: Request  failed!
D: Starting I2S playtask..
D: Output to internal DAC
D: Playtask stop song

I would need to dig deeper into this SPIFFS topic, but at the moment I don't even know what that is...

Lesior avatar Apr 14 '22 14:04 Lesior

obviously.... when you read manuals, life becomes easier. Everything is clearly described in the manual doc. Now I got the web-browsing working. Indeed I missed doing "pio run -t uploadfs". Thanks!

Lesior avatar Apr 14 '22 15:04 Lesior