Hi! I was unable to compile any of the examples for an ESP8266 board (a Wemos D1 Mini, to be specific) - a memory fault appeared to be causing an infinite reset when attempting to set the contract (which I found odd since it's the same board depicted in the images accompanying the https://github.com/fredilarsen/ModuleInterface/tree/master/examples/WebPage )
After some digging through the code, I believe I have found the problem:
In ModuleVariable.cpp, variable type names are stored in a PROGMEM char array:
However, the length of this array is accessed using strlen() in the get_type() function:
uint8_t len = (uint8_t) strlen(get_mv_type_names()) / 2;
This appears to compile and run ok under AVR architecture (even though it shouldn't), but causes a memory fault on ESP8266 boards. The attached PR fixes this issue by using the strlen_P() function intead.
Hi! I was unable to compile any of the examples for an ESP8266 board (a Wemos D1 Mini, to be specific) - a memory fault appeared to be causing an infinite reset when attempting to set the contract (which I found odd since it's the same board depicted in the images accompanying the https://github.com/fredilarsen/ModuleInterface/tree/master/examples/WebPage )
After some digging through the code, I believe I have found the problem: In ModuleVariable.cpp, variable type names are stored in a PROGMEM char array:
However, the length of this array is accessed using strlen() in the get_type() function:
This appears to compile and run ok under AVR architecture (even though it shouldn't), but causes a memory fault on ESP8266 boards. The attached PR fixes this issue by using the strlen_P() function intead.