Raspberry 3 and dwm1001

Hello guys, I’m going to try to connect my raspberry 3 pi and one uwb antenna from mdek1001 kit.
My final goal is a little bit difficult to explain now here, but I would like to start step by step.
So, I bought the header connector with 2x13 pins (it will arrive tomorrow) and currently I’m downloading the virtual machine for the development environment.

Actually I don’t need in taking any kind of measurements. My first goal is to implement the following use case.

Suppose to have two devices: raspberry+uwb and another uwb.
The first one just sends a custom value taken from the raspberry main program.
The second one, has only to receive the value sent by the first device.
In other words, i would like to run a program from raspberry in which it sends a certain value through the uwb module to the other uwb receiver antenna.

Could you give me hints?

Thanks in advance!

1 Like

Hi Bettis,

It sounds that for now your main interest is to use UWB to transfer data. It is possible and actually fairly easy.

I would recommend you to start from our simple example on https://github.com/Decawave/dwm1001-examples

These examples are implementing TWR between two devices. You can increase the payload of the frame and use it to send data over UWB.

Maybe take a look at the DW1000 api and user manual which will be full of information/example regarding data transfer and paylod.


Thank you,

So, are you saying that I can use the code of the old examples provided for the previous antennas DWM1000?
You understood my goal, in practice I do not need to exploit measurements, rather to send and receive simple numbers.


Dear Yves,
I have currently implemented the C-code in order to send data from TX to RX starting from the DWM1000 examples.
It actually works but the sent message is encapsulated (hard-coded) inside the TX.
I moreover soldered the TX to a Raspberry 3 (I mean, I soldered the dwm1001 to a 26-pin header!). [see attached image]

So, at this point I would like to go to the next step.
For example, a nice thing could be execute a python script from the Raspberry and determine a value to send through SPI (I suppose) to the TX.
Finally, TX (coded in C) can read from SPI and send the message to RX with the proper new message.

The question is: is it possible to implement that?
Only this I need to know… nothing else.

Thanks again!

Hi Betis,

Yes I don’t see why such an application would not work. There is a bit of software development, for example you may want to use an RTOS and have a task for the spi interface and the UWB TX/RX.

Let me know how it goes,
Thank you,

Just now I’m trying to do that… step by step, but I don’t manage to reach my goal.
For instance, I entered to Raspberry via ssh and ran the following statement:

# Write binary 1, 2 and 3 echo -ne "\x01\x02\x03" > /dev/spidev0.0

Then I wrote the following C code to one UWB device:

[code]volatile uint8 data[20];

dwt_readfromdevice(0x21, 0, 20, &data[0]);[/code]

In debug mode I’m able only to see strange characters…

Please, give me an example on how to send messages from Raspberry to UWB device via SPI.

Hi Yves Bernard and Betis,

Would you please show me an example code for sending a message from RPi to DWM1001, a corresponding code at DWM1001 to get that message?

Thank you so much,

Hello RyanVuHa,
in DWM1001_DWM1001-DEV_MDEK1001_Sources_and_Docs_v8\DWM1001\Source_Code, the DWM1001_host_api folder, has examples to compile in the raspeberry pi.

Best Regards