Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By pomelo
#39481 I hope i am not double posting, my previous post is lost?

First of all i would like to say ESP8266 is a great platform.
The only problem i have with my application so far is the EEPROM.

Secondly please excuse my newbie approach, i just started with arduino, nevertheless i am 15+yrs experienced in C++.

Problem:
I am able to Save/Load to EEPROM without any problems as long as my Board is connected to the power.
However when i power off or reset the board (opening Serial Monitor) the EEPROM data is trash (random characters)

The setup i am using is as follows:
Code: Select allARDUINO IDE 1.6.7
OS MAC OSX 10.11.2 EL CAPTAIN
PYESPTOOL programmer (only this works for me on MAC)



programmers.txt
Code: Select allpyesptool.name=pyesptool
pyesptool.communication=serial
pyesptool.protocol=esp
pyesptool.program.protocol=esp
pyesptool.program.tool=pyesptool
pyesptool.program.extra_params=



platform.txt
Code: Select alltools.pyesptool.cmd=esptool.py
tools.pyesptool.cmd.windows=esptool.exe
tools.pyesptool.path={runtime.ide.path}/hardware/tools/esp8266/pyesptool
tools.pyesptool.program.params.verbose=""
tools.pyesptool.program.params.quiet=""
tools.pyesptool.program.pattern=python "{path}/{cmd}" {program.verbose} --port "{serial.port}" write_flash 0x00000 "{build.path}/{build.project_name}.bin"



The Save/Load code
Code: Select allvoid CSense::SaveConfig(const tConfig& rtConfig)

  // Clear EEPROM
  for(int a = 0; a < m_iMaxSSIDLength + m_iMaxPasswordLength;a++)
  {
    EEPROM.write(a, 0);
  }

  // Save SSID
  for (int i = 0; i < m_iMaxSSIDLength; i++)
  {
    if(i < rtConfig.m_strWiFiSSID.length())
      EEPROM.write(i, rtConfig.m_strWiFiSSID[i]);
  }

  // Save Password
  for (int i = 0; i < m_iMaxPasswordLength; i++)
  {
    if(i < rtConfig.m_strWiFiPassword.length())
      EEPROM.write(i + m_iMaxSSIDLength, rtConfig.m_strWiFiPassword[i]);   
  }
  EEPROM.commit();
  yield();

}

void CSense::LoadConfig(tConfig& rtConfig)
{
  //
  rtConfig.m_strWiFiSSID = "";
  rtConfig.m_strWiFiPassword = "";
 
 
  // Laod SSID First
  for (int i = 0; i < m_iMaxSSIDLength; i++)
  {
      rtConfig.m_strWiFiSSID += char(EEPROM.read(i));
  }

   // Load PASS
   for (int i = 0; i < m_iMaxPasswordLength; i++)
   {
      rtConfig.m_strWiFiPassword += char(EEPROM.read(m_iMaxSSIDLength+i));
   } 
 
}



Would you be able to help me out with this please? If there is anything else i need to share, please let me know.


Investigation here: https://github.com/esp8266/Arduino/issues/1486