These are chat archives for SmingHub/Sming

14th
Dec 2018
riban-bw
@riban-bw
Dec 14 2018 07:57 UTC
Some boards (NodeMCU, WeMos) have a reset button. I think using the software system reset does not help in this situation.
cometurrata
@cometurrata
Dec 14 2018 13:51 UTC
Hello, I think the hardwareTimer is broken in v3.7.1
#include <user_config.h>
#include "SmingCore.h"
#include "HardwareTimer.h"

#define LED_PIN 2 // GPIO2
HardwareTimer procTimer;
bool state = true;
void IRAM_ATTR blink()
{
    digitalWrite(LED_PIN, state);
    state = !state;
}

void IRAM_ATTR init()
{
    pinMode(LED_PIN, OUTPUT);
    procTimer.initializeMs(1000, blink).start();
}
Does not work and wdt reset everytime
Also it works with a previous version of sming
riban-bw
@riban-bw
Dec 14 2018 13:58 UTC
I found similar when I was testing GDB but it started to work when we fixed GDB so Hardware Timer may not be the cause.
cometurrata
@cometurrata
Dec 14 2018 14:13 UTC
What could it be related to ?
slaff
@slaff
Dec 14 2018 15:46 UTC

Hello, I think the hardwareTimer is broken in v3.7.1

Check if Basic_Blink sample is working for you.

cometurrata
@cometurrata
Dec 14 2018 16:56 UTC
This works :
#include <user_config.h>
#include "SmingCore.h"
#include "HardwareTimer.h"

#define LED_PIN 2 // GPIO2
Timer procTimer;
bool state = true;

void IRAM_ATTR blink()
{
    digitalWrite(LED_PIN, state);
    state = !state;
}

void IRAM_ATTR init()
{
    pinMode(LED_PIN, OUTPUT);
    procTimer.initializeMs(1000, blink).start();
}
only difference being HardwareTimer vs Timer
cometurrata
@cometurrata
Dec 14 2018 17:23 UTC
I'm using SDK-2.0.0 if that makes a difference
cometurrata
@cometurrata
Dec 14 2018 18:15 UTC

Also, I kept looking into the memory leak while doing repeated https requests (with this code: https://pastebin.com/pcfDyWmC ) (v3.6.0)

Heap Monitoring
You can see a drop in available heap, and a few more occur until the application crashs

riban-bw
@riban-bw
Dec 14 2018 19:25 UTC
I think removing IRAM_ATTR may also make it work.