New “Data Emulator” function

Massimo7 months ago

I can’t found anything about this new function.
Someone can explain about it?

Anton Tananaev7 months ago

You can access it via Settings > Preferences > Info > Emulator.

It basically allows you to emulate a device by clicking on a map. Useful for testing and demos. It uses OsmAnd protocol.

Massimo7 months ago

Thank you Anton.

Claudio7 months ago

Hi, cool feature.
I see that the emulator uses window.location to make the call. Do you think it would be possible to make the endpoint configurable? Our backend exposes the device protocol ports under a different domain than the one used by the webapp.

Anton Tananaev7 months ago

Feel free to submit a feature request.

Santiago6 months ago

Hello everyone, could you tell me if the problem persists when using the emulator on a site with an SSL certificate?
I get "Failed to fetch", I even did a test from the demo server and the problem occurs there too
https://demo.traccar.org/emulator
Request URL:
http://demo.traccar.org:5055/?id=proofx1&lat=-22.86432148341639&lon=66.98456792178175
Reference Policy:
strict-origin-when-cross-origin

Anton Tananaev6 months ago

It should be fixed in the next release.

Santiago6 months ago

For what it's worth, I compiled the project as it is now and tested it on my own server and the problem persists.

Anton Tananaev6 months ago

Which project have you compiled? Backend of the web app?

Santiago6 months ago

web app only.

Anton Tananaev6 months ago

What error do you see in the console?

Santiago6 months ago

in the web console - Network
Headers
Request URL:
https://fakeurl.com/
Request Method:
POST
Status Code:
400 Bad Request
Remote Address:
xxx.xxx.xxx.xxx:443
Referrer Policy:
strict-origin-when-cross-origin

Payload
id: 9172716350
lat: -31.592137255187467
lon: -64.46671012829997

in the backend console

2024-06-26 21:57:39  INFO: [T3893fa16: osmand < 127.0.0.1] 504f5354202f20485454502f312e310d0a4f726967696e3a2068747470733a2f2f737276312e7261737472656f2e636f6d2e61720d0a436f6f6b69653a20757365723d6157356d6230427959584e30636d56764c6d4e766253356863672533442533443b2070617373776f72643d593239754d7a4e6a62476c6a3b20706d61557365722d313d253742253232697625323225334125323234773239745a62726a7a253543253246474f6155793262394937672533442533442532322532432532326d6163253232253341253232653635663361386162386231363637323732643636643034323230373030343664376533326266322532322532432532327061796c6f61642532322533412532324952554965253543253246356a5279436c427951676c6f373048412533442533442532322537443b205f67613d4741312e332e323133313334303132382e313731373432373131333b205f67615f595338574358313552333d4753312e312e313731383933353737352e392e302e313731383933353737352e302e302e303b204a53455353494f4e49443d6e6f646530317072666c75753869776c626d3978327039623736683378733831322e6e6f6465300d0a4163636570743a202a2f2a0d0a557365722d4167656e743a204d6f7a696c6c612f352e3020284c696e75783b20416e64726f69642031333b20534d2d473938314229204170706c655765624b69742f3533372e333620284b48544d4c2c206c696b65204765636b6f29204368726f6d652f3131362e302e302e30204d6f62696c65205361666172692f3533372e33360d0a526566657265723a2068747470733a2f2f737276312e7261737472656f2e636f6d2e61722f6e7565766f2f656d756c61746f720d0a582d466f727761726465642d486f73743a20737276312e7261737472656f2e636f6d2e61720d0a5365632d46657463682d536974653a2073616d652d6f726967696e0d0a5365632d46657463682d446573743a20656d7074790d0a4163636570742d456e636f64696e673a20677a69702c206465666c6174652c2062722c207a7374640d0a5365632d46657463682d4d6f64653a20636f72730d0a7365632d63682d75613a20224e6f742f41294272616e64223b763d2238222c20224368726f6d69756d223b763d22313236222c2022476f6f676c65204368726f6d65223b763d22313236220d0a7365632d63682d75612d6d6f62696c653a203f310d0a7365632d63682d75612d706c6174666f726d3a2022416e64726f6964220d0a582d466f727761726465642d466f723a203139302e3138332e3133322e3137320d0a4163636570742d4c616e67756167653a2065732d45532c65733b713d302e390d0a582d466f727761726465642d5365727665723a20737276312e7261737472656f2e636f6d2e61720d0a436f6e74656e742d547970653a206d756c7469706172742f666f726d2d646174613b20626f756e646172793d2d2d2d2d5765624b6974466f726d426f756e64617279484e6f3577584b46416b3672564a76470d0a5669613a20312e3120737276312e7261737472656f0d0a582d466f727761726465642d466f723a205b303a303a303a303a303a303a303a315d0d0a582d466f727761726465642d50726f746f3a20687474700d0a582d466f727761726465642d486f73743a206c6f63616c686f73743a383038320d0a582d466f727761726465642d5365727665723a205b303a303a303a303a303a303a303a315d0d0a486f73743a206c6f63616c686f73743a353035350d0a436f6e74656e742d4c656e6774683a203335390d0a0d0a2d2d2d2d2d2d5765624b6974466f726d426f756e64617279484e6f3577584b46416b3672564a76470d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d226964220d0a0d0a393137323731363335300d0a2d2d2d2d2d2d5765624b6974466f726d426f756e64617279484e6f3577584b46416b3672564a76470d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d226c6174220d0a0d0a2d33312e35393331363939333439393737340d0a2d2d2d2d2d2d5765624b6974466f726d426f756e64617279484e6f3577584b46416b3672564a76470d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d226c6f6e220d0a0d0a2d36342e34363639353638393135323937380d0a2d2d2d2d2d2d5765624b6974466f726d426f756e64617279484e6f3577584b46416b3672564a76472d2d0d0a
Anton Tananaev6 months ago

It looks like something is wrong with your proxy. The request is clearly not the same.