helium / console

A management console to onboard and manage devices running on the Helium blockchain network.
Apache License 2.0
104 stars 31 forks source link

Uplink integration request is sending plain text of decoder function #1008

Closed slavendam closed 2 years ago

slavendam commented 2 years ago
  1. Are you using Helium hosted Console or running your own open source Console? Helium hosted, console.helium.com

  2. If you are experiencing bugs in Helium hosted Console, please specify your Organization name and Device ID

Device joins and Console is sending Integration request for join action. That JSON body is correct as it should be. Check bellow "JOIN REQ"

But when device is sending Uplink Console is sending Integration request with wrong body. In body it is sending plain text of decoder function instead of JSON body with message parameters. Check bellow "UPLINK REQ"

JOIN REQ { "category": "uplink", "description": "Request sent to <<\"glamosWalkerIntegration\">>", "device_id": "47c4eac8-94fd-442a-b933-03c6e79b1867", "device_name": "Glamos Walker", "id": "b43dbeac-1e41-4208-a47d-740e6dee3cf9", "inserted_at": "2022-01-30T16:02:11", "organization_id": "4ec65bb3-7c1a-44e3-a51e-e1428e13e599", "reported_at": "1643558531797", "reported_at_naive": "2022-01-30T16:02:11", "router_uuid": "f27ce172-1a80-4954-b557-bca50e646815", "sub_category": "uplink_integration_req", "updated_at": "2022-01-30T16:02:11" } Device Information { "name": "Glamos Walker" } Integration Debug Request { "id": "f6967c9b-60df-41b1-959a-c027e16ce5b0", "name": "glamosWalkerIntegration", "status": "success" } { "body": { "app_eui": "D84BCF407AFDC54C", "dev_eui": "1D4A7D0000E27859", "devaddr": "53000048", "fcnt": 0, "hold_time": 3993, "hotspots": [ { "channel": 0, "frequency": 868.0999755859375, "hold_time": 3993, "id": "11KvoW2dYkDX9DeA9cHbE7SFPdLKoHmjDmzBNTM7WBxKZQi5H1w", "lat": -25.989978408452956, "long": 27.809082720765627, "name": "micro-oily-pigeon", "reported_at": 1643558529815, "rssi": -123, "snr": -6.199999809265137, "spreading": "SF11BW125", "status": "success" }, { "channel": 0, "frequency": 868.0999755859375, "hold_time": 3632, "id": "11XQUumaWtiTSawismxWsakvuYDDQ9agTtuqXJaG5j2DN9eAjvZ", "lat": -26.08548182149297, "long": 28.00706197752956, "name": "real-concrete-shetland", "reported_at": 1643558529412, "rssi": -124, "snr": -15, "spreading": "SF11BW125", "status": "success" } ], "id": "47c4eac8-94fd-442a-b933-03c6e79b1867", "metadata": { "adr_allowed": false, "cf_list_enabled": false, "labels": [ { "id": "5f3ce5a2-d8f6-4119-b771-5642f8c90135", "name": "devices", "organization_id": "4ec65bb3-7c1a-44e3-a51e-e1428e13e599" } ], "multi_buy": 1, "organization_id": "4ec65bb3-7c1a-44e3-a51e-e1428e13e599", "rx_delay": 1 }, "name": "Glamos Walker", "port": 0, "raw_packet": "AEzF/XpAz0vYWXjiAAB9Sh2tDqsinJg=", "reported_at": 1643558529815, "type": "join", "uuid": "f27ce172-1a80-4954-b557-bca50e646815" }, "headers": { "Content-Type": "application/json", "server": "helium" }, "method": "post", "url": "http://api.glamos.eu/device.php?api_key=", "url_params": { "api_key": "" } }

UPLINK REQ { "category": "uplink", "description": "Request sent to <<\"glamosWalkerIntegration\">>", "device_id": "47c4eac8-94fd-442a-b933-03c6e79b1867", "device_name": "Glamos Walker", "id": "6e0631ec-1ff3-4cf5-9684-6e682c15726c", "inserted_at": "2022-01-30T16:12:30", "organization_id": "4ec65bb3-7c1a-44e3-a51e-e1428e13e599", "reported_at": "1643559150775", "reported_at_naive": "2022-01-30T16:12:30", "router_uuid": "8d2a5996-9686-463c-aa1c-e3a43601650e", "sub_category": "uplink_integration_req", "updated_at": "2022-01-30T16:12:30" } Device Information { "name": "Glamos Walker" } Integration Debug Request { "id": "f6967c9b-60df-41b1-959a-c027e16ce5b0", "name": "glamosWalkerIntegration", "status": "success" } { "body": "function Decoder(bytes, port) {\n\n var decoded = {};\n var position = {};\n\n position.lat = ((bytes[0] << 16) >>> 0) + ((bytes[1] << 8) >>> 0) + bytes[2];\n position.lat = (position.lat / indexed16777215.0 180) - 90;\n position.lat = position.lat.toFixed(7);\n position.lng = ((bytes[3] << 16) >>> 0) + ((bytes[4] << 8) >>> 0) + bytes[5];\n position.lng = (position.lng / indexed16777215.0 360) - 180;\n position.lng = position.lng.toFixed(7);\n\n var altValue = ((bytes[6] << 8) >>> 0) + bytes[7];\n var sign = bytes[6] & (1 << 7);\n\n if (sign) {\n position.altitude = 0xFFFF0000 | altValue;\n } else {\n position.altitude = altValue;\n }\n\n decoded.antenna = bytes[8];\n\n // Payload format for Mappers / Cargo\n\n decoded.ant = decoded.antenna;\n decoded.lat = position.lat;\n decoded.lon = position.lng;\n decoded.alt = position.altitude;\n\n // Payload format for HeliumVision\n\n if (Object.getOwnPropertyNames(position).length > 0) {\n decoded.position = position;\n }\n\n return decoded;\n}\n", "headers": { "Content-Type": "application/json", "server": "helium" }, "method": "post", "url": "http://api.glamos.eu/device.php?api_key=", "url_params": { "api_key": "" } }

michaeldjeffrey commented 2 years ago

Can we see what your Integrations template looks like?

slavendam commented 2 years ago

There was issue. We didn't see that user changed these options. Thanks for pointing to that.