当前位置:网站首页>Lora sync word settings
Lora sync word settings
2022-07-06 22:14:00 【zterrorblade】
According to the sx1302 Is it public network,loragw_sx1302.c
int sx1302_lora_syncword(bool public, uint8_t lora_service_sf) {
/* Multi-SF modem configuration */
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF5->SF6 with syncword PRIVATE (0x12)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF5_PEAK1_POS_SF5, 2);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF5_PEAK2_POS_SF5, 4);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF6_PEAK1_POS_SF6, 2);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF6_PEAK2_POS_SF6, 4);
if (public == true) {
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PUBLIC (0x34)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 6);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 8);
} else {
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PRIVATE (0x12)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 2);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 4);
}
/* LoRa Service modem configuration */
if ((public == false) || (lora_service_sf == DR_LORA_SF5) || (lora_service_sf == DR_LORA_SF6)) {
DEBUG_PRINTF("INFO: configuring LoRa (Service) SF%u with syncword PRIVATE (0x12)\n", lora_service_sf);
lgw_reg_w(SX1302_REG_RX_TOP_LORA_SERVICE_FSK_FRAME_SYNCH0_PEAK1_POS, 2);
lgw_reg_w(SX1302_REG_RX_TOP_LORA_SERVICE_FSK_FRAME_SYNCH1_PEAK2_POS, 4);
} else {
DEBUG_PRINTF("INFO: configuring LoRa (Service) SF%u with syncword PUBLIC (0x34)\n", lora_service_sf);
lgw_reg_w(SX1302_REG_RX_TOP_LORA_SERVICE_FSK_FRAME_SYNCH0_PEAK1_POS, 6);
lgw_reg_w(SX1302_REG_RX_TOP_LORA_SERVICE_FSK_FRAME_SYNCH1_PEAK2_POS, 8);
}
return LGW_REG_SUCCESS;
}
Where the setting code is
if (public == true) {
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PUBLIC (0x34)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 6);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 8);
} else {
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PRIVATE (0x12)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 2);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 4);
}
sx126x Set the synchronization word related code
sx126x.h
/*!
* Syncword for Private LoRa networks
*/
#define LORA_MAC_PRIVATE_SYNCWORD 0x1424
/*!
* Syncword for Public LoRa networks
*/
#define LORA_MAC_PUBLIC_SYNCWORD 0x3444
radio.c
void RadioSetPublicNetwork( bool enable )
{
RadioPublicNetwork.Current = RadioPublicNetwork.Previous = enable;
RadioSetModem( MODEM_LORA );
if( enable == true )
{
// Change LoRa modem SyncWord
SX126xWriteRegister( REG_LR_SYNCWORD, ( LORA_MAC_PUBLIC_SYNCWORD >> 8 ) & 0xFF );
SX126xWriteRegister( REG_LR_SYNCWORD + 1, LORA_MAC_PUBLIC_SYNCWORD & 0xFF );
}
else
{
// Change LoRa modem SyncWord
SX126xWriteRegister( REG_LR_SYNCWORD, ( LORA_MAC_PRIVATE_SYNCWORD >> 8 ) & 0xFF );
SX126xWriteRegister( REG_LR_SYNCWORD + 1, LORA_MAC_PRIVATE_SYNCWORD & 0xFF );
}
}
public network true Set sync word 0x34
false 0x12
边栏推荐
- i.mx6ull搭建boa服务器详解及其中遇到的一些问题
- GPS从入门到放弃(十五)、DCB差分码偏差
- Oracle Performance Analysis 3: introduction to tkprof
- Insert sort and Hill sort
- AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing
- 2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
- PVL EDI 项目案例
- [Chongqing Guangdong education] Tianjin urban construction university concrete structure design principle a reference
- 中国固态氧化物燃料电池技术进展与发展前景报告(2022版)
- Intelligent online customer service system source code Gofly development log - 2 Develop command line applications
猜你喜欢
GPS从入门到放弃(十二)、 多普勒定速
zabbix 代理服务器 与 zabbix-snmp 监控
Search element topic (DFS)
Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode
[Yu Yue education] higher mathematics of Nanchang University (2) reference materials
GPS from entry to abandonment (XIV), ionospheric delay
[线性代数] 1.3 n阶行列式
bat脚本学习(一)
小常识:保险中的“保全”是什么?
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
随机推荐
About the professional ethics of programmers, let's talk about it from the way of craftsmanship and neatness
zabbix 代理服务器 与 zabbix-snmp 监控
Four data streams of grpc
Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
第4章:再谈类的加载器
LeetCode刷题(十一)——顺序刷题51至55
GPS from getting started to giving up (12), Doppler constant speed
Shell product written examination related
A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely
Management background --3, modify classification
Realization of epoll reactor model
GPS from getting started to giving up (XI), differential GPS
QT | UDP broadcast communication, simple use case
Mongodb (III) - CRUD
数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据
[sciter]: encapsulate the notification bar component based on sciter
Unity3D学习笔记6——GPU实例化(1)
Leetcode learning records (starting from the novice village, you can't kill out of the novice Village) ---1
PVL EDI 项目案例
Kohana 数据库