XDK and NTP Time Server
응답
18. 4. 9 오전 9:06

Hello, actually i am developing an XDK application which is posting data into the
elasticsearch database (and visualisation kibana).
Therefore i have to implement a NTP Server Request - cause i need a timestamp.

Here in the community i have found many entries - but no real code snipet or a working solution.
So i made some research.
In this project you will find a good start to build your own working solution.

https://github.com/ubirch/ubirch-xdk-firmware


Here my start-up sequence - showing all works fine ....

 INFO | XDK DEVICE 1: Bosch XDK SmartSensor from BCDS
 INFO | XDK DEVICE 1:   
 INFO | XDK DEVICE 1: ElasticSearch Kibana Application V1.01
 INFO | XDK DEVICE 1: KeHo Software - Achim Kern - 09.04.2018
 INFO | XDK DEVICE 1:   
 INFO | XDK DEVICE 1: File system mount done
 INFO | XDK DEVICE 1: f_open done
 INFO | XDK DEVICE 1: f_lseek done
 INFO | XDK DEVICE 1: f_read done, bytes Read = 111
 INFO | XDK DEVICE 1: SD-Card config.txt:
 INFO | XDK DEVICE 1: [            SSID] = [KeHoSoftware]
 INFO | XDK DEVICE 1: [        PASSWORD] = [???]
 INFO | XDK DEVICE 1: [        SERVERIP] = [192.168.178.99]
 INFO | XDK DEVICE 1: [      SERVERPORT] = [9200]
 INFO | XDK DEVICE 1: [          XDKMAC] = [F4B85E3B4642]
 INFO | XDK DEVICE 1:   
 INFO | XDK DEVICE 1: [x] Bosch XDK - all avaibale inbuild sensors initialized
 INFO | XDK DEVICE 1: [x] Bosch XDK - buttons,leds and the expansionboard initialized
 INFO | XDK DEVICE 1: [x] Bosch XDK - initializing WLAN
 INFO | XDK DEVICE 1: [x] Bosch XDK - setting IP to DHCP
 INFO | XDK DEVICE 1: [x] Bosch XDK - connecting to KeHoSoftware
 INFO | XDK DEVICE 1: [x] Bosch XDK - getting IP settings
 INFO | XDK DEVICE 1: [x] Bosch XDK - convert the IP address to string format
 INFO | XDK DEVICE 1: [x] Bosch XDK - connected to WPA network successfully.
 INFO | XDK DEVICE 1: [x] Bosch XDK - IP address of your XDK device:F4B85E3B4642 - 192.168.178.101
 INFO | XDK DEVICE 1:   
 INFO | XDK DEVICE 1:  Ip address of the server 192.168.178.99
 INFO | XDK DEVICE 1:    
 INFO | XDK DEVICE 1: [x] Bosch XDK - initialized RestClient
 INFO | XDK DEVICE 1: [x] Bosch XDK - SNTP Server initialized
 INFO | XDK DEVICE 1: [x] Bosch XDK - XUDP Initialized
 INFO | XDK DEVICE 1: [x] Bosch XDK - XUDP Started
 INFO | XDK DEVICE 1:   
 INFO | XDK DEVICE 1:  Ip address of the server 188.68.36.203
 INFO | XDK DEVICE 1: 
 INFO | XDK DEVICE 1: [x] Bosch XDK - IP resolved
 INFO | XDK DEVICE 1: [x] Bosch XDK - NTP request Sending Complete
 INFO | XDK DEVICE 1: [x] Bosch XDK - UDP packet sent...
 INFO | XDK DEVICE 1: [x] Bosch XDK - Received data
 INFO | XDK DEVICE 1: [x] Bosch XDK - Received data satus OK
 INFO | XDK DEVICE 1: [x] Bosch XDK - NTP got UTC secSince1970: 1523263996
 INFO | XDK DEVICE 1: [>] Bosch XDK - GetUtcTime = 1523264001
 INFO | XDK DEVICE 1: [x] Bosch XDK - intialization complete!
 INFO | XDK DEVICE 1:   
 INFO | XDK DEVICE 1: [x] Bosch XDK - running the application ...


 

+1 (1 투표)
RE: XDK and NTP Time Server
응답
18. 4. 9 오후 3:18 as a reply to Achim Kern.
Hello Achim,

I see that you used the SNTP implmementation from the BoschXdkCloudConnectivity.

Since timestamps are often required for applications on the XDK, an example that focusses on SNTP may be a useful addition the XDK-Workbench Welcome Screen.

Thus, I will forward feedback in that regard.

Kind regards,
Alex
+1 (1 투표)
RE: XDK and NTP Time Server
응답
18. 4. 10 오전 6:23 as a reply to Alexander Sawtschuk.

Perfect.
I think we should see here more and more usefull code snipets.
 

0 (0 투표)