Connect to a device behind a firewall with low data traffic

I am developing a connected device with a raspberry pi over a 3G connection. My 3G suggestion gives me 50MB max data usage as the limit. I want to be able to exchange a very small amount of data with the Raspberry Pi from the internet (e.g. ~ 5kb per day), but I want to be able to communicate with it 24/7.

Of course, with a 3G connection, I don't have a public IP address, and I can't use NAT to access my raspberry directly. Question: How can I communicate with Rapsberry Pi without using more than 50MB / month?

I tried to connect to OpenVPN but it takes 200MB per month to keep in touch with it. I also tried socket.io with node.js to keep the connection between my Raspberry Pi and my server, but again it needs ~ 200MB per month.

Any idea for sending any kind of notifications with small payloads instantly, without having an expensive data connection?

+3


source to share


2 answers


All a lot of research and testing and thanks to Morne's answer, I found 2 solutions for my need:



  • XMPP: The protocol used for instant messaging. Maintain live connections ~ 30MB / month
  • MQTT: protoco l is used for M2M compromises and is used by Facebook Messenger. After some tests, it only uses 12MB / month for keepalive. It is specially designed for low bandwidth communications. I will use this. There are several python and node.js packages.
0


source


One way to do something like this is to use XMPP. I created a Google account for my Pi and then wrote a small python application that will log into Gtalk (XMPP) using that account and process the messages received. Of course, using this method has some overhead as the Pi will "ping" the Google server from time to time, but probably not up to 50MB (but then it might be, I've never tested).



+1


source







All Articles