golioth / golioth-zephyr-sdk

Golioth SDK For Zephyr
https://www.golioth.io
Apache License 2.0
65 stars 20 forks source link

Writing simple CBOR to LightDB Stream or State fails #391

Closed jaredwolff closed 1 year ago

jaredwolff commented 1 year ago

Zephyr Commit hash

fcaa60a99fa9d5256078ed28557856ec3709cfa9

Golioth SDK Commit Hash

ff8de0da412680d8c8e3ca082369fda2f71a99ad

Hardware Target

nRF52

What host OS are you using?

cat /etc/os-release
NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 22.04 LTS"
VERSION_ID="22.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy
LOGO=distributor-logo-pop-os

Current Behavior

When I try to write a simple CBOR payload to LightDB I get:

[00:07:31.594,970] <inf> app_802154: 13 bytes recieved!
[00:07:31.595,031] <inf> app_802154: 
                                     a2 64 74 65 6d 70 16 63  68 75 6d 18 31          |.dtemp.c hum.1   
[00:07:31.595,153] <inf> aqw_golioth_802154_hub: Incoming APP_EVENT_REMOTE_DATA
[00:07:31.642,517] <wrn> golioth: Server reports CoAP Bad Request. (Check payload formatting)
[00:07:31.642,547] <wrn> golioth: req_sync finished with error -14
[00:07:31.642,547] <wrn> aqw_golioth_802154_hub: Failed to send data: -14
[00:07:31.642,608] <inf> golioth: cancel and free req: 0x200015a8

The objects JSON representation is:

{"pm25": 7}

Expected Behavior

I expect it to publish this type of CBOR object without issue. I also expect to push multiple data points at the same time.

Steps To Reproduce

  1. Connect to Golioth
  2. Create CBOR payload above
  3. Publish
  4. Get error

Logs, console output, or any kind of debug information

See the above.
hasheddan commented 1 year ago

Thanks for logging this issue @jaredwolff! I'm taking a look and will follow-up shortly 👍🏻

jaredwolff commented 1 year ago

Looking like user error. I'll re-open if I'm still having trouble.

hasheddan commented 1 year ago

Thanks! I verified that I was able to send the payload successfully, but happy to dig in further if issue persists 👍🏻

jaredwolff commented 1 year ago

User error. Thanks @hasheddan