GithubHelp home page GithubHelp logo

Comments (5)

proddy avatar proddy commented on August 22, 2024 1

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.

rjwats avatar rjwats commented on August 22, 2024

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:

image

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.

rjwats avatar rjwats commented on August 22, 2024

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.

proddy avatar proddy commented on August 22, 2024

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.

proddy avatar proddy commented on August 22, 2024

Closing this as the fix works marvelously.

from esp8266-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.