Open G2G2G2G opened 2 years ago
OK this is directly related to how you switch from scanning for wifi to being an AP, it uses too much memory on that switch. This means the ESP8266 can NOT handle the default NUM_NODES that are set, since it is taking up memory by default (static??) it's too much memory, at compile time it needs <70% or the 8266 will crash. https://github.com/gmag11/EnigmaIOT/blob/master/docs/howto.md I notice you mention NUM_NODES here but it's probably more important to have a default of like.. 10 nodes, not 35.
Also what params are used in the EnigmaIoTconfig.h and the advanced.h?
//Debug
#ifndef DEBUG_ESP_PORT
#define DEBUG_ESP_PORT Serial ///< @brief Stream to output debug info. It will normally be `Serial`
#endif // DEBUG_ESP_PORT
#ifndef DEBUG_LEVEL
// DON'T ENABLE DEBUG IF YOU CAN ONLY DO OTA UPDATE. YOU MAY BE UNABLE TO DO OTA UPDATE ANYMORE UNTIL YOU FLASH THE NODE THROUGH WIRE
#define DEBUG_LEVEL WARN ///< @brief Possible values VERBOSE, DBG, INFO, WARN, ERROR, NONE
#endif //DEBUG_LEVEL
this doesn't do anything, ERROR, NONE, even commenting it out doesn't change anything at all. It's always on what seems to be "INFO" even though the default is "WARN", and there's no way to change it. Serial should probably always be disabled when this is being used, so being able to disable it is good..
and where is "SECURE_MQTT" defined? it isn't in the settings, but it's at the top of the .ino examples usually.
thanks
default config:
static const int NUM_NODES = 10;
RAM: [======= ] 65.4% (used 53576 bytes from 81920 bytes)
Flash: [======= ] 65.8% (used 687044 bytes from 1044464 bytes)
removing things: SHOULD BE ABLE TO REMOVE SERIAL DEBUG TOO BUT DOESN'T WORK the entirety of serial should be disabled which reduces cpu usage massively on esps.
//CONFIG
#define ENABLE_STATUS_MESSAGES 0
static const int NUM_NODES = 10;
#define ENABLE_WEB_API 0
///ADVANCED CONFIG
#define ENABLE_REST_API 0
#define SUPPORT_HA_DISCOVERY 0
RAM: [====== ] 62.4% (used 51124 bytes from 81920 bytes)
Flash: [====== ] 62.9% (used 657396 bytes from 1044464 bytes)
Now you can use the above and add 20 nodes and still be safe:
//CONFIG
#define ENABLE_STATUS_MESSAGES 0
static const int NUM_NODES = 20;
#define ENABLE_WEB_API 0
///ADVANCED CONFIG
#define ENABLE_REST_API 0
#define SUPPORT_HA_DISCOVERY 0
RAM: [======= ] 67.3% (used 55124 bytes from 81920 bytes)
Flash: [====== ] 62.9% (used 657412 bytes from 1044464 bytes)
edit: well I've solved the issue you can see on the second post, this is a deterrent to newcomers to enigmaIOT because the tutorial assumes esp8266's work and I assume you didn't test them. Due to the methods of switching scan mode to AP mode it uses +30% ram so you need <70% of max ram at compile time, anymore and it is bound to crash quickly. NUM_NODES = 35 is guaranteed to crash esp8266.
on all esp8266 (have 6 different ones), don't have esp32 to test