Date 1970.01.01 Issue

When collecting data from my beacon using the api I get this Linux start date.It might be something that can cause other issues.

command:

curl -X GET 'https://cloud.estimote.com/v3/lte/device_events?identifier=xxxxxxxxxxxx' -u xxxxxxxxxxxxxx -H "Accept: application/json"
response:
{
    "data": [
        {
            "type": "position-change",
            "payload": {
                "at": {
                    "type": 255,
                    "buffer": {
                        "data": [
                            73,
                            114,
                            1,
                            0,
                            0,
                            133,
                            119,
                            98
                        ],
                        "type": "Buffer"
                    }
                },
                "lat": 55.746150970458984,
                "long": 12.542181968688965
            },
            "enqueued_at": "1970-01-02T02:19:53.413Z",
            "device_identifier": "f5ea3f85ed562fcde4e2110d14c5ff1f",
            "received_at": "2019-07-19T10:20:45.701Z",
            "app_id": "ecUG93TdHe",
            "app_release": 49
        },
        {
            "type": "position-change",
            "payload": {
                "at": {
                    "type": 255,
                    "buffer": {
                        "data": [
                            73,
                            114,
                            1,
                            0,
                            0,
                            133,
                            119,
                            98
                        ],
                        "type": "Buffer"
                    }
                },
                "lat": 55.746150970458984,
                "long": 12.542181968688965
            },
            "enqueued_at": "1970-01-02T02:19:53.413Z",
            "device_identifier": "f5ea3f85ed562fcde4e2110d14c5ff1f",
            "received_at": "2019-07-19T10:20:45.694Z",
            "app_id": "ecUG93TdHe",
            "app_release": 49
        },
        {
            "type": "position-change",
            "payload": {
                "at": {
                    "type": 255,
                    "buffer": {
                        "data": [
                            230,
                            116,
                            1,
                            0,
                            0,
                            81,
                            37,
                            2
                        ],
                        "type": "Buffer"
                    }
                },
                "lat": 55.74919509887695,
                "long": 12.540340423583984
            },
            "enqueued_at": "1970-01-02T02:31:02.009Z",
            "device_identifier": "f5ea3f85ed562fcde4e2110d14c5ff1f",
            "received_at": "2019-07-19T10:20:45.677Z",
            "app_id": "ecUG93TdHe",
            "app_release": 49
        },

The reason for this is, when the LTE Beacon resets (e.g., battery dies, and you recharge it later), it loses the time (it goes to 0 = 1970-01-01), and needs to sync it again via the cellular network. Until that sync happens, events will be enqueued with such weird time.

The only good workaround I can think of is, hold off from enqueueing events until the time is set. You can check the current time in the beacon via the regular JavaScript Date class. I believe the beacon will try to sync immediately after startup, but I’m not sure, so may need to throw sync.now() on app startup if that’s not the case.

1 Like

Looking at your other posts it seems that you are using different SIM card than provided. If it is not properly configured (or operator does not support time synchronisation) this may prevent modem from properly synchronising time.
I suspect that those events that you are receiving are coming though WebIDE not via modem.

2 Likes

I am using the same card on one beacon and I am using different on the other which is supporting LTE (3 mobile)And you are right the 3 mobile does not support time sync and I get 1970.01.01 on that one .The other does not show that error, so that was the problem