How to keep the connection to the Hologram Cloud


#1

Hi. I use a LTE BG96 Cat.M1/NB1 & EGPRS Module for send a data-messege to Dashboard Hologram. Send is as follows: first I “open” the socket, then I send a messege and after that, as I understood, the socket is closes automatically. The problem is: how can I send two or more data-messeges to cloud for one socket opening? Maybe I need to send a PING? Please, tell me.


#2

The connection is closed by holograms servers on the remote end, I don’t think they allow persistent connections. Note the TCP connection is closed, not necessarily the “socket” which is on the modem only. I am not familiar with the BG96 but there is no reason you shouldn’t be able to re-use the socket, it should be able to re-use the socket to create a new TCP connection for your next message (unless the modem automatically closes and discards the socket after TCP is closed, which would seem strange to me).

I use the U-Blox equivalent of the BG96 and create one socket on boot which is usually assigned a number 0-5 and re-use the same socket for every message I send.


#3

Thanks for reply. There is no trouble in creating a new TCP connection (Open CloudSocket) everytime for send new messege, but this action takes everytime extra 1-1.5 kByte of resource.
Support of Hologram answered me, that “Cloud Sockets close after 10 seconds of inactivity and currently there is no way to keep the connection alive.”. Then, the only way to keep a connection with Hologram cloud is send messege every 1-10 seconds. What do you think about this?


#4

Well, now the support of Hologram answered for my question (“It is possible to send multiple messages for one opening?”), and they said, that “Right now it would only support a single message per connection.”. So, to send a new message, I need to open socket every time.


#5

Yea, i think in most cases it should be ~500 bytes, but you will have that amount of overhead for each TCP connection. Checkout my response to a post here for more info: Does Hologram Charge any Data Session Fee?