Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. cowen71
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    cowen71

    @cowen71

    1
    Reputation
    7
    Posts
    379
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    cowen71 Follow

    Best posts made by cowen71

    • RE: MQTT Client gateway

      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.

      posted in Development
      cowen71
      cowen71

    Latest posts made by cowen71

    • RE: MQTT Client gateway

      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.

      posted in Development
      cowen71
      cowen71
    • RE: MQTT Client gateway

      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!

      posted in Development
      cowen71
      cowen71
    • RE: MQTT Client gateway

      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)

      posted in Development
      cowen71
      cowen71
    • RE: MQTT Client gateway

      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.

      posted in Development
      cowen71
      cowen71
    • RE: 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

      posted in Development
      cowen71
      cowen71
    • RE: MQTT Client gateway

      Hi Samuel,

      OK, I was hoping there was a known 'trick' to get things working, but maybe I was just dreaming. Of course, if not - much more information is needed!

      At the moment I am testing with a Mega2560 with an arduino ethernet shield attached. This has (and still does) work well with the mqtt gateway downloaded from mysensors after a few minor pin assignment changes.

      The problem I am having is that I cannot compile the mqttClientGateway code. I get errors. I have to be honest that whilst I had experience 20 years ago with PIC's and other uC's, I am incredibly rusty with C and completely new to Arduinos. So it is a steep learning curve currently. In this case, I would not be surprised if I have made a real schoolboy error!

      So what did I do?....
      At the moment I installed the PubSubLient library into the Arduino libraries file.
      I copied the code from here: https://github.com/ntruchsess/MySensors/tree/mqttclient/libraries/MySensors/examples/MQTTClientGateway
      creating the three files in my mqttClientGateway development folder.

      I changed nothing (accept target and com port and hit the compile button! This fails with the following error initially:

      sketch\MyMQTTClient.cpp:14:30: fatal error: utility/MsTimer2.h: No such file or directory
      #include "utility/MsTimer2.h"

      I modified the include text to: #include "MsTimer2.h"
      and tried to compile again again. The result is:

      sketch\MyMQTTClient.cpp: In constructor 'MyMQTTClient::MyMQTTClient(PubSubClient, uint8_t, uint8_t)':

      MyMQTTClient.cpp:106: error: no matching function for call to 'MySensor::MySensor(uint8_t&, uint8_t&)'

       MySensor(_cepin, _cspin), buffsize(0)
      
                                           ^
      

      sketch\MyMQTTClient.cpp:106:41: note: candidates are:

      In file included from sketch\MyMQTTClient.h:15:0,

                   from sketch\MyMQTTClient.cpp:13:
      

      C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:158:2: note: MySensor::MySensor(MyTransport&, MyHw&)

      MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver()

      ^

      C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:158:2: note: no known conversion for argument 1 from 'uint8_t {aka unsigned char}' to 'MyTransport&'

      C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:149:7: note: constexpr MySensor::MySensor(const MySensor&)

      class MySensor

         ^
      

      C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:149:7: note: candidate expects 1 argument, 2 provided

      C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:149:7: note: constexpr MySensor::MySensor(MySensor&&)

      C:\Program Files (x86)\Arduino\libraries\MySensors/MySensor.h:149:7: note: candidate expects 1 argument, 2 provided

      sketch\MyMQTTClient.cpp: In member function 'void MyMQTTClient::begin(rf24_pa_dbm_e, uint8_t, rf24_datarate_e, uint8_t, uint8_t, uint8_t)':

      MyMQTTClient.cpp:146: error: 'setupRepeaterMode' was not declared in this scope

      setupRepeaterMode();

                       ^
      

      MyMQTTClient.cpp:152: error: 'setupRadio' was not declared in this scope

      setupRadio(paLevel, channel, dataRate);

                                          ^
      

      MyMQTTClient.cpp:153: error: 'BASE_RADIO_ID' was not declared in this scope

      RF24::openReadingPipe(WRITE_PIPE, BASE_RADIO_ID);

                                       ^
      

      MyMQTTClient.cpp:155: error: cannot call member function 'void RF24::startListening()' without object

      RF24::startListening();

      My suspicion is I have a compatibility problem between library versions and/or the sketch I have downloaded. The radio stuff I can probably solve (hopefully) its the issues before that I am struggling with.

      Any advice would be appreciated.

      Cheers

      posted in Development
      cowen71
      cowen71
    • RE: MQTT Client gateway

      Good afternoon gents!

      So I have been playing with openHab and an arduino as a mqtt gateway and this has been successful. The only thing I don't like is that the arduino does not seem to like multiple connections to the MQTT broker.

      My next step then is to use an MQTT broker (mosquitto) on the pi and then subscribe to this from the arduino. If I understand correctly, this is exactly what this thread is discussing.

      So - I have downloaded the codes and without changing anything, tried to compile. This fails with numerous errors. I have te latest libraries installed and to be honest, I am a little lost as to what is wrong. Before I post lots of error messages, are there any known 'tricks' to get the latest version working?

      Hopefully someone can help - Thanks guys 🙂

      posted in Development
      cowen71
      cowen71