Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. MySensors GW on rpi3

MySensors GW on rpi3

Scheduled Pinned Locked Moved Troubleshooting
gateway
20 Posts 2 Posters 82 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kurtsejr
    wrote on last edited by
    #3

    I used the "Raspberry pi OS (32 bit) from 2022-09-22

    on configure I used
    sudo ./configure --my-gateway=ethernet
    could see that port 5003 and rf24 was default

    My controller is HA, but the error messages was of cause from

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kurtsejr
      wrote on last edited by
      #4

      Used --rf24 I get:

      [SECTION] Detecting target machine.
      [OK] machine detected: SoC=BCM2837, Type=rpi3, CPU=armv7l.
      [SECTION] Detecting SPI driver.
      [OK] SPI driver detected:BCM.
      [SECTION] Gateway configuration.
      [OK] Type: ethernet.
      [OK] Transport: rf24.
      [OK] Signing: Disabled.
      [OK] Encryption: Disabled.
      [OK] CPPFLAGS: -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX_ARCH_RASPBERRYPI
      [OK] CXXFLAGS: -std=c++11
      [SECTION] Detecting init system.
      [OK] Init system detected: systemd.
      [SECTION] Saving configuration.
      [OK] Saved.
      [SECTION] Cleaning previous builds.
      [OK] Finished.

      Seems fine for me

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kurtsejr
        wrote on last edited by
        #5

        Sorry one more:

        pi@MySensor-GW:~/MySensors $ sudo make
        pi@MySensor-GW:~/MySensors $ sudo make install
        Installing bin/mysgw to /usr/local/bin
        install -m0644 initscripts/mysgw.systemd /etc/systemd/system/mysgw.service
        systemctl daemon-reload
        MySensors gateway has been installed, to add to the boot run:
        sudo systemctl enable mysgw.service
        To start the gateway run:
        sudo systemctl start mysgw.service
        pi@MySensor-GW:~/MySensors $ sudo systemctl enable mysgw.service
        pi@MySensor-GW:~/MySensors $

        So no warnings or errors on make and make install, seens to be ok.

        Then a "sudo reboot"

        mfalkviddM 1 Reply Last reply
        0
        • K Kurtsejr

          Sorry one more:

          pi@MySensor-GW:~/MySensors $ sudo make
          pi@MySensor-GW:~/MySensors $ sudo make install
          Installing bin/mysgw to /usr/local/bin
          install -m0644 initscripts/mysgw.systemd /etc/systemd/system/mysgw.service
          systemctl daemon-reload
          MySensors gateway has been installed, to add to the boot run:
          sudo systemctl enable mysgw.service
          To start the gateway run:
          sudo systemctl start mysgw.service
          pi@MySensor-GW:~/MySensors $ sudo systemctl enable mysgw.service
          pi@MySensor-GW:~/MySensors $

          So no warnings or errors on make and make install, seens to be ok.

          Then a "sudo reboot"

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #6

          @Kurtsejr did you reboot befor running sudo ./bin/mysgw?
          If that’s the case my guess is that the gateway was already started automatically at boot. When you tried to start another instance, the tcp port was already in use.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Kurtsejr
            wrote on last edited by
            #7

            Yes I made a reboot, just made a new reboot - same result :-(

            mfalkviddM 1 Reply Last reply
            0
            • K Kurtsejr

              Yes I made a reboot, just made a new reboot - same result :-(

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #8

              @Kurtsejr yes the gateway will start automatically at each boot, unless automatic start is disabled.

              1 Reply Last reply
              0
              • mfalkviddM Offline
                mfalkviddM Offline
                mfalkvidd
                Mod
                wrote on last edited by
                #9

                To check if the gateway has started automatically, run sudo systemctl enable mysgw.service

                K 1 Reply Last reply
                0
                • mfalkviddM Offline
                  mfalkviddM Offline
                  mfalkvidd
                  Mod
                  wrote on last edited by mfalkvidd
                  #10

                  @Kurtsejr I tested the gateway on a spare raspberry pi and it does indeed print lots of ERROR accept: Bad file descriptor when more than one instance of the gateway is started. The solution is easy: don't start two instances at the same time.

                  The reason is actually printed in the log: ERROR bind: Address already in use but is easy to miss due to the many ERROR accept: Bad file descriptor

                  INFO  Starting gateway...
                  INFO  Protocol version - 2.4.0-alpha
                  DEBUG MCO:BGN:INIT GW,CP=R-NGL---,FQ=NA,REL=0,VER=2.4.0-alpha
                  ERROR bind: Address already in use
                  ERROR Failed to bind!
                  DEBUG MCO:BGN:STP
                  DEBUG MCO:REG:NOT NEEDED
                  DEBUG MCO:BGN:INIT OK,TSP=NA
                  ERROR accept: Bad file descriptor
                  ERROR accept: Bad file descriptor
                  ERROR accept: Bad file descriptor
                  ERROR accept: Bad file descriptor
                  
                  K 1 Reply Last reply
                  0
                  • mfalkviddM mfalkvidd

                    To check if the gateway has started automatically, run sudo systemctl enable mysgw.service

                    K Offline
                    K Offline
                    Kurtsejr
                    wrote on last edited by
                    #11

                    @mfalkvidd said in MySensors GW on rpi3:

                    sudo systemctl enable mysgw.service

                    Thanks for your reply

                    I have run the command, result:

                    pi@MySensor-GW:~ $ sudo systemctl enable mysgw.service
                    pi@MySensor-GW:~ $

                    How do I remove if more that one instance is started? - I will try to google it. Perhaps it's easier to start from beginning again

                    mfalkviddM 1 Reply Last reply
                    0
                    • mfalkviddM mfalkvidd

                      @Kurtsejr I tested the gateway on a spare raspberry pi and it does indeed print lots of ERROR accept: Bad file descriptor when more than one instance of the gateway is started. The solution is easy: don't start two instances at the same time.

                      The reason is actually printed in the log: ERROR bind: Address already in use but is easy to miss due to the many ERROR accept: Bad file descriptor

                      INFO  Starting gateway...
                      INFO  Protocol version - 2.4.0-alpha
                      DEBUG MCO:BGN:INIT GW,CP=R-NGL---,FQ=NA,REL=0,VER=2.4.0-alpha
                      ERROR bind: Address already in use
                      ERROR Failed to bind!
                      DEBUG MCO:BGN:STP
                      DEBUG MCO:REG:NOT NEEDED
                      DEBUG MCO:BGN:INIT OK,TSP=NA
                      ERROR accept: Bad file descriptor
                      ERROR accept: Bad file descriptor
                      ERROR accept: Bad file descriptor
                      ERROR accept: Bad file descriptor
                      
                      K Offline
                      K Offline
                      Kurtsejr
                      wrote on last edited by
                      #12

                      @mfalkvidd I decided to reinstall, start from scratch by installing a new pi image om my SDHC disk, but trying to install the GW software I get this message:

                      pi@MySensor-GW:~ $ pwd
                      /home/pi
                      pi@MySensor-GW:~ $ sudo git clone https://github.com/mysensors/MySensors.git --branch development
                      Cloning into 'MySensors'...
                      fatal: unable to access 'https://github.com/mysensors/MySensors.git/': Couldn't connect to server
                      pi@MySensor-GW:~ $ sudo git clone https://github.com/mysensors/MySensors.git --branch master
                      Cloning into 'MySensors'...
                      fatal: unable to access 'https://github.com/mysensors/MySensors.git/': Couldn't connect to server
                      pi@MySensor-GW:~ $

                      Has something changed? or is it github that does not response?

                      mfalkviddM 1 Reply Last reply
                      0
                      • K Kurtsejr

                        @mfalkvidd I decided to reinstall, start from scratch by installing a new pi image om my SDHC disk, but trying to install the GW software I get this message:

                        pi@MySensor-GW:~ $ pwd
                        /home/pi
                        pi@MySensor-GW:~ $ sudo git clone https://github.com/mysensors/MySensors.git --branch development
                        Cloning into 'MySensors'...
                        fatal: unable to access 'https://github.com/mysensors/MySensors.git/': Couldn't connect to server
                        pi@MySensor-GW:~ $ sudo git clone https://github.com/mysensors/MySensors.git --branch master
                        Cloning into 'MySensors'...
                        fatal: unable to access 'https://github.com/mysensors/MySensors.git/': Couldn't connect to server
                        pi@MySensor-GW:~ $

                        Has something changed? or is it github that does not response?

                        mfalkviddM Offline
                        mfalkviddM Offline
                        mfalkvidd
                        Mod
                        wrote on last edited by
                        #13

                        @Kurtsejr said in MySensors GW on rpi3:

                        Has something changed? or is it github that does not response?

                        The Raspberry Pi probably doesn't have the right settings for connecting to Internet. What happens if you run ping google.com for example? You should get something like this:

                        ping google.com
                        PING google.com (142.250.179.142) 56(84) bytes of data.
                        64 bytes from ams17s10-in-f14.1e100.net (142.250.179.142): icmp_seq=1 ttl=58 time=33.3 ms
                        64 bytes from ams17s10-in-f14.1e100.net (142.250.179.142): icmp_seq=2 ttl=58 time=33.4 ms
                        

                        If you don't get any replies, the raspberry pi doesn't have a working internet connection.

                        K 1 Reply Last reply
                        0
                        • K Kurtsejr

                          @mfalkvidd said in MySensors GW on rpi3:

                          sudo systemctl enable mysgw.service

                          Thanks for your reply

                          I have run the command, result:

                          pi@MySensor-GW:~ $ sudo systemctl enable mysgw.service
                          pi@MySensor-GW:~ $

                          How do I remove if more that one instance is started? - I will try to google it. Perhaps it's easier to start from beginning again

                          mfalkviddM Offline
                          mfalkviddM Offline
                          mfalkvidd
                          Mod
                          wrote on last edited by
                          #14

                          @Kurtsejr said in MySensors GW on rpi3:

                          How do I remove if more that one instance is started? - I will try to google it. Perhaps it's easier to start from beginning again

                          sudo systemctl stop mysgw.service will stop the gateway service if it is currently running. It will start automatically again after reboot (unless disabled).

                          sudo systemctl disable mysgw.service will disable autostart, but will keep the service running if it has already been started.

                          https://www.linuxtrainingacademy.com/systemd-cheat-sheet/ can be a good place to start

                          1 Reply Last reply
                          0
                          • mfalkviddM mfalkvidd

                            @Kurtsejr said in MySensors GW on rpi3:

                            Has something changed? or is it github that does not response?

                            The Raspberry Pi probably doesn't have the right settings for connecting to Internet. What happens if you run ping google.com for example? You should get something like this:

                            ping google.com
                            PING google.com (142.250.179.142) 56(84) bytes of data.
                            64 bytes from ams17s10-in-f14.1e100.net (142.250.179.142): icmp_seq=1 ttl=58 time=33.3 ms
                            64 bytes from ams17s10-in-f14.1e100.net (142.250.179.142): icmp_seq=2 ttl=58 time=33.4 ms
                            

                            If you don't get any replies, the raspberry pi doesn't have a working internet connection.

                            K Offline
                            K Offline
                            Kurtsejr
                            wrote on last edited by
                            #15

                            @mfalkvidd You are right, no network connection - strange I will investigate, thanks!

                            K 1 Reply Last reply
                            0
                            • K Kurtsejr

                              @mfalkvidd You are right, no network connection - strange I will investigate, thanks!

                              K Offline
                              K Offline
                              Kurtsejr
                              wrote on last edited by
                              #16

                              @Kurtsejr Now I have network connection, made an update and upgrade, and now I can install from github. Changed to rf24 radio, and could see that ethernet was default.

                              pi@MySensor-GW:~/MySensors $ sudo ./configure --my-transport=rf24
                              [SECTION] Detecting target machine.
                              [OK] machine detected: SoC=BCM2837, Type=rpi3, CPU=armv7l.
                              [SECTION] Detecting SPI driver.
                              [OK] SPI driver detected:BCM.
                              [SECTION] Gateway configuration.
                              [OK] Type: ethernet.
                              [OK] Transport: rf24.
                              [OK] Signing: Disabled.
                              [OK] Encryption: Disabled.
                              [OK] CPPFLAGS: -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloa t-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX _ARCH_RASPBERRYPI
                              [OK] CXXFLAGS: -std=c++11
                              [SECTION] Detecting init system.
                              [OK] Init system detected: systemd.
                              [SECTION] Saving configuration.
                              [OK] Saved.
                              [SECTION] Cleaning previous builds.
                              [OK] Finished.

                              Next was to do a make, result:

                              pi@MySensor-GW:~/MySensors $ sudo make
                              g++ -MT build/hal/architecture/Linux/drivers/core/interrupt.o -MMD -MP -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -I./hal/architecture/Linux/drivers/BCM -c hal/architecture/Linux/drivers/core/interrupt.cpp -o build/hal/architecture/Linux/drivers/core/interrupt.o
                              hal/architecture/Linux/drivers/core/interrupt.cpp:33:10: fatal error: stropts.h: No such file or directory
                              33 | #include <stropts.h>
                              | ^~~~~~~~~~~
                              compilation terminated.
                              make: *** [Makefile:99: build/hal/architecture/Linux/drivers/core/interrupt.o] Error 1
                              pi@MySensor-GW:~/MySensors $

                              So it seems that something is missing, something linux basic ....

                              mfalkviddM K 2 Replies Last reply
                              0
                              • K Kurtsejr

                                @Kurtsejr Now I have network connection, made an update and upgrade, and now I can install from github. Changed to rf24 radio, and could see that ethernet was default.

                                pi@MySensor-GW:~/MySensors $ sudo ./configure --my-transport=rf24
                                [SECTION] Detecting target machine.
                                [OK] machine detected: SoC=BCM2837, Type=rpi3, CPU=armv7l.
                                [SECTION] Detecting SPI driver.
                                [OK] SPI driver detected:BCM.
                                [SECTION] Gateway configuration.
                                [OK] Type: ethernet.
                                [OK] Transport: rf24.
                                [OK] Signing: Disabled.
                                [OK] Encryption: Disabled.
                                [OK] CPPFLAGS: -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloa t-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX _ARCH_RASPBERRYPI
                                [OK] CXXFLAGS: -std=c++11
                                [SECTION] Detecting init system.
                                [OK] Init system detected: systemd.
                                [SECTION] Saving configuration.
                                [OK] Saved.
                                [SECTION] Cleaning previous builds.
                                [OK] Finished.

                                Next was to do a make, result:

                                pi@MySensor-GW:~/MySensors $ sudo make
                                g++ -MT build/hal/architecture/Linux/drivers/core/interrupt.o -MMD -MP -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -I./hal/architecture/Linux/drivers/BCM -c hal/architecture/Linux/drivers/core/interrupt.cpp -o build/hal/architecture/Linux/drivers/core/interrupt.o
                                hal/architecture/Linux/drivers/core/interrupt.cpp:33:10: fatal error: stropts.h: No such file or directory
                                33 | #include <stropts.h>
                                | ^~~~~~~~~~~
                                compilation terminated.
                                make: *** [Makefile:99: build/hal/architecture/Linux/drivers/core/interrupt.o] Error 1
                                pi@MySensor-GW:~/MySensors $

                                So it seems that something is missing, something linux basic ....

                                mfalkviddM Offline
                                mfalkviddM Offline
                                mfalkvidd
                                Mod
                                wrote on last edited by mfalkvidd
                                #17

                                Nice work on the internet connectivity @Kurtsejr

                                It is an issue on some (newer?) linux versions. It has been fixed in the development version of MySensors. You can switch to the development version, or add the fix yourself.

                                See https://github.com/mysensors/MySensors/issues/1431 and https://github.com/mysensors/MySensors/pull/1446/files

                                Sorry for the inconvenience.

                                1 Reply Last reply
                                0
                                • K Kurtsejr

                                  @Kurtsejr Now I have network connection, made an update and upgrade, and now I can install from github. Changed to rf24 radio, and could see that ethernet was default.

                                  pi@MySensor-GW:~/MySensors $ sudo ./configure --my-transport=rf24
                                  [SECTION] Detecting target machine.
                                  [OK] machine detected: SoC=BCM2837, Type=rpi3, CPU=armv7l.
                                  [SECTION] Detecting SPI driver.
                                  [OK] SPI driver detected:BCM.
                                  [SECTION] Gateway configuration.
                                  [OK] Type: ethernet.
                                  [OK] Transport: rf24.
                                  [OK] Signing: Disabled.
                                  [OK] Encryption: Disabled.
                                  [OK] CPPFLAGS: -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloa t-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX _ARCH_RASPBERRYPI
                                  [OK] CXXFLAGS: -std=c++11
                                  [SECTION] Detecting init system.
                                  [OK] Init system detected: systemd.
                                  [SECTION] Saving configuration.
                                  [OK] Saved.
                                  [SECTION] Cleaning previous builds.
                                  [OK] Finished.

                                  Next was to do a make, result:

                                  pi@MySensor-GW:~/MySensors $ sudo make
                                  g++ -MT build/hal/architecture/Linux/drivers/core/interrupt.o -MMD -MP -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -I./hal/architecture/Linux/drivers/BCM -c hal/architecture/Linux/drivers/core/interrupt.cpp -o build/hal/architecture/Linux/drivers/core/interrupt.o
                                  hal/architecture/Linux/drivers/core/interrupt.cpp:33:10: fatal error: stropts.h: No such file or directory
                                  33 | #include <stropts.h>
                                  | ^~~~~~~~~~~
                                  compilation terminated.
                                  make: *** [Makefile:99: build/hal/architecture/Linux/drivers/core/interrupt.o] Error 1
                                  pi@MySensor-GW:~/MySensors $

                                  So it seems that something is missing, something linux basic ....

                                  K Offline
                                  K Offline
                                  Kurtsejr
                                  wrote on last edited by
                                  #18

                                  @Kurtsejr Thanks a lot!
                                  I removed the entry in the interrupt.cpp fil, and was then able to do a make , "make" - with some warnings, but make ended up writing this to me:

                                  /home/pi/MySensors/./hal/architecture/Linux/drivers/core/config.h:39: multiple d efinition of `conf'; build/hal/architecture/Linux/drivers/core/config.o:/home/pi /MySensors/hal/architecture/Linux/drivers/core/config.h:39: first defined here
                                  collect2: error: ld returned 1 exit status
                                  make: *** [Makefile:80: bin/mysgw] Error 1
                                  pi@MySensor-GW:~/MySensors $
                                  pi@MySensor-GW:~/MySensors $ sudo ./bin/mysgw -c
                                  sudo: ./bin/mysgw: command not found

                                  This means that I do not have a mysgw file in "bin" - bin dir is empty

                                  K 1 Reply Last reply
                                  0
                                  • K Kurtsejr

                                    @Kurtsejr Thanks a lot!
                                    I removed the entry in the interrupt.cpp fil, and was then able to do a make , "make" - with some warnings, but make ended up writing this to me:

                                    /home/pi/MySensors/./hal/architecture/Linux/drivers/core/config.h:39: multiple d efinition of `conf'; build/hal/architecture/Linux/drivers/core/config.o:/home/pi /MySensors/hal/architecture/Linux/drivers/core/config.h:39: first defined here
                                    collect2: error: ld returned 1 exit status
                                    make: *** [Makefile:80: bin/mysgw] Error 1
                                    pi@MySensor-GW:~/MySensors $
                                    pi@MySensor-GW:~/MySensors $ sudo ./bin/mysgw -c
                                    sudo: ./bin/mysgw: command not found

                                    This means that I do not have a mysgw file in "bin" - bin dir is empty

                                    K Offline
                                    K Offline
                                    Kurtsejr
                                    wrote on last edited by
                                    #19

                                    @Kurtsejr Thanks
                                    Everything seems to be working, used the "dev version" - thanks for helping, I started with a new image.

                                    mfalkviddM 1 Reply Last reply
                                    1
                                    • K Kurtsejr

                                      @Kurtsejr Thanks
                                      Everything seems to be working, used the "dev version" - thanks for helping, I started with a new image.

                                      mfalkviddM Offline
                                      mfalkviddM Offline
                                      mfalkvidd
                                      Mod
                                      wrote on last edited by
                                      #20

                                      Nice work @Kurtsejr, thanks for reporting back

                                      1 Reply Last reply
                                      0
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      22

                                      Online

                                      11.7k

                                      Users

                                      11.2k

                                      Topics

                                      113.1k

                                      Posts


                                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • MySensors
                                      • OpenHardware.io
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular