thotro / arduino-dw1000

A library that offers functionality to use Decawave's DW1000 chips/modules with Arduino.
Apache License 2.0
516 stars 288 forks source link

DW1000Ranging_TAG nothing recieve #233

Open Maxai2 opened 6 years ago

Maxai2 commented 6 years ago

Hi everybody!

We have Decawave TREK1000 (3 Anchors and 1 Tag). Tag has connected to Arduino Uno through SPI connection.

Decawave(SPI) Arduino Uno(SPI) Pin 1(Not Connected) X Pin 2(GND) GND Pin 3(WAKEUP) X Pin 4(IRQ) D2 Pin 5(MISO) D12 Pin 6(Not Connected) X Pin 7(SCK) D13 Pin 8(MOSI) D11 Pin 9(CSn) D10 Pin 10(GND) GND

There are 3 switches on board(S1, S2, S3). S2(ARM chip) has been set on off position.

S3-1(ARM GPIO PA0 pin) off S3-2(LED0) on S3-3(GPIO 5 pin) off S3-4(GPIO 6 pin) off

What do you want?

Describe the problem

Not receive any needed information.

Describe your environment

Affected file(s) or example(s):

DW1000Ranging_Tag

Observed Results:

device address: 7D:00:22:EA:82:60:3B:9C

TAG

Expected Results:

from: Range: m RX power: dBm

Relevant Code:

/**
 * 
 * @todo
 *  - move strings to flash (less RAM consumption)
 *  - fix deprecated convertation form string to char* startAsTag
 *  - give example description
 */
#include <SPI.h>
#include "DW1000Ranging.h"

// connection pins
const uint8_t PIN_RST = 9; // reset pin
const uint8_t PIN_IRQ = 2; // irq pin
const uint8_t PIN_SS = SS; // spi select pin

void setup() {
  Serial.begin(115200);
  delay(1000);
  //init the configuration
  DW1000Ranging.initCommunication(PIN_RST, PIN_SS, PIN_IRQ); //Reset, CS, IRQ pin
  //define the sketch as anchor. It will be great to dynamically change the type of module
  DW1000Ranging.attachNewRange(newRange);
  DW1000Ranging.attachNewDevice(newDevice);
  DW1000Ranging.attachInactiveDevice(inactiveDevice);
  //Enable the filter to smooth the distance
  //DW1000Ranging.useRangeFilter(true);

  //we start the module as a tag
  DW1000Ranging.startAsTag("7D:00:22:EA:82:60:3B:9C", DW1000.MODE_LONGDATA_RANGE_ACCURACY);
}

void loop() {
  DW1000Ranging.loop();
}

void newRange() {
  Serial.print("from: "); Serial.print(DW1000Ranging.getDistantDevice()->getShortAddress(), HEX);
  Serial.print("\t Range: "); Serial.print(DW1000Ranging.getDistantDevice()->getRange()); Serial.print(" m");
  Serial.print("\t RX power: "); Serial.print(DW1000Ranging.getDistantDevice()->getRXPower()); Serial.println(" dBm");
}

void newDevice(DW1000Device* device) {
  Serial.print("ranging init; 1 device added ! -> ");
  Serial.print(" short:");
  Serial.println(device->getShortAddress(), HEX);
}

void inactiveDevice(DW1000Device* device) {
  Serial.print("delete inactive device: ");
  Serial.println(device->getShortAddress(), HEX);
}
  // TODO(you): code here to reproduce the problem
Hasan1612 commented 6 years ago

I have an issue occurs the following notification. Any suggestion about it? Highly appreciated.

I:\NEW PROJECT\MYCODE\arduino-dw1000-master\examples\DW1000Ranging_TAG\DW1000Ranging_TAG.ino: In function 'void setup()':

I:\NEW PROJECT\MYCODE\arduino-dw1000-master\examples\DW1000Ranging_TAG\DW1000Ranging_TAG.ino:29:90: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

DW1000Ranging.startAsTag("7D:00:22:EA:82:60:3B:9C", DW1000.MODE_LONGDATA_RANGE_ACCURACY);