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. Cannot run MySensors on RPI 3

Cannot run MySensors on RPI 3

Scheduled Pinned Locked Moved Troubleshooting
32 Posts 9 Posters 3.5k Views 9 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.
  • rozpruwaczR rozpruwacz

    This weekend a had also issues with nrf24 on rpi3. I'm using openhabian image and it was all working ok. But my sd card got corrupted and i had to reinstall openhabian. So I downloaded the newest image burned and ran my setup script - which should give me running and restored setup of OpenHAB, MySensors and couple more. But mysensors didn't work ... I found that the mysgw was failing to initialise nrf module (!TSM:INIT:TSP FAIL) - wierd because even with the binary that was working in previous setup i got the same error ... same hardware only new software ... So I connected my oscilloscope to spi pins and to my amazement there was no life on MOSI pin ... I even try with python to send something trough SPI - the same result. Then I compiled the mysgw with BCM driver ... and it worked ! Even better, I recompiled again with SPIDEV driver AND STILL WORKED !!!

    So @kkanedaa try to compile with BCM driver - maybe it will work, for me it did.

    gohanG Offline
    gohanG Offline
    gohan
    Mod
    wrote on last edited by
    #23

    @rozpruwacz did you use mysensors 2.1 or 2.2?

    rozpruwaczR 1 Reply Last reply
    0
    • gohanG gohan

      @rozpruwacz did you use mysensors 2.1 or 2.2?

      rozpruwaczR Offline
      rozpruwaczR Offline
      rozpruwacz
      wrote on last edited by
      #24

      @gohan I was trying both master and developement branches (I believe ...).

      1 Reply Last reply
      0
      • rozpruwaczR Offline
        rozpruwaczR Offline
        rozpruwacz
        wrote on last edited by
        #25

        @gohan I am sure that the old binary mysgw that was working before openhabian update and was not working after openhabian update was 2.1.

        1 Reply Last reply
        0
        • gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #26

          A lot of users reported 2.1 no longer working with the more recent raspian images, while development version is known to be working better.

          1 Reply Last reply
          0
          • R reinhold

            I've been running the Ethernet gateway (port 5003) on my raspi without issues for several months now.

            @kkanedaa It looks like the development version finally works with your nrf module. Regarding the MQTT connection refused: Are you sure your MQTT broker does not need a username and password?

            kkanedaaK Offline
            kkanedaaK Offline
            kkanedaa
            wrote on last edited by
            #27

            Hello all,

            Thank you for all the replies. It is very much appreciated :)

            @reinhold said in Cannot run MySensors on RPI 3:

            I've been running the Ethernet gateway (port 5003) on my raspi without issues for several months now.

            @kkanedaa It looks like the development version finally works with your nrf module. Regarding the MQTT connection refused: Are you sure your MQTT broker does not need a username and password?

            I am starting to think that I am misunderstanding the concept of MySensors. I thought that the RPI would handle both RF24 communication and MQTT. That is not correct...right?

            And your Ethernet gateway, did you use an Arduino to make the gateway and connected it to your RPI, or is the RPi itself the gateway?

            Can't I just install Mosquitto on my RPI and use it as a gateway? I'm really confused here.

            All I did was add MySensors (dev) to a fresh install of Raspbian Stretch Lite.

            Could you please tell me what exactly you did, I would appreciate it a lot.

            @rozpruwacz Unfortunately I am still fairly new to this, and I do not know what you mean by BCM and SPIDEV... but my ultimate goal is what you are doing: using MySensors in combination with openHABian (but currently I am trying with MyController since it seems easier).

            Anyways, I hope some of you guys can help me out setting up MySensors on RPI3 :)

            Thanks again for all the replies.

            1 Reply Last reply
            0
            • rozpruwaczR Offline
              rozpruwaczR Offline
              rozpruwacz
              wrote on last edited by rozpruwacz
              #28

              @kkanedaa said in Cannot run MySensors on RPI 3:

              @rozpruwacz Unfortunately I am still fairly new to this, and I do not know what you mean by BCM and SPIDEV... but my ultimate goal is what you are doing: using MySensors in combination with openHABian (but currently I am trying with MyController since it seems easier).

              to compile the gateway with BCM driver You need to add to ./configure invocation special option, I don't remember now how it is named ... run ./configure --help and find this option - look for spidev and bcm keywords.
              and after that run make install :)

              1 Reply Last reply
              0
              • kkanedaaK Offline
                kkanedaaK Offline
                kkanedaa
                wrote on last edited by
                #29

                Hi all! Good news! I managed to make it work, finally :)

                Here is what I did (for those who might face the same problem):

                1. Fresh install of Raspbian Stretch Lite
                2. Install Mosquitto MQTT
                3. Install MySensors
                ./configure --my-transport=nrf24 --my-gateway=mqtt --my-controller-ip-address=[RPI-IP] --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1
                

                (Replace [RPI-IP] with your IP)

                1. "make" then "sudo ./bin/mysgw -d"

                I got the following output

                pi@rpi-mycontroller:~/MySensors $ sudo ./bin/mysgw -d
                mysgw: Config file /etc/mysensors.dat does not exist, creating new config file.
                mysgw: Starting gateway...
                mysgw: Protocol version - 2.2.0-rc.2
                mysgw: MCO:BGN:INIT GW,CP=RNNGL---,VER=2.2.0-rc.2
                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: MCO:BGN:STP
                mysgw: MCO:BGN:INIT OK,TSP=1
                mysgw: GWT:RMQ:MQTT RECONNECT
                mysgw: connected to 192.168.xx.166
                mysgw: GWT:RMQ:MQTT CONNECTED
                mysgw: GWT:TPS:TOPIC=mysensors-out/0/255/0/0/18,MSG SENT
                mysgw: Received SIGINT
                
                1. Auto start service with "sudo systemctl enable mysgw.service"

                Thank you for all your inputs, guys. Really really appreciated. I am looking forward playing with MySensors. Very excited :D

                1 Reply Last reply
                1
                • rozpruwaczR Offline
                  rozpruwaczR Offline
                  rozpruwacz
                  wrote on last edited by
                  #30

                  @kkanedaa said in Cannot run MySensors on RPI 3:

                  Install MySensors

                  developement branch as 2.2.0-rc.2 suggests that.
                  So you only added --my-transport=nrf24 to what You started with ? (which seems to be the default so it shouldn't matter ...)

                  kkanedaaK 1 Reply Last reply
                  0
                  • rozpruwaczR rozpruwacz

                    @kkanedaa said in Cannot run MySensors on RPI 3:

                    Install MySensors

                    developement branch as 2.2.0-rc.2 suggests that.
                    So you only added --my-transport=nrf24 to what You started with ? (which seems to be the default so it shouldn't matter ...)

                    kkanedaaK Offline
                    kkanedaaK Offline
                    kkanedaa
                    wrote on last edited by
                    #31

                    @rozpruwacz said in Cannot run MySensors on RPI 3:

                    (which seems to be the default so it shouldn't matter ...)

                    Yea, I'm confused too. But basically a fresh install of Raspbian did the trick..

                    1 Reply Last reply
                    0
                    • gohanG Offline
                      gohanG Offline
                      gohan
                      Mod
                      wrote on last edited by
                      #32

                      If you had failed mqtt connection it was most likely caused by mqtt broker non accepting anonymous connections

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


                      99

                      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