pedestrian0423 / DW1000_Raspi_Python_library

Python library for the DWM1000 ultra wide band modules
19 stars 24 forks source link

Question:RangingTag #1

Closed abhatikar closed 2 years ago

abhatikar commented 6 years ago

Hi,

Is there an Arduino compatible code which can work with RangingAnchor.py in the repository. I was not able get the one available working. Could someone please help ?

Thanks

pedestrian0423 commented 6 years ago

Hello, This code is for Raspberry Pi and the single board computers (SBCs) which support RPi.GPIO package.

If you want arduino compatible code, I recommend following repository. https://github.com/thotro/arduino-dw1000

Or if you want using this code for Raspberry or SBCs, please let us know your hardware configuration and error message.

abhatikar commented 6 years ago

Sure, actually let me tell you what i am trying. I am trying the ranging anchor and tag on 2 pi boards. It works. But i want to use arduino which will now act as tag (https://github.com/thotro/arduino-dw1000) and pi as the anchor (this library). But this is not working as expected. What could I be missing?

pedestrian0423 commented 6 years ago

Actually, operating procedure of this library is different from the Arduino library. And I forked this library from another user and only considered to use the DW1000 on the Raspberry Pi. I think your approach is very important to this library. I'll add this issue to the milestone.

Or your issue might relate to hardware (current supply). Since the current supply of GPIO(including Raspberry Pi and Arduino), DW1000 module cannot work properly when only powered by Raspberry Pi and Arduino.

abhatikar commented 6 years ago

I am using raspbery pi zero and particle photon. To power the chip i am using 3.3v. I am not sure what you meant in the earlier comment.

pedestrian0423 commented 6 years ago

About hardware

By DW1000 datasheet link, the module needs 140 or 160 mA for TX and RX. However, Particle photon and Raspberry Pi cannot supply the required current solely.

Therefore, you might need independent power supply for DW1000. I used Wayne's breakout board link to use DW1000 with Arduino Pro Mini.

However, the module is designed for Arduino and does not fit for Raspberry Pi. I designed simple breakout board for raspberry pi and examine the board. I'll upload the board design when I finished the test.

About software

This code is only designed for using DW1000 module with the Raspberry Pi. And the design or structure does not fits to work with Arduino. Therefore, to use this library with Arduino, I (or we) have to match the message protocol (including packet structure) with each other (Arduino and Raspberry). Since your question is very attractive to me, I'll plan to redesign this library.

siddharthramesh commented 6 years ago

Hey , So im trying to run this library by thingtype on an odroid xu4 board. On the header files i have completely ported the Rpi depended APIs and header files ( ex - Rpi.GPIO to wiringPi (harkernel) ). The issue iam facing right now is the SPI communication is not taking place. There is absolutely no data exchange between the odroid XU4 and the DW1000 module. screenshot from 2018-03-16 12 23 30 Can you help me figure out what could possible the issue here?

pedestrian0423 commented 6 years ago

Actually, Voltage level of DW1000's SPI is 3.3 V However, the voltage level of Odroid XU4's SPI is 1.8 V

Therefore, you should shift the voltage level of Odroid XU4's SPI port with level shifter. I suggest two solutions.

  1. Using level shifter IC to adjust the voltage of XU4's SPI port
  2. Buy and using XU4 shifter shield (http://www.hardkernel.com/main/products/prdt_info.php?g_code=G143556253995)

Also, default GPIO port of Raspberry Pi cannot provide sufficient current to the DW1000 module (I think Odroid XU4 is also not provide sufficient current) Therefore, you should provide external power (with 3.3V) to DW1000 module. If you only provide power from GPIO port, message transmission might not be performed due to current shortage.

siddharthramesh commented 6 years ago

Hey , I have used a shield for my setup. And if you dont mind can we continue this conversation on mail. This is my email id sidramesh95@gmail.com my setup img_20180316_131259_hdr