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.
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
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
The other side will receive hello
Frequently Asked Questions
- 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
After the change
- 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 *
- Or the serial port is not opened (shell debugging serial port needs to be closed): sudo raspi-config Select Interface Options
NO before YES; Restart:
- 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: