Page 1 of 1

OsmAnd HTTPS Support

Posted: Wed Dec 28, 2022 4:47 am
by johnstonjs
Thanks for making this excellent device and all the source code available. I'm planning to use my recently purchased One+ to keep track of a vehicle I keep halfway across the country for family adventures. Since getting the device a couple of weeks ago, I've been able to compile the code using PlatformIO (though not without difficulties) and successfully send data via UDP to a private Traccar instance.

In the README for v5 telelogger it lists support for HTTP(s) and the OsmAnd protocol. I would love to know that the data being transmitted by the One+ is encrypted using HTTPS and to close the UDP ports on my Traccar instance. Unfortunately, I'm unable to get it to work on the One+. Here's the situation:

My Traccar instance sits behind nginx reverse proxy, and everything sent to is redirected to Traccar's OsmAnd port - 5055. I'm able to test that it works with the Traccar Client sending to the redirected url (so it HTTPS connects to port 443, then is redirected to 5055 on Traccar). Here's an example from the nginx logs:

Code: Select all

IP.ADD.RESS - - [26/Dec/2022:12:46:53 -0500] "POST /osmand?id=DEVICE_ID&timestamp=1672076808&lat=LAT.PRECISE&lon=LON.PRECISE&speed=0&bearing=0&altitude=ALT.PRECISE&accuracy=35&batt=92 HTTP/1.1" 200 0 "-" "TraccarClient/57 CFNetwork/1402.0.8 Darwin/22.2.0"
Reconfiguring config.h for HTTPS does not seem to send the correct messages for OsmAnd. The only message format that looks correct in teleclient.cpp is the GET method, which I think is not correct to use). Configuring for HTTPS, PROTOCOL_METHOD_GET, and with SERVER_PATH set to "/osmand" results in:

Code: Select all

IP.ADD.RESS - - [26/Dec/2022:12:48:06 -0500] "GET /osmand/notify/DEVICE_ID?EV=1&SSI=0&VIN= HTTP/1.1" 403 162 "-" "-"
Configuring for PROTOCOL_METHOD_POST results in a 403 Forbidden issue when reviewing the serial console from the One+, with no log whatsoever from nginx. The attempted path from the serial console appears similarly incorrect for OsmAnd.

Code: Select all

[CELL] /osmand/post/DEVICE_ID
[HTTP] http/1.1 403 forbidden
server: nginx/1.18.0 (ubuntu)
I could certainly change the reverse proxy redirect path, but even that format of *post/DEVICE_ID* doesn't look like OsmAnd formatting. Is there another option in the existing code that I'm not seeing? Thanks in advance for the help.

A couple of other observations:

I've been entirely unable to compile the code using ESP-IDF. Following all the install directions consistently results in *fatal error: esp32/spiram.h: No such file or directory*

For PlatformIO, I had to update both the platform and platform_packages in platform.ini

Code: Select all

platform = espressif32
platform_packages = platformio/framework-arduinoespressif32