Sigfox Device intergration

Wesley3 months ago

Hi,
I am trying to link a sigfox GPS tracker to our traccar server, I have setup the callbacks on Sigfox side as follow:
Type:Data/Uplink
Channel: URL
URL Pattern: http://{servername}:5154/?id={device}&data={data}&seqNumber={seqNumber}&time={time}

Content Type: application/json
Body:

{
   "id":"{device}",
   "data":"{data}",
   "seqNumber":"{seqNumber}",
   "time":"{time}"
}

However I get the following error on my log files:

2024-01-22 16:43:35  INFO: [Tfde1e8f2] connected
2024-01-22 16:43:35  INFO: [Tfde1e8f2: sigfox < 185.110.98.3] 504f5354202f3f69643d3146464641314226646174613d363464313534656266636635346335653063663832643030267365714e756d6265723d313936362674696d653d3137303539343138313320485454502f312e310d0a636f6e74656e742d6c656e6774683a203131310d0a6163636570742d6c616e67756167653a2066720d0a686f73743a20747261636b696e672e63656c6c73746f702e636f6d2e6e613a353135340d0a636f6e74656e742d747970653a206170706c69636174696f6e2f6a736f6e0d0a6163636570742d656e636f64696e673a20677a69702c6465666c6174650d0a757365722d6167656e743a20534947464f580d0a6163636570742d636861727365743a205554462d383b713d302e392c2a3b713d302e370d0a0d0a7b0d0a202020226964223a2231464646413142222c0d0a2020202264617461223a22363464313534656266636635346335653063663832643030222c0d0a202020227365714e756d626572223a2231393636222c0d0a2020202274696d65223a2231373035393431383133220d0a7d
2024-01-22 16:43:35  INFO: [Tfde1e8f2] error - Cannot invoke "javax.json.JsonString.getString()" because the return value of "org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl.getJsonString(String)" is null - NullPointerException (... < SigfoxProtocolDecoder:116 < ExtendedObjectDecoder:72 < ... < WrapperContext:102 < ...)
2024-01-22 16:43:35  INFO: [Tfde1e8f2] disconnected

Is there something else that needs to be enabled to use the Sigfox protocol?

Anton Tananaev3 months ago

Where did you get the format from? It doesn't seem to match the expected one.

Wesley3 months ago

I got it from a post on this forum: https://www.traccar.org/forums/topic/sigfox-setup-newbie-question/

Is the URL pattern wrong or the body? What should it be?

Anton Tananaev3 months ago

It doesn't seem like you've read that thread properly. The example you're using was for OsmAnd protocol.

Wesley3 months ago

I replicated the config from the 1st post and edited to match my server config. Using port 5154 which is the sigfox port is it not?

Do I have the json body wrong or my URL string wrong? Should I edit my Sigfox backend callbacks to match OsmAnd or are the sigfox protocols supported by default?

Anton Tananaev3 months ago

You did not replicate the config from the 1st post. Double check that.

Wesley3 months ago

URL pattern:

https://{server}:5154/?id={device}&data={data}&seqNumber={seqNumber}&time={time}

Content-type:

application/x-www-form-urlencoded

Body:

{
    "device":"{device}",
    "data":"{data}",
    "seqNumber:"{seqNumber}",
    "time":"{time}"
}

Still get below error:

