Why is the port 5050?
In fact, that's a good question, I did not see this! Thanks for pointing out, now I got somewhere to investigate further!
Ok, this is solved. It was a problem of the router. A firmware update fixed this issue. I first defined forward 5050 -> 5050, then corrected it to 5055 -> 5055, but the router made 5055 -> 5050 out of this.
Thanks a lot!
Hello Etien
Could you tell me with what to send data to the server through your raspberry
You're using openwrt or linux in general as a client?
Thanks so much
All ..
Hi allin,
I'm using Raspbian Jessie Lite on the rovers. The server is running on a debian server. Router forwards ports 5055 and 8082 (but second is not important for tracking). I am using the following script on the Raspberrys. It's simple, but it works. I need to add smart beaconing and error handling soon. Tell me when you are interested in newer versions, then I might set up a git.
NB: Remember to block all your outgoing ports on your raspberry for the mobile connection except ports 53 and 5055 if you don't have a flat rate.
#!/usr/bin/env python
###
# Simple GPS Tracker for raspberry pi
# Written by Eduard Iten, March 2017
# GPL 2.0
###
from gps3 import gps3
import dateutil.parser
import calendar
from datetime import datetime, date
import time
import urllib2
### Configuration variables
id="test" # id of the tracker
url="http://my.dynamic.dns:5055" # destination host ip or name
interval=30 # sending interval in seconds
### Configuration end
gps_socket = gps3.GPSDSocket()
data_stream = gps3.DataStream()
gps_socket.connect()
gps_socket.watch()
for new_data in gps_socket:
if new_data:
data_stream.unpack(new_data)
mode = 0
utctime = 0
lat = 0
lon = 0
speed = 0
track = 0
alt = 0
hdop = 0
last=0
if isinstance(data_stream.TPV['mode'], int):
mode = data_stream.TPV['mode']
# Only process if we got a 3D fix. For 2D fix, change to 2
if mode >= 3:
if not data_stream.TPV['time'] == 'n/a':
utctime = calendar.timegm(dateutil.parser.parse(data_stream.TPV['time']).timetuple())
if not data_stream.TPV['lat'] == 'n/a':
lat = data_stream.TPV['lat']
if not data_stream.TPV['lon'] == 'n/a':
lon = data_stream.TPV['lon']
if not data_stream.TPV['speed'] == 'n/a':
speed = data_stream.TPV['speed']
if not data_stream.TPV['track'] == 'n/a':
track = data_stream.TPV['track']
if not data_stream.TPV['alt'] == 'n/a':
track = data_stream.TPV['alt']
if not data_stream.SKY['hdop'] == 'n/a':
hdop = data_stream.SKY['hdop']
if (last + interval) < time.time():
query = "/?id={0}&lat={1}&lon={2}×tamp={3:.0f}&hdop={4}&altitude={5}&speed={6}&heading={7}".format (
id,
lat,
lon,
utctime,
hdop,
alt,
speed,
track
)
print urllib2.urlopen(url+query).read()
last = time.time()
Hi everyone,
I'm using some Raspberry Clients which work like a charm. I also use a Android Client (Galaxy S7, Android 7.0) which does not work. The server log looks as like this:
Which translates to
(stars entered for my privacy :))
Anybody knows what's going wrong here?
Regards, Edi