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. General Discussion
  3. MQTT Broker support in MySensors 1.6

MQTT Broker support in MySensors 1.6

Scheduled Pinned Locked Moved General Discussion
12 Posts 3 Posters 4.6k Views 1 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.
  • J Offline
    J Offline
    jkandasa
    Plugin Developer
    wrote on last edited by
    #1

    @hek I believe in 1.5 version we have MQTT broker which is completely different than 1.6 MQTT Client version

    In version 1.5 I'm using client version of MQTT in MyController, So from version 1.6 I should have broker version of MQTT with MyController. Am I correct?

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      Yes, the MQTT "broker" variant has been removed from development branch. It was not maintained by anyone and was rendering too much (unanswered) support questions.

      And yes, either you have to have to have a build in broker in the controller or add an external broker (like mosquito).

      J ahmedadelhosniA 2 Replies Last reply
      0
      • hekH hek

        Yes, the MQTT "broker" variant has been removed from development branch. It was not maintained by anyone and was rendering too much (unanswered) support questions.

        And yes, either you have to have to have a build in broker in the controller or add an external broker (like mosquito).

        J Offline
        J Offline
        jkandasa
        Plugin Developer
        wrote on last edited by
        #3

        @hek said:

        Yes, the MQTT "broker" variant has been removed from development branch. It was not maintained by anyone and was rendering too much (unanswered) support questions.

        And yes, either you have to have to have a build in broker in the controller or add an external broker (like mosquito).

        Thank you!

        1 Reply Last reply
        0
        • hekH hek

          Yes, the MQTT "broker" variant has been removed from development branch. It was not maintained by anyone and was rendering too much (unanswered) support questions.

          And yes, either you have to have to have a build in broker in the controller or add an external broker (like mosquito).

          ahmedadelhosniA Offline
          ahmedadelhosniA Offline
          ahmedadelhosni
          wrote on last edited by
          #4

          @hek I was also confused by this change. The API & Download page does show only 1.5 version, but 1.6 version is the one on Github, right ?

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #5

            We do releases of the "master" branch. Most recent release is 1.5.1.

            All development and pull requests happens against the "development" branch (1.6.0-beta). When this is released and merged into master, I'll update the main site to reflect the changes in api and examples.

            All download links on the site points to the correct releases in master branch.
            But the default branch on github is set to "development" on purpose. If you start cloning git repositories you probably know how to switch between branches. See:
            http://forum.mysensors.org/topic/330/how-to-contribute-code-to-the-mysensors-project/25

            ahmedadelhosniA 1 Reply Last reply
            1
            • hekH hek

              We do releases of the "master" branch. Most recent release is 1.5.1.

              All development and pull requests happens against the "development" branch (1.6.0-beta). When this is released and merged into master, I'll update the main site to reflect the changes in api and examples.

              All download links on the site points to the correct releases in master branch.
              But the default branch on github is set to "development" on purpose. If you start cloning git repositories you probably know how to switch between branches. See:
              http://forum.mysensors.org/topic/330/how-to-contribute-code-to-the-mysensors-project/25

              ahmedadelhosniA Offline
              ahmedadelhosniA Offline
              ahmedadelhosni
              wrote on last edited by
              #6

              @hek Thanks. This leads me to another question please.
              I want to try the new MQTT client version. There is no complete example, right ? Only the empty .ino file on github from the development branch. https://github.com/mysensors/Arduino/tree/development/libraries/MySensors/examples/GatewayW5100MQTTClient

              If there is no working example, then I'll have to read first the development notes ( https://docs.google.com/document/d/1NKq5uuNdnxF5jWnum7VT32mbKLjuvqlx2A5D1qQ-H3Q/edit#) and then try to know which header files to include and which interfaces to be called to run the MQTT. Am I wrong ?

              Thank you.

              1 Reply Last reply
              0
              • hekH Offline
                hekH Offline
                hek
                Admin
                wrote on last edited by
                #7

                It should be "empty". The defines at the top enables the features needed and builds the gateway for you.

                It works.. :)

                The only issue I know about right now is topic naming that the gateway subscribes to. Messages from your radio network will be looped back to the gateway by your broker because the gateway subscribes to the same topic as it publishes to (which you define in the sketch).

                I will probably rename the subscribe topic to avoid this.. Just haven't come up with any good prefix-name. Will probably just be user defined as well.

                ahmedadelhosniA 1 Reply Last reply
                0
                • hekH hek

                  It should be "empty". The defines at the top enables the features needed and builds the gateway for you.

                  It works.. :)

                  The only issue I know about right now is topic naming that the gateway subscribes to. Messages from your radio network will be looped back to the gateway by your broker because the gateway subscribes to the same topic as it publishes to (which you define in the sketch).

                  I will probably rename the subscribe topic to avoid this.. Just haven't come up with any good prefix-name. Will probably just be user defined as well.

                  ahmedadelhosniA Offline
                  ahmedadelhosniA Offline
                  ahmedadelhosni
                  wrote on last edited by
                  #8

                  @hek Great :D I reflashed the mqttclient and it works well. Will test it with another node now.
                  Thanks hek.

                  1 Reply Last reply
                  0
                  • ahmedadelhosniA Offline
                    ahmedadelhosniA Offline
                    ahmedadelhosni
                    wrote on last edited by ahmedadelhosni
                    #9

                    I have spent the last hour trying to create a new node but it keeps telling me that Radio init fail.
                    What I reached is that the below condition in RF24.cpp does not return true.

                      if( setDataRate( RF24_250KBPS ) )
                      {
                        p_variant = true ;
                      }
                    

                    Thus in trasnportInit(), the following condition will return false.

                    if (!_rf24.isPVariant()) {
                    	debug(PSTR("isPVariant\n"));
                    	return false;
                    }
                    

                    Which finally lead to print Radio fail in MysensorCore.cpp

                    
                    if (!transportInit()) {
                    			debug(PSTR("Radio init fail\n"));
                    			// Nothing more we can do
                    			while(1) {
                    				#if defined(MY_GATEWAY_ESP8266)
                    					yield();
                    				#endif
                    			};
                    		}
                    

                    I tried using two boards which were running using v1.5. I checked also version 1.5 and the setDataRate function are the same. What do you think ?

                    1 Reply Last reply
                    0
                    • ahmedadelhosniA Offline
                      ahmedadelhosniA Offline
                      ahmedadelhosni
                      wrote on last edited by
                      #10

                      I am using RelayActuator example.

                      It's 1 AM and I may have missed something :D I will try to run it again tomorrow after work. Thanks.

                      1 Reply Last reply
                      0
                      • hekH Offline
                        hekH Offline
                        hek
                        Admin
                        wrote on last edited by
                        #11

                        Usually indicates a mis-wired radio. If you´re using a non+ NRF-radio you might wanna remove that check.

                        ahmedadelhosniA 1 Reply Last reply
                        0
                        • hekH hek

                          Usually indicates a mis-wired radio. If you´re using a non+ NRF-radio you might wanna remove that check.

                          ahmedadelhosniA Offline
                          ahmedadelhosniA Offline
                          ahmedadelhosni
                          wrote on last edited by
                          #12

                          @hek I am back from work.
                          In 10 mins I knew what was the problem and you won't believe it :|
                          Since I was flashing at first the gateway, thus I defined the MY_SOFTSPI and didn't commented it back when I was flashing the relayactuator ! What a mistake !!

                          I'll keep you updated as I'll start development the logic for the gateway using mqtt and the other node.

                          Thanks hek.

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


                          10

                          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