Python Mesh Positioning API - server side high level TWR and diagnostic

There is no such thing as UWB position, UWB only provide ToF and range, therefore experimenting with different positioning algorithms can now be offloaded to a server environment with high performance and where you can easily have a complex logic for deciding which nodes to range. Also in case the uwb ranging is not working, and your solution is based on a balck-box closed source, there’s no way to figure out what the problem is, therefore being able to perform diagnostic between any two nodes with the same firmware running the ranging function is important to keep a live status of your uwb network.
From these two ideas is born this mesh positioning framework.

This framework is developed as part of the Home Smart Mesh a non-profit organisation developing open source projects . It provides a python API on top of a simplemesh custom RF REST API. This REST API can generate a dynamic, request specific TDMA layer for performing a long sequence of basic uwb commands that wraps dwt_ functions.

The simplemesh communication layer is a permanent channel between all nodes and the server that can for example in one command set different nodes in different uwb channels config and roles independently of their current uwb channel.

Full description available on the project’s website

A dedicated forum category also exist for this project on the Home Smart Mesh forum, it can be used to answer questions, provide free support and discuss potential contributions. But for Qorvo/Decawave products related discussions please rather use decaforum.

Please note that although already functional and even a database has been generated with the python functions, this project is only few weeks old and still a work in progress so not for production purpose. The current state is collection of diagnostic and real time ranging data between any combination of nodes, but this data has not been exploited yet for positioning calculation which should be an easy thing on python or in case a high throughput is needed with a C++ A Core with a linux os like the raspberry pi, these are yet to be developed and the performance comparison yet to be performed.
If someone is interested to use or contribute, you can get in touch with me.


example of First Path analysis with numpy and matplotlib

link to the full jupyter notebook on github mesh_position/uwb_diag_file.ipynb at main · HomeSmartMesh/mesh_position · GitHub

added Channel Impulse Response retrieval wirelessly from any node.

  • call a ping between two nodes uwb_ping_diag(n_init,n_resp)
  • call a request to retrieve the cir accumulator uwb_cir("Resp"). ‘Resp’ is the target node friendly name.
  • convert with numpy frombuffer with type i2 and plot

Link to the python notebook mesh_position/uwb_cir.ipynb at main · HomeSmartMesh/mesh_position · GitHub

I’m not sure if the current implementation is correct, the first path index of 750.4375 is not always matching accumulator cir index.

So I still have the question, how to reconstruct the first path index and fpAmp1 from the accumulator data, otherwise how to cross check if they’re matching each other.
Something might have been wrong in the buffers manipulation

The dummy byte read is quite confusing