arduino-dw1000 icon indicating copy to clipboard operation
arduino-dw1000 copied to clipboard

Does this code work on an ESP8266 or ESP32 programmed w/ Arduino IDE?

Open nodemand opened this issue 8 years ago • 37 comments

I'm curious if anyone has tested this code on an ESP8266 or ESP32 connected to a DWM1000 module. The extra processing power of these modules combined with Wi-Fi (and Bluetooth on the ESP32) might make for a great anchor and/or tag being able to calculate ranges and such on its own and connect to a central server through Wi-Fi.

nodemand avatar Jan 18 '17 08:01 nodemand

I tried to port it. Changes are in the actual library. But I never got it stable on a Wemos D1 mini. So you have to invest time for debug and code changes.

Rotzbua avatar Jan 18 '17 12:01 Rotzbua

Thanx for your reply! May I ask what problems did you encounter? Where they the common ESP8266 issues like WDT reset and such?

nodemand avatar Jan 19 '17 12:01 nodemand

WDT reset with an older ESP-SDK, with newer not but randomly the dwm1000 drop connection or did not start up. Maybe my hardware/connection was not good.

Another issue on this library mention that they changed the spi-speed, but I never tried.

Rotzbua avatar Jan 19 '17 13:01 Rotzbua

Ok thank you!

nodemand avatar Jan 19 '17 13:01 nodemand

I tried and tried to get the DWM1000 to work with the ESP8266 and it worked for brief periods. The ESP8266 kept rebooting at random times. I finally broke down and bought the SparkFun ESP32 Thing and connect pins as follows:

const uint8_t PIN_SCK = 18; const uint8_t PIN_MOSI = 23; const uint8_t PIN_MISO = 19; const uint8_t PIN_SS = 2; const uint8_t PIN_RST = 15; const uint8_t PIN_IRQ = 17;

I no longer have issues with the ESP32, but my connection using wires to the DMW1000 is flaky. I just created some new circuit boards and will mount the DMW1000 and the ESP32 WROOOM-32 on the same board (antennas facing away from each other). The ESP32 runs much faster and has more memory than any arduino. Hope this is a good combination.

andrespineda avatar Mar 06 '17 06:03 andrespineda

@andrespineda So in conclusion it works with a esp8266?

Rotzbua avatar Apr 26 '17 11:04 Rotzbua

I could never get the DWM1000 to work on ESP8266; the ESP8266 keeps crashing every few seconds. The ESP32 is very stable with both the DWM1000 and Wifi. Eventually, I moved away from this code and used the C code provided by Decawave as it provides more detailed functionality.

andrespineda avatar Apr 26 '17 17:04 andrespineda

I can confirm that the DWM1000 works well with the ESP8266. The system is very stable but does require good power, which I believe is the cause of 99% of the reset issues people generally report. I use a 1-A regulator and make sure that the input voltage is high enough to keep a steady 3.3V out even with current spikes.

aacton avatar Apr 26 '17 17:04 aacton

On ESP8266 you need a 'delay(1)' (ESP-chip will do some 'own' things then) in loop() to avoid WDT resets. This works for me but for 'range'-values I always get random numbers - some with neg sign. No idea.

Oli-M avatar Jun 22 '17 13:06 Oli-M

@Oli-M Hi, Can you please let me know wiring for NodeMCU. as I am trying to connect dwm1000 but receiving image

also did you used power from nodemcu or external power?

Any changes in library code to make it work? Thanks

khawajamechatronics avatar Jul 03 '17 11:07 khawajamechatronics

This works for me:

Wiring DWM->NodeMCU GPIO-#:

SPI: 20 (CLK), 19 (MISO), 18 (MOIS), 17 (CSn) -> 14 (CLK), 12 (MISO), 13 (MOSI), 15 (SS) RST: 2 (RSTn) -> 5 IRQ: 22 (IRQ) -> 4 PWR: 7 (VDD3.3) -> 3.3V
GND: 8 (VSS) -> GND

NodeMCU: USB-powered max. 1A source. +- 300mA max measured. WiFi.mode(WIFI_OFF); inserted top of setup() - no other changes to src.
Use short wiring and proper connections - <15cm jumper wire are ok. Use DW1000.begin(PIN_IRQ, PIN_RST); // dont' forget RST! SPI-connection-success if Device ID comes with 'DECA1'. RangingTag & RangingAnchor are working OK with stable ranges, but only 1 to 1; any 2nd anchor is showing wrong range-values. DW1000Ranging-Examples are all showing wrong and permanently changing random ranges.

Hope you'll have success...

Oli.

Oli-M avatar Jul 03 '17 12:07 Oli-M

