MQTT Client gateway
-
Cheers Samuel,
I will let you know. I am happy (actually perhaps not happy!) to admit the failures are purely down to me trying to get to grips with everything here.I also have just noticed that ruslan reported the same error somewhere above and so I will also look at the solutions that worked for him.
I let you know what happens
-
OK so as you suggested - everything redownloaded and a new folder structure created. And actually, I get exactly the same problem. Incidentally, my other sketches compile no problem. Some written by me, some downloaded (e.g. Serial_Gateway, mqtt_Gateway). The only one I have a problem with is the mqttClientGateway.
I see above that ruslan had exactly the same issue 7 months ago and then got it working. The answer that helped him was....
@tomkxy said:
here https://github.com/tomkxy/Arduino.git in the branch MQTTClient.
Did you have a look at my repository above? Functional wise it is the same adapted for version 1.5. I have it in use for quite a while now.but this link seems dead now.
I better stop for the evening before my wife files for divorce! I get back to this tomorrow!
Thanks for the support so far. -
OK so as you suggested - everything redownloaded and a new folder structure created. And actually, I get exactly the same problem. Incidentally, my other sketches compile no problem. Some written by me, some downloaded (e.g. Serial_Gateway, mqtt_Gateway). The only one I have a problem with is the mqttClientGateway.
I see above that ruslan had exactly the same issue 7 months ago and then got it working. The answer that helped him was....
@tomkxy said:
here https://github.com/tomkxy/Arduino.git in the branch MQTTClient.
Did you have a look at my repository above? Functional wise it is the same adapted for version 1.5. I have it in use for quite a while now.but this link seems dead now.
I better stop for the evening before my wife files for divorce! I get back to this tomorrow!
Thanks for the support so far.@cowen71 Could you post your sketch for either me or a software contributor to see what is going on with it please. If you're certain that the error codes are the same as before then we can use the previous post as reference, if they're different in any way, please post the error codes again with the sketch :)
-
The link mentioned by @cowen71 was put into a pull request which went into the development branch. However, the MQTTClientGateway has been reworked significantly in the development branch. The message structure is now similar to the serial gateway. I just completed a "migration" from that old version to the latest development branch version which worked perfectly, apart from RF issues I had.
Thus, I suggest to use the latest version of the development branch.
-
The link mentioned by @cowen71 was put into a pull request which went into the development branch. However, the MQTTClientGateway has been reworked significantly in the development branch. The message structure is now similar to the serial gateway. I just completed a "migration" from that old version to the latest development branch version which worked perfectly, apart from RF issues I had.
Thus, I suggest to use the latest version of the development branch.
@tomkxy, if he followed my instructions like he said he has, he should all being well be running the latest version of the development branch. I may be incorrect but i still feel there may be some sort of folder structure error going on here.
-
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) -
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)@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.
-
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!
-
@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_CLIENTwhich is as far as I remember already in the sketch.
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.
-
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.
-
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.
@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!
-
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.@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 :)
-
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() ?
-
Got it to work. Removed serial.print lines and changed sleep() to wait().