当前位置:网站首页>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 .
边栏推荐
- Practical cases, hand-in-hand teaching you to build e-commerce user portraits | with code
- Build your own application based on Google's open source tensorflow object detection API video object recognition system (I)
- MySQL数据库(五)视 图 、 存 储 过 程 和 触 发 器
- Statistics 8th Edition Jia Junping Chapter 2 after class exercises and answer summary
- MySQL数据库(三)高级数据查询语句
- The four connection methods of JDBC are directly coded
- {1,2,3,2,5} duplicate checking problem
- CSAPP家庭作业答案7 8 9章
- [oiclass] maximum formula
- Database monitoring SQL execution
猜你喜欢
软件测试有哪些常用的SQL语句?
Description of Vos storage space, bandwidth occupation and PPS requirements
软件测试工作太忙没时间学习怎么办?
ucore lab1 系统软件启动过程 实验报告
The common methods of servlet context, session and request objects and the scope of storing data in servlet.
The minimum number of operations to convert strings in leetcode simple problem
The salary of testers is polarized. How to become an automated test with a monthly salary of 20K?
Es full text index
MySQL数据库(四)事务和函数
ucore lab5用户进程管理 实验报告
随机推荐
Zhejiang University Edition "C language programming experiment and exercise guide (3rd Edition)" topic set
How to use Moment. JS to check whether the current time is between 2 times
pytest
Leetcode simple question: check whether two strings are almost equal
Zhejiang University Edition "C language programming experiment and exercise guide (3rd Edition)" topic set
后台登录系统,JDBC连接数据库,做小案例练习
How to learn automated testing in 2022? This article tells you
[HCIA continuous update] working principle of static route and default route
Cadence physical library lef file syntax learning [continuous update]
HackTheBox-Emdee five for life
Emqtt distribution cluster and node bridge construction
To brush the video, it's better to see if you have mastered these interview questions. Slowly accumulating a monthly income of more than 10000 is not a dream.
Global and Chinese markets for GaN on diamond semiconductor substrates 2022-2028: Research Report on technology, participants, trends, market size and share
ucore lab1 系统软件启动过程 实验报告
The common methods of servlet context, session and request objects and the scope of storing data in servlet.
UCORE lab1 system software startup process experimental report
“Hello IC World”
UCORE lab7 synchronous mutual exclusion experiment report
Face and eye recognition based on OpenCV's own model
The minimum number of operations to convert strings in leetcode simple problem