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. Controllers
  3. MQTT Broker gateway

MQTT Broker gateway

Scheduled Pinned Locked Moved Controllers
132 Posts 34 Posters 115.6k Views 7 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.
  • CARSTENC CARSTEN

    @Damme I tried today the mysensor 1.4.1 library, uploaded with Arduino 1.5.8 to UNO with Ethernet Shield (W5100) and an NRF24L01+pa+lna. Compilation and upload worked fine.
    I can ping the IP address defined in the MQTTGateway.ino sketch.
    I maintained on my RPI the openhab.cfg file with the url and port number from the gateway.
    When starting the openhab it shows:
    ... - MQTT Service initialization completed.
    ... - Starting MQTT broker connection 'mysensor'.

    Then a couple of message later:
    ...Mqtt Exception
    Caused by: java.net.SocketTimeoutException: connect timed out

    Any suggestion what I could look at.

    I also tried to work with the development library of Mysensors but did not get very far with that. My ultimate goal is to something like a moteino with the RFM69HW radio module in connection with either openhab or pidome.
    I have a quite a bit of hardware lying around here so I am happy to do any testing if somebody gives me some guidance.
    Thanks.

    C Offline
    C Offline
    C.r.a.z.y.
    wrote on last edited by
    #64
    This post is deleted!
    1 Reply Last reply
    0
    • V Offline
      V Offline
      viking
      wrote on last edited by
      #65

      Thanks for the mqtt broker. Just a tip to people who might fall in to the same pit as I:

      The mqtt broker gateway doesn't distribute node ids unless you're connected to it using a mqtt client. I.e. if you did what I did, installed the gateway and wanted to test that the sensors found the gateway and was distributing the code then it doesn't work until you've connected to it. I had to go through the source code to figure it out.

      If you don't have openhab or simply want to test, this is what I did on my raspberry (but should work similarly on others)

      // install mosquitto client
      sudo apt-get install mosquitto-clients

      // Start the client, replace the 10.0.0.200 with your ip. The port will default to 1883

      mosquitto_sub -h 10.0.0.200 -d -t hello/world -v

      You should be able to see messages:
      Received PUBLISH (d0, q0, r0, m0, 'MyMQTT/20/0/V_LIGHT_LEVEL', ... (2 bytes))

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by A Former User
        #66

        Hi All

        Just a simple question:

        Are there any limitation in how many MQTT connections/sessions the MQTT Gateway can handle?

        If so, can this be changed?

        A 1 Reply Last reply
        0
        • G Offline
          G Offline
          Gambituk
          wrote on last edited by
          #67

          Hello. I am new to Mysensors, openhab and mosquitto.. I have a working knowledge of arduino and nrf24l01, and currently am running a wireless(nrf) twitter controlled heating scheduler, and am sending multiple temp (ds18b20) sensors to Xively feed.

          I am really hooked on the idea of mqtt and openhab, and i thought that mysensors seemed like a good solution for implementing that idea.

          My progress so far is to install the DallasTemperatureSensor by MySensors node to one nano, and the ethernet gateway sketc as a first step, and now i have installed the mqttgateway again from the build page, and i have a working install of mosquitto and openhab on a rasp pi b+.

          I am just having difficulty getting it all stuck together. I have created the sitemap items and transform files as above and can access the openhab sitemap for the above configuration. i just don't know if i need to configure other items? how can i test each step? and can i use mosquitto with the setup that i have outlined. There seems to be conflicting info about what can and cannot be done with mosquitto and mysensors.

          1 do i need to modify the sketch of the temp node? i have some output from the serial that suggests that it is communicating with the gateway.
          2 do i need to modify the gateway with info of the mosquitto server?
          3 what can i do to test each step of the transit from temp sensor to openhab?

          Thanks for any and all responses.

          1 Reply Last reply
          0
          • X Offline
            X Offline
            xefil
            wrote on last edited by
            #68

            Hello!

            I've downloaded the 1.4.1 version of the library and tested it via OpenHab.
            I'm still not getting the sketch_name correctly via MQTT and Openhab. Is it still an open bug?

            Thanks!

            Simon

            1 Reply Last reply
            1
            • I Offline
              I Offline
              igorvin2
              wrote on last edited by
              #69

              Hi Simon,
              I had the same problem
              I tried several time clean Eeprom and flash sketch again but with no results
              Only after cleaning of Eeprom with the following scratch my sensor is starting work correctly
              I recommend to try it:
              Clearing EEPROM

              Igor

              1 Reply Last reply
              0
              • ? A Former User

                Hi All

                Just a simple question:

                Are there any limitation in how many MQTT connections/sessions the MQTT Gateway can handle?

                If so, can this be changed?

                A Offline
                A Offline
                alexeinz
                wrote on last edited by
                #70

                @mwhansen Hi, I am also struggling with this, seems it can only handle one connection now which makes it extremely hard to debug or check node ids

                mqtt gw 1.4 /openhab / zwave

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

                  @Gambituk To connect to a external MQTT server (mosquitto) use this MQTT gateway version:
                  http://forum.mysensors.org/topic/524/mqtt-client-gateway/

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    Gambituk
                    wrote on last edited by
                    #72

                    Thanks @celonunes I eventually found that version of gateway via somebody else. i have another post with some issues i found with that version. http://forum.mysensors.org/topic/921/strange-value-being-sent-from-controller-using-mixed-temp-relay-node it's not really resolved, but i have some kind of workaround.

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

                      @mwhansen @alexeinz The MQTT gateway can handle up to four simultaneous socket connections, this is the limit of Arduino ethernet shield (Wiznet W5100).

                      The problem is that openhab don't get along with the way the gateway handles multiple client packages. I will send a fix for this problem in the next few days.

                      A 1 Reply Last reply
                      0
                      • M marceloaqno

                        @mwhansen @alexeinz The MQTT gateway can handle up to four simultaneous socket connections, this is the limit of Arduino ethernet shield (Wiznet W5100).

                        The problem is that openhab don't get along with the way the gateway handles multiple client packages. I will send a fix for this problem in the next few days.

                        A Offline
                        A Offline
                        alexeinz
                        wrote on last edited by
                        #74

                        @celonunes actually, i figured a way around it using mosquitto bridge
                        that way its much more robust too, so I am good :-)
                        can post my conf if anyone interested.

                        mqtt gw 1.4 /openhab / zwave

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

                          Those are the most recent changes to MQTT gateway:

                          • Fixed node id distribution by the gateway (reported by @viking)
                          • Fixed the problem with openhab and multiple MQTT clients
                          • Fixed the appearance of garbage in messages sent from MQTT to a node
                          1 Reply Last reply
                          1
                          • C Offline
                            C Offline
                            C.r.a.z.y.
                            wrote on last edited by C.r.a.z.y.
                            #76

                            I can't change on-off manually for button with relay sketch, if i try, connection is lost, switching from screen never works again until restart everything.

                            2015-03-05 15:51:29.200 [INFO ] [runtime.busevents ] - node2_sw2 received command OFF
                            2015-03-05 15:51:32.624 [INFO ] [runtime.busevents ] - node2_sw2 received command ON

                            Openhab 1.6.2 or 1.7.0 same result.

                            **My main problem is losing connections with nodes. I also tried serial binding and same result.
                            **
                            Mysensors+Openhab useless with mqtt and also serial binding

                            M hekH 2 Replies Last reply
                            0
                            • C C.r.a.z.y.

                              I can't change on-off manually for button with relay sketch, if i try, connection is lost, switching from screen never works again until restart everything.

                              2015-03-05 15:51:29.200 [INFO ] [runtime.busevents ] - node2_sw2 received command OFF
                              2015-03-05 15:51:32.624 [INFO ] [runtime.busevents ] - node2_sw2 received command ON

                              Openhab 1.6.2 or 1.7.0 same result.

                              **My main problem is losing connections with nodes. I also tried serial binding and same result.
                              **
                              Mysensors+Openhab useless with mqtt and also serial binding

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

                              @C.r.a.z.y. Could you send the serial output from the gateway? And a more complete log from openhab showing errors?

                              C 1 Reply Last reply
                              0
                              • C C.r.a.z.y.

                                I can't change on-off manually for button with relay sketch, if i try, connection is lost, switching from screen never works again until restart everything.

                                2015-03-05 15:51:29.200 [INFO ] [runtime.busevents ] - node2_sw2 received command OFF
                                2015-03-05 15:51:32.624 [INFO ] [runtime.busevents ] - node2_sw2 received command ON

                                Openhab 1.6.2 or 1.7.0 same result.

                                **My main problem is losing connections with nodes. I also tried serial binding and same result.
                                **
                                Mysensors+Openhab useless with mqtt and also serial binding

                                hekH Online
                                hekH Online
                                hek
                                Admin
                                wrote on last edited by
                                #78

                                @C.r.a.z.y. said:

                                I can't change on-off manually for button with relay sketch, if i try, connection is lost, switching from screen never works again until restart everything.

                                Are you sure it isn't a powering issue of the "button-node" where radio shuts down when you press the button? Are you controlling a physical relay?

                                1 Reply Last reply
                                0
                                • M marceloaqno

                                  @C.r.a.z.y. Could you send the serial output from the gateway? And a more complete log from openhab showing errors?

                                  C Offline
                                  C Offline
                                  C.r.a.z.y.
                                  wrote on last edited by
                                  #79

                                  @celonunes You can find MQTT and serial logs in the zip files openhab 1.6.2 and 1.7.0 logs-1.7.0.zip logs-1.6.2.zip

                                  @hek My nodes are working perfect when i only plug serial usb to any usb socket of a computer-printer-usb hub even a mobile phone charger :) they are good without server/controller

                                  1 Reply Last reply
                                  0
                                  • C Offline
                                    C Offline
                                    C.r.a.z.y.
                                    wrote on last edited by
                                    #80

                                    @hek My relay powered from nano icp headers maybe this makes trouble for wifi , i will change this and give update.

                                    My button is not normal button , its an ir distance sensor which trigers the relay.

                                    1 Reply Last reply
                                    0
                                    • H Offline
                                      H Offline
                                      hooraysimpsons
                                      wrote on last edited by
                                      #81

                                      I can't seem to get openhab to communicate with my MQTT gateway. I can connect to the gateway with the MyMQTT Android app and I receive messages from my light sensor node including the sketch name and light level. I can ping my gateway without issue as well.

                                      However, OpenHab never seems like it notices the gateway. No data in the sketch name or node result. I've used the sitemap, items, and config files as described above and I've also customized them to match my sensor node more specifically. Both without success. The only change I've made is my sensor node is defined as node ID 20 within it's sketch.

                                      When using start_Debug.bat what should I see in the command line window to indicate OpenHab even sees or connects to the gateway. I see no indication that it attempts to connect to the IP address of my gateway.

                                      Thanks

                                      1 Reply Last reply
                                      0
                                      • G Offline
                                        G Offline
                                        Gambituk
                                        wrote on last edited by
                                        #82

                                        Maybe if you can share your items, sitemap, and rules if any.

                                        H 1 Reply Last reply
                                        0
                                        • G Gambituk

                                          Maybe if you can share your items, sitemap, and rules if any.

                                          H Offline
                                          H Offline
                                          hooraysimpsons
                                          wrote on last edited by hooraysimpsons
                                          #83

                                          @Gambituk
                                          openhab.cfg
                                          test.items
                                          1present0absent.map
                                          test.sitemap

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


                                          16

                                          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