Data to Server invalid JSON format

Hi All!

We are sniffing wifi signals and sending to AWS Lambda via HTTP POST request.

The problem seems to be in the JSON formatting of the array containing the sniff objects:

here’s what we expect to get as a payload in the request (MAC addresses are not real):

{
    "body": {
        "base_to_wifi": {
            "time": 1708041021,
            "local_time": "2024-02-15 15:50:21",
            "fw": "  RUTX_R_00.07.06.3",
            "name": "WiFi_Scanner_to_AWS",
            "id": "1"
        },
        "wifi_to_aws": [
            {
                "timestamp": 1708404782,
                "mac": "c0:7c:d1:dd:58:80",
                "host": "ZoomieCharlie",
                "signal": -78
            }
        ]
    }
}

what we’re seeing is instead the following. notice the incorrect curly brackets for objects teltonika is using instead of the correct square brackets for arrays.

{
    "body": {
        "base_to_wifi": {
            "time": 1708404786,
            "local_time": "2024-02-19 20:53:06",
            "fw": "RUTX_R_00.07.06.3",
            "name": "aws_wifi",
            "id": "1"
        },
        "wifi_to_aws": {
            {
                "timestamp": 1708404782,
                "date": "19/02/2024 20:53:02",
                "mac": "28:bd:89:f7:a1:75",
                "host": "My Internet",
                "signal": -40
            }
        }
    }
}

DEVICE INFO

  • Model
    RUTX11

  • Firmware version
    RUTX_R_00.07.06.3

  • Firmware build date
    2024-01-12 06:47:21

  • Internal modem firmware version
    EG06ALAR04A01M4G

  • Kernel version
    5.10.199

Hello,

In the Data to Server configuration, there is a toggle whether the data is sent as object:


This option will change whether to send the data with square or curly brackets.
Alternatively, instead of selecting Format type as JSON, custom format can be used with the needed configuration, where the data format and symbols can be specified manually.
Perhaps I missed some information or formatting issues?

Best regards,

Hi @Daumantas ,

We fixed it by disabling the toggle and the custom format. Thank you!

1 Like

This topic was automatically closed after 15 days. New replies are no longer allowed.