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. MQTT Client gateway

MQTT Client gateway

Scheduled Pinned Locked Moved Development
91 Posts 33 Posters 52.0k Views 14 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.
  • cowen71C Offline
    cowen71C Offline
    cowen71
    wrote on last edited by cowen71
    #81

    OK - I couldn't sleep and so I am back for a short time.

    So first I have to confess, I did not read the instructions from Samuel correctly and downloaded the Stable libraries rather than the development versions. I have corrected this. With the development libraries several of my other sketches will no longer compile - but lets not worry about that now!!

    Next - I could not find within the mqttClientGateway sketch within the downloaded development folder. In the case I am just having a blonde moment, could you tell me exactly where this is located please.

    Final question regarding the folder structures. I have the Arduino installation in the program files where it installs automatically, and then my Sketchbook is set up as follows..

    \Arduino\Hardware
    \Arduino\Documentation
    \Arduino\Sketch\libraries
    \Arduino\Sketch\mqttGateway
    \Arduino\Sketch\pondController (etc... - folders for other sketches)

    S 1 Reply Last reply
    0
    • cowen71C cowen71

      OK - I couldn't sleep and so I am back for a short time.

      So first I have to confess, I did not read the instructions from Samuel correctly and downloaded the Stable libraries rather than the development versions. I have corrected this. With the development libraries several of my other sketches will no longer compile - but lets not worry about that now!!

      Next - I could not find within the mqttClientGateway sketch within the downloaded development folder. In the case I am just having a blonde moment, could you tell me exactly where this is located please.

      Final question regarding the folder structures. I have the Arduino installation in the program files where it installs automatically, and then my Sketchbook is set up as follows..

      \Arduino\Hardware
      \Arduino\Documentation
      \Arduino\Sketch\libraries
      \Arduino\Sketch\mqttGateway
      \Arduino\Sketch\pondController (etc... - folders for other sketches)

      S Offline
      S Offline
      Samuel235
      Hardware Contributor
      wrote on last edited by
      #82

      @cowen71, so lets get to know where your sketch book is located. I may have wrongly assumed this in my last post. Could you go to your arduino IDE > file > Preferences. On that panel you should see the location of your sketchbook, the default will be in your Documents folder, within another folder called Arduino. This is now where all of the sketches should be located. So if we go there you should have a folder structure like I mentioned in my last post. At least for this instance, could you get the latest development branch of MySensors Libraries. If i remember correctly, the software guys here have redone the MQTT client gateway sketch in the development branch to now work properly.

      This is why i was asking what ethernet module you was using, because they have two mqtt gateway sketches now, one for W5100 (the one i use) and then one for ESP8266. These will be named appropriately for you to see. They also have a serial version in there too, which i have never used. Use the appropriate one for you, all instructions for pin changes SHOULD be inside, i may be wrong though.

      In regards to your folder structure again, you're using the program files directory. This is incorrect as this is simply where arduino installs itself. You do not want to be putting your sketches for arduino IDE in there (if the location for your sketches inside of the preference menu for arduino IDE states a different location). Where ever your arduino IDE states is the sketchbook, place your sketches/libraries in there.

      MySensors 2.1.1
      Controller - OpenHAB (Virtual Machine)
      Gateway - Arduino Mega MQTT Gateway W5100

      1 Reply Last reply
      0
      • cowen71C Offline
        cowen71C Offline
        cowen71
        wrote on last edited by
        #83

        Hi Samuel,

        Firstly the folder structure - my previous explanation was poor. Let me try again. Under Program Files I have the normal installation that is done automatically. So far so good I think.
        Under a separate dedicated folder (c:\cloudstation\arduino) I have the additional directories I mentioned above. So..
        \Hardware
        \Documentation
        \Sketch\libraries
        \Sketch\mqttGateway (for example)
        \Sketch\pondController (etc... - folders for other sketches)
        \Sketch\mqttClientGateway (I hope to have this!!)
        I had already correctly set the sketchbook location in the preferences. I "think" this is correct as installing new libraries seems to install them to the correct location.

        And I did find of course the examples folder and the 'GatewayW5100MQTTClient'. But I thought this was actually a sketch providing the framework rather than a complete functional mqttClientGateway. It certainly seems a little sparse!

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tomkxy
          wrote on last edited by
          #84

          @cowen71 The whole library has been completely refactored. Yes, the sketch looks sparse. You get all the necessary functionality by the define

          #define MY_GATEWAY_MQTT_CLIENT
          

          which is as far as I remember already in the sketch.

          S 1 Reply Last reply
          0
          • T tomkxy

            @cowen71 The whole library has been completely refactored. Yes, the sketch looks sparse. You get all the necessary functionality by the define

            #define MY_GATEWAY_MQTT_CLIENT
            

            which is as far as I remember already in the sketch.

            S Offline
            S Offline
            Samuel235
            Hardware Contributor
            wrote on last edited by
            #85

            And from what i remember, this then enables it to gather the code required from the files from the #include function. This is the beauty of mysensors layout, enables us to use very clean and easy to read sketches for the newbies to completely understand. This is half of the error your getting when it referes to that .h file that it cant find. That is some of the code needed to run this gateway sketch.

            This is one of the reasons i love MySensors so much.

            MySensors 2.1.1
            Controller - OpenHAB (Virtual Machine)
            Gateway - Arduino Mega MQTT Gateway W5100

            1 Reply Last reply
            0
            • cowen71C Offline
              cowen71C Offline
              cowen71
              wrote on last edited by
              #86

              Guys, firstly, Thank you. You have the patience of saints!
              Believe it or not, I am actually a Software developer/Electronics engineer by trade but PC based. The Arduino platform is a new experience for me and my previous uC experience is 20years old!

              I now have a working mqttClientGateway. I need to play some more - but first indications are that it is working well.

              My problems were a combination of bad folder structure and also bad combinations of sketches and libraries (desperately trying to play down the lack of experience factor here!!). Once I got this sorted, it started working.

              A huge 'High 5' to you guys. I owe you a bier or maybe 2!

              Not a question for this thread I know, but before I leave you in peace - what are you using for your Home Automation controllers? I have been playing with openHab and this seems to work well, but I have not really investigated the others.

              S 1 Reply Last reply
              1
              • cowen71C cowen71

                Guys, firstly, Thank you. You have the patience of saints!
                Believe it or not, I am actually a Software developer/Electronics engineer by trade but PC based. The Arduino platform is a new experience for me and my previous uC experience is 20years old!

                I now have a working mqttClientGateway. I need to play some more - but first indications are that it is working well.

                My problems were a combination of bad folder structure and also bad combinations of sketches and libraries (desperately trying to play down the lack of experience factor here!!). Once I got this sorted, it started working.

                A huge 'High 5' to you guys. I owe you a bier or maybe 2!

                Not a question for this thread I know, but before I leave you in peace - what are you using for your Home Automation controllers? I have been playing with openHab and this seems to work well, but I have not really investigated the others.

                S Offline
                S Offline
                Samuel235
                Hardware Contributor
                wrote on last edited by
                #87

                @cowen71, you seem to be an awful lot like me ;) I'm using that exact sketch for the gateway with a W5100, modified in an enclosure with incating LEDs on to show the communication. I too use OpenHAB and love it. However i'm yet to experiment with others. Drop me a message, i feel we could have some decent conversations!

                Glad you have gotten your gateway working, pleased it was such a simple solution!

                MySensors 2.1.1
                Controller - OpenHAB (Virtual Machine)
                Gateway - Arduino Mega MQTT Gateway W5100

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tomkxy
                  wrote on last edited by
                  #88

                  I am using Openhab. I also did not investigate into a lot of controllers. What I like about Openhab is the powerful rules engine and the tons of bindings it support.
                  If you are able to program possibilities seem to endless.

                  S 1 Reply Last reply
                  0
                  • T tomkxy

                    I am using Openhab. I also did not investigate into a lot of controllers. What I like about Openhab is the powerful rules engine and the tons of bindings it support.
                    If you are able to program possibilities seem to endless.

                    S Offline
                    S Offline
                    Samuel235
                    Hardware Contributor
                    wrote on last edited by
                    #89

                    @tomkxy, it seems that openhab users all love it for the exact same reasons. They sure have a strong client base. Those that like it, love it. I've never tried any of the others and i don't have any inclination to. The only other controller i really like the look of is MYScontroller being created by the software smartass' here ;). When it becomes more feature rich I'll be trialing it for my home :)

                    MySensors 2.1.1
                    Controller - OpenHAB (Virtual Machine)
                    Gateway - Arduino Mega MQTT Gateway W5100

                    1 Reply Last reply
                    0
                    • rollercontainerR Offline
                      rollercontainerR Offline
                      rollercontainer
                      wrote on last edited by
                      #90

                      I'am trying to add a local DHT22 sensor but as soon as anything is in the loop(), the gateway stops to work.

                      even if I delete the sleep() rows. Hasn't it to be wait() ?

                      1 Reply Last reply
                      0
                      • rollercontainerR Offline
                        rollercontainerR Offline
                        rollercontainer
                        wrote on last edited by
                        #91

                        Got it to work. Removed serial.print lines and changed sleep() to wait().

                        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