Good morning,
I just discovered that it is possible to follow the tractor in real time with this tracker. https://github.com/lansalot/AgOpenGPS-Tools/tree/main/Tracker.
@andyinv did you create this code?
is there a particular setting to make in Agio? Does this work with usb or only udp mounting?
Thanks
I have made something like this also. It also uses traccar server. And i use AIO to send location status. And you can add anything you want like power status, speed anything you like.
But you need to code that in your self.
If you want i can add some pictures how it looks like
Yup, that was me - no settings required in AgIO. Reads the data off as it passes through Localhost, but that reminds me, am going to get it so it reads from Teensy instead, thus no agio dependency.
I did have a bug that locked the port if AGIO wasn’t running, let me know if it works OK for you. Currently it’s for sending to my TRACCAR server, but you could adapt the code to have it do anything you like.
Hi,
That’s interesting, how do you send the data to traccar from the AIO?
You’ll see it in the source code, but basically an HTTP request. AIO doesn’t send it - the tracker app does.
I have this error :
Waiting for data from AOG and time interval 300 to elapse
Exception non gérée : System.Net.Sockets.SocketException: Une seule utilisation de chaque adresse de socket (protocole/adresse réseau/port) est habituellement autorisée
Ă System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
Ă System.Net.Sockets.Socket.Bind(EndPoint localEP)
à System.Net.Sockets.UdpClient…ctor(IPEndPoint localEP)
Ă Tracker.Program.Main(String Args)
Do you know what is the problem ?
I use gps data and build the string and send to server.
In AIO formloop.cs
i use this:
private void TrackandTrace()
{
if (TrackTraceCounter == 40 && TrackerAan == true)
{
string Id = Properties.Settings.Default.TrackId;
string IP = Properties.Settings.Default.TrackIP;
string Port = Properties.Settings.Default.TrackPort;
string date = DateTime.Now.ToString("yyyy/MM/dd");
string Time = DateTime.Now.ToString("HH:mm:ss");
string lat = lblCurrentLat.Text.Replace(",", ".");
string lon = lblCurentLon.Text.Replace(",", ".");
var request = (HttpWebRequest)WebRequest.Create(IP + ":" + Port + "/?id=" + Id + "&lat=" + lat + "&lon=" + lon + "×tamp=" + date + "T" + Time + "Z");
var postData = "";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/json";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
//request.Abort();
TrackTraceCounter = 0;
}
else return;
}
Try starting AOG/AGIO first, that’s the bug I was referring to - doesn’t look like I pushed it to github yet, so the release is out of date. Will try to sort that later tonight.
What parameters did you install it with?
I install it with the paramters of the readme
Now, I manage to retrieve the position and the http address is successfully created but I have an error in sending, as if it could not find an internet connection.
Do you have any idea of ​​the problem?
No, because I’ve no idea where you’re sending it, nor any clear error message.
here is the error message :
http://demo.traccar.org:5055/?id=ARION1&lat=45,6751699716667&lon=0,120321633333333 Exception: Une erreur s'est produite lors de l'envoi de la demande.
Still no idea where you’re sending it… but it’s a back-end issue, to do with your TRACCAR.
There’s still a bug I have to sort out, it’s fine on my PC, but for whatever reason, if it starts before AOG on my tablet, it locks the port. Just finding the time to look at it.
Is osmand protocol. You sure you have the right string format? I see you miss T and Z in the format time string
Works on mine and I just have a standard TRACCAR installation?
HTTP to port 5505 as a) it’s a PoC for me at the moment and b) not set up HTTPS yet.
This was really written as kind of a template for people to use with whatever system they wish, coding whatever back-end they desire.