Hello all,
This is my first delve into the Blues, and very new to programming in general.
I’m following this tutorial, and I’ve made it down to step 7 of “Write Code”. I I have tried changing the port address from 0 to 0x17 per some google searching, without change.
Here is my code:
# This script is used to test the functionality of a Blues Notecard
import json
import notecard
import notecard_pseudo_sensor
from periphery import I2C
import time
#Taken from bluesnotehub under devices>summary
productUID = "com.xxx.xxx:dev_project"
port = I2C("/dev/i2c-1")
card = notecard.OpenI2C(port, 0x17, 0)
#card = notecard.OpenI2C(port, 0, 0)
#Configure the Notecard:-------------------------
req = {"req": "hub.set"}
req["product"] = productUID
req["mode"] = "continuous"
print(json.dumps(req))
rsp = card.Transaction(req)
print(rsp)
#--------------------------------------------
And the response is:
{"req": "hub.set", "product": "com.xxx.xxx:dev_project", "mode": "continuous"}
{'crc': '0000:A3A6BF43'}
Per the tutorial, I should receive an empty {} indicating a successful request.
What does {‘crc’: ‘0000:A3A6BF43’} indicate?
If I continue through the tutorial, I can create mock sensor readings, send them to Notehub rsp={‘total’: 1, ‘crc’: ‘0001:15CB2833’} where they are visible in the Events tab.
Since the tutorial states I should receive an empty JSON object if successful (my rsp is not empty), but the data is sent successfully (also without an empty JSON rsp), am I getting an error or is the documentation outdated?