Moderator: igrr
#include <ESP8266WiFi.h>
const char* ssid = "YOURSSID";
const char* password = "YOURPWD";
setup{
Serial.begin(115200);
Serial.print("Connecting to ");
Serial.print(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.print("\nWiFi connected, IP address : ");
Serial.println(WiFi.localIP());
}
loop
{}
There are liberaries that let you have a webpage to choose WiFi from what the ESP sees.
Hope this helps you
So now I want to use SPIFFS or EEPROM because I want to store data that each unit can access. State data basically. Any good examples out there? Especially the SPIFFS as I found an EEPROM example.
What is confusing me now is how things are being loaded into my units. I have 4MB of flash. This is what I see when I build:
Sketch uses 229493 bytes (21%) of program storage space. Maximum is 1044464 bytes.
Global variables use 32236 bytes (39%) of dynamic memory, leaving 49684 bytes for local variables. Maximum is 81920 bytes.
So even though I have a 4MB flash, my max is only 1044464 (0xfeff0)?
So what is this dynamic memory of 81920 bytes? Is that RAM or part of the flash?
When I was building from the SDK before, I could do this:
sudo python ~/Desktop/ESP/esptool-master/esptool.py --port /dev/ttyUSB0 write_flash -fs 32m -fm dio \
0x00000 bin/eagle.flash.bin \
0x20000 bin/eagle.irom0text.bin \
0x3fe000 bin/blank.bin \
0x3fc000 bin/esp_init_data_default.bin
So how does this relate to the Arduino IDE's way of flashing? I suspect my sketch is effectively the "eagle.flash.bin" and "eagle.iron0text.bin" part? Since 229493 is 0x38075 falls in the ranges above. But does it do the blank.bin or the esp_init_data_default.bin flashing as well or is it assumed it was already flashed before? It would be nice to have greater control over what gets flashed where. Maybe a MAP file for what the IDE does would be useful.
Any help appreciated of course.
Chris
Arduino IDE produce a single file binary, so no needs for eagle.flash.bin, etc. blank.bin is only useful when WiFi data becomes corrupted. But, it is easier to use esptool.py with the erase_flash command.