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. Development
  3. MySensors Raspberry port suggestions

MySensors Raspberry port suggestions

Scheduled Pinned Locked Moved Development
96 Posts 14 Posters 42.4k Views 17 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.
  • E Offline
    E Offline
    emc2
    Hardware Contributor
    wrote on last edited by
    #66

    Good to know then, thanks!

    1 Reply Last reply
    1
    • alexsh1A Offline
      alexsh1A Offline
      alexsh1
      wrote on last edited by
      #67

      BTW, I am using a nice adapter for nrf24l01+ LNA+PA designed by @GertSanders :
      https://www.openhardware.io/view/17/Raspberry-Pi2-GPIO-interface-for-NRF24L01

      Works nicely with this port and RPi 3.

      1 Reply Last reply
      0
      • E Offline
        E Offline
        emc2
        Hardware Contributor
        wrote on last edited by emc2
        #68

        Same, I had one Pi with GertSanders adapter and now switched to the SMD versions to fit nicely in my case.
        https://www.openhardware.io/view/105/MySRaspiGW
        https://www.openhardware.io/view/116/MySRaspiGW-PALNA

        Interestingly the regular one is working better than the PA+LNA version since moved to 2.0, at least in term of sending commands. Receiving is fine. Compiling with --my-rf24-pa-level=RF24_PA_LOW helps a lot. It seems 2.0 is really more power hungry, any hope to optimize this?

        Which remind me of one thing, sorry to bother you again @marceloaqno (how) is the --my-rf24-irq-pin=<PIN> working?
        I installed wiringpi to get rid of the wiringPiISR: Can't find gpio program but I'm not sure if it's supposed to do anything in the long term.
        I was thinking updating the design of my PCB to link BCM 24 (pin 18) to the IRQ pin of the radio module but it's unclear to me if the IRQ will ever actually be used on the gateway.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          marceloaqno
          Code Contributor
          wrote on last edited by
          #69

          Those are cool adapters, I need to build one for me.

          @emc2 It's no bother at all!
          Using nrf24 IRQ pin can give you more throughput and less chance of losing messages. It makes more sense to use if you have many sensors or need to transfer binary data (https://forum.mysensors.org/topic/3594/solar-powered-observation-nesting-box-network/).

          --my-serial-is-pty will simulate a serial port and create a symbolic link to it instead of using a real one.

          E 1 Reply Last reply
          0
          • M marceloaqno

            Those are cool adapters, I need to build one for me.

            @emc2 It's no bother at all!
            Using nrf24 IRQ pin can give you more throughput and less chance of losing messages. It makes more sense to use if you have many sensors or need to transfer binary data (https://forum.mysensors.org/topic/3594/solar-powered-observation-nesting-box-network/).

            --my-serial-is-pty will simulate a serial port and create a symbolic link to it instead of using a real one.

            E Offline
            E Offline
            emc2
            Hardware Contributor
            wrote on last edited by emc2
            #70

            @marceloaqno Thanks for the heads up.
            I'm totally happy with the ethernet version, but as it seems @hek is in the process of writing guides on https://www.mysensors.org/build/raspberry I did a few tests.

            If I understood correctly (and it seems to work), to "replace" the 1.x serial gateway with the new one running the following command should work as is (/dev/ttyUSBMySensorsGateway can be renamed to /dev/ttyMySensorsGateway to be exactly as in 1.x or /dev/ttyUSB20 to bypass the symlink step)

            ./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSBMySensorsGateway --my-rf24-pa-level=RF24_PA_LOW
            

            --my-rf24-pa-level=RF24_PA_LOW can be omitted, especially if not using a PA+LNA module, but it seems 2.0 is really more power hungry than 1.4.

            @marceloaqno said:

            Those are cool adapters, I need to build one for me.

            If you are interested by the SMD ones, PM me your address and I will happily send you something!

            1 Reply Last reply
            1
            • H Offline
              H Offline
              hawk_2050
              wrote on last edited by
              #71

              @marceloaqno The mechanism for assigning the pty serial port the specified group ownership doesn't appear to be working. The pty port is always created with root:root ownership. Can you (or anyone else) confirm whether this is working for you? I'm on a Raspberry Pi 2 running Raspian Jessie. Thanks.

              M 1 Reply Last reply
              0
              • H hawk_2050

                @marceloaqno The mechanism for assigning the pty serial port the specified group ownership doesn't appear to be working. The pty port is always created with root:root ownership. Can you (or anyone else) confirm whether this is working for you? I'm on a Raspberry Pi 2 running Raspian Jessie. Thanks.

                M Offline
                M Offline
                marceloaqno
                Code Contributor
                wrote on last edited by marceloaqno
                #72

                @emc2 I appreciate the offer for the adapter, but my country's post is a little complicated (to say the least).

                @hawk_2050 /dev/ttyUSBMySensorsGateway (or any other parameter you pass to --my-serial-pty) is a symbolic link:

                $ ls -lah /dev/ttyMySensorsGateway
                lrwxrwxrwx 1 root root 10 Sep 16 12:39 /dev/ttyMySensorsGateway -> /dev/pts/2
                

                In this case it is pointing to /dev/pts/2 but can vary, and it's the one who holds the specified group ownership.

                E 1 Reply Last reply
                0
                • M marceloaqno

                  @emc2 I appreciate the offer for the adapter, but my country's post is a little complicated (to say the least).

                  @hawk_2050 /dev/ttyUSBMySensorsGateway (or any other parameter you pass to --my-serial-pty) is a symbolic link:

                  $ ls -lah /dev/ttyMySensorsGateway
                  lrwxrwxrwx 1 root root 10 Sep 16 12:39 /dev/ttyMySensorsGateway -> /dev/pts/2
                  

                  In this case it is pointing to /dev/pts/2 but can vary, and it's the one who holds the specified group ownership.

                  E Offline
                  E Offline
                  emc2
                  Hardware Contributor
                  wrote on last edited by
                  #73

                  @marceloaqno Up to you. I don't mind giving it a shot, if I send you the pcb alone it will fit in a regular letter and should not even have to go through customs etc. Worst case scenario it won't reach you.

                  1 Reply Last reply
                  0
                  • M marceloaqno

                    @ericvdb That's right. I hope to add support for RFM69, Serial and software signing very soon.

                    To use, clone the raspberryPi port for MySensors 2.0:

                    git clone https://github.com/marceloaqno/MySensors.git
                    cd MySensors
                    

                    To configure it, take a look at the options available within configure:

                    ./configure --help
                    

                    For other options, you may have to edit the sample file example_linux/mysGateway.cpp, and uncoment what you need.

                    Once done, run:

                    make
                    sudo make install
                    

                    To run the gateway you need to be root or use sudo:

                    sudo msyGateway -h
                    

                    For wiring, follow this guide:
                    https://forum.mysensors.org/topic/2437/step-by-step-procedure-to-connect-the-nrf24l01-to-the-gpio-pins-and-use-the-raspberry-as-a-serial-gateway-mysensors-1-x

                    ikkeTI Offline
                    ikkeTI Offline
                    ikkeT
                    wrote on last edited by
                    #74

                    @marceloaqno , I assume your link for the wiring pinout behind the link is for Raspi 1 A+ with 26 pin header? Or for which version?

                    I'd like to try this with raspi 2 B, would you have instructions how to wire it?

                    Raspi2:
                    raspi2 pinout
                    Raspi1:
                    raspi1 pinout

                    Thanks

                    1 Reply Last reply
                    0
                    • ikkeTI Offline
                      ikkeTI Offline
                      ikkeT
                      wrote on last edited by
                      #75

                      No, looking it again, it's vice versa, so yours is for Raspi2, right?

                      M 1 Reply Last reply
                      0
                      • ikkeTI Offline
                        ikkeTI Offline
                        ikkeT
                        wrote on last edited by
                        #76

                        So this 1.6 pinout would still apply? https://forum.mysensors.org/topic/2437/step-by-step-procedure-to-connect-the-nrf24l01-to-the-gpio-pins-and-use-the-raspberry-as-a-serial-gateway-mysensors-1-x

                        pinout

                        1 Reply Last reply
                        0
                        • ikkeTI ikkeT

                          No, looking it again, it's vice versa, so yours is for Raspi2, right?

                          M Offline
                          M Offline
                          marceloaqno
                          Code Contributor
                          wrote on last edited by
                          #77

                          @ikkeT yes, these are the default pins.
                          (SCK = 23, MISO = 21, MOSI = 19, CS = 24, CE = 22)

                          1 Reply Last reply
                          1
                          • ikkeTI Offline
                            ikkeTI Offline
                            ikkeT
                            wrote on last edited by
                            #78

                            Yahooo! It works, finally. I bet my problem was Raspi1 all along. I never realized the pinouts in github were for raspi with 40 pins, b+/2/3. Thanks!

                            M 1 Reply Last reply
                            0
                            • ikkeTI ikkeT

                              Yahooo! It works, finally. I bet my problem was Raspi1 all along. I never realized the pinouts in github were for raspi with 40 pins, b+/2/3. Thanks!

                              M Offline
                              M Offline
                              marceloaqno
                              Code Contributor
                              wrote on last edited by
                              #79

                              @ikkeT it should also work for Raspi1, I got one running fine here.

                              1 Reply Last reply
                              0
                              • ikkeTI Offline
                                ikkeTI Offline
                                ikkeT
                                wrote on last edited by
                                #80

                                OK, then I just screwed up something. Thanks for the info, so I know I can do this also with my old raspi one day.

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  marceloaqno
                                  Code Contributor
                                  wrote on last edited by marceloaqno
                                  #81

                                  Update: Added support for status leds (RX/TX/ERR), you can enable it in examples_linux/mysGateway.cpp file.

                                  E 1 Reply Last reply
                                  2
                                  • ikkeTI Offline
                                    ikkeTI Offline
                                    ikkeT
                                    wrote on last edited by
                                    #82

                                    Continuing the learning here, new questions... Thanks so far, I've now got the temp/hum/door messages sent and received from sensebender micro to raspi2. The next thing I would like to do is to send the messages as mqtt to the next box hosting some controller.

                                    How to get the mysGateway to send the stuff forward as mqtt? I tried to look into Makefile, MyConfig.h and such, but didn't quite figure out yet how to do that. Any pointers?

                                    So I'd like to have the following: sensebender -> radio -> raspi2 -> some box hosting the controller. Perhaps even outside of home, so routable traffic e.g. to OpenShift.com.

                                    Should I now somehow configure and build mysGateway to send stuff as MQTT, or pipe the traffic somehow to mqtt like mosqitto? How is this normally done if the controller server is not running on the gateway Raspi?

                                    Thanks for the patience, I'm just getting into all this interesting stuff :)

                                    mfalkviddM H 2 Replies Last reply
                                    0
                                    • ikkeTI ikkeT

                                      Continuing the learning here, new questions... Thanks so far, I've now got the temp/hum/door messages sent and received from sensebender micro to raspi2. The next thing I would like to do is to send the messages as mqtt to the next box hosting some controller.

                                      How to get the mysGateway to send the stuff forward as mqtt? I tried to look into Makefile, MyConfig.h and such, but didn't quite figure out yet how to do that. Any pointers?

                                      So I'd like to have the following: sensebender -> radio -> raspi2 -> some box hosting the controller. Perhaps even outside of home, so routable traffic e.g. to OpenShift.com.

                                      Should I now somehow configure and build mysGateway to send stuff as MQTT, or pipe the traffic somehow to mqtt like mosqitto? How is this normally done if the controller server is not running on the gateway Raspi?

                                      Thanks for the patience, I'm just getting into all this interesting stuff :)

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

                                      @ikkeT I haven't tried but using nodered should be fairly simple and very flexible. This discussion might be useful: https://forum.mysensors.org/topic/2802/flow-to-turn-serialgateway-into-mqtt-serialgateway/

                                      1 Reply Last reply
                                      1
                                      • ikkeTI ikkeT

                                        Continuing the learning here, new questions... Thanks so far, I've now got the temp/hum/door messages sent and received from sensebender micro to raspi2. The next thing I would like to do is to send the messages as mqtt to the next box hosting some controller.

                                        How to get the mysGateway to send the stuff forward as mqtt? I tried to look into Makefile, MyConfig.h and such, but didn't quite figure out yet how to do that. Any pointers?

                                        So I'd like to have the following: sensebender -> radio -> raspi2 -> some box hosting the controller. Perhaps even outside of home, so routable traffic e.g. to OpenShift.com.

                                        Should I now somehow configure and build mysGateway to send stuff as MQTT, or pipe the traffic somehow to mqtt like mosqitto? How is this normally done if the controller server is not running on the gateway Raspi?

                                        Thanks for the patience, I'm just getting into all this interesting stuff :)

                                        H Offline
                                        H Offline
                                        hawk_2050
                                        wrote on last edited by
                                        #84

                                        @ikkeT you can build the Raspberry Pi mysGateway as either Serial, Ethernet or MQTT by using appropriate commandline parameters with the configure script. Just do ./configure --help and you'll get a list of all the options available. Once you've chosen your options and run configure then you 'make'. An example of a set of options that will generate an MQTT Gateway is:
                                        ./configure --my-debug=enable --my-gateway=mqtt --my-rf24-channel=100 --my-rf24-pa-level=RF24_PA_LOW --my-controller-ip-address=127,0,0,1 --my-port=1883
                                        --my-mqtt-client-id=MyGW2 --my-mqtt-publish-topic-prefix="MyGW2out" --my-mqtt-subscribe-topic-prefix="MyGW2in"

                                        In this case my MQTT Broker is Mosquitto and is on the same Raspberry Pi hence the use of 127,0,0,1 for the specified --my-controller-ip-address. Change that as appropriate to your intended setup.

                                        Hope that helps.

                                        ikkeTI 1 Reply Last reply
                                        2
                                        • M marceloaqno

                                          @ericvdb That's right. I hope to add support for RFM69, Serial and software signing very soon.

                                          To use, clone the raspberryPi port for MySensors 2.0:

                                          git clone https://github.com/marceloaqno/MySensors.git
                                          cd MySensors
                                          

                                          To configure it, take a look at the options available within configure:

                                          ./configure --help
                                          

                                          For other options, you may have to edit the sample file example_linux/mysGateway.cpp, and uncoment what you need.

                                          Once done, run:

                                          make
                                          sudo make install
                                          

                                          To run the gateway you need to be root or use sudo:

                                          sudo msyGateway -h
                                          

                                          For wiring, follow this guide:
                                          https://forum.mysensors.org/topic/2437/step-by-step-procedure-to-connect-the-nrf24l01-to-the-gpio-pins-and-use-the-raspberry-as-a-serial-gateway-mysensors-1-x

                                          W Offline
                                          W Offline
                                          wergeld
                                          wrote on last edited by
                                          #85

                                          @marceloaqno I have been trying to build this out by first building the RF24 library using the following:

                                          git clone https://github.com/TMRh20/RF24.git
                                          cd RF24
                                          make
                                          sudo make install
                                          

                                          However, this fails on the make command:

                                          Makefile:17: Makefile.inc: No such file or directory
                                          [Running configure]
                                          [SECTION] Detecting arm compilation environment.
                                            [OK] arm-linux-gnueabihf-gcc detected.
                                            [OK] arm-linux-gnueabihf-g++ detected.
                                          [SECTION] Detecting target machine.
                                          [OK] machine detected: SoC=BCM2836, Type=RPi2, CPU=armv7l.
                                          [SECTION] Detecting DRIVER
                                            [OK] DRIVER detected:RPi.
                                          [SECTION] Detecting OS.
                                            [INFO] OS detected:LINUX.
                                          [SECTION] Preparing configuration.
                                          [SECTION] Saving configuration.
                                          [OK] Finished.
                                          arm-linux-gnueabihf-g++ -fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread  -c RF24.cpp
                                          cc1plus: error: bad value (cortex-a7) for -mtune switch
                                          Makefile:40: recipe for target 'RF24.o' failed
                                          make: *** [RF24.o] Error 1
                                          

                                          I am not sure what to do here. Looks like the gcc does not support the cortex-a7? I am trying to run this on my RPi 2 B.

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


                                          13

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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