Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Me No Dev
@me-no-dev
uses no power when asleep
startup has some options though
so there things varry a bit
Markus
@Links2004
deep sleep need around 10uA
Me No Dev
@me-no-dev
I saw some new functions in 1.4 (have not checked what we run currently) that you can use to stop the WiFi and use verry little power while mentaining operation
Markus
@Links2004
SDK is at 1.3
1.4 make problems hope 1.5 will do better
Me No Dev
@me-no-dev
yeah, I heard
slow loop as well
yeah, wififpm* functions are not in 1.3
#define FPM_SLEEP_MAX_TIME 0xFFFFFFF
wifi_station_disconnect();
wifi_set_opmode(NULL_MODE); // set WiFi mode to null mode
wifi_fpm_set_sleep_type(MODEM_SLEEP_T);
wifi_fpm_open();
wifi_fpm_do_sleep(FPM_SLEEP_MAX_TIME);
......
// wake up to use WiFi again 
wifi_fpm_do_wakeup(); 
wifi_fpm_close(); 
wifi_set_opmode(STATION_MODE); 
wifi_station_connect();
brutzler
@brutzler
just one additional question to the time.ino:
there are two parts of the code. one in setup an one in loop.
Is the time in both parts picked from the ntp.server, or is it only read out from the internal clock?
Markus
@Links2004
the ntp server is called periodically (in background) to keep the internal clock correct,
all time functions use the internal clock.
brutzler
@brutzler
OK, set timezone to "1" for me to work (germany). But I am not sure, that daylight will be automatically?
Markus
@Links2004
I use configTime(1 * 3600, 0, "192.168.1.12", "192.168.0.1"); and it working fin. also Germany :)
brutzler
@brutzler
Using interal NTP?
Markus
@Links2004
yup, they are in sync with the PTB atomic clock.
brutzler
@brutzler
Router? or what device?
Markus
@Links2004
one router with openwrt + RTC one linux server
server is master
brutzler
@brutzler
will have a look, if my router makes ntp...
Markus
@Links2004
a fritzbox have it integrate for example
brutzler
@brutzler
Guess, what I have? ;-)
Markus
@Links2004
yup fritzbox is common in germany
brutzler
@brutzler
Just wanted to see this periodically update. Started wireshark, but I do not see any matching telegrams?
There is only one telegram on startup of the ESP:
10579    23:22:46.609658000    192.168.1.29    224.0.0.1    IGMPv2            60    Membership Report group 224.0.0.1
Markus
@Links2004
periodically not meany minutes the internal clock is good.
brutzler
@brutzler
Yes, but shouldn't be there a ntp-request on booting the chip?
Markus
@Links2004
yes if configTime is called ther shut be one
if you add Serial.setDebugOutput(true); you will see the sync info
brutzler
@brutzler

hmmmmm.... Code is working, I see the actual time in the console, but no telegram...
capturing filter is:

ip.src == 192.168.1.29|| ip.dst ==192.168.1.29

debug is on. what sync info do you expect?

I get this:
Connecting to WiFi
...scandone
state: 0 -> 2 (b0)
.state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
pm open phy_2,type:2 0 0
cnt 

connected with WLAN_xyz, channel 4
dhcp client start...
.ip:192.168.1.29,mask:255.255.255.0,gw:192.168.1.1

Waiting for time
please start sntp first !
.Fri Nov 27 23:29:28 2015
Markus
@Links2004
looks like working :)
i get the date + time one time Fri Nov 27 23:31:22 2015
brutzler
@brutzler
please start sntp first! Sounds not good
Markus
@Links2004
i dont get this, i only have configTime in my code.
brutzler
@brutzler
Only made changes regarding to my WiFi
Markus
@Links2004
make sens based on the code.
in the first time call to check the time the time is not synced
brutzler
@brutzler
???
Markus
@Links2004
  while (!time(nullptr)) {
    Serial.print(".");
    delay(1000);
  }
the time call triggers the messages please start sntp first !
so basically the check if the sync is done is triggering the msg
brutzler
@brutzler
OK, you think the stuff is working, but why do i get no telegram on wireshark?
Markus
@Links2004
ther musst be one. will sniff my self.
brutzler
@brutzler
arrrggg.....forget it. how to sniff WLAN?
Markus
@Links2004
wireshark + (lowlevel driver or linux) , or use tcpdump at the router.
wireshark can decode wlan when you know the key.
Mario Mikočević
@mozgy
I have RasPi on wlan for that :)
Markus
@Links2004
openwrt on the router make it easy too, call tcpdump and you are done.
brutzler
@brutzler
haha ... openwrt. Only a Fritz with AVM-OS
Markus
@Links2004
yes hidden webinterface :)
brutzler
@brutzler
more input pls