Gps103 command

Arturo Negreiros2 years ago

hi, I'm using the Coban and I've been trying to send a command using sockets connections; this is the payload made for the communication by sockets according the documentation, the command 112 is for disable alarms. **,imei:868166051864296,112, and sending to my server by 5001 port, I don't know if the method is right or there are another problem to make communication.

Anton Tananaev2 years ago

Why not use the web UI? Or the API?

Arturo Negreiros2 years ago

In the main repository i didn't find any api to send the commands; but i'm trying to understand the way in how the device accept the command, i don't know if is as i said or is converted on hexadecimal the payload...

Anton Tananaev2 years ago

In the main repository i didn't find any api to send the commands

You should probably read the documentation first before digging into the code.

Arturo Negreiros2 years ago

I did it, but using my own server with the coban connected to the port 5001, for example, i make a netcat connection to my server to the port 5001 and send the command encoded as hexadecimal and according the documentation it should be send disable alarm but the server only response with the "ON" word in the netcat connection... That's the reason i want to know if i'm doing the right method to send commands

Anton Tananaev2 years ago

Is your question related to Traccar or are you building your own server?

Arturo Negreiros2 years ago

I'm trying to understand the protocols communication, I know Coban using GPS103 protocol, and i'm sending commands using the specific port and i don't know or i don't realize the best way to send commands.

Anton Tananaev2 years ago

Devices are clients, not servers. You can't connect to it and send something. It doesn't listen to any ports.

It sounds like you don't understand the very basics of network communication. You should probably research it a little bit before actually trying to work with a device.

Arturo Negreiros2 years ago

i see, i going to be a research as well, thanks for the support, i think i need to understand more about the tracking devices.

Arturo Negreiros2 years ago

Hi, so you in the moment you deploy your server in traccar, you make a link with the gps coban to the ip server and the port 5001 isn't ?

Doing a further researching for the coban manual, its says, there are two ways to communicate each other, the server to the gps and the gps response to the server. So my question is in the base code, how the server send the commands to coban ?

Arturo Negreiros2 years ago

Hi, after a huge research in the coban manual, i found something interesting about the coban, so this device is connected in the port 5001 by the protocol gps103 and this one can be used with SMS commands, but actually i ain't not using SMS to send commands, only i want to know how the server can send commnads using the traccar base code:

json={"id": 0, "description": "New\\u2026", "deviceId": int, "type": "alarmDisarm",
                          "textChannel": False, "attributes": {}}

and the server send the commands to the Coban GPS, so how the server make possible the coban react by the command ???

Anton Tananaev2 years ago

Server sends the command using the same network connection the device used to report the data.

Arturo Negreiros2 years ago

this payload imei:868166051864296,112 in hexadecimal is 696d65693a3836383136363035313836343239362c313132
So then this could be the command for the disable alarm

My code in my server to test the command is

nc 127.0.0.1 5001

and send the payload or as you said in the latest replies, device are client and device are connected in the port 5001 and expect the reply isn't ?

Anton Tananaev2 years ago

Yes, devices are expecting commands using the same connection.

Arturo Negreiros2 years ago

So only encode the command in hexadecimal and testing using netcat to my server in the port 5001, and send this, the server can locate the device connected and make the command sent possible?