Gateway with dwm-daemon on Raspberry pi

Hello, I try to set up the gateway (listener bridge) for the PANS on my Raspberry pi. It is not working. It looks like there is no communication between the DWM1001 and the Raspberry pi. The web server and the MQTT server are working but no data come from the PANS network. I have this message from the dwm-daemon.log

Fri Apr 5 16:38:33 EDT 2019
Starting daemon dwm-daemon with command ‘/usr/local/bin/dwm-daemon’ and options ‘-c /etc/dwm1001/dwm1001.config -l /var/log/dwm-daemon.log’…

2019-04-05 16:38:34.015 INFO [408] [leaps::core::[email protected]] starting…
2019-04-05 16:38:34.028 ERROR [408] [leaps::core::[email protected]] write failed! error -1
2019-04-05 16:38:39.034 INFO [408] [leaps::core::[email protected]] stopping…

My questions are:
What is the meaning of this message?
What is the communication port that used the Raspberry pi to communicate with the dwm-1001?
Could you share with me the code of the dwm-daemon? It will be nice to understand well how the gateway work.

Thanks

+1 for me. I’m seeing the same issue and log entries.

Hello, I have a same issue as well. Cannot figure out why it did not work.

Hi All,

can you please provide more details about the issue?

  1. Which Raspberry hardware revision are you using? If possible please send a picture of the Raspberry with the DWM1001.
  2. Is the DWM1001 reflashed with the R2 binary?
  3. Which Raspberry Image are you using? The official one from the Release 2?
  4. How do you start the DWM Daemon? Manually or just restarted the Raspberry?
  5. Can you get the system working or it keeps failing like this?
  6. Can you enter the module shell using: minicom -D /dev/serial0 (and double enter)?
  7. Please send outputs of the commands on the failing system:
    1. lsmod
    2. ls -la /dev/dwm0
    3. ps ax | grep dwm

Thanks!
Cheers, TDK

Hi TDK,

Thank you for your response. Here are the answers to your questions.

Thanks,

Ben.

Which Raspberry hardware revision are you using? If possible please send a picture of the Raspberry with the DWM1001.
Raspberry Pi 3 Model B V1.2

Is the DWM1001 reflashed with the R2 binary?
yes, as you can see from the “si” command
[000542.280 INF] sys: fw2 fw_ver=x01030001 cfg_ver=x00010700
[000542.280 INF] uwb0: panid=xA4BD addr=xDECA55C8F000419F
[000542.290 INF] mode: bn (act,-)
[000542.290 INF] uwbmac: disconnected
[000542.290 INF] enc: off
[000542.300 INF] ble: addr=CC:89:A0:B9:90:A8

Which Raspberry Image are you using? The official one from the Release 2?
Yes, DRTLS_raspbian_R2.0.img

How do you start the DWM Daemon? Manually or just restarted the Raspberry?
The daemon seems to start automatically when the Pi boots. However, it then stops after a few seconds with the error below.
Issuing a “sudo service dwm1001 restart” restarts the daemon but it stops again with the same error in the log.

From dwm-daemon.log:
Fri Apr 12 09:17:06 UTC 2019
Starting daemon dwm-daemon with command ‘/usr/local/bin/dwm-daemon’ and options ‘-c /etc/dwm1001/dwm1001.config -l /var/log/dwm-daemon.log’…

2019-04-12 09:17:06.989 INFO [519] [leaps::core::[email protected]] starting…
2019-04-12 09:17:07.012 ERROR [519] [leaps::core::[email protected]] write failed! error -1
2019-04-12 09:17:12.014 INFO [519] [leaps::core::[email protected]] stopping…

Fri Apr 12 09:23:17 UTC 2019
Stopping daemon dwm-daemon…

Fri Apr 12 09:23:17 UTC 2019
Starting daemon dwm-daemon with command ‘/usr/local/bin/dwm-daemon’ and options ‘-c /etc/dwm1001/dwm1001.config -l /var/log/dwm-daemon.log’…

2019-04-12 09:23:18.002 INFO [913] [leaps::core::[email protected]] starting…
2019-04-12 09:23:18.005 ERROR [913] [leaps::core::[email protected]] write failed! error -1
2019-04-12 09:23:23.007 INFO [913] [leaps::core::[email protected]] stopping…

Can you get the system working or it keeps failing like this?
It has always failed like this since I set it up. Gateway shows in web application but no tags or anchors.

Can you enter the module shell using: minicom -D /dev/serial0 (and double enter)?
Yes, see some outputs here:

Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Apr 22 2017, 09:14:19.
Port /dev/serial0, 09:18:47

Press CTRL-A Z for help on special keys

[000542.280 INF] sys: fw2 fw_ver=x01030001 cfg_ver=x00010700
[000542.280 INF] uwb0: panid=xA4BD addr=xDECA55C8F000419F
[000542.290 INF] mode: bn (act,-)
[000542.290 INF] uwbmac: disconnected
[000542.290 INF] enc: off
[000542.300 INF] ble: addr=CC:89:A0:B9:90:A8
dwm>
dwm> la
[001101.680 INF] AN: cnt=6 seq=x08
[001101.680 INF] 0) id=DECA149CA6315412 seat=0 seens=203 rssi=-78
[001101.690 INF] 1) id=DECABDC348205013 seat=1 seens=195 rssi=-78
[001101.690 INF] 2) id=DECA2A90BC9082AC seat=2 seens=6 rssi=-79
[001101.700 INF] 3) id=DECAC8AB2AE28330 seat=3 seens=21 rssi=-79
[001101.710 INF] 4) id=DECAA63581B0599C seat=4 seens=117 rssi=-79
[001101.710 INF] 5) id=DECAD22BA6628F16 seat=5 seens=129 rssi=-79
[001101.720 INF]
dwm> lb
[001108.010 INF] BN: cnt=1 seq=x76
[001108.010 INF] 0) id=DECA55C8F000419F seat=1 seens=0 rssi=-127
[001108.020 INF]
dwm>

Please send outputs of the commands on the failing system:
lsmod
ls -la /dev/dwm0
ps ax | grep dwm

[email protected]:/var/log $ lsmod
Module Size Used by
fuse 110592 3
rfcomm 49152 4
bnep 20480 2
hci_uart 36864 1
btbcm 16384 1 hci_uart
serdev 20480 1 hci_uart
bluetooth 368640 29 hci_uart,bnep,btbcm,rfcomm
ecdh_generic 28672 1 bluetooth
evdev 24576 2
joydev 20480 0
hid_logitech_hidpp 36864 0
spidev 16384 0
binfmt_misc 20480 1
sg 28672 0
uas 24576 0
hid_logitech_dj 20480 0
brcmfmac 307200 0
brcmutil 16384 1 brcmfmac
cfg80211 573440 1 brcmfmac
rfkill 28672 6 bluetooth,cfg80211
snd_bcm2835 32768 1
snd_pcm 98304 1 snd_bcm2835
snd_timer 32768 1 snd_pcm
snd 69632 5 snd_timer,snd_bcm2835,snd_pcm
spi_bcm2835 16384 0
uio_pdrv_genirq 16384 0
uio 20480 1 uio_pdrv_genirq
fixed 16384 0
i2c_dev 16384 0
ip_tables 24576 0
x_tables 32768 1 ip_tables
ipv6 425984 53

[email protected]:/var/log $ ls -la /dev/dwm0
ls: cannot access ‘/dev/dwm0’: No such file or directory

[email protected]:/var/log $ ps ax | grep dwm
520 ? Sl 0:02 /usr/local/bin/dwm-proxy -c /etc/dwm1001/dwm1001-proxy.config
875 ? Sl 0:01 leafpad /home/pi/Desktop/dwm.txt
1376 pts/0 S+ 0:00 grep --color=auto dwm

Hi Ben,

thanks for your detailed feedback!

Can you please send outputs of these commands:

  1. ls -la /lib/modules/4.14.50-v7+/dwm.ko
  2. modinfo /lib/modules/4.14.50-v7+/dwm.ko
  3. cat /proc/iomem
  4. find /proc/device-tree/ -name “*spi*”
  5. uname -a
  6. cat /proc/cpuinfo
  7. insmod /lib/modules/4.14.50-v7+/dwm.ko
  8. dmesg

Thanks!
Cheers, TDK

Hi Ben,

on the picture some pins do not look like to be well soldered. Can you please check also that all the pins are well soldered?

Cheers,
TDK

Ha, clearly soldering is not my strength! While I attend to that, take a look at the following outputs.

output.txt (33.4 KB)

Thanks,

Ben.

Hi Ben,

thanks for the output file!

In the outputs I can see, that your Raspberry is running Kernel: 4.14.98-v7+
while the dwm.ko module is compiled for Kernel: 4.14.50-v7+
That’s the reason why the Kernel Module dwm.ko could not load. It provides communication between the DWM1001 and the DWM Daemon.

Can you please check that the Raspberry Image you have used is reflashed in whole to the SD card?
What is the size of your SD card?

Thanks!
Cheers, TDK

Hi

Re-flashing the Pi has fixed it. Thank goodness no more soldering for now!

Many thanks,

Ben.

Hi Ben,

