1

I have been going through a tutorial about this, based on the example code for the "BTLE" Arduino Library.

This is my program:

#include <SPI.h>
#include <RF24.h>
#include <BTLE.h>
RF24 radio(9,10);
BTLE btle(&radio);
void setup() {
 Serial.begin(9600);
 while (!Serial) { }
 Serial.println("BTLE advertisement receiver");
 btle.begin("");
}
void loop() {
 if (btle.listen()) {
 Serial.print("Got payload: ");
 for (uint8_t i = 0; i < (btle.buffer.pl_size)-6; i++) {
 Serial.print(char(btle.buffer.payload[i]));
 }
 Serial.println("");
 }
 btle.hopChannel();
}

I saw a video of a person running this code, and then sending advertising information via the "nRF Connect" Android app. In that video (https://www.youtube.com/watch?v=DGgjdBSId4Y) they would receive output in the Serial Monitor very regularly, as I would expect. When I run my code, and start advertising, then I see the name of my phone only every other minute in the output, and between that time, there is a lot of garbage. I cannot copy the output because of too many special characters.

I would expect the string that I am advertising to show up approximately every 100ms, as that is the rate of the advertisement.

Any idea what I could be doing wrong, or how to debug this better?

asked Jun 11, 2021 at 23:40

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.