Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By ChrisSparks
#62482 I am still wrestling with the ethernet and DHCP connections for my ESP. I can build from the RTOS SDK and get the ethernet to talk, but not from the Arduino IDE. I'd like to be able to use my GPIO/Pin Arduino demo and add ethernet to it as I cannot figure out to use the GPIO on the RTOS SDK.
User avatar
By la3bna
#62492 Getting the ESP to talk to WiFi in Arduino is not too hard..

Code: Select all#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
User avatar
By ChrisSparks
#62611 I have persevered and have been able to use the Generic Setup for my NODEMCU unit and the Arduino IDE successfully! Woo Hoo! Specifically I have my 2 units talking UDP DGRAMS to a program running on my PC. From my PC I can control 2 different 4 channel relay boards.

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
User avatar
By martinayotte
#62613 The "Maximum is 1044464 bytes" is the maximum sketch code size, it doesn't included SPIFFS and EEPROM and WiFi configs. The "Maximum is 81920 bytes" is effectively that maximum RAM, including heap and stack.
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.