MQTT Client gateway
-
You can save program space by uploading it without a bootloader (ISP).
-
Questions (Sorry)
I have rebuild the whole original MQTT sketch so it supports the standard mysensors protocol (the serial/ethernet gateway).
With this, we have all functionality that the original mysensor serial gateway supports.What would be the downside with this implementation ?
The data being transferred is like
http://www.mysensors.org/download/serial_api_14
It is now also very easy to pass the payload an internal serial/ethernet gateway handler, but the payload is not easily interpreted as human text of course.
Would this be something to submit as a replacement of the original MQTT library?
Devs just need to push the payload to their original serial/ethernet handler, and sending messages is also in the same format
-
Remove PROGMEM from line 72 at the file PubSubClient.h
Works for me, but I really don't know why, I remember to read it somewhere.... not sure if it is "safe" to do, but at least I can compile it and test it, and BTW, works fine with my mosquitto instance on my NAS, still have to do more tests.
Regards.
EDIT: The solution is on this thread XD
-
Questions (Sorry)
I have rebuild the whole original MQTT sketch so it supports the standard mysensors protocol (the serial/ethernet gateway).
With this, we have all functionality that the original mysensor serial gateway supports.What would be the downside with this implementation ?
The data being transferred is like
http://www.mysensors.org/download/serial_api_14
It is now also very easy to pass the payload an internal serial/ethernet gateway handler, but the payload is not easily interpreted as human text of course.
Would this be something to submit as a replacement of the original MQTT library?
Devs just need to push the payload to their original serial/ethernet handler, and sending messages is also in the same format
-
Could someone please post the latest working version of the MQTT Client gateway sketch?
-
Does anyone have a version of this reworked for the new 1.5 client? Looking through the MySensor class, it looks like a lot of the code in MyMQTTClient.cpp can be removed as it's now in the sensor class. I'd like to use this for my gateway as it's a much better system than the broker gateway that's in the standard library but it needs to support message signing and the newer 1.5 code base. If someone else finished this already I'll just use that, otherwise I'll start working on it. I have family coming in town so I don't expect to get much done in the next week but assuming that the MQTT code is working fine (I have no experience with that writing an MQTT client), it shouldn't take much work to refactor the client to use the new MySensor base.
-
I just did an adaptation. I removed the MyMQTTClient.cpp completely. It looks codewise more than the MQTTGateway. I am in the process of testing it.
You can find it here https://github.com/tomkxy/Arduino.git in the branch MQTTClient.
-
Well it seems to work. Only point I saw and don't understand is that the gateway tries to send a message back to the sensor which does not seem to be an ACK. See my post here http://forum.mysensors.org/topic/1782/gateway-is-sending-command-1-type-1-c-1-t-1-message-to-sensor but so far no feedback on that. Functional wise it works, at least with my test temp and humidity sensor.
-
Please help! This MQTT client gateway fails to compile. I use 1.6.5. IDE, 1.5 library. Applied patches as suggested by ntruchsess and still get this error:
MyMQTTClient.cpp: In constructor 'MyMQTTClient::MyMQTTClient(PubSubClient, uint8_t, uint8_t)': MyMQTTClient.cpp:108: error: no matching function for call to 'MySensor::MySensor(uint8_t&, uint8_t&)' MySensor(_cepin, _cspin), buffsize(0) ^ MyMQTTClient.cpp:108:41: note: candidates are: In file included from MyMQTTClient.h:16:0, from MyMQTTClient.cpp:14: R:\Arduino\libraries\MySensors/MySensor.h:153:2: note: MySensor::MySensor(MyTransport&, MyHw&) MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver() ^ R:\Arduino\libraries\MySensors/MySensor.h:153:2: note: no known conversion for argument 1 from 'uint8_t {aka unsigned char}' to 'MyTransport&' R:\Arduino\libraries\MySensors/MySensor.h:144:7: note: MySensor::MySensor(const MySensor&) class MySensor ^ R:\Arduino\libraries\MySensors/MySensor.h:144:7: note: candidate expects 1 argument, 2 provided 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:148: error: 'setupRepeaterMode' was not declared in this scope setupRepeaterMode(); ^ MyMQTTClient.cpp:154: error: 'setupRadio' was not declared in this scope setupRadio(paLevel, channel, dataRate); ^ MyMQTTClient.cpp:155: error: 'BASE_RADIO_ID' was not declared in this scope RF24::openReadingPipe(WRITE_PIPE, BASE_RADIO_ID); ^ MyMQTTClient.cpp:157: error: cannot call member function 'void RF24::startListening()' without object RF24::startListening(); ^ no matching function for call to 'MySensor::MySensor(uint8_t&, uint8_t&)' -
to tomkhy: your gateway sketch compiles, but Arduino runs out of memory (I use Nano with W5100 ethernet module, SOFTSPI enabled). It does fit with MY_SIGNING_FEATURE and DEBUG disabled, but I need debug - somehow it is not registering with MQTT server. Please tell me how to reduce memory footprint.
-
Hi,
can this run on ESP8266 (as wifi-mqttclient-gateway), too?
GreetingsAndreas