@andrespineda Hi can you provide me the code and the library which is working with ESP32+DWM1000? Is it able to build a network includes of 3 anchors + 1 tag using ESP32+DWM1000?

AnhDongNguyen avatar Jul 07 '17 17:07 AnhDongNguyen

@Oli-M can you provide a sample code please?

hdineth avatar Aug 03 '17 00:08 hdineth

hi can i have a sample code please

rahulbhagat8 avatar Aug 03 '17 09:08 rahulbhagat8

I used sucessfully RangingAnchor and RangingTag from 'here' in original with RST and IRQ pin changed to GPIO-# 5 and 4. (ESP8266).

Oli-M avatar Aug 03 '17 11:08 Oli-M

Hi Oli-M, i am a hardware guy i don't have much idea about coding. can I have your code i am making it for my college project

rahulbhagat8 avatar Aug 03 '17 12:08 rahulbhagat8

@Oli-M can you please make sure about pin connection with nodemcu, i have that pin, do i need any changes in code and api . also i have doubt about rstn pin, u said rst pin in dw1000 is 2, but in module it is 3rd pin, 2 nd pin is wakeup,so where shuld i connect.

SIVAComtustec avatar Aug 12 '17 05:08 SIVAComtustec

Hi @Oli-M

I solved the issue by adding a capacitor near power pins. Unfortunately its still not reliable as it hits WDT Resets a lot.

Is there any other ARM based board that can work smoothly with this library?

khawajamechatronics avatar Aug 28 '17 04:08 khawajamechatronics

@SIVAComtustec Sorry - RST is Pin 3 on DWM. Use this. @khawajamechatronics I had trouble using ESP8266 and DWM1000 connected with (short) jumperwires. I now made a pcb with ESP, DWM and USB 5V to 3.3V DC, some capacitors - everything works fine. Error is about 50cm...1m (everytime more than real) on starting, getting better to 20...50cm after 2..3 sec. You can calibrate chip on antenna-delay-time by cmd - or - what I do - subtract error against 'mechanical' measure as constant. Sure it's better to calculate errors 'away' by some algorithms/statistics I have to find out. Next I'll check WIFI (now OFF) and com to a cloud service. I'm hopeful ESP8266&DWM would be a nice pair for this task.

Oli-M avatar Aug 28 '17 10:08 Oli-M

'class SPIClass' has no member named 'usingInterrupt' i get this error with the esp32

gabdsg avatar Sep 18 '17 21:09 gabdsg

Hi,

I was wondering if anybody made the DWM1000 work with WeMos D1 Mini. I am using the DWM1000 Wayne breakout board and I have my connections as follows:

RST - RST 3.3v - External 3.3v LM2596 1A GND - GND IRQ - D1 (330 Ohm in parallel to ground) CLK - D5 MISO - D6 MOSI - D7 CS - D8

I am trying to run the basic connectivity test on the esp8266. But it keeps getting resetting. Any pointers please?

ets Jan  8 2013,rst cause:2, boot mode:(7,6)

waiting for host

Thanks S

werty37 avatar Sep 26 '17 17:09 werty37

Add delay or yield, just random everywhere anh for optimize , slowly tune the delay shorter, but neh, getting it works is amazing af already XD On 27 Sep 2017 00:47, "werty37" [email protected] wrote:

Hi,

I was wondering if anybody made the DWM1000 work with WeMos D1 Mini. I am using the DWM1000 Wayne breakout board and I have my connections as follows:

RST - RST 3.3v - External 3.3v LM2596 1A GND - GND IRQ - D1 (330 Ohm in parallel to ground) CLK - D5 MISO - D6 MOSI - D7 CS - D8

I am trying to run the basic connectivity test on the esp8266. But it keeps getting resetting. Any pointers please?

ets Jan 8 2013,rst cause:2, boot mode:(7,6)

waiting for host

Thanks S

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thotro/arduino-dw1000/issues/156#issuecomment-332279289, or mute the thread https://github.com/notifications/unsubscribe-auth/AVt0w1iSJQhSMg2D9HcZ8gyQoTpX78Vtks5smTicgaJpZM4LmnfG .

curlyz avatar Sep 26 '17 20:09 curlyz

Hi @curlyz

Thank you. I will give it a shot. It would be of help if you can provide the pin mapping of WeMos D1 with the DWM1000.

Cheers S

werty37 avatar Sep 26 '17 20:09 werty37

Hi,

I can confirm that ESP8266 WeMos D1 Mini works with the DWM1000. I powered the esp and dwm with LM2596. I was able to run the basic connectivity and the two way ranging examples. I will create a wiki with the pin mappings soon.

