How can I send a GPRS command to traccar server manually, meaning using a PC software tool.

José Fernandez10 months ago

Hello, I am about to order a Coban GPS306B device, I know they use the GPRS protocol. While I am waiting for the device, I was wondering if someone in this forum could help me to simulate or emulate the device by sending certain desired gps tracker commands to traccar server manually.
for example I saw this command in the GPRS protocol manual:


I have a tool such as "packet sender" but I don't know what to insert as value in order for it to communicate with traccar server over 5001 port.
thanks in advance

Anton Tananaev10 months ago

There are some scripts in the tools folder in the repository.

José Fernandez10 months ago

I found something that could be useful. Thank you so much Anton. Your help is always appreciated. I've read so far plenty of issues threads in this forum and you always respond to help, thanks again.

David10 months ago

Hi José, could you share it because it can be useful to me? Thank you

David10 months ago

Hi Jose, I find it interesting what you were asking .. could you please share it

José Fernandez9 months ago

David here is the script I found, the way is helping me is by making me realize that it is a socket programming script which sends a similar command I want to try to the port 5001. honestly i thought the network packet that had to be sent was more complicated since it wasn't an http request like anything else, that's why i asked the question.However thanks to Anton i figured that is just a socket program which sends udp packets following this example below


import socket
import binascii

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 5001))

while True:
    print s.recv(1024)

David9 months ago

Thanks Jose. But I don't understand the programming :-(

José Fernandez9 months ago

Well first of all the language is Python probably you already noticed that. I don't know Python however i can tell from the code that is the line s = socket.socket(socket.AF_INET, socket.SOCK_STREAM is just to create a socket, then s.connect(("localhost", 5001)) is to stablish the connection with the traccar server through the port '5001'. the other line s.send("imei:1234567.....) is the string command being sent to the server simulating the tracker that uses the GPRS protocol. so the string sent to the server imei:1234567....E,0.00,0; is actually a sample of what a tracker may send to traccar server which can include the latitude and longitude info. you would have to read the GPRS protocol to determine what strings you can be using to send to the server using the script i have shown you above.

David9 months ago

thanks José for explaining me line by line

David9 months ago

how to read the GPRS protocols of a device