0
点赞
收藏
分享

微信扫一扫

两个Lora 模块通信

斗米 2023-04-28 阅读 52


Software preparation

https://www.waveshare.net/w/upload/6/68/SX126X_LoRa_HAT_Code.zip

Hardware connection

To remove M1 and M2, adjust the cap in B.

两个Lora 模块通信_sed


Communication steps

After running the program, Raspberry Pi A will not move after running the program; Raspberry Pi B blindly presses S, please wait patiently for 10S-20S to receive temperature and other data

两个Lora 模块通信_ide_02

If Raspberry Pi A presses I, you need to enter parameters such as address and frequency, for example, the default of the l routine:

0,868,hello

两个Lora 模块通信_Code_03

The other side will receive hello

Frequently Asked Questions

  1. The default frequency band of the sample program is 868. Is it OK to use the 433 frequency band? It can also be used, but the data of the 868 frequency band will be printed. It is recommended to change the corresponding code in the main.py file to the 433 frequency band, as shown in the following figure: Before the change

两个Lora 模块通信_ide_04

After the change

两个Lora 模块通信_物联网_05


  1. Why did you not report an error after running the program, but did not print any information? Generally, it is a serial port setting problem. The default serial port used in the routine is ttyS0. If the strawberry pie uses other serial ports such as ttyAMA0, it can be confirmed with the following instructions: ls -l /dev/serial *

两个Lora 模块通信_Code_06


  1. Or the serial port is not opened (shell debugging serial port needs to be closed): sudo raspi-config Select Interface Options

两个Lora 模块通信_ide_07


NO before YES; Restart:

两个Lora 模块通信_ide_08


  1. What if you have used it on a windows computer and you can't get a strawberry pie?

The tuning cap used by the computer is different from the strawberry pie. Please change it to the tuning cap connection of the strawberry pie. See the starting picture for details;

In addition, if the computer may change the address of the module, it is recommended to use the computer configuration software to restore the module to factory settings, as shown in the following figure:

两个Lora 模块通信_sed_09


举报

相关推荐

0 条评论