Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation or Manual #4

Open
jbarriosmuriel opened this issue Feb 19, 2020 · 7 comments
Open

Documentation or Manual #4

jbarriosmuriel opened this issue Feb 19, 2020 · 7 comments

Comments

@jbarriosmuriel
Copy link

Hi

Congratulation for your work. Could you to do a manual or documentation to implement yor develop. I purchase the ZX303 model but I'm not can implement your PETGPS work.

Thanks

@jbarriosmuriel jbarriosmuriel changed the title documentatio or Manual Ddocumentation or Manual Feb 19, 2020
@jbarriosmuriel jbarriosmuriel changed the title Ddocumentation or Manual Documentation or Manual Feb 19, 2020
@tobadia
Copy link
Owner

tobadia commented Feb 19, 2020

Hi,
This is a very basic Python program, so you'd need Python (3) to run it. Just
python gps_tcp_server.py and the server should be up and running.

You need to setup the device so that it sends packets towards the IP where you'll be running the server, this is done with an SMS command (e.g. DOMAIN#IP_OF_RUNNING_SERVER#PORT#). And obviously, set up port forward towards the machine actually running the script.

I'm not planning on doing much more documentation at the moment. While poorly organized the code should be pretty much self-explanatory. If you're unfamiliar with how to setup your device, or port forwarding etc, I can't help much there.

@jbarriosmuriel
Copy link
Author

Thanks for your response. Yes, I have knowlodge in python. It was in case I was developing a manual to wait for me.
Another question. Does the python script generate the server where the Zx303 device sends the data or it's necessary to create a server and the python script redirects them there?

On the other hand, to configure the device via SMS, I am not sure about the hexadecimal format. Could you give me an example?

Thank you for your patience and understanding

@tobadia
Copy link
Owner

tobadia commented Feb 19, 2020

The python script is actually the server (plus a bunch of functions used to communicate with the GPS device). Running the script, you'll enter an infinite loop that starts the server using the socket library.

To configure the device itself, you just send it an SMS while its running. No hex at all there.
If I want to configure it so that it send packets to mydomain.com on port 1234, I send a message with DOMAIN#mydomain.com#1234#, upon sucessful config the device sends a text to the number that sent the command with the same content. It also works with IPs. To query a specific parameter, send its name by sms (so, say I want to know what the current domain is, I'll send a text with DOMAIN).

Non-exhaustive list of commands: see this post. I personnally use:
Change device braodcast to specific ip/domain DOMAIN#MY_DOMAIN_NAME#MY_PORT#
Accept incoming call from specific phone number MONITOR#+33123456789#
Change time interval between packets to N minutes TIME#N
Get current location and device status 999

@kjbaker-uk
Copy link

Firstly, thank you for your hard work. You seem to be the master of these devices across the internet.
I am having an issue where I send it the command to change domain to my ip and port where I have your server running within a digital ocean droplet. I get an SMS back with the same command, however when I ask it for the DOMAIN again it tells me its going to www.365gps.com on port 8002 so the changes I am sending it are not taking effect?

@kjbaker-uk
Copy link

I have managed to work out how to make the domain and port take effect. It required a reboot after sending the message. I now have the issue when running your script I see it connect then disconnect. If after I send a DOMAIN message the domain and port have reverted to the factory ones??

@tobadia
Copy link
Owner

tobadia commented Apr 17, 2020

Hey there,

Apologies for the delay. I have compiled whatever data I could find fro various technical doc but in the end the protocol is still largely undocumented and there are a lot of things inaccurate in the docs. Only experimenting will help...

Re the DOMAIN command :

  1. Texting DOMAIN will have the device answer with the current domain that's set.
  2. Texting DOMAIN#a_domain_name#port# will set the domain to a_domain_name and port port. Note the domain can also be provided as an IP. The device will text back the exact same message to acknowledge it was received.

As far as I remember, the domain ultimately reverts to the original 365gps.com address after a period of timeout on the other one that was set. In my attempts, it was typically happening when I was shutting down my local server and the device wasn't able to communicate with it anymore.

Bottom line: if the domain/port revert to the factory default, it's because the device isn't able to discuss with the server. Aside from looking at the logs and experimenting, I can't be too sure...

@samex
Copy link

samex commented Mar 16, 2023

Here we can find also good informations:

https://gist.github.com/emilio-martinez/11019f04c5b05e3f7f753eaca0e58941

The main server changes by the command "DOMAIN#", and the fallback server can be changed by "SERVER# "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants