kristov94
Posts: 6
Joined: Thu Nov 30, 2017 11:51 am

How to use Server-Client with 3G/4G network ?

Fri Jan 11, 2019 5:31 pm

Hello,

I implemented a farming monitoring project with three raspberries ( one is server and the others are the clients with the humidity sensor ). The server and the client is connected via Wifi and the server works as DHCP server so each client which connect to server get an Ip address and they send every 30 minutes the data to the server which store them to a database.
From an app in my laptop i can connect to server via Wifi, TCP/Ip protocol ( server has a static Ip ) and i can see the data in my laptop.
Now, I would like to install this system ( server and clients ) to my farm ( far away from my home ) and connect to the server from my app. Because i will not have internet connection in my farm i saw that a good way is to put a 3g/4g dongle in the server.
I would like to ask how i can implement this way and have server-client model via 3g/4g network?

Thank you in advance.

Andyroo
Posts: 2916
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: How to use Server-Client with 3G/4G network ?

Fri Jan 11, 2019 5:50 pm

Simplest way is to buy a 3G or 4G router with an Ethernet port on it and just plug into that.

Plenty of things to think about though:

1) Cost of calls
2) Security of the Pi (both physical and system wise)
3) IP address or Dynamic DNS service
4) Delays added into to communications (latency)
5) What other programs on the Pi will wake the link up and use your data allowance?

Have you looked at LORA for data transmission? Low cost if your data needs are low and real time is not needed.
Need Pi spray - these things are breeding in my house...

kristov94
Posts: 6
Joined: Thu Nov 30, 2017 11:51 am

Re: How to use Server-Client with 3G/4G network ?

Sat Jan 12, 2019 9:51 am

Thank you for your answer.
So now i can set a static ip to the modem which is now on the farm and i can connect to the server via this ip and work with the same way, right ?
Also do you know if it is possible, instead of buy a modem 3g/4g to use my smartphone as a modem and set to this a static ip and connect there from my app?
Thank you in advance.

Andyroo
Posts: 2916
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: How to use Server-Client with 3G/4G network ?

Sat Jan 12, 2019 9:38 pm

Normally you cannot get static IPs for 3G or 4G connections.

You could look at using a dynamic DNS system - each Pi would then run a program that updates the server each time the IP address changes (normally on reconnect). For example https://www.noip.com/free is free for names along the lines of yourname.no-ip.info Lots of them out there that will turn up on a Google search for ‘free DDNS service’

As for using your phone - depends on what you have. I know the iPhones have a personal hotspot option that creates a WiFi network and then devices can connect to that to get internet access. Check your contract as some do not let you use the phone data allowance for tethering.
Need Pi spray - these things are breeding in my house...

Alex4Life
Posts: 1
Joined: Sun Jan 13, 2019 2:31 am

Re: How to use Server-Client with 3G/4G network ?

Sun Jan 13, 2019 2:41 am

Hi, first of all you need to know that 3G/4G networks are always associated with dynamic IP's. You need a service that gives you a hostname that allow ip dynamic changes, like NoIP(https://www.noip.com/). It allows automatic changes provided by the server via specific software(checks for IP address changes in the background and automatically updates the DNS).
The service is free and all you need to know is your ip address, that you can check on: https://meuip.pt/ and an account at NoIP. Be sure that you have the needed traffic limit on your internet plan. Good luck :)

Return to “Networking and servers”