2019-02-21 02:39 AM
I'm using the SPWF04SA module to write sensor data to Azure Storage Table service by sending https POST request over a socket connection. The application works fine for some hundred requests over several hours but occasionally a WIND: NtpServerDelivery message just occurs when I have opened the socket for writing which makes my program hang (yet unknown reason).
To circumvent this problem I wanted to control the SPWF04SA ntp client so that the WIND: NtpServerDelivery messages occur at a time where I'm just not opening a socket.
I can switch off the NtpServerDelivery with AT+S.SCFG (ip_ntp_startup = 0) command but I'couldn't manage to change the refresh interval with AT+S.SCFG (ip_ntp_refresh = xxxx). Whatever value I write to the 'ip_ntp_refresh' variable (success controlled by reading it back), the WIND: 'NtpServerDelivery' events comes in every 60 minutes.
Is there something I could be doing wrong?
Is there a way to control the timing of the WIND: NtpServerDelivery messages?
Solved! Go to Solution.
2019-02-26 05:01 AM
Hello,
Is the masking of WINDs suitable for your application?
I cross checked the ntp refresh config, actually in release 171117-0328fe3 the ip_ntp_refresh value is not taken into account.
Regards,
Elio
2019-02-22 01:16 AM
Dear,
the WIND:84 message is printed to inform the user that the NTP client has just updated the RTC.
You can selectively disable the WIND printing by means of console_wind_off_* variables. In order to disable WIND:84 you should set bit 20 in console_wind_off_high.
About ip_ntp_refresh, it can be changed runtime (i.e. there is no need to save config or reboot the SPWF04), the timeout is computed since last NTP refresh.
As an example:
AT+S.SCFG=ip_ntp_refresh,30
AT-S.OK
+WIND:84:NTP Server delivery:2019.2.22:5:9.5.52
+WIND:84:NTP Server delivery:2019.2.22:5:9.6.22
AT+S.SCFG=console_wind_off_high,0x100000
AT-S.OK
AT+S.SCFG=console_wind_off_high,0
AT-S.OK
+WIND:84:NTP Server delivery:2019.2.22:5:9.7.50
+WIND:84:NTP Server delivery:2019.2.22:5:9.8.20
Regards,
Elio
2019-02-22 08:05 AM
Thanks for your answer,
it is strange, I tried again to change 'ip_ntp_refresh' time. I can set the variable. When I read back the changed variable with 'AT+S.GCFG=ip_ntp_refresh' I get: 'AT-S.Var:ip_ntp_refresh=30'. So I think that I can conclude that the content is effectively changed. Nevertheless I do not get '+WIND:84:NTP Server delivery:.... ' every 30 sec.
2019-02-22 08:11 AM
Hello,
could you post you Configuration (AT+S.GCFG) and Status (AT+S.STS)?
2019-02-22 08:41 AM
AT+S.SCFG=ip_ntp_refresh,30
AT-S.OK
AT+S.GCFG
AT-S.List
AT-S.Var:nv_manuf=ST
AT-S.Var:nv_model=SPWF04SA
AT-S.Var:nv_serial=3817Z31881
AT-S.Var:nv_wifi_macaddr=00:80:E1:C3:C5:0E
AT-S.Var:standby_time=10
AT-S.Var:standby_enabled=0
AT-S.Var:sleep_enabled=0
AT-S.Var:etf_mode=0
AT-S.Var:blink_led=1
AT-S.Var:ext_volume=1
AT-S.Var:ramdisk_memsize=16
AT-S.Var:aes128_key=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
AT-S.Var:user_desc=anonymous
AT-S.Var:python_script=3:/uPython_test.py
AT-S.Var:python_memsize=32
AT-S.Var:console_enabled=1
AT-S.Var:console_speed=921600
AT-S.Var:console_hwfc=0
AT-S.Var:console_echo=1
AT-S.Var:console_errs=2
AT-S.Var:console_winds=2
AT-S.Var:console_verbose=1
AT-S.Var:console_repeater=0x21
AT-S.Var:console_delimiter=0x2C
AT-S.Var:console_wind_off_low=0x00000000
AT-S.Var:console_wind_off_medium=0x00000000
AT-S.Var:console_wind_off_high=0x00000000
AT-S.Var:wifi_tx_msdu_lifetime=0
AT-S.Var:wifi_rx_msdu_lifetime=0
AT-S.Var:wifi_operational_mode=0x00000011
AT-S.Var:wifi_beacon_wakeup=1
AT-S.Var:wifi_beacon_interval=100
AT-S.Var:wifi_listen_interval=0
AT-S.Var:wifi_rts_threshold=3000
AT-S.Var:wifi_ssid=46:72:69:42:6F:32:34:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
AT-S.Var:wifi_ssid_len=7
AT-S.Var:wifi_txfail_thresh=5
AT-S.Var:wifi_dtim_period=1
AT-S.Var:wifi_add_tim_ie=0
AT-S.Var:wifi_region=1
AT-S.Var:wifi_ht_mode=1
AT-S.Var:wifi_channelnum=11
AT-S.Var:wifi_opr_rate_mask=0x003FFFCF
AT-S.Var:wifi_bas_rate_mask=0x0000000F
AT-S.Var:wifi_mode=1
AT-S.Var:wifi_auth_type=0
AT-S.Var:wifi_atim_window=0
AT-S.Var:wifi_powersave=0
AT-S.Var:wifi_tx_power=18
AT-S.Var:wifi_rssi_thresh=0
AT-S.Var:wifi_rssi_hyst=0
AT-S.Var:wifi_ap_idle_timeout=120
AT-S.Var:wifi_beacon_loss_thresh=10
AT-S.Var:wifi_priv_mode=2
AT-S.Var:wifi_wep_keys[0]=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
AT-S.Var:wifi_wep_keys[1]=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
AT-S.Var:wifi_wep_keys[2]=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
AT-S.Var:wifi_wep_keys[3]=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
AT-S.Var:wifi_wep_key_lens=00:00:00:00
AT-S.Var:wifi_wep_default_key=0
AT-S.Var:wifi_wpa_psk_raw=47:3E:7A:AD:68:20:52:1A:1E:22:E5:36:E3:B4:3F:AE:B0:E2:2D:E2:5D:AA:41:73:D0:33:C1:63:43:7B:39:D2
AT-S.Var:wifi_wpa_psk_text=Moxxxxxxxxx03
AT-S.Var:wifi_eap_identity=identity
AT-S.Var:wifi_eap_anon_identity=anonymous@identity.org
AT-S.Var:wifi_eap_passwd=password
AT-S.Var:wifi_eap_type=0
AT-S.Var:wifi_eap_skip_datechecks=0
AT-S.Var:wifi_wps_walk_time=120
AT-S.Var:wifi_wps_pin=1234567
AT-S.Var:ip_sock_memsize=1
AT-S.Var:ip_sock_threshold=0
AT-S.Var:ip_dhcp_lease_time=120
AT-S.Var:ip_macfilter=00:00:00:00:00:00
AT-S.Var:ip_num_clients=5
AT-S.Var:ip_allow_port_scans=1
AT-S.Var:ip_use_v6=1
AT-S.Var:ip_use_dhcpd=1
AT-S.Var:ip_use_httpd=1
AT-S.Var:ip_use_tftpd=1
AT-S.Var:ip_use_dhcpc=2
AT-S.Var:ip_hostname=iwm-C3-C5-0E
AT-S.Var:ip_apdomainname=captiveportal.net
AT-S.Var:ip_apredirect=firstset.html
AT-S.Var:ip_ipaddr=192.168.0.50
AT-S.Var:ip_netmask=255.255.255.0
AT-S.Var:ip_gw=192.168.0.1
AT-S.Var:ip_dns1=208.67.222.222
AT-S.Var:ip_dns2=208.67.220.220
AT-S.Var:ip_local=0:0:0:0:0:0:0:0
AT-S.Var:ip_dns1v6=0:0:0:0:0:0:0:0
AT-S.Var:ip_dns2v6=0:0:0:0:0:0:0:0
AT-S.Var:ip_dhcp_timeout=20
AT-S.Var:ip_ntp_server1=ptbtime1.ptb.de
AT-S.Var:ip_ntp_server2=ntp0.ipv6.fau.de
AT-S.Var:ip_ntp_refresh=30
AT-S.Var:ip_ntp_startup=1
AT-S.Var:ip_mdns_domain_name=SPWF04S-Default
AT-S.Var:ip_mdns_device_name_ttl=120
AT-S.Var:ip_mdns_services_name=SPWF04S-WebSrv SPWF04S-TFTPSrv
AT-S.Var:ip_mdns_services_prot=_http._tcp _tftp._udp
AT-S.Var:ip_mdns_services_keys=dev1 dev2
AT-S.Var:ip_mdns_services_vals=number1 number2
AT-S.Var:ip_mdns_services_port=80 69
AT-S.Var:ip_mdns_services_ttl=120 60
AT-S.Var:ip_mdns_startup=01:01
AT-S.OK
AT+S.STS
AT-S.List
AT-S.Var:build=171117-0328fe3-SPWF04S
AT-S.Var:fw_version=1.1.0
AT-S.Var:boot_version=1.0
AT-S.Var:var_version=2
AT-S.Var:free_heap=45064
AT-S.Var:min_heap=42224
AT-S.Var:system_time=1550853473
AT-S.Var:system_uptime=437
AT-S.Var:system_sleeptime=0
AT-S.Var:reset_reason=2
AT-S.Var:startup=0
AT-S.Var:random_number=3141079114
AT-S.Var:gpio_enable=0x0000
AT-S.Var:app_fs=1
AT-S.Var:ram_fs=1
AT-S.Var:user_fs=0
AT-S.Var:extvol_fs=1
AT-S.Var:nv_power_cycles=6
AT-S.Var:nv_wdog_resets=0
AT-S.Var:nv_reset_cycles=15
AT-S.Var:wifi_state=10
AT-S.Var:wifi_own_macaddr=00:80:E1:C3:C5:0E
AT-S.Var:wifi_bssid=C8:0E:14:9F:C9:60
AT-S.Var:wifi_aid=2
AT-S.Var:wifi_channelnum=11
AT-S.Var:wifi_sup_rate_mask=0x003FFFCF
AT-S.Var:wifi_bas_rate_mask=0x0000054F
AT-S.Var:wifi_chan_activity=0x00001FFF
AT-S.Var:wifi_max_tx_power=18
AT-S.Var:wifi_gf_mode=0
AT-S.Var:wifi_reg_country=DE
AT-S.Var:wifi_dtim_period=1
AT-S.Var:wifi_num_assoc=0
AT-S.Var:ip_from_AutoIP=0
AT-S.Var:ip_ipaddr=192.168.1.70
AT-S.Var:ip_netmask=255.255.255.0
AT-S.Var:ip_gw=192.168.1.1
AT-S.Var:ip_dns1=192.168.1.1
AT-S.Var:ip_dns2=0.0.0.0
AT-S.Var:ip_linklocal=fe80:0:0:0:280:e1ff:fec3:c50e
AT-S.Var:ip_local=2a02:908:1a65:75a0:280:e1ff:fec3:c50e
AT-S.Var:ip_dns1v6=0:0:0:0:0:0:0:0
AT-S.Var:ip_dns2v6=0:0:0:0:0:0:0:0
AT-S.OK
2019-02-26 05:01 AM
Hello,
Is the masking of WINDs suitable for your application?
I cross checked the ntp refresh config, actually in release 171117-0328fe3 the ip_ntp_refresh value is not taken into account.
Regards,
Elio
2019-02-26 09:19 AM
Thanks Elio
I will try when I am back home next week.
Regards
Roland
2019-03-04 05:17 AM
Hello,
masking the WIND for NtpServerDelivery solved the problem.
Thanks for your guidance.
Regards
Roland