Cheers S

werty37 avatar Sep 27 '17 21:09 werty37

Here are the pin mappings. I am using Wemos D1 Mini and Wayne DWM1000 Adapter.

DWM1000 Adapter - ESP8266 WeMos D1 RST - D2 IRQ - D1 CLK - D5 MISO - D6 MOSI - D7 CS - D8

Add a 10K resistor between IRQ and GND.

Here is source code mappings for Wemos D1 Mini. This might change depending on the type of ESP you are using.

// connection pins
const uint8_t PIN_RST = D2; // reset pin
const uint8_t PIN_IRQ = D1; // irq pin
const uint8_t PIN_SS = D8; // spi select pin

Hope this helps.

werty37 avatar Jan 01 '18 12:01 werty37

I tried and tried to get the DWM1000 to work with the ESP8266 and it worked for brief periods. The ESP8266 kept rebooting at random times. I finally broke down and bought the SparkFun ESP32 Thing and connect pins as follows:

const uint8_t PIN_SCK = 18; const uint8_t PIN_MOSI = 23; const uint8_t PIN_MISO = 19; const uint8_t PIN_SS = 2; const uint8_t PIN_RST = 15; const uint8_t PIN_IRQ = 17;

I no longer have issues with the ESP32, but my connection using wires to the DMW1000 is flaky. I just created some new circuit boards and will mount the DMW1000 and the ESP32 WROOOM-32 on the same board (antennas facing away from each other). The ESP32 runs much faster and has more memory than any arduino. Hope this is a good combination.

@andrespineda it shows esp modules dnt support can u help???

jat1n avatar Sep 14 '18 05:09 jat1n

Hello Guys i just want to embark on this project Nodemcu with DWM1000 One thing i learned from this post is that its possible but i have a few question

  1. is it possible to store the output of the DWM1000 from the serial monitor to an sd card or
  2. will the Nodemcu wifi work at the same time with the DWM1000 so i can just send the data to database and
  3. am trying to make indoor(DWM1000) and Outdoor(GPS) position tracking and some other voice recognition included which means i need the sd card to save the data when wifi is not available and when wifi is available all this information are sent to database. so i will like to know if this is all possible with the nodemcu or not. if not can you suggest another MCU capable of this. Any suggestion is appreciated.

regards A.

hazee007 avatar Oct 17 '18 11:10 hazee007

I could never get the DWM1000 to work on ESP8266; the ESP8266 keeps crashing every few seconds. The ESP32 is very stable with both the DWM1000 and Wifi. Eventually, I moved away from this code and used the C code provided by Decawave as it provides more detailed functionality. @andrespineda Can you provide link to this code(decawave code for dwm1000) or any newer version to it if available.

Yashvardhan-A avatar Sep 11 '21 20:09 Yashvardhan-A

Attached is some old code that worked for me on the ESP32. I could never get the ESP8266 to work reliably.

Best, Andres

On Sat, Sep 11, 2021 at 1:47 PM Yashvardhan Agarwal < @.***> wrote:

I could never get the DWM1000 to work on ESP8266; the ESP8266 keeps crashing every few seconds. The ESP32 is very stable with both the DWM1000 and Wifi. Eventually, I moved away from this code and used the C code provided by Decawave as it provides more detailed functionality. @andrespineda https://github.com/andrespineda Can you provide link to this code or any newer version to it if available.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/thotro/arduino-dw1000/issues/156#issuecomment-917477619, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWGEZRNX3HNY62KIKOQZGLUBO56FANCNFSM4C42O7DA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Best, Andres

andrespineda avatar Sep 12 '21 06:09 andrespineda

I tried and tried to get the DWM1000 to work with the ESP8266 and it worked for brief periods. The ESP8266 kept rebooting at random times. I finally broke down and bought the SparkFun ESP32 Thing and connect pins as follows:

const uint8_t PIN_SCK = 18; const uint8_t PIN_MOSI = 23; const uint8_t PIN_MISO = 19; const uint8_t PIN_SS = 2; const uint8_t PIN_RST = 15; const uint8_t PIN_IRQ = 17;

I no longer have issues with the ESP32, but my connection using wires to the DMW1000 is flaky. I just created some new circuit boards and will mount the DMW1000 and the ESP32 WROOOM-32 on the same board (antennas facing away from each other). The ESP32 runs much faster and has more memory than any arduino. Hope this is a good combination.

@andrespineda Thanks for sharing your experience with esp-32. I am also trying to use ESP32 board and could not get it to work with SPI. Can you tell me which SPI library did you use for ESP32 board?

kyuhyong avatar Oct 27 '21 05:10 kyuhyong