You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 :)
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.
The text was updated successfully, but these errors were encountered: