
Cloud protocol
– JSON
WiFi sensors have capability to send current readings to remote server by
http(s) POST with JSON data format. JSON protocol is described at this
chapter. Python example of http server is available at About / Library section
of webpages. There are two modes of Cloud protocol - ATAL Onlinesensor
mode and ATAL Database / User server. This chapter is described User
server mode only.
Measured values are sent via HTTP POST with JSON data content.
Structure of JSON message is described in chapter
. Each
message needs to be confirmed by response described in chapter
In case the message is not confirmed from the server side, then
message is not marked as successfully sent. And when memory (cache)
feature is not deactivated, message is re-sent again at next connection.
Messages from memory (cache) are send first. Size of memory (cache) is
around 900 messages and is cleared after changing device setup. Device
uses HTTP 1.1 transfer. That means via one TCP connection can be sent
multiple POST requests (multiple JSON messages). In case of server is not
capable to properly serve this behaviour, memory (cache) feature needs to
be deactivated. Responses without chunked transfer encoding are expected
(that means messages with proper header Content-Length are expected).
Device supports HTTP and HTTPs JSON message. In case of client-side
authentication is required, this can be done via ATAL root certificate (CA file
ATAL System CA is available at the support request).
JSON structure
Structure of JSON wrapper is following:
{
<JsonType>,
<JsonVersion>,
<OrderId>,
<MsgType>,
<MsgCache>,
<Sn>,
<Desc>,
<Kind>,
<AState>,
<NConf>,
<ConfID>,
<Interval>,
<Time>,
<Rssi>,
<LocalIP>,
<Channels>
}
AState filed structure:
<AState>: { <Reg>, <Mask> }
Time field structure:
<Time>: { <Now>, <Sample>, <IsValid> }