ClearEprom does not work for Sensebender GW



  • I just tried to delete the EEPROM of my Sensebender GW with the sample sketch coming with the MySensor library (ClearEepromConfig) It does not seem to work. At least as far I can deduce from the debug statements I inserted. I put a print just before the for loop in the setup function and one after hwWriteConfig. The code does not reach the hwWriteConfig.

    I am using MySensors 2.1.1


  • Hardware Contributor

    Hello @tomkxy it seems your post was missed by the "specialists" of the Sensebender boards.
    On Sensebender GW the chip doesn't have EEPROM so it's using an external EEPROM, maybe it's related.
    What is it printing if you put the following lines at the beginning of the script ?

    Serial.print("EEPROM_LOCAL_CONFIG_ADDRESS: ");
    Serial.println(EEPROM_LOCAL_CONFIG_ADDRESS);
    
    

  • Hardware Contributor

    @tbowmo is any special action needed to clear EEPROM on Sensebender gateway ?


  • Admin

    @tomkxy @Nca78

    the ClearEEPROM sketch does use the hw abstraction layer, so it should work with the sensebender gateway. We did have some timing issues at one point in time, if I remember right. But I think we solved it.

    Which version of arduino are you using? And which version of the Arduino SAMD and MySensors SAMD board packages are you using?



  • The changed the sketch as follows:

    #define MY_CORE_ONLY
    
    #include <MySensors.h>
    
    void setup()
    {
    
    	unsigned long enter = hwMillis();
      while (hwMillis() - enter < (unsigned long)15000);
    
    	Serial.begin(MY_BAUD_RATE);
    
      Serial.print("EEPROM_LOCAL_CONFIG_ADDRESS: ");
      Serial.println(EEPROM_LOCAL_CONFIG_ADDRESS);
    	Serial.println("Started clearing. Please wait...");
    	for (int i=0; i<EEPROM_LOCAL_CONFIG_ADDRESS; i++) {
    		hwWriteConfig(i,0xFF);
    	}
    	Serial.println("Clearing done. You're ready to go!");
    }
    
    void loop()
    {
    	// Nothing to do here...
    }
    

    The output is:

    EEPROM_LOCAL_CONFIG_ADDRESS: 413
    Started clearing. Please wait...

    I use the following versions:
    My Arduino version is: 1.8.5
    MySensors Board Version: 1.0.5
    Arduino SAMD Board Version: 1.6.11 (M3), 1.6.17 (M0+)

    Interesting observation which might be hinting at a fundamental problem:
    I need to double the baud rate in the serial monitor. So in order to get any output I need to set the baud rate to 230400



  • I have the same problem:

    void setup()
    Serial.begin(MY_BAUD_RATE);
     while(!Serial);
      Serial.print("EEPROM_LOCAL_CONFIG_ADDRESS: ");
      Serial.println(EEPROM_LOCAL_CONFIG_ADDRESS);
    	Serial.println("Started clearing. Please wait...");
    	for (uint16_t i=0; i<EEPROM_LOCAL_CONFIG_ADDRESS; i++) {
        Serial.println("Clearing");
    		hwWriteConfig(i,0xFF);
    	}
    	Serial.println("Clearing done.");
    }
    

    Output:

    EEPROM_LOCAL_CONFIG_ADDRESS: 413
    Started clearing. Please wait...
    Clearing
    

    Edit:
    Changed to

    //#define MY_CORE_ONLY
    #define MY_RADIO_NRF24
    

    and added the code to before() and it works?


  • Admin

    @NiklasO @tomkxy

    Could any of you open an issue on github? Then we can track it with the project (and include it in an upcoming core group hackaton in February)



  • @tbowmo Any luck on fixing it please?


  • Admin

    @alexsh1

    I thought that we had it solved, during our last collaboration code-sprint-evening a couple of months ago. But now I see that the bug was re-opened..

    I'll see if I can have a look later this week, when I'm in the lab.. (But I am terrible at remembering stuff at the moment... 😞 )



  • @tbowmo I'll give you heads-up 🙂
    Thanks for sorting it out!



  • @tbowmo Any luck please?


  • Admin

    @alexsh1

    Sorry, didn't have access to my hardware lab, so got thrown off by other projects.

    The upcoming weekend will probably go with looking at old nasty php code, fixing issues in a 7 year old project I made for a former employer..

    / Thomas


Log in to reply
 

Suggested Topics

  • 3
  • 2
  • 3
  • 15
  • 2
  • 2

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts