Chat freely about anything...

User avatar
By alonewolfx2
#9062 Here is working timer example.

Code: Select all#include "osapi.h"
#include "at_custom.h"
#include "user_interface.h"
#include "espconn.h"
#include "mem.h"

static ETSTimer sleepTimer;

static void ICACHE_FLASH_ATTR sleepTimerCb(void *arg)
{
   os_timer_disarm(&sleepTimer);
   //os_timer_disarm(&sleepTimer);
   system_deep_sleep(60*1000*1000);
}

void user_init(void)
{
   
   os_timer_disarm(&sleepTimer);
      os_timer_setfn(&sleepTimer, sleepTimerCb, NULL);
      os_timer_arm(&sleepTimer, 15000, 1);
}
User avatar
By EadF
#9079 Yeah, that's exactly what the blinky already demo does.

I'm trying to figure out why it does not work on my system when i build it with sdk 0.9.5.
Specially when it works flawlessly on 0.9.4.

I could be something in that old Makefile (is it from 0.9.3?), so it would be useful if someone could test that exact setup.
User avatar
By alonewolfx2
#9097 I compiled your ping example with 0.9.5 SDK Under windows eclipse ide. (with some makefile modification) its compiling successfully. But its crashing with fatal error 28. I comment out timer part but some result.

EadF wrote:Yeah, that's exactly what the blinky already demo does.

I'm trying to figure out why it does not work on my system when i build it with sdk 0.9.5.
Specially when it works flawlessly on 0.9.4.

I could be something in that old Makefile (is it from 0.9.3?), so it would be useful if someone could test that exact setup.
User avatar
By EadF
#9122 I've found one important (for me at least) api change in 0.9.5:

user_interface.h:
Code: Select all#define NULL_MODE       0x00
#define STATION_MODE    0x01
#define SOFTAP_MODE     0x02
#define STATIONAP_MODE  0x03

In 0.9.4 the call "wifi_set_opmode(NULL_MODE);" had the practical effect of turning off the WiFi
In 0.9.5 it means "let's crashs the whole system after a second or so" :cry:

Since this seems to be a persistent setting, it carried over from my "console only" test program to the blinky example i had problem with above. (blinky does not set wifi opmode)