English |中文
[toc]
- Implementation of LoRaWAN application under Linux, supporting LoRaWAN 1.0.2 protocolv
- Supports multiple frequency bands
- Build with cmake and easily add your own application code
- Support graphical interface for parameter configuration
- First, you need to install make, camke, and gcc.
- Download the source code locally.
- Enter the build folder under the project and execute the following commands in sequence.
rm -rf *
cmake ..
make
- After the execution is completed, an executable file will be generated in the bin folder.
- After the execution is completed, an executable file will be generated in the bin folder.
make menuconfig
- Enter the bin folder of the project and execute the startup command.
./demo
- If you encounter Certificate verification failed, please refer to License Verification.
- Enter the folder of LoRaWAN executable files.
cd /home/lora/linux_lora/bin/
- Execution ./demo
Certificate verification failed
Please provide a correct license! For more information:
http://www.heltec.cn/search/
ChipID=303030303337
- Open the address connection to obtain the license, enter the ChipID of the product obtained in the previous step, and you can obtain the required license.
- Use the shell command make menuconfig to open the configuration interface, find the license input option, and enter the aforementioned license. Save and exit.
HelTec LoRaWAN license --->
|-- bin
|-- build
|-- functional_module
| |-- bmp180
| |-- data_conversion
| |-- fifo
| |-- hdc1080
| `-- lora
|-- hardware_driver
| |-- gpio
| |-- i2c
| `-- spi
|-- lib
`-- project
|-- config
`-- main
- AS923 region
- AU915 region
- CN470 region
- CN779 region
- EU433 region
- EU868 region
- KR920 region
- IN865 region
- US915 region
- US915_HYBRID region
- AU915 SB2 region
- AS923 AS1 region
- AS923 AS2 region
Taking bmp180 as an example
-
Add a new folder named bmp180 under the functional_module folder.
-
Add the following file in the bmp180 folder
bmp180.c
bmp180.h
CMakeLists.txt
README.md
-
Write source file and Header file content.
-
Write CMakeList.txt
aux_source_directory(. BMP180)
include_directories(${PROJECT_SOURCE_DIR}/hardware_driver/i2c)
link_directories(${PROJECT_SOURCE_DIR}/lib)
LINK_LIBRARIES(-lm)
add_library(bmp180 ${BMP180} )
target_link_libraries(bmp180 i2c )
target_include_directories(bmp180 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
-
Write a
README.md
instruction document. -
add in functional_module/CMakeLists.txt
add_subdirectory(bmp180)
-
Add bmp180 in the link library option of project/main/CMakeLists.txt
target_link_libraries(${PROJECT_NAME} fifo config lora hdc1080 bmp180 data_conversion)
-
Add your own Header file of bmp180 in main. c to call the bmp180 function.
-
Find the Kconfig file for the project and add it in the LORAWAN_APP_DATA menu bar
config BMP180_DATA bool "bmp180"
-
Add to the LORAWAN_DATA_SELECTION menu bar in project/config/config.ini
;BMP180_DATA=3
-
The name of this option needs to be consistent with the options in Kconfig, both being BMP180_DATA.
-
The value of this option needs to be matched with the option to prepare data in main.c, and its values are all equal to 3
typedef enum { fixed_data =0, mkfifo_data, hdc1080_data, bmp180_data }data_selection_num;
-
-
In project/config/kconfig_lib/configini_to_kconfig.sh's #Configure LoRaWAN upload data selection add
elif [ $DATA_SELECTION -eq 3 ];then echo "CONFIG_BMP180_DATA=y" >> $K_CONFIGFILE
- configini_to_kconfig.sh will synchronize the C configuration file with the graphical interface configuration file.
-
The bmp180 configuration option added this time does not require modifying the project/config/kconfig_lib/kconfig_to_configini.sh file, as the previous synchronization options have already matched bmp180.
- kconfig_to_configini.sh will synchronize the graphical interface configuration file to the C configuration file.
-
Add and read the config.ini file in project/main/main.c .
data_selection = iniparser_getint(ini,"LORAWAN_DATA_SELECTION:data_selection",-1);
-
Use make menuconfig to configure the bmp180 option and save it. At this point, the data_selection=3 is read in main.c.
-
After adding, you can implement relevant functions through options in man.c.
Thank you very much for joining! Raise an Issue or submit a Pull Request.
The standard Readme follows the Contributor Covenant code of conduct.
Thank you to the following people who participated in the project:
Luckybuyu 🎨 |
Aaron.Lee 💻 |