Ok, great! What we suspect might happened is that your system has been updated either automatically by Raspberry or you have triggered that. The dwm.ko module must run on the kernel version 4.14.50-v7+ so Raspberry can update anything but not the Kernel.

Can you please verify if anything like that might happened? If so, please disable the kernel update on your Raspberry or if that is not possible then disable completely the system update.

Thanks!
Cheers, TDK

Yes, an enthusiastic staffer “made sure everything was up to date”. Not unreasonable in many situations, but clearly not this one.

Many thanks for the support.

Ben.

1 Like

Just hopping in here, is there a reason the GPIO header needs to have long pins? Wouldn’t something like this work too? https://www.antratek.nl/raspberry-pi-gpio-tall-header-2x20?___SID=U

Hi,

sure, that connector should be Ok.

Cheers,
TDK

Hi guys,
i have many problems like u had , the web manager did not see any device…
then i flashed again the raspian image do to that kernel issue, and now the web manager sees the node unit but can’t see any tags or anchors…
also when i access minicom :

  • minicom -b 115200 -o -D /dev/ttyS0
    or minicom -b 115200 -o -D /dev/serial0
    and tap enter tiwce i could not acceess dwm app, there is no response in minicom.
    Any help ?

Hi Ahmed,

it is strange that you do not see any output on the minicom. That means either the Firmware is not on the module or something is wrong with the communication with the board - please check the wiring/soldering and reflash the module to ensure it contains correct firmware.

Can you please go through the following steps and send me the outputs/feedback?

  1. Which Raspberry hardware revision are you using? If possible please send a picture of the Raspberry with the DWM1001.
  2. Is the DWM1001 reflashed with the R2 binary?
  3. Which Raspberry Image are you using? The official one from the Release 2?
  4. Please send outputs of the commands on the failing system:
  5. lsmod
  6. ls -la /dev/dwm0
  7. ps ax | grep dwm
  8. uname -a
  9. dmesg
  10. tail -n50 -f /var/log/dwm-daemon.log
  11. Check that /etc/dwm1001/dwm1001.config contains the same PANID as your other running Anchors.
  12. A screenshot of what you see on the Web Manager.

Cheers,
TDK

1/using Raspberry pi 3 model B V1.2 2015.

2/ yes fw2 :
aazzz

3/ using the DRTLS_raspbian_R2.0 from release 2 files.

4/
5/ lsmod

6/
[email protected]:~ $ ls -la /dev/dwm0
crw------- 1 root root 200, 0 Apr 16 10:05 /dev/dwm0

7/
[email protected]:~ $ ps ax | grep dwm
426 ? Sl 0:20 /usr/local/bin/dwm-proxy -c /etc/dwm1001/dwm1001-proxy.config
427 ? Sl 0:01 /usr/local/bin/dwm-daemon -c /etc/dwm1001/dwm1001.config -l /var/log/dwm-daemon.log
1695 pts/0 S+ 0:00 grep --color=auto dwm
[email protected]:~ $

8/
[email protected]:~ $ uname -a
Linux raspberrypi 4.14.50-v7+ #1122 SMP Tue Jun 19 12:26:26 BST 2018 armv7l GNU/Linux
[email protected]:~ $ ^C

9/dmesg_command.txt (48.5 KB)

10/
[email protected]:~ $ tail -n50 -f /var/log/dwm-daemon.log

2019-04-15 16:52:16.575 INFO [436] [leaps::core::[email protected]] starting…
2019-04-15 16:52:21.636 INFO [612] [leaps::core::[email protected]] Client decada95ceb5c0b0 reconnect
2019-04-15 16:52:22.670 INFO [612] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 Connection Accepted.
2019-04-15 16:52:22.670 INFO [612] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 disconnected(rc=7)
2019-04-15 16:52:26.672 INFO [612] [leaps::core::[email protected]] Client decada95ceb5c0b0 reconnect
2019-04-15 16:52:27.673 INFO [612] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 Connection Accepted.
2019-04-15 16:52:31.725 INFO [612] [leaps::core::[email protected]] Client decada95ceb5c0b0 ip addresses updated
2019-04-15 16:53:01.760 INFO [612] [leaps::core::[email protected]] Client decada95ceb5c0b0 ip addresses updated

Mon 15 Apr 17:01:20 UTC 2019
Starting daemon dwm-daemon with command ‘/usr/local/bin/dwm-daemon’ and options ‘-c /etc/dwm1001/dwm1001.config -l /var/log/dwm-daemon.log’…

2019-04-15 17:01:21.703 INFO [442] [leaps::core::[email protected]] starting…
2019-04-15 17:01:26.723 INFO [650] [leaps::core::[email protected]] Client decada95ceb5c0b0 reconnect
2019-04-15 17:01:27.757 INFO [650] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 Connection Accepted.
2019-04-15 17:01:36.769 INFO [650] [leaps::core::[email protected]] Client decada95ceb5c0b0 ip addresses updated
2019-04-15 17:02:06.804 INFO [650] [leaps::core::[email protected]] Client decada95ceb5c0b0 ip addresses updated
2019-04-16 09:06:42.477 INFO [650] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 disconnected(rc=7)
2019-04-16 09:06:42.478 INFO [650] [leaps::core::[email protected]] Client decada95ceb5c0b0 reconnect
2019-04-16 09:06:43.478 INFO [442] [leaps::core::[email protected]] stopping…
2019-04-16 09:06:48.812 INFO [442] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 disconnected(rc=7)

Tue 16 Apr 09:07:17 UTC 2019
Starting daemon dwm-daemon with command ‘/usr/local/bin/dwm-daemon’ and options ‘-c /etc/dwm1001/dwm1001.config -l /var/log/dwm-daemon.log’…

2019-04-16 09:07:19.681 INFO [440] [leaps::core::[email protected]] starting…
2019-04-16 09:07:24.740 INFO [596] [leaps::core::[email protected]] Client decada95ceb5c0b0 reconnect
2019-04-16 09:07:25.772 INFO [596] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 Connection Accepted.
2019-04-16 09:07:34.783 INFO [596] [leaps::core::[email protected]] Client decada95ceb5c0b0 ip addresses updated
2019-04-16 09:08:42.818 INFO [596] [leaps::core::[email protected]] Client decada95ceb5c0b0 ip addresses updated
2019-04-16 10:05:05.646 INFO [596] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 disconnected(rc=7)
2019-04-16 10:05:05.647 INFO [596] [leaps::core::[email protected]] Client decada95ceb5c0b0 reconnect
2019-04-16 10:05:06.649 INFO [440] [leaps::core::[email protected]] stopping…
2019-04-16 10:05:12.003 INFO [440] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 disconnected(rc=7)

Tue 16 Apr 10:05:40 UTC 2019
Starting daemon dwm-daemon with command ‘/usr/local/bin/dwm-daemon’ and options ‘-c /etc/dwm1001/dwm1001.config -l /var/log/dwm-daemon.log’…

2019-04-16 10:05:42.817 INFO [427] [leaps::core::[email protected]] starting…
2019-04-16 10:05:47.897 INFO [556] [leaps::core::[email protected]] Client decada95ceb5c0b0 reconnect
2019-04-16 10:05:48.936 INFO [556] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 Connection Accepted.
2019-04-16 10:05:57.948 INFO [556] [leaps::core::[email protected]] Client decada95ceb5c0b0 ip addresses updated
2019-04-16 10:06:27.983 INFO [556] [leaps::core::[email protected]] Client decada95ceb5c0b0 ip addresses updated
2019-04-16 13:18:03.294 INFO [556] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 disconnected(rc=7)
2019-04-16 13:18:03.295 INFO [556] [leaps::core::[email protected]] Client decada95ceb5c0b0 reconnect
2019-04-16 13:18:04.296 INFO [556] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 Connection Accepted.
2019-04-16 13:28:21.353 INFO [556] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 disconnected(rc=7)
2019-04-16 13:28:21.354 INFO [556] [leaps::core::[email protected]] Client decada95ceb5c0b0 reconnect
2019-04-16 13:28:22.355 INFO [556] [leaps::mq::client::mosquitto::[email protected]] Client decada95ceb5c0b0 Connection Accepted.

11/
#######################################################################

DWM Kernel Module settings

UWB network PANID

Allowed values: 16-bit number in decimal, hexadecimal or octal format

panid = 0x394E

UWB encryption

Allowed values: true/false

enc_en = false

UWB encryption key

Allowed values: 128-bit number in hexadecimal format

enc_key = “333333339999999944444444EEEEEEEE”

UWB firmware update

Allowed values: true/false

uwb_fwup = true

UWB mode

Allowed values: 0=Off 1=Passive 2=Active

uwb_mode = 2

and we have an anchor example si command azeazeaxqdsqsd

12/ web manager

Hi Ahmed,

On the last picture there is some progress I think as both the Daemon and the proxy are reported on the webmanager.

Do you have an anchor configured as initiator in your network ?

Thanks
Yves

i did further research on my own and configurations , now the web manager works but accuracy not that much good.
but the minicom serial connection is still non functional.

Hi Ahmed,

where was the issue? What have you done to get it working? Please share the details so we can know how to help further.

Thanks!
Cheers, TDK