Open mrlightsman opened 6 years ago
Have you tried changing the flash size to a higher value?
@BoriKing Do you mean the 1M(512SPIFFS) setting in Arduino ide? Does the ESP01 have more memory available? My next setting is 2M(1M SPIFFS).
When I compile it, ide says: Sketch uses 437781 bytes (87%) of program storage space. Max is 499696 bytes. Global variables use 39332 bytes (48%) of dynamic memory, leaving 42588 bytes for local variables. Max is 81920 bytes.
Is this what you mean? What is the highest setting I can use with an esp01? Thanks.
yes that's what i mean. as for the highest setting i'm not sure. this may help.
Thanks. I’ll give the sketch a try after work tomorrow and report out.
For my learning... I assume dynamic memory is equated to ram in a pc. Is it possible the variables I am using really use up 52% of the memory?
I know I am getting close on the program storage. I’m not sure if there is anything I can do to make the code more lean. I’m clearly a novice, but have tried to keep my modifications as efficient as I know how.
Thanks again for always being willing to help.
I ran the sketch @BoriKing shared. The ESP01 is a 1M chip. So, it seems 1M (512 SPIFFS) is my limit. Assuming size is the problem, and short of buying a different version of the ESP, is there anything I can do to reduce the size of my code and/or variables?
For example, are most DHCP servers "smart enough" that if I only have json handle the IP address, the DHCP will be able to fill in the gateway and subnet without me having to handle them in the sketch?
After doing a bit more testing, I commented out the json handling for gateway (static_gw) and subnet (static_sn). Now everything works as expected. Except that the wifi manager now shows the gw and sn as 0.0.0.0 and even when I change the IP, it defaults back to the dhcp given IP. I suspect the latter is because of json["ip"] = WiFi.localIP().toString();
This doesn't really matter to me, as I will just do an address reservation in my router.
I just wonder why the gateway and subnet cause problems. Is it possible that wifiManager.setSTAStaticIPConfig(_ip, _gw, _sn);
is a bug and should be wifiManager.setSTAStaticIPConfig(_ip, _sn, _gw);
?
I realize this is not a Sinric issue, but it is an interesting topic which I should probably migrate to the other git, but it doesn't seem to draw too many comments any more.
Probably not a Sinric issue, but it is manifesting itself here...
Because I am using a combination of UDP and Alexa, I need to be able to set the IP address with the WiFi manager. I am using the standard code found on Tzapu GitHub... WiFi Manager with parameters and custom IP.
The first time the ESP connects to wifi, it uses DHCP to set the IP. Then with reset, it shows the custom IP in the WiFi manager and can be changed, if desired. I am not changing the IP. I just want to see it.
The sinric code works fine on first ESP connect to wifi, but after reset, it no longer receives the sinric commands... possible conflict with websockets???
The UDP connections all work fine and physical buttons work also.
I'm puzzled and confused. I'm not sure what is happening in the SPIFFS or websockets upon reset of the ESP. I don't change the IP address or any parameters. If I comment out:
Everything works as expected after formatting the SPIFFS and reentering the parameters. I just can't identify the IP address.
Thoughts and suggestions are appreciated. The full code is listed here: