Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about sending custom BLE packet #24

Open
yan-xiao-xi opened this issue Dec 29, 2021 · 3 comments
Open

Question about sending custom BLE packet #24

yan-xiao-xi opened this issue Dec 29, 2021 · 3 comments

Comments

@yan-xiao-xi
Copy link

Hi @Matheus-Garbelini ,

First of all, thanks for this work!

I try to send custom BLE packet by modifying the Python script, and sniff packets with Wireshark.

I find that:

1.When sending SCAN_REQ with a valid advertiser address (advertising address of a real peripheral), the LED of nRF52840 flashes blue, and Wireshark can sometimes sniff the sent packet.
Codes as follow
image
Logs as follow
image
Captured packets as follow
Wireshark

2.When sending SCAN_REQ with an invalid advertiser address (advertising address not used by peripherals), the LED of nRF52840 stays blue, and Wireshark can not sniff the sent packet.
Codes as follow
image
nRF52840 looks like
image

3.When sending custom ADV_NONCONN_IND, the LED of nRF52840 stays blue, and Wireshark can not sniff the sent packet.
Codes as follow
image
Pcap saved by wrpcap looks like
image

And the question is:
1.Why can nRF52840 send SCAN_REQ only with a valid advertiser address, is there any additional logic in the firmware?
2.What does it mean that the LED of nRF52840 stays blue, is that an abnormal state? How can I confirm that the packet is sent to the air successfully?
3.Can I send custom ADV_NONCONN_IND packet (more specifically, custom BLE mesh packet) with your firmware? If so, would you like to give me a hint about how to do?

Appreciate for your help.

Regards,
yan_xiao_xi

@Matheus-Garbelini
Copy link
Owner

Matheus-Garbelini commented Dec 29, 2021

Hi @yan-xiao-xi thanks for your great question.

  1. Yes, scan requests are only sent by the firmware after it receives a valid advertisement from a peripheral. More precisely it sends a scan request after ~150us of receiving an advertisement from the real peripheral (as intended by the spec). As you can guess, if you send a scan request with invalid advertiser address, the firmware will wait forever for an nonexistent peripheral advertisement.
  2. It means: "Waiting reception of peripheral advertisement with the address you have informed via scan request PDU". When the blue led goes off, it means that the scan request has been sent to the peripheral.
  3. Certainly you can, but you would need to modify the firmware source code in it. If you like low-level firmware programming, feel free to send to [email protected] a request from your university email. Regards.

@yan-xiao-xi
Copy link
Author

Hi @Matheus-Garbelini,

Many thanks to your answer!

@sacca97
Copy link

sacca97 commented Oct 24, 2024

Hi @Matheus-Garbelini I tried to contact you about the firmware using my academic email but got no reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants