C Generic API Issues

Hi ,

I am trying to run the example program provided for RPi generic APIs . However I am getting some issues .
As per the output , it looks like UART initialization is done , however Configuration failed , hence no location or anchor data is received.
Can anyone help to resolve this issue . Do I need to do a dwm_reset before starting ?

Program I am trying to run -" dwm1001_host_api/examples/ex1_TWR_2Hosts/tag/tag_cfg " after changing the Makefile to “INTERFACE_NUMBER = 0”

root@raspberrypi:/home/pi/decawave/dwm1001_host_api/examples/ex1_TWR_2Hosts/tag# ./tag_cfg
dwm_init(): dev0
Opening log file log.txt
LMH_UARTRX_Init()…
UART: Init start.
UART: Init done.
Setting to tag: dev0.
dwm_cfg_tag_set(&cfg_tag): dev0.

TIMED OUT <<<<<< UART: Received 0 bytes, expected 3 bytes, timed out in 1000 ms
UART: Received length=0
Wait 2s for node to reset.
TIMED OUT <<<<<< UART: Received 0 bytes, expected 7 bytes, timed out in 1000 ms
UART: Received length=0
Comparing set vs. get: dev0.
low_power_en cfg_tag=0 : cfg_node=166
meas_mode cfg_tag=0 : cfg_node=1
loc_engine_en cfg_tag=1 : cfg_node=36
common.led_en cfg_tag=1 : cfg_node=214
common.ble_en cfg_tag=1 : cfg_node=182
common.uwb_mode cfg_tag=2 : cfg_node=2109
common.fw_update_en cfg_tag=0 : cfg_node=92

Configuration failed.

Wait 1000 ms…
dwm_loc_get(&loc):
Wait 1000 ms…
dwm_loc_get(&loc):
Wait 1000 ms…
dwm_loc_get(&loc):
Wait 1000 ms…
^C

Didnt work for me , can you please share the complete setting .
Just checked with UART Shell mode , lep and les are not giving any output .
Think some setting I need to tweak to make it work .

you can paste you cmdline.txt here, i try modify for you

This is the original text

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=d1c36e1b-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

dwc_otg.lpm_enable=0 root=PARTUUID=d1c36e1b-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

1 Like

Did the Changes and still getting same error -

Is there anything else I need to do by initializing COM PORT or something , All i did was take source code from example , added bcm2835 library and compiled and ran .

root@raspberrypi:/home/pi/decawave/dwm1001_host_api/examples/ex1_TWR_2Hosts/tag# cat /boot/cmdline.txt dwc_otg.lpm_enable=0 root=PARTUUID=d1c36e1b-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

[code]root@raspberrypi:/home/pi/decawave/dwm1001_host_api/examples/ex1_TWR_2Hosts/tag# ./tag_cfg
dwm_init(): dev0
Opening log file log.txt
LMH_UARTRX_Init()…
UART: Init start.
UART: Init done.
Wait 2s for node to reset.
Setting to tag: dev0.
dwm_cfg_tag_set(&cfg_tag): dev0.

TIMED OUT <<<<<< UART: Received 0 bytes, expected 3 bytes, timed out in 1000 ms
UART: Received length=0
Wait 2s for node to reset.
TIMED OUT <<<<<< UART: Received 0 bytes, expected 7 bytes, timed out in 1000 ms
UART: Received length=0
Comparing set vs. get: dev0.
low_power_en cfg_tag=0 : cfg_node=246
meas_mode cfg_tag=0 : cfg_node=1
loc_engine_en cfg_tag=1 : cfg_node=36
common.led_en cfg_tag=1 : cfg_node=237
common.ble_en cfg_tag=1 : cfg_node=38
common.uwb_mode cfg_tag=2 : cfg_node=2109
common.fw_update_en cfg_tag=0 : cfg_node=92

Configuration failed.

Wait 1000 ms…
dwm_loc_get(&loc):
Wait 1000 ms…
dwm_loc_get(&loc):
^C
[/code]

  1. Followed the user manual document to check UART shell mode in windows and commands are working .
    However with raspberry pi , ( les,lep,lec) commands are not working but the ut, apg commands are working .
    I have connected a tag to PI and there are couple of anchors which are in direct LOS for the tag .

Am i missing some setting in PI ?

[code]root@raspberrypi:/home/pi# minicom -D /dev/ttyACM0 -b 115200

Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Apr 22 2017, 09:14:19.
Port /dev/ttyACM0, 13:39:53

Press CTRL-A Z for help on special keys

DWM1001 TWR Real Time Location System

Copyright : 2016-2017 LEAPS and Decawave
License : Please visit https://decawave.com/dwm1001_license
Compiled : Nov 29 2017 13:35:02

Help : ? or help

dwm> ut
[001569.450 INF] uptime: 00:26:09.450 0 days (1569450 ms)
dwm> les
dwm> lep
dwm> lec
dwm> apg
x:0 y:0 z:0 qf:0
dwm>

[/code]

I

Finally I was able to resolve the Issue ,

I had to change the file “dwm1001_host_api/platform/rpi/hal/hal_uart.c”

< //uart0_filestream = open("/dev/serial0", O_RDWR | O_NOCTTY | O_NDELAY); //Open in non blocking read/write mode < uart0_filestream = open("/dev/ttyACM0", O_RDWR | O_NOCTTY | O_NDELAY); //Open in non blocking read/write mode

Ideally /dev/serial0 should have been picked up ,but changing the hal_uart.c and compiling resolved issue.

Yves / Decawave team ,

1.Does the user need to change any setting in PI to get API working without above mentioned changes ?

[code]####################################################

TARGET

0: Raspberry-Pi

1: else

TARGET = 1

After Changing the TARGET = 1 in "dwm1001_host_api/examples/ex1_TWR_2Hosts/tag/Makefile " . Build fails with error

root@raspberrypi:/home/pi/decawave/dwm1001_host_api/examples/ex1_TWR_2Hosts/tag# make

make: *** No rule to make target ‘/hal.c’, needed by ‘tag_cfg’. Stop.
[/code]

When checked I found that HAL_DIR is initialized only when the target is Raspberry pi , for any other host , build will fail.

ifeq ($(TARGET),0) cc = $(ARM_CC) HAL_DIR = $(PROJ_DIR)/platform/rpi/hal endif

Is the code tested for other hosts and if so what all hosts it has been tested for ?