gmag11 / FSBrowserNG

Full autocontained (on SPIFFS) async web server on ESP8266. Written as a Library.
Other
158 stars 70 forks source link

Can't enter AP mode #50

Closed mstjerna closed 6 years ago

mstjerna commented 6 years ago

Hi

This project looks very interesting and I would love to get started playing with it. I struggle a little bit with your simplest example "StartHere"

All files compilte in the PlatformIO just fine, the "data" folder is added to the project and I see that it's uploaded to the ESP when compiling. I never get to the AP-point mode. The serial output just keeps "Attemping WiFi***" forever.

I have tried to put the GPIO-4 pin high/low and re-power the module with the same result. IS this the GPIO? or a different pin? I use a NodeMCU v1 ESP12e.

define AP_ENABLE_BUTTON 4 // Button pin to enable AP during startup for configuration. -1 to disable

platformio.ini [env:nodemcuv2] platform = espressif8266 board = nodemcuv2 framework = arduino lib_deps =
https://github.com/gmag11/FSBrowserNG https://github.com/PaulStoffregen/Time https://github.com/gmag11/NtpClient https://github.com/me-no-dev/ESPAsyncTCP https://github.com/me-no-dev/ESPAsyncWebServer https://github.com/bblanchon/ArduinoJson monitor_baud = 115200 targets = buildfs, uploadfs

Br Michael Stjerna

species5618 commented 6 years ago

it shoudl be GPIO4 , which is believe is labeed D2 for some odd reason on the NodeMCU v1 i think it needs to be pulled down, some of the documention may say tie up to acess AP mode, it was changed to make the pin multi use and compatible for i2c use , which has a pull up by default

I have not tested this feature for a long time,
as my prefernce is to create a config.json file in my data folder and pre load the wi-fi config i need dont forget to upload the data folder to the SPIFFs, iin arduino and Visual Studio IDE (with vMicro) there is publish data files option, not sure about Visual vode or other platformio IDEs

it is also worth noting there is a change pending to stop the lack of wi-fi blocking start up, for situations where you need data loggin to continue regardless

mstjerna commented 6 years ago

Oh, that was a quick replay! I got it working 1min after the post :-) While you are there, another quick question. When I save some data for the WiFi configuration i get:

Attemping WiFi IP Address: 192.168.0.8

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v4ceabea9 ~ld

Attemping WiFi IP Address: 192.168.0.8

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v4ceabea9 ~ld

Attemping WiFi IP Address: 192.168.0.8

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v4ceabea9 ~ld

Attemping WiFi IP Address: 192.168.0.8

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v4ceabea9 ~ld

Attemping WiFi IP Address: 192.168.0.8

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v4ceabea9 ~ld

Is this expected to restart the chip to Join the network?

mstjerna commented 6 years ago

Closing this one... Thanks for a great project!

species5618 commented 6 years ago

Attemping WiFi IP Address: 192.168.0.8

tell me it has joined youi wi-fi network, then something is killing the code

as the librery is written on ascyncTCP, you must not have any blocking code have yoiu got any code in the loop() section such which contains delay()

the use of delay() in the main code has a habbit of breaking things and causing crashes like this,

you have to use the millis value and loops to manage timeing and peridioc tasks in your main code may be worth a compile with only the handle() in the loop section

mstjerna commented 6 years ago

Hm... So if I want to handle a temperature sensor read every 5min and publish it via MQTT do you have any tips instead of using a delay inside the loop()? I don't expect any code example just a tip what to look for on the web :+1:

mstjerna commented 6 years ago

Ha ha... Never mind.. You already got an example for what I am looking for https://github.com/species5618/MQTT_Thermometer_ESP-01

Thanks for the support and have a great day!