Hi,
I am running some of the sample code examples bundled with the Device Cloud Connector. I have been impressed with the capabilities of the device cloud connector so far. However, there is one issue that I have found, in particular, with the “data_point” sample code. Here, the sample code takes a reading of the cpu usage of the device. It then puts 5 readings into a message and uploads it to Device Cloud into one of the streams. This works fine when the network is solid.
However, when the network goes down, even intermittently, the sample code balks and exits. To get it working again, I have to restart the device and run the sample code again.
Here is a print out of the log:
edp_tcp_receive_process: receive data facility = 0x00c0
Received data point response [0] for energy
Data point message sent, status[0]
edp_tcp_receive_process: receive data facility = 0x00c0
Received data point response [0] for energy
Data point message sent, status[0]
edp_tcp_receive_process: receive data facility = 0x00c0
Received data point response [0] for energy
Data point message sent, status[0]
edp_tcp_receive_process: receive data facility = 0x00c0
Received data point response [0] for energy
Data point message sent, status[0]
edp_tcp_receive_process: receive data facility = 0x00c0
Received data point response [0] for energy
Data point message sent, status[0]
Data point app: waiting for a response...
.Data point app: waiting for a response...
Data point sample is exited!
application_run thread exits 1
(note, i have replaced the variable names “cpu_usage” to “energy” for my application, the code is the same)
Would anyone know of how I could modify the code to keep attempting to re-connect until the network is up and running again?
Thanks!