Using smartphone to send GPRS data

149 views Asked by At

i've created a UDP server in c# that listen to specific port for UDP data, the project relie on Dataloggers to send data via GPRS, but because we do not have these dataloggers yet, and for testing purposes, is there any way or idea to make my android phone that has a SIM card send data to the server static ip adress with specific port through gprs network ? pls help

i've seen some videos of sending gprs data using gprs module like sim900 and arduinos, but i have only a smartphone right now

1

There are 1 answers

3
Anthony G. On

GPRS is simply your communication layer. You wouldn't care if a PC is connected to your hard-wired network or wifi, only that it is able to communicate with the IP and port. If your UDP server is available any client that knows its IP and port, (and isn't blocked by firewalls, or network topology) should be able to communicate with it. While doing so from Android may have benefits, a simple console app would test your server the same way.

https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.udpclient.send?view=net-6.0

UdpClient udpClient = new UdpClient();

Byte[] sendBytes = Encoding.ASCII.GetBytes("Is anybody there");
try{
    udpClient.Send(sendBytes, sendBytes.Length, "www.contoso.com", 11000);
}
catch ( Exception e ){
    Console.WriteLine(e.ToString());    
}