MQTT Client gateway
-
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
-
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.
@ruslan said:
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.
Looks like you have it working now, but just incase, Previously when I have had memory issues , I have upgraded my bootloader to use Optiboot which gives you a little bit more.
HTH
-
OK. I've got the gateway to compile and get the following:
Started! 0;0;3;0;9;read: 110-110-0 s=1,c=1,t=0,pt=7,l=5:13.2 0;0;3;0;9;read: 105-105-0 s=0,c=1,t=1,pt=7,l=5:70.0 0;0;3;0;9;read: 110-110-0 s=0,c=1,t=1,pt=7,l=5:58.3 0;0;3;0;9;read: 105-105-0 s=0,c=1,t=1,pt=7,l=5:69.9 0;0;3;0;9;read: 110-110-0 s=0,c=1,t=1,pt=7,l=5:58.2 0;0;3;0;9;read: 105-105-0 s=0,c=1,t=1,pt=7,l=5:70.0 0;0;3;0;9;read: 110-110-0 s=0,c=1,t=1,pt=7,l=5:58.3 0;0;3;0;9;read: 105-105-0 s=0,c=1,t=1,pt=7,l=5:69.9 0;0;3;0;9;read: 110-110-0 s=0,c=1,t=1,pt=7,l=5:58.2 0;0;3;0;9;read: 110-110-0 s=0,c=1,t=1,pt=7,l=5:58.3 0;0;3;0;9;read: 105-105-0 s=0,c=1,t=1,pt=7,l=5:69.8 0;0;3;0;9;read: 110-110-0 s=1,c=1,t=0,pt=7,l=5:13.3 0;0;3;0;9;read: 110-110-0 s=0,c=1,t=1,pt=7,l=5:58.5I can ping the MQTTClinetGateway from another machine and I've confirmed Mosquitto is running OK with a series of pub/subs from other machines/devices and that side of things is working perfectly fine.
I'm not seeing any of the above gateway readings publish to my broker. Thoughts?
Cheers.
-
Following points to verify and check:
- is the gateway connected to the broker. As far as I remember you can check that by subscribiing to Mosquitto status messages
mosquitto_sub -v -t \$SYS/#If not check what the authentication method is mosquitto is. If it allows anonymous access make sure that "MQTT_AUTH_REQUIRED" is not defined in the MQTTClientGateway sketch. If username and password are set correctly.
It seems that you are not using signing. So ensure that your MQTTClientGateway is compiled with the signing feature disabled. That are the two points I can imagine now provided that you are sure that you have of course a working ethernet connection.
-
I downloaded and installed the development branch and got the MQTTClientGateway running on an UNO with a W5100 shield (that I'm suspicious of, in terms of its reliability). The sketch runs great for a while publishing data to Mosquitto on my Mac Mini, but then stops responding after a while. I'm pretty sure the cause of the problem is the ethernet shield as it bombs out when running other sketches - the webserver one for example.
I have a few of these ENC28J60 boards and I'd like to use one of those instead, but have had some problems.
I notice in the MQTTClientGateway sketch that I should just need to comment out the one W5100 Ethernet.h library and substitute with the UIPEthernet.h one, but I tried that and had no joy. Does anyone have a working sketch based on the ENC28J60 that they could post, along with the wiring diagram to connect that board in along with any additional tweaks necessary to get it running on an Uno? Thanks in advance. Cheers.
-
Hi Guys,
I get this:
Started! 0;0;3;0;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0: 0;0;3;0;9;version mismatch 0;0;3;0;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0: 0;0;3;0;9;version mismatchAlso the Gateway does not answer to pings. Any suggestions?
edit: after a rebbot I get valid readings in the Serial monitor of the Arduino IDE now:
0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:1 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:0 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:1 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:0 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:1 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:0 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:1 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:0 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:1 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:0 0;0;3;0;9;read: 20-20-0 s=3,c=1,t=16,pt=2,l=2:1But still, can´t ping the gw. Double checked IP and Port, seems to be fine.
-
I've ordered a new W5100 module - this time the red mini W5100 board missing the SD Card slot to see if I have better luck. Still keen to see code for an ENC based MQTTClientGateway though, as this will take a while to arrive... ;)
-
To developers of the MQTT client:
I just tried the GatewayW5100MQTTClient in the latest development branch - it gives me "0;0;3;0;9;Radio init fail" error, while GatewayW5100 sketch works fine. What could be the reason? I noticed that the declarations parts in these sketches are rather different.
My setup: ARduino nano clone + W5100 module + NRF24L01 radio. All wired as in the MySensors ethernet gateway guide ([http://www.mysensors.org/build/ethernet_gateway]) -
For the W5100 SOFTSPI has to be enabled. I see that this is missing from the sketch..
Try adding (coming from the normal W5100 sketch)
// W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal) //#define MY_W5100_SPI_EN 4 // Enable Soft SPI for NRF radio (note different radio wiring is required) // The W5100 ethernet module seems to have a hard time co-operate with // radio on the same spi bus. #if !defined(MY_W5100_SPI_EN) #define MY_SOFTSPI #define MY_SOFT_SPI_SCK_PIN 14 #define MY_SOFT_SPI_MISO_PIN 16 #define MY_SOFT_SPI_MOSI_PIN 15 #endifI'll update the repository.