How to properly add a task to LoRaWAN_End_Node
- September 9, 2022
- 2 replies
- 1539 views
Hello everyone,
Situation: Currently, I am trying to intergrate BME688 to the board Nucleo-WL55JC1. To be specific, on the board, I downloaded and ran the LoRaWAN_End_Node example. Then, instead of obtaining temperature/humidity/pressure from a function from the example (I assumed the original data obtaining function is EnvSensors_Read(&sensor_data) in lora_app.c), I want to use the sensor BME688 to give me those measurement.
What I did: I initialized the BME688 sensor as well as set up some constrains for it after the MX_LoRaWAN_Init(). Then I set the BME688 data obtaining process as a function and register it as a task. The task has an equal priority as the SendTxData() function.
Result: the program stopped right at the first measurement.
Question:
- Was my procedure of intergrating BME688 into LoRaWAN_End_Node example correct or I missed something else? I assume the fault was when I set the BME688 data obtaining process with an equal priority as SendTxData()?
- If I was wrong at that part, what else should I consider when adding BME688?
P/s: this post related to this post (https://community.st.com/s/feed/0D53W00001n9fiGSAQ).
I attached main.c and lora_app.c below.
I hope to have your opinions on this question.
Thank you, Huy Nguyen.
