Comments (5)
Not sure its flash related. The SPIFFS FS and json files are loaded correctly. I think the problem is in the wifi.getmode() which is always returning WIFI_AP even before the WiFi has been initialized. I'll deep dive tomorrow.
from esp8266-react.
Odd! I had never erased one of these esp8266 chips until you mentioned this. Same effect for me!
Flashing my other chips (without erasing) gives normal behaviour. It must be something to do with the build or upload in PlatformIO. Maybe there's a flag missing to initialise the flash properly. I'm not too sure yet.
I managed to get my erased chip working though PlatformIO after flashing a random sketch to it through the Arduino IDE using the settings below:
It again breaks after erasing... I've done some reading and nothing has leapt out at me yet. I've tried explicitly telling the linker which .ld script to use to no effect. Will keep looking and see if I can find an answer.
I guess the work-around for now is to not erase the flash :)
from esp8266-react.
Indeed, I noted the config was loading fine also. Uploading a different sketch changed the persistent opmode resulting in the device starting up subsequently in station mode - so the APSettingsService code was then initialising correctly on startup.
The espressif SDK stores it's persistent WiFi config in a separate area on the flash (/* wifi @0x405FD000 (12KB) */ ) and it would appear that when erased with 0xFFs this value becomes (or defaults to) a 3 (WIFI_AP_STA) - at least that's what this code was demonstrating on my device:
void setup() { Serial.begin(115200); WiFi.begin(); } void loop() { Serial.println(WiFi.getMode()); delay(1000); }
In esp8266-react we disable WiFi settings persistence and rely purely on configuration stored as JSON in SPIFFS. However the management code does expect the device to be coming up with an opcode of 0.
I've tested and pushed a fix for this which makes sure the device always starts up in opmode 0 (by configuring the persistent default).
Thanks for pointing this one out, I never erased my devices so I never saw it!
from esp8266-react.
great that you found the root cause. I would also have expected that when all the flash sectors were erased the wifi mode would not default to STA on boot up.
from esp8266-react.
Closing this as the fix works marvelously.
from esp8266-react.
Related Issues (20)
- Error npm start or build Error: ...API schema. - options.allowedHosts[0] should be a non-empty string. HOT 3
- Support to show user defined build version infomation in the about screen x.x.x. Also nice to expose an api that can return this infomation. This can be handy if you want to mass update devices that meet a version criteria.
- Help me understand why "We want the device to come up in opmode=0 (WIFI_OFF)" (WiFiSettingsService.cpp)
- ESP32 light sleep mode and WiFi on/off
- websocket (WS_EVT_DATA) event from client does not update state on esp8266 only HOT 1
- Add netBIOS name
- On Mobile after clicking on menu item it does not close drawer HOT 7
- Firebase Integration HOT 1
- [Question] Add a websocket based STOMP implementation
- How to use MQTT function
- How to buy a coffee? HOT 2
- Retain flag on MQTT topic & Last will & Testament message HOT 1
- Possibility to use a JsonArray instead of JsonObject in read/update method
- Using PreactJS instead of ReactJS to reduce bundle size HOT 8
- Merging 2 websockets into a single one
- esp32 bootloop with platform=espressif32 HOT 5
- Manual Set Time not accounting for DST Properly (Fix attached) HOT 1
- web interface
- Slider Issue
- Working Platformio packages versions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266-react.