当前位置:网站首页>Portapack application development tutorial (XVII) nRF24L01 launch B
Portapack application development tutorial (XVII) nRF24L01 launch B
2022-07-06 15:09:00 【Lao Shao's open source world】
This project github:
GitHub - jamesshao8/btle_nrf24l01: send or receiver btle packet with nrf24l01
More than a year ago, I realized PortaPack receive nrf24l01/btle Data packets . Later, I always wanted to realize portapack/hackrf launch nrf24l01 Data packets , The previous idea was to change gr-noridc The launch code in is given to its own receiving code or several other open source receiving projects . But it didn't work . There are problems in both coding and modulation .
Then I came up with a new method . since hackrf and nrf24l01 There are ready-made projects to send and receive low Bluetooth packets . Then I can also use it hackrf Send Bluetooth packets to nrf24l01, Packaging data into Bluetooth mode can be regarded as application layer coding , The bottom layer is consistent nrf24l01 Required , It can also be regarded as indirectly realizing my needs .
However, there are still many holes in the concrete implementation , Here's a record .
I first implemented it with the following project hackrf Send and receive data packets to mobile phones GitHub - jamesshao8/BTLE: Bluetooth Low Energy (BLE) packet sniffer and transmitter for both standard and non standard (raw bit) based on Software Defined Radio (SDR).
SDR Send low-power Bluetooth packets _ Bili, Bili _bilibili
The above is the corresponding video
command
./btle_tx 37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-070203040506-LOCAL_NAME09-SHAO_HACKRF r30
You can iphone Jacket nrf connect This app Take a look at the searched packets .
such hackrf Launching low-power Bluetooth is done , Of course, receiving is no problem btle_rx Just go .
Then I found two projects , Namely nrf24l01 Transmitting and receiving low-power Bluetooth packets .
The first project is only launch , Corresponding to me github Under the project of send_simplified, The code structure is very simple , There is no need to call a third party RF24 library . Another project has reception , Corresponding send and recv, But sending and receiving are complicated .
Let me use it first. send_simplified project , Confirmed. arduino+nrf24l01 It can indeed send data to mobile phones , And the hardware itself and the connection are all right .
Then try again send and recv. There was a problem , No hair , The data received is also very strange , Later, I learned that the two projects are used by default ce csn The words are reversed . So we changed our country send recv Code for , It was originally radio(9,10) The place is changed to radio(10,9).
then send To send data packets to mobile phones , also recv Can also receive send Data packets of ( The fast refresh is for manual use send The hair , Not environmental ). however send and recv There is too much code to understand ,recv I didn't know what the serial output data was .
So I later tried to use recv Collect it send_simplified Data packets of , And then from send_simplified Find the corresponding relationship in the code of .
I have learned that recv The data of data is actually the data before encoding or after decoding , And does not include the previous broadcast address . After knowing this, I can follow send_simplified The definitions of various data bits are recv Do decoding work in . Mainly to find out Name Length and Name Itself binary to character and find Data And directly show data The number .
After finishing these , I'll try HackRF Send packets to nrf24l01+arduino Of recv Program .
I learned that in fact send_simplified Send packets ,hackrf function btle_rx When , Will receive such a message .
65776us Pkt1111 Ch37 AA:8e89bed6 ADV_PDU_t2:ADV_NONCONN_IND T1 R0 PloadL21 AdvA:685746352413 Data:0201060608534841524604ccaabbdd CRC0
This is related to arduino recv It's corresponding in . then btle_tx There will also be a prompt when launching INFO bit and PHY bit. I guess INFO bit Is the data before coding ,PHY bit It's coded ( It doesn't make much sense ).
Then my later goal was to find ways to adjust btle_tx Parameters of , Make it emit INFO bit Data similar to the following in ( Follow send_simplified Send and recv The solution is exactly the same ):
2 1 6 6 8 53 48 41 52 46 4 CC AA BB DD
I found it impossible to send LOCAL_NAME09 It's packed , Otherwise, the first few values (2 1 Representative data type ) It's different . Later I read it carefully hackrf With btle Documentation of the program , It is found that the data before coding can be written directly by hand , So I use the following command :
./btle_tx 39-ADV_IND-TxAdd-1-RxAdd-0-AdvA-685746352413-AdvData-0201060608534841524604ccaabbdd r1000
You can see , This manual packet , Mandatory data type 0201, And the following content also follows me send_simplified Send exactly the same , Just like the ,arduino recv You can see this packet .
You can also change the data yourself ccaabbdd Change the content casually , But don't change the length .
SDR Send low-power Bluetooth packets to nrf24l01_ Bili, Bili _bilibili
Theoretically , You can control the small four axes in this way , Small four axis is directly used nrf24l01 Many as receivers . I also found a project to use nrf+arduino Realized ppm Output , This can completely replace ppm The remote control receiver is connected to my own small four-axis .
But there are still several areas that need to be improved : One is data accuracy , If ccaabbdd As data ,4 One channel, one for each channel cc, That's one byte, Then it can only be divided into 256 Combinations of . And it turns out ppm perhaps pwm You can go from 0 To 2000 change , In this case, the accuracy will be lost 8 times . There is also a bigger problem that the data interval sent is relatively large , At present, it is the smallest 300ms, The received data interval is larger due to packet loss , In this way, there is no time to control the aircraft .
So I have a few things to do later :
1. Abbreviation btle_tx project , Try to improve the launch efficiency
2.btle_tx Migration to portapack in
3. use nrf24l01+arduino pro mini combination cheapass receiver, Self control ppm The receiver is ready .
边栏推荐
- Iterators and generators
- Report on the double computer experiment of scoring system based on 485 bus
- 几款开源自动化测试框架优缺点对比你知道吗?
- Wang Shuang's detailed learning notes of assembly language II: registers
- Global and Chinese market of RF shielding room 2022-2028: Research Report on technology, participants, trends, market size and share
- [pointer] find the length of the string
- [pointer] solve the last person left
- pytest
- Capitalize the title of leetcode simple question
- Cadence physical library lef file syntax learning [continuous update]
猜你喜欢
CSAPP homework answers chapter 789
ucore lab8 文件系统 实验报告
接口测试面试题及参考答案,轻松拿捏面试官
Quaternion -- basic concepts (Reprint)
软件测试工作太忙没时间学习怎么办?
软件测试行业的未来趋势及规划
[Ogg III] daily operation and maintenance: clean up archive logs, register Ogg process services, and regularly back up databases
Maximum nesting depth of parentheses in leetcode simple questions
UCORE lab8 file system experiment report
Soft exam information system project manager_ Project set project portfolio management --- Senior Information System Project Manager of soft exam 025
随机推荐
MySQL development - advanced query - take a good look at how it suits you
"If life is just like the first sight" -- risc-v
软件测试方法有哪些?带你看点不一样的东西
Pointer -- output all characters in the string in reverse order
Dlib detects blink times based on video stream
JDBC介绍
How to rename multiple folders and add unified new content to folder names
Four methods of exchanging the values of a and B
Express
Daily code 300 lines learning notes day 9
Global and Chinese market of maleic acid modified rosin esters 2022-2028: Research Report on technology, participants, trends, market size and share
Maximum nesting depth of parentheses in leetcode simple questions
Pointer -- eliminate all numbers in the string
The number of reversing twice in leetcode simple question
Leetcode simple question: check whether two strings are almost equal
如何成为一个好的软件测试员?绝大多数人都不知道的秘密
China's county life record: go upstairs to the Internet, go downstairs' code the Great Wall '
Statistics 8th Edition Jia Junping Chapter 1 after class exercises and answers summary
Capitalize the title of leetcode simple question
Thinking about three cups of tea