Rak 5010 Getting Sensor Data

Issue: Software


Details: Hey guys I am actually trying to write a function in my main in user_app.c file to read the sensor data however everytime I read the data, the data values for all the sensor datas is being shown as 0 like for temp its showing 0, for humidity 0, for battery 0V and so on. So I am not sure as to was it going on?


You can refer to this part of code in line 498:

Actually @nero I am doing this only but its still showing 0 for all sensor values in user_app.c file however if I try to do the same thing in at.c file using an at command it works. So I am not too sure. Could you maybe help me further?

Maybe you can download our last 5010 firmware:

And send at+get_config=device:status to check the hardware normal or not.
If it is ok, can you post your code? We can check in details.

Hi @nero, it still hasn’t worked. Here is the link to the zip file of my code. APN is defined as a macro to enter the AP, IP as a macro for the IP address and the PORT as a macro for the Port number.


Is our firmware ok? I want to exclude the problem of hardware.

Yes @nero, the firmware is ok and the hardware is also ok because when I do the at command for device status the sensor data information is correct

OK, it must be the code problem. Can you send your code to [email protected]. Because the net problem ,I can’t download it. Besides, please concentrate your issues in one topic. It is really difficult to follow. As for rui_device_sleep(1), it will power off bg96 and sensors. rui_device_sleep(0) will wake them.

Hey @nero I will try to post all the questions in a single topic next time. Sorry about that and I have emailed you the code.

OK, have got your code. I will test later.