2024-01-22 18:01:29  INFO: [T0b736731: sigfox < 185.110.98.3] 160301010f0100010b0303765ed25d3d7c5e3edab0b5eec055b028d5ae89478f772299423f4c8559fe048220fc1340fa162e63b258e2fdcb61e2abf0dcd196aed8d0aa20deef02a7a8707de4001813011302c02cc02bc02fc030c013c014009c002f003500ff010000aa0000001d001b000018747261636b696e672e63656c6c73746f702e636f6d2e6e61000b000403000102000a000a0008001d001700180019002300000016000000170000000d002a0028040305030603080708080809080a080b080408050806040105010601030303010302040205020602002b00050403040303002d00020101003300260024001d0020e025acc6e973bed6cc1afa233bf95108d1d0715f7779c896bcb5601718e42f2a
2024-01-22 18:01:29  INFO: [T0b736731] error - Invalid token=EOF at (line no=1, column no=0, offset=-1). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL] - JsonParsingException (... < SigfoxProtocolDecoder:110 < ExtendedObjectDecoder:72 < ... < WrapperContext:102 < ...)
2024-01-22 18:01:29  INFO: [T0b736731] disconnected
2024-01-22 18:02:36  INFO: [Ta7e63fac] connected
2024-01-22 18:02:36  INFO: [Ta7e63fac: sigfox < 185.110.98.0] 160301010f0100010b030362fb28cf0a6bdc305359eadc6123a6d5cf28a81aeb319bea0f64264e97c025ae20c819fdbe96e73e0a6fbeab91d199ea386c488138a211655f381209b6c27d93fe001813011302c02cc02bc02fc030c013c014009c002f003500ff010000aa0000001d001b000018747261636b696e672e63656c6c73746f702e636f6d2e6e61000b000403000102000a000a0008001d001700180019002300000016000000170000000d002a0028040305030603080708080809080a080b080408050806040105010601030303010302040205020602002b00050403040303002d00020101003300260024001d0020a903bcece80f9465078074ab0fb9dd2e79011eef9339475b6a938416aa9cfa6c
2024-01-22 18:02:36  INFO: [Ta7e63fac] error - Invalid token=EOF at (line no=1, column no=0, offset=-1). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL] - JsonParsingException (... < SigfoxProtocolDecoder:110 < ExtendedObjectDecoder:72 < ... < WrapperContext:102 < ...)
2024-01-22 18:02:36  INFO: [Ta7e63fac] disconnected
2024-01-22 18:02:49  INFO: [T051911bf] connected
2024-01-22 18:02:49  INFO: [T051911bf: sigfox < 185.110.98.3] 160301010f0100010b0303bcb8c64a52d9330edd82404cefb34c72f03d2f13e804a09ffd74ca9eb86fcefc20bca8ea11bc3e95b839948dc25f10bc1827ad2017c1d56466932650aff32b400a001813011302c02cc02bc02fc030c013c014009c002f003500ff010000aa0000001d001b000018747261636b696e672e63656c6c73746f702e636f6d2e6e61000b000403000102000a000a0008001d001700180019002300000016000000170000000d002a0028040305030603080708080809080a080b080408050806040105010601030303010302040205020602002b00050403040303002d00020101003300260024001d0020fa85b99426174ab46f39c5264ad383653d1cdff941913b7313268e40b61bec02
2024-01-22 18:02:49  INFO: [T051911bf] error - Invalid token=EOF at (line no=1, column no=0, offset=-1). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL] - JsonParsingException (... < SigfoxProtocolDecoder:110 < ExtendedObjectDecoder:72 < ... < WrapperContext:102 < ...)
2024-01-22 18:02:49  INFO: [T051911bf] disconnected
2024-01-22 18:04:34  INFO: [T0a67581f] connected
2024-01-22 18:04:34  INFO: [T0a67581f: sigfox < 185.110.98.0] 160301010f0100010b0303665cfe8f00ddfd64a5f0bdb1d0aa40cbeaf890f8d9e578622986f9725373d99f20f759ce6655f7c5a78f970543877339a3445e579b3fe5e2aed28cca3cf89f7e06001813011302c02cc02bc02fc030c013c014009c002f003500ff010000aa0000001d001b000018747261636b696e672e63656c6c73746f702e636f6d2e6e61000b000403000102000a000a0008001d001700180019002300000016000000170000000d002a0028040305030603080708080809080a080b080408050806040105010601030303010302040205020602002b00050403040303002d00020101003300260024001d0020f2e2c4b522c9feeafc9b1dd47cc0a2ede747249e01e0f9fe9b1efe47732cb326
2024-01-22 18:04:34  INFO: [T0a67581f] error - Invalid token=EOF at (line no=1, column no=0, offset=-1). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL] - JsonParsingException (... < SigfoxProtocolDecoder:110 < ExtendedObjectDecoder:72 < ... < WrapperContext:102 < ...)
2024-01-22 18:04:34  INFO: [T0a67581f] disconnected
2024-01-22 18:04:36  INFO: [T9efcc271] connected
2024-01-22 18:04:36  INFO: [T9efcc271: sigfox < 185.110.98.0] 160301010f0100010b0303d6a48693c11174316bdf4d4a5c1742fd798e350d86af170169cfe07a3b9249f02015ac2568828d7a85c07b2d47d032dc626a2456175163bd575f8ee1ea931417bc001813011302c02cc02bc02fc030c013c014009c002f003500ff010000aa0000001d001b000018747261636b696e672e63656c6c73746f702e636f6d2e6e61000b000403000102000a000a0008001d001700180019002300000016000000170000000d002a0028040305030603080708080809080a080b080408050806040105010601030303010302040205020602002b00050403040303002d00020101003300260024001d0020a30cb437065a1714da2d778c64c5ead5808898abb87c9d35975d57aeb44ce601
2024-01-22 18:04:36  INFO: [T9efcc271] error - Invalid token=EOF at (line no=1, column no=0, offset=-1). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL] - JsonParsingException (... < SigfoxProtocolDecoder:110 < ExtendedObjectDecoder:72 < ... < WrapperContext:102 < ...)
2024-01-22 18:04:36  INFO: [T9efcc271] disconnected
Anton Tananaev3 months ago

You obviously have to have a valid JSON.

Wesley3 months ago

Ok I will do some more research on the tracker first to see how its payloads are setup etc. Safe to assume the native support for sigfox units on traccar is not universal for all Sigfox based tracker.

If I may ask, the Sigfox protocol currently support, for which device was that?

Anton Tananaev3 months ago

I'm pretty sure we implemented support based on multiple devices.

The error seems to indicate a problem with the handling of the JSON response in the Sigfox protocol decoder in Traccar. The message "Cannot invoke "javax.json.JsonString.getString()" because the return value of "org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl.getJsonString(String)" is null" suggests that the decoder expects a non-null value, but you are receiving a null value.

To address this, you could review the following points:

JSON Format in Response: Make sure the Traccar server expects a valid JSON response. The response you provide appears to be in JSON format, but there may be some problem in constructing the JSON that results in a null value.

Handling Null Fields: Verify that the fields in your response are not arriving as null. In your answer, fields like data, seqNumberand timemust have non-null values.