I have two Reach modules which, with the help of the guide, I set up to work as base and rover. The output from the rover is read by a small Python script on a PC. It works great when all the components are on the same WLAN, but now I am trying to have the modules connect to a mobile wifi router (Huawei E5330) outside and read the output on the office PC and have had little succes.
I set up the position output on the rover to broadcast on the 9001 port and the port forwarding on the router to send all requests for that port to the rover’s IP. The Python script is now set up to connect to the router’s public IP on port 9001. I read the public IP using checkip.dyndns.org (on a phone connected to the mobile wifi, not on the office PC ). When I run the script it gives a timeout error.
Have you tried something similar and could explain how you went about it, or do you have any other suggestions on how to get the data from Reach into Python using mobile internet?
Thanks a lot!
Here is the (very basic) Python script:
import pyproj import socket import time RD = pyproj.Proj("+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.237,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812 +units=m +no_defs") WGS = pyproj.Proj(proj='latlong',datum='WGS84') while True: s = socket.socket() s.connect(('100.74.216.120', 9001)) data = s.recv(1024).decode("utf-8").split() s.close() x, y, z = pyproj.transform(WGS, RD, data, data, data) print() print(data, data) print(data, data, data ) print(x, y, z) time.sleep(5.0)