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.
  • raptorjrR Offline
    raptorjrR Offline
    raptorjr
    wrote on last edited by
    #37

    Would it be possible to enable both the Serial and Ethernet communication at the same time in the gateway? I'm about to try PiDome as a controller. And it seems that it only have support for Serial gateway. But the Ethernet gateway is so practical to use when I need to debug and use MYScontroller to connect and see what is happening. Or if I would like to try OTA updates of my nodes.

    mfalkviddM 1 Reply Last reply
    0
    • raptorjrR raptorjr

      Would it be possible to enable both the Serial and Ethernet communication at the same time in the gateway? I'm about to try PiDome as a controller. And it seems that it only have support for Serial gateway. But the Ethernet gateway is so practical to use when I need to debug and use MYScontroller to connect and see what is happening. Or if I would like to try OTA updates of my nodes.

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

      @raptorjr some people have used nodered to "split" the communication to more than one controller. NodeRed has the ability to prevent certain types of messages. If two controllers are connected to the same gateway without filtering, both controllers will respond which might be very confusing for the node.

      https://forum.mysensors.org/topic/4112/is-it-possible-to-connect-an-ethernet-gateway-to-node-red-and-share-it/ is a pretty good place to start

      raptorjrR 1 Reply Last reply
      0
      • mfalkviddM mfalkvidd

        @raptorjr some people have used nodered to "split" the communication to more than one controller. NodeRed has the ability to prevent certain types of messages. If two controllers are connected to the same gateway without filtering, both controllers will respond which might be very confusing for the node.

        https://forum.mysensors.org/topic/4112/is-it-possible-to-connect-an-ethernet-gateway-to-node-red-and-share-it/ is a pretty good place to start

        raptorjrR Offline
        raptorjrR Offline
        raptorjr
        wrote on last edited by
        #39

        @mfalkvidd

        Thank you. Maybe I should just try out PiDome first with serial gateway =)

        But anyway, I thought that mysGateway would create something like /dev/ttyMySensorsGateway that I could then use, or ln to something like ttyUSB20, and add it in PiDome.

        But after compiling and installing mysGateway with serial support I only get a a error "Unable to open the serial port /dev/ttyUSB0". Am I thinking the wrong way? Isn't mysGateway supposed to work like the old Raspberry MySensors gateway?

        M 1 Reply Last reply
        0
        • raptorjrR raptorjr

          @mfalkvidd

          Thank you. Maybe I should just try out PiDome first with serial gateway =)

          But anyway, I thought that mysGateway would create something like /dev/ttyMySensorsGateway that I could then use, or ln to something like ttyUSB20, and add it in PiDome.

          But after compiling and installing mysGateway with serial support I only get a a error "Unable to open the serial port /dev/ttyUSB0". Am I thinking the wrong way? Isn't mysGateway supposed to work like the old Raspberry MySensors gateway?

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

          @raptorjr Sorry, pseudo tty isn't supported. I will try to add it till the end of the day.

          raptorjrR 1 Reply Last reply
          1
          • M marceloaqno

            @raptorjr Sorry, pseudo tty isn't supported. I will try to add it till the end of the day.

            raptorjrR Offline
            raptorjrR Offline
            raptorjr
            wrote on last edited by
            #41

            @marceloaqno

            What does the serial gateway do then? Can I use it as it is today with PiDomo and a RasberryPi? Or do I need to make a dedicated stand-alone serial gateway with a Arduino and a NRF?

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

              @raptorjr
              In the current state, serial gateway on RPi can only use a "real" serial port like /dev/ttyAMA0 (gpio pins) or (if an arduino is connected or a USB->Serial adapter) /dev/ttyACM0. To use PiDomo you will need to put an Arduino to the mix.

              raptorjrR 1 Reply Last reply
              1
              • M marceloaqno

                @raptorjr
                In the current state, serial gateway on RPi can only use a "real" serial port like /dev/ttyAMA0 (gpio pins) or (if an arduino is connected or a USB->Serial adapter) /dev/ttyACM0. To use PiDomo you will need to put an Arduino to the mix.

                raptorjrR Offline
                raptorjrR Offline
                raptorjr
                wrote on last edited by
                #43

                @marceloaqno

                Thank you. I'll have to wait for pseudo tty or for PiDome to get support for Ethernet gateway.

                M 1 Reply Last reply
                0
                • raptorjrR raptorjr

                  @marceloaqno

                  Thank you. I'll have to wait for pseudo tty or for PiDome to get support for Ethernet gateway.

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

                  @raptorjr
                  I think PiDome also supports MQTT Gateway. Did you try that?

                  raptorjrR 1 Reply Last reply
                  0
                  • M marceloaqno

                    @raptorjr
                    I think PiDome also supports MQTT Gateway. Did you try that?

                    raptorjrR Offline
                    raptorjrR Offline
                    raptorjr
                    wrote on last edited by
                    #45

                    @marceloaqno

                    I don't really understands what MQTT is and how to use it. But maybe I'll try that. Would like to see how PiDome works and if I like it better than Domoticz.

                    M 1 Reply Last reply
                    0
                    • raptorjrR raptorjr

                      @marceloaqno

                      I don't really understands what MQTT is and how to use it. But maybe I'll try that. Would like to see how PiDome works and if I like it better than Domoticz.

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

                      @raptorjr PiDome should work now (https://forum.mysensors.org/topic/2389/added-support-for-local-mysensors-rpi-direct-radio-connection).

                      You need to add --my-serial-is-pty when running ./configure or uncomment the line #define MY_IS_SERIAL_PTY in mysGateway.cpp.

                      raptorjrR 2 Replies Last reply
                      2
                      • M marceloaqno

                        @raptorjr PiDome should work now (https://forum.mysensors.org/topic/2389/added-support-for-local-mysensors-rpi-direct-radio-connection).

                        You need to add --my-serial-is-pty when running ./configure or uncomment the line #define MY_IS_SERIAL_PTY in mysGateway.cpp.

                        raptorjrR Offline
                        raptorjrR Offline
                        raptorjr
                        wrote on last edited by
                        #47

                        @marceloaqno

                        Wow. That was fast work =)

                        Trying it now and the /dev/ttyMySensorsGateway is created. Followed the guide in the link you provided. Everything goes great until the last step. I don't see the message "Gateway startup complete". So I don't know if I have any communication between PiDome and the gateway?

                        I'll start reading forums and see if I can find a solution. Or if I missed something.

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

                          @marceloaqno I've got the MysGateway configured and built to be an MQTT Gateway. I have a node (MySensors v2.01) sending temperature, humidity and voltage data to the Gateway. Looking at the stdout on the Raspberry Pi I can see that the information is being correctly received but there seems to be a problem with the published messages. I'm getting "send: Broken pipe" messages. I've copied and pasted some of the MysGateway stdout terminal output below. Do you have any insights on what might be going wrong?

                          Thanks very much

                          Sending message on topic: MyGW2out/0/255/0/0/18
                          TSF:MSG:READ,20-20-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
                          TSF:MSG:BC
                          TSF:MSG:FPAR REQ,ID=20
                          TSF:CHKUPL:OK
                          TSF:MSG:GWL OK
                          TSF:MSG:SEND,0-0-20-20,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
                          TSF:MSG:READ,20-20-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
                          TSF:MSG:PINGED,ID=20,HP=1
                          TSF:MSG:SEND,0-0-20-20,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
                          TSF:MSG:READ,20-20-0,s=255,c=3,t=12,pt=0,l=3,sg=0:0.5
                          Sending message on topic: MyGW2out/20/255/3/0/12
                          send: Broken pipe
                          Attempting MQTT connection...
                          MQTT connected
                          Sending message on topic: MyGW2out/0/255/0/0/18
                          TSF:MSG:READ,20-20-0,s=2,c=0,t=23,pt=0,l=0,sg=0:
                          Sending message on topic: MyGW2out/20/2/0/0/23
                          TSF:MSG:READ,20-20-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
                          TSF:MSG:SEND,0-0-20-20,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
                          TSF:MSG:READ,20-20-0,s=1,c=1,t=0,pt=7,l=5,sg=0:19.9
                          Sending message on topic: MyGW2out/20/1/1/0/0
                          send: Broken pipe
                          Attempting MQTT connection...
                          MQTT connected
                          Sending message on topic: MyGW2out/0/255/0/0/18
                          TSF:MSG:READ,20-20-0,s=2,c=1,t=38,pt=7,l=5,sg=0:3319.0
                          Sending message on topic: MyGW2out/20/2/1/0/38
                          send: Broken pipe
                          Attempting MQTT connection...
                          MQTT connected
                          Sending message on topic: MyGW2out/0/255/0/0/18
                          TSF:MSG:READ,20-20-0,s=0,c=1,t=1,pt=7,l=5,sg=0:58.6
                          Sending message on topic: MyGW2out/20/0/1/0/1
                          send: Broken pipe
                          Attempting MQTT connection...
                          MQTT connected
                          Sending message on topic: MyGW2out/0/255/0/0/18

                          1 Reply Last reply
                          0
                          • b0rmannB Offline
                            b0rmannB Offline
                            b0rmann
                            wrote on last edited by
                            #49

                            feature request: logging via syslog (journald). or unbuffered debug output to stdio

                            1 Reply Last reply
                            0
                            • M marceloaqno

                              @raptorjr PiDome should work now (https://forum.mysensors.org/topic/2389/added-support-for-local-mysensors-rpi-direct-radio-connection).

                              You need to add --my-serial-is-pty when running ./configure or uncomment the line #define MY_IS_SERIAL_PTY in mysGateway.cpp.

                              raptorjrR Offline
                              raptorjrR Offline
                              raptorjr
                              wrote on last edited by
                              #50

                              @marceloaqno

                              I think there may be a memory leak in the gateway. While using it as a ethernet gateway I loose about 100Mb every day, if my only node is turned on. After a few days I can't even login with SSH and need to remove the power to my Pi3 to reboot it.

                              If I turn off my node, memory usage is normal. So it seems to have something to to when messages is received/transmitted. Is there anything I can do to get more details where the problem could be?

                              I'm using the image from Domoticz where everything is installed, and have only added mysGateway.

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

                                @raptorjr @hawk_2050 I'll check.
                                @b0rmann I'll do something about it.

                                1 Reply Last reply
                                0
                                • raptorjrR raptorjr

                                  @marceloaqno

                                  I think there may be a memory leak in the gateway. While using it as a ethernet gateway I loose about 100Mb every day, if my only node is turned on. After a few days I can't even login with SSH and need to remove the power to my Pi3 to reboot it.

                                  If I turn off my node, memory usage is normal. So it seems to have something to to when messages is received/transmitted. Is there anything I can do to get more details where the problem could be?

                                  I'm using the image from Domoticz where everything is installed, and have only added mysGateway.

                                  b0rmannB Offline
                                  b0rmannB Offline
                                  b0rmann
                                  wrote on last edited by
                                  #52

                                  @raptorjr

                                  gateway running 8 days:

                                  pi@pi:~$ ls -ld /proc/`pidof mysGateway`
                                  dr-xr-xr-x 7 root root 0 Aug 30 22:40 /proc/3935
                                  

                                  memory consumption (peak) - 22M

                                  pi@pi:~$ cat /proc/`pidof mysGateway`/status
                                  Name:   mysGateway
                                  State:  S (sleeping)
                                  Tgid:   3935
                                  Ngid:   0
                                  Pid:    3935
                                  PPid:   1
                                  TracerPid:      0
                                  Uid:    0       0       0       0
                                  Gid:    0       0       0       0
                                  FDSize: 256
                                  Groups:
                                  NStgid: 3935
                                  NSpid:  3935
                                  NSpgid: 3935
                                  NSsid:  3935
                                  VmPeak:    22108 kB
                                  VmSize:    22108 kB
                                  VmLck:         0 kB
                                  VmPin:         0 kB
                                  VmHWM:      3088 kB
                                  VmRSS:      3088 kB
                                  VmData:      236 kB
                                  VmStk:       136 kB
                                  VmExe:        80 kB
                                  VmLib:      4392 kB
                                  VmPTE:        30 kB
                                  VmPMD:         0 kB
                                  VmSwap:        0 kB
                                  Threads:        1
                                  SigQ:   0/7339
                                  SigPnd: 0000000000000000
                                  ShdPnd: 0000000000000000
                                  SigBlk: 0000000000000000
                                  SigIgn: 0000000000001000
                                  SigCgt: 0000000180004002
                                  CapInh: 0000000000000000
                                  CapPrm: 0000003fffffffff
                                  CapEff: 0000003fffffffff
                                  CapBnd: 0000003fffffffff
                                  Seccomp:        0
                                  Cpus_allowed:   f
                                  Cpus_allowed_list:      0-3
                                  Mems_allowed:   1
                                  Mems_allowed_list:      0
                                  voluntary_ctxt_switches:        71974874
                                  nonvoluntary_ctxt_switches:     167964
                                  
                                  1 Reply Last reply
                                  0
                                  • M marceloaqno

                                    @b0rmann It should work now. Thank you for reporting this.

                                    alexsh1A Offline
                                    alexsh1A Offline
                                    alexsh1
                                    wrote on last edited by
                                    #53

                                    @marceloaqno Hi, could you please explain to me what the steps are to compile it for RPi3?
                                    I went here - https://github.com/marceloaqno/Raspberry
                                    Downloaded and tried to compile. The following error has come up:

                                    pi@m:~/Raspberry-GW $ make all
                                    make -C librf24-bcm
                                    make[1]: Entering directory '/home/pi/Raspberry-GW/librf24-bcm'
                                    cp utility/RPi/includes.h utility/includes.h
                                    g++ -Wall -fPIC -Ofast -mfpu=vfp -mfloat-abi=hard -march=armv7-a -mtune=arm1176jzf-s -c RF24.cpp
                                    g++ -Wall -fPIC -Ofast -mfpu=vfp -mfloat-abi=hard -march=armv7-a -mtune=arm1176jzf-s -c utility/RPi/spi.cpp
                                    gcc -Wall -fPIC -Ofast -mfpu=vfp -mfloat-abi=hard -march=armv7-a -mtune=arm1176jzf-s -c utility/RPi/bcm2835.c
                                    g++ -Wall -fPIC -Ofast -mfpu=vfp -mfloat-abi=hard -march=armv7-a -mtune=arm1176jzf-s -c utility/RPi/interrupt.c
                                    g++ -shared -Wl,-soname,librf24-bcm.so.1 -pthread -Ofast -mfpu=vfp -mfloat-abi=hard -march=armv7-a -mtune=arm1176jzf-s -o librf24-bcm.so.1.0 RF24.o spi.o bcm2835.o interrupt.o
                                    make[1]: Leaving directory '/home/pi/Raspberry-GW/librf24-bcm'
                                    g++ -std=c++0x -g -Wall -Wextra -Ofast -mfpu=vfp -mfloat-abi=hard -mtune=arm1176jzf-s -Ilibmysensors -Ilibrf24-bcm -pthread -DRASPBERRYPI_ARCH  -march=armv7-a -MMD -c -o src/Basic/PiGatewaySample.o src/Basic/PiGatewaySample.cpp
                                    src/Basic/PiGatewaySample.cpp: In function ‘int main()’:
                                    src/Basic/PiGatewaySample.cpp:63:15: error: ‘usleep’ was not declared in this scope
                                       usleep(10000); // 10ms
                                                   ^
                                    Makefile:103: recipe for target 'src/Basic/PiGatewaySample.o' failed
                                    make: *** [src/Basic/PiGatewaySample.o] Error 1
                                    

                                    Thanks

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

                                      OK, I manage to install it finally.

                                      However, again I have a problem:

                                      ./configure --my-gateway=ethernet --my-rf24-channel=1 --my-rf24-pa-level=RF24_PA_MAX --my-controller-ip-address=127,0,0,1
                                      

                                      when I start it I have the following in the log:

                                      failed to bind
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      accept: Bad file descriptor
                                      
                                      
                                      
                                      1 Reply Last reply
                                      0
                                      • M Offline
                                        M Offline
                                        marceloaqno
                                        Code Contributor
                                        wrote on last edited by marceloaqno
                                        #55

                                        Add some options to the gateway execution:

                                        # ./examples_linux/mysGateway -h
                                        Usage: mysGateway [options]
                                        
                                        Options:
                                        -h            Display a short summary of all program options.
                                        -d            Enable debug.
                                        -b            Become a daemon.
                                        

                                        Debug is now disabled by default.
                                        You can't run it as a linux daemon if debug is enabled.
                                        When daemonized all messages will be print to syslog.

                                        b0rmannB alexsh1A 2 Replies Last reply
                                        2
                                        • M marceloaqno

                                          Add some options to the gateway execution:

                                          # ./examples_linux/mysGateway -h
                                          Usage: mysGateway [options]
                                          
                                          Options:
                                          -h            Display a short summary of all program options.
                                          -d            Enable debug.
                                          -b            Become a daemon.
                                          

                                          Debug is now disabled by default.
                                          You can't run it as a linux daemon if debug is enabled.
                                          When daemonized all messages will be print to syslog.

                                          b0rmannB Offline
                                          b0rmannB Offline
                                          b0rmann
                                          wrote on last edited by
                                          #56
                                          This post is deleted!
                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          7

                                          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