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

incompatible with Traccar past version 4.10 #5

Open
Haskar opened this issue Apr 23, 2021 · 2 comments
Open

incompatible with Traccar past version 4.10 #5

Haskar opened this issue Apr 23, 2021 · 2 comments

Comments

@Haskar
Copy link

Haskar commented Apr 23, 2021

Traccar can send multiple formated responses on the position requests. I do not really understand the mechanics behind this but I read that we need to add "accept-headers" so I changed the following lines in node_helper.js:
changed
'headers': { 'Cookie': response.headers['set-cookie'][0] }
to
'headers': {'Accept': 'application/json', 'Cookie': response.headers['set-cookie'][0] }

It's in the SETUP part of the socketNotificationReceived-function.
Took me a couple of weeks to figure this out ... needless to say, I am a crappy programmer and therefore I'd rather write down my fixes here than commiting the files.

@Haskar
Copy link
Author

Haskar commented Apr 23, 2021

unfortunately, that didn't fix the problem either ... it just happens less often.

@Haskar
Copy link
Author

Haskar commented Apr 24, 2021

well I guess the fix was much easier than that.
make the traccar websocket timeout longer - as a minimum I recommend to set it to the time of your fastest updating device + something.

I set mine to 15 minutes by adding this line to the traccar.xml:
<entry key='web.timeout'>900000</entry>

I also added
self.socket.on('close', function(){ self.sendSocketNotification("Error","Error"); });
to the SETUP part of the socketNotificationReceived-function.

I should add some code to close those websocket connections on a restart of the magicmirror-service. I had to restart because I got every update a zillion times :)

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

1 participant