Eelink timeout and http 422 error code

Jordana year ago

Hi

I have a Micodus MV401G (eelink protocol) tracker on my electric cargo bike. I chose this device because it can run directly off the 48v battery, is water resistant and can wake up, get GPS fix and send location when the bike is moved, and it supports all of the 3G and 4G bands of my carrier.

I have the device setup and working well, but I'm trying to tune battery and data consumption down.

There is an eelink heartbeat option (hbt) which defaults to 3 minutes. I would like to increase this to the maximum of 60 minutes, but if it's set to any value above about 6 minutes I get this in my traccar logs:

2024-02-20 06:07:01  INFO: [T6b2b12d0] disconnected
2024-02-20 06:07:01  INFO: Event id: 868450047056120, time: 2024-02-20 06:07:01, type: deviceOffline, notifications: 0
2024-02-20 06:07:01  WARN: Event forwarding failed - HTTP code 422 - RuntimeException (EventForwarderJson:57 < *:50 < ...)

The device goes offline as expected, but when the heartbeat eventually occurs it won't come back online and I don't get anything in the logs. Checking the status of the tracker via SMS it still has data connection and GPS fix. Device remains offline permanently.

At this point you might blame the device, but I can only get the tracker online again after restarting Traccar even if I've already restarted the device. To me this suggests something may be going wrong with Traccar itself.

Any suggestions on what to look at would be appreciated.

Thanks

Track-tracea year ago

You can change the protocol time-out set through the config file.

https://www.traccar.org/configuration-file/

What is the event forwardinf for?

Anton Tananaeva year ago

Device goes offline doesn't have anything with the server. You need to check your device.

As for the forwarding error, the error is coming from the service you're forwarding the data to.

Jordana year ago

Oh the event forwarding is probably for home assistant. I forgot I had that set up.

I will try upping the timeout on the configuration file, thanks.

Jordana year ago

I tried upping the eelink timeout to ensure it was higher than the device heartbeat but it didn't seem to help anything. At first I thought traccar needed restarting when I had problems, but it turns out I was mistaken. Restarting the device gets it online again.

These are the "heartbeat" messages I get from the device when the timeout is too long (it seems max is in practise about 10 minutes)

2024-02-21 07:27:21  INFO: [T7fd869df: eelink < 122.56.209.235] 6767120045000d65d5a5d803fb5393e712846ccd00050000000005021200056ded0995e28333066b117b12f30000000000000d90058e0000000014000000000000000000000000000000
2024-02-21 07:27:21  INFO: [T7fd869df: eelink > 122.56.209.235] 6767120002000d

If I get one of these messages the device will not come back online without a restart, even when it's moving and should be active.

When the timeout is shorter I get the location in the heartbeat. This seems to be the correctly formed heartbeat. The device stays online.

2024-02-21 07:40:47  INFO: [T5f6440f3: eelink < 122.56.235.25] 67670300040005006a
2024-02-21 07:40:47  INFO: [T5f6440f3] id: 868450047056120, time: 2024-02-21 05:26:06, lat: -xx.56032, lon: xx.59363, course: 91.0
2024-02-21 07:40:47  INFO: [T5f6440f3: eelink > 122.56.235.25] 67670300020005

So I guess the Chinese tracker just has buggy firmware (surprise!). I'll have to stick to a shorter heartbeat interval.