How to use LM35 temperature Sensor with DWM1001

Dear Decawave developers,

How do I use the LM35 temperature sensor with DWM1001 TAG and publish the value to Web-Manager?
I read the documentation (DWM1001 Firmware API & / User Guide),
but it’s still unclear to me,
by using C API for user applications, it seems that it is only able to show values / data to TeraTerm, but I need to send this data (UPLINK) to the web-manager,

I am confused by the many terms: shell command (not suitable for mobile tag. right?) - udi / uui /,
User Code C Application - dwm_i2c_read, dwm_gpio_cfg_output / input, dwm_usr_data_write
which one is the best suit? which combination should I choose?
could you share more complete steps, please?

thank you so much in advance,
Madrin.

2 Likes

Hi Madrin,

You will need to create a user application and recompile a new image.

To help you start there are a couple of examples in the firmware download package in this directory: DWM1001_DWM1001DEV_MDEK1001 Design Package/V9/DWM1001/Source_Code

I assume it will be SPI interface?

Thanks,
Ken

Hi Dwyer,

right now I use only GPIO_13 as the input signal, yes should be SPI, but the sensor is not final yet, maybe can be changed later.

yes, I should try the examples and try to learn from it first,

thank you,
Madrin

Hi Ken,

I already able to transmit/upload the data to Web-Manager and MQTT Interface as well.
but I face a problem about :


How to Decode/convert the data to be plain text, instead of HEX or Base64?


I would like to make a new dialog box in Web-Manager, so I can show the temperature data on that.

I’m also wondering, why the data between Web-Manager and MQTT are different?
in Web-Manager, the data based on HEX, and in MQTT Interface the data based on Base64.

this is the example of uploading data to Web-Manager/MQTT, I only send a single value ‘1’.

dwm_usr_data_write(1, 34, false);

and then I got this
Web-Manager:
image
MQTT interface:

Thank you in advance,
Febby Madrin.

i already solved the problem,

i can convert the HEX data on Web-Manager, by adding some line of code at …/js/drtls-manager.js using this script:

    function hex_to_ascii(str1)
     {
    	var hex  = str1.toString();
    	var str = '';
    	for (var n = 0; n < hex.length; n += 2) {
    		str += String.fromCharCode(parseInt(hex.substr(n, 2), 16));
    	}
    	return str;
     }

my code in dwm_simple.c:
dwm_usr_data_write("hi there!", 34, 1);

and then, i got this dialogbox:
image


but why ‘HELLO’ is still there?, this is my first trial of coding

Thankyou,
Febby Madrin

I’m not too familiar with the software you’re using but at a guess the issue is that you are setting the text “hi there!” (9 characters) and then telling it to send 34 characters. Everything after the text that you set is what happened to be in the rest of the output buffer at that time, normally it’ll be whatever the previous output was. Buffers aren’t normally erased after they have been used.

ohh I see,

Thank you Andy.