mysgw: bind: Address already in use



  • Hi there!

    Just started with my diy home automation project and as was following the https://www.mysensors.org/build/raspberry tutorial.

    What I have done so far:

    1. Installed openhab2 on a rpi2
    2. followed all the steps of the guide
    3. wired the NRF24L01+ onto the rpi

    Now, as my sensors haven't arrived yet, I would like to test if I can make the rpi and a adruino mini pro communicate via the radio.

    The problem:

    pi@raspberrypi:~ $ sudo /usr/local/bin/mysgw -d
    mysgw: Starting gateway...
    mysgw: Protocol version - 2.1.1
    mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.1.1
    mysgw: TSF:LRT:OK
    mysgw: TSM:INIT
    mysgw: TSF:WUR:MS=0
    mysgw: TSM:INIT:TSP OK
    mysgw: TSM:INIT:GW MODE
    mysgw: TSM:READY:ID=0,PAR=0,DIS=0
    mysgw: MCO:REG:NOT NEEDED
    mysgw: bind: Address already in use
    mysgw: Failed to bind!
    mysgw: MCO:BGN:STP
    mysgw: MCO:BGN:INIT OK,TSP=1
    mysgw: accept: Bad file descriptor
    mysgw: accept: Bad file descriptor
    mysgw: accept: Bad file descriptor
    ...
    mysgw: accept: Bad file descriptor
    mysgw: TSF:MSG:READ,0-0-0,s=0,c=0,t=0,pt=0,l=0,sg=0:
    mysgw: !TSF:MSG:LEN,0!=7
    mysgw: accept: Bad file descriptor
    ...
    

    I found what I think is a similar issue here: https://forum.mysensors.org/topic/1598/openhab-2-0-binding/303

    But the process was overwhelming for a a beginner at my level.

    There probably is a step I am missing, but couldn't locate it.

    The problem with all these tutorials is that they tell what to do but don't explain what you are doing and why. If anyone knows any good basic principle "text books" on the subject, please add a link or something.

    Regards,
    Fipster


  • Hero Member

    Looks like another service is already blocking the port for the gateway. My guess: there already is a instance of the gateway running. Check with: "ps -ax" command. You should see all running process.



  • @TimO

    Thank you for quick response!

    There are the running processes:

      PID TTY      STAT   TIME COMMAND
        1 ?        Ss     0:03 /sbin/init splash
        2 ?        S      0:00 [kthreadd]
        3 ?        S      0:01 [ksoftirqd/0]
        5 ?        S<     0:00 [kworker/0:0H]
        7 ?        S      0:15 [rcu_sched]
        8 ?        S      0:00 [rcu_bh]
        9 ?        S      0:00 [migration/0]
       10 ?        S      0:00 [migration/1]
       11 ?        S      0:01 [ksoftirqd/1]
       13 ?        S<     0:00 [kworker/1:0H]
       14 ?        S      0:00 [migration/2]
       15 ?        S      0:01 [ksoftirqd/2]
       17 ?        S<     0:00 [kworker/2:0H]
       18 ?        S      0:00 [migration/3]
       19 ?        S      0:02 [ksoftirqd/3]
       21 ?        S<     0:00 [kworker/3:0H]
       22 ?        S      0:00 [kdevtmpfs]
       23 ?        S<     0:00 [netns]
       24 ?        S<     0:00 [perf]
       25 ?        S      0:00 [khungtaskd]
       26 ?        S<     0:00 [writeback]
       27 ?        S<     0:00 [crypto]
       28 ?        S<     0:00 [bioset]
       29 ?        S<     0:00 [kblockd]
       30 ?        S      0:00 [kworker/0:1]
       31 ?        S<     0:00 [rpciod]
       32 ?        S      0:00 [kswapd0]
       33 ?        S<     0:00 [vmstat]
       34 ?        S      0:00 [fsnotify_mark]
       35 ?        S<     0:00 [nfsiod]
       44 ?        S<     0:00 [kthrotld]
       45 ?        S<     0:00 [bioset]
       46 ?        S<     0:00 [bioset]
       47 ?        S<     0:00 [bioset]
       48 ?        S<     0:00 [bioset]
       49 ?        S<     0:00 [bioset]
       50 ?        S<     0:00 [bioset]
       51 ?        S<     0:00 [bioset]
       52 ?        S<     0:00 [bioset]
       53 ?        S<     0:00 [bioset]
       54 ?        S<     0:00 [bioset]
       55 ?        S<     0:00 [bioset]
       56 ?        S<     0:00 [bioset]
       57 ?        S<     0:00 [bioset]
       58 ?        S<     0:00 [bioset]
       59 ?        S<     0:00 [bioset]
       60 ?        S<     0:00 [bioset]
       61 ?        S<     0:00 [bioset]
       62 ?        S<     0:00 [bioset]
       63 ?        S<     0:00 [bioset]
       64 ?        S<     0:00 [bioset]
       65 ?        S<     0:00 [bioset]
       66 ?        S<     0:00 [bioset]
       67 ?        S<     0:00 [bioset]
       68 ?        S<     0:00 [bioset]
       69 ?        S<     0:00 [VCHIQ-0]
       70 ?        S<     0:00 [VCHIQr-0]
       71 ?        S<     0:00 [VCHIQs-0]
       72 ?        S<     0:00 [iscsi_eh]
       73 ?        S<     0:00 [dwc_otg]
       75 ?        S<     0:00 [DWC Notificatio]
       77 ?        S      0:00 [VCHIQka-0]
       78 ?        S<     0:00 [deferwq]
       80 ?        S<     0:00 [bioset]
       81 ?        S      0:01 [mmcqd/0]
       82 ?        S      0:00 [jbd2/mmcblk0p2-]
       83 ?        S<     0:00 [ext4-rsv-conver]
       87 ?        S<     0:00 [ipv6_addrconf]
      104 ?        S<     0:00 [kworker/0:1H]
      131 ?        Ss     0:06 /lib/systemd/systemd-journald
      135 ?        Ss     0:00 /lib/systemd/systemd-udevd
      283 ?        S      0:00 [kworker/2:2]
      367 ?        Ssl    0:01 /usr/sbin/rsyslogd -n
      368 ?        Ss     0:00 /usr/sbin/cron -f
      370 ?        Ss     0:00 avahi-daemon: running [raspberrypi.local]
      371 ?        Ss     1:51 /usr/local/bin/mysgw
      372 ?        Ss     0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfil
      375 ?        S      0:00 avahi-daemon: chroot helper
      379 ?        S<     0:00 [cfg80211]
      380 ?        Ss     0:00 /sbin/dhcpcd -q -b
      405 ?        Ss     0:00 /lib/systemd/systemd-logind
      414 ?        S<     0:00 [kworker/3:1H]
      430 ?        Ss     0:00 /usr/sbin/sshd -D
      437 ?        Ss     0:00 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
      454 ?        Ssl    0:00 /usr/sbin/lightdm
      596 ?        Ss     0:00 /usr/sbin/thd --daemon --triggers /etc/triggerhappy/triggers.d/ --so
      619 tty7     Ssl+   0:03 /usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -no
      620 tty1     Ss     0:00 /bin/login -f
      621 ?        Ss     0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 106:111
      622 ?        Ss+    0:00 /sbin/agetty --keep-baud 115200 38400 9600 ttyAMA0 vt102
      629 ?        S<     0:00 [kworker/2:1H]
      633 ?        Ss     0:00 /lib/systemd/systemd --user
      638 ?        S      0:00 (sd-pam)
      646 tty1     S+     0:00 -bash
      703 ?        Sl     0:00 lightdm --session-child 13 16
      723 ?        Ssl    0:00 /usr/bin/lxsession -s LXDE-pi -e LXDE
      782 ?        Sl     1:53 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc
      804 ?        Ss     0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-sessio
      807 ?        S      0:00 /usr/bin/dbus-launch --exit-with-session x-session-manager
      808 ?        Ss     0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --sessio
      818 ?        Sl     0:00 /usr/lib/gvfs/gvfsd
      822 ?        Sl     0:00 /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes
      823 ?        S<     0:00 [kworker/1:1H]
      997 ?        S      0:01 openbox --config-file /home/pi/.config/openbox/lxde-pi-rc.xml
      999 ?        Sl     0:00 lxpolkit
     1003 ?        Sl     0:01 pcmanfm --desktop --profile LXDE-pi
     1009 ?        Ss     0:00 /usr/bin/ssh-agent -s
     1018 ?        Ssl    0:00 /usr/lib/policykit-1/polkitd --no-debug
     1023 ?        S      0:00 sh -c zenity --info --text="Your Raspbian system has been upgraded t
     1025 ?        Sl     0:01 zenity --info --text=Your Raspbian system has been upgraded to the l
     1049 ?        Sl     0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
     1051 ?        Ssl    0:00 /usr/lib/udisks2/udisksd --no-debug
     1063 ?        SNsl   0:00 /usr/lib/rtkit/rtkit-daemon
     1073 ?        Sl     0:00 /usr/lib/gvfs/gvfs-goa-volume-monitor
     1077 ?        Sl     0:00 /usr/lib/gvfs/gvfs-mtp-volume-monitor
     1083 ?        Sl     0:00 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
     1089 ?        Sl     0:00 /usr/lib/gvfs/gvfs-afc-volume-monitor
     1091 ?        Ss     0:00 /usr/lib/bluetooth/bluetoothd
     1104 ?        S      0:00 /bin/sh /usr/bin/start-pulseaudio-x11
     1105 ?        S      0:00 /usr/bin/xprop -root -spy
     1121 ?        Ssl    0:00 /usr/lib/menu-cache/menu-cached /tmp/.menu-cached-:0-pi
     1138 ?        Sl     0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.1 /org/gtk/gvfs/exec_spaw/0
     1508 ?        S      0:00 [kworker/u8:0]
     1523 ?        S      0:00 [kworker/1:2]
     1556 ?        S      0:00 [kworker/3:2]
     1641 ?        Sl     0:08 lxpanel --profile LXDE-pi
     1661 ?        S      0:00 [spi0]
     1747 ?        S      0:00 [kworker/2:0]
     1762 ?        Ss     0:00 sshd: pi [priv]
     1769 ?        R      0:00 sshd: pi@pts/0
     1771 pts/0    Ss     0:00 -bash
     1874 ?        Ssl    0:00 /usr/lib/packagekit/packagekitd
     1883 ?        S      0:00 [kworker/3:1]
     2153 ?        S      0:00 [kworker/1:0]
     2212 ?        S      0:00 [kworker/0:0]
     2241 ?        S      0:00 [kworker/u8:2]
     2286 pts/0    R+     0:00 ps -ax
    

  • Mod

    @fipster you already have one mysgw running

    371 ? Ss 1:51 /usr/local/bin/mysgw


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.