Bluetooth.CHAR_NOTIFY_EVENT When triggered
-
Hey, I am trying this Tutorial https://docs.pycom.io/tutorials/networks/ble/callback/ and it doesn't execute the char_notify_callback function in the client.
So my question is, when does the Bluetooth.CHAR_NOTIFY_EVENT get triggered?
Where can I find the source code of the network lib?I use 2 LoPys, one of them is the client and the other one the server
-
Could you perhaps add some print statements to see where the code stops?
When trying this example, I did have some difficulty syncing both devices up (with correct connection / disconnection status) But was able to make it work
-
@Gijs in the client I never get in the char_notify_callback method and also never send a read request.
If I try a char.read() after the line, where I call the Callback method, then I get this error:Unhandled exception in callback handler
TypeError: function takes 2 positional arguments but 1 were given -
Are you running the same firmware on both devices, I tried with the latest stable release, 1.20.2.r4. Also, could you check whether the
conn_cbis triggered on the Server device, and whetherConnected to FiPy 45is printed on the Client?Im not sure what you mean with
char.read()? -
@Gijs An update fixed my problem, thank you.
Do you know, when this in the server is triggered?chr1.callback(trigger=(Bluetooth.CHAR_READ_EVENT | Bluetooth.CHAR_SUBSCRIBE_EVENT), handler=chr1_handler)
-
When you read the characteristic. The actual reading is done at
conn.services(), but we later register the callback on the Client side. a CHAR_READ_EVENT triggers the callback on the server side to send data -
@Gijs where can i find a documentation, where the trigger is discribed?
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login