Open Luis-Filipe opened 8 years ago
Do you see the client connect to mosquitto at all? Have you tried adding some debug to show what is happening? Have you tried the basic example the library includes to prove that part is working?
Any update?
Hello Knolleary, soon I post more for that, because I was not succeed and had to change the design . But I will return to this implementation briefly.
I am having a similar problem. I have just moved from a Uno to a Mega and am starting to have problems. I've gone back to the basic example and am getting a return code of 2 when I attempt to connect to MQTT. Can you help?
I backtracked a bit to ensure that I could run a modified version of the basic example on my network using a Uno and then tried again on the Mega and although it gave a return code of -2 on the first attempt, it was OK subsequently.
Hello guys,
I´m play around with my arduino mega with a ethernet shield and MQTT protocol, but since I´have some issues i´hope you guys can help me to solve the problem.
I work with the mosquitto in my PC to make my MQTT broker up and running, look:
C:\Program Files (x86)\mosquitto>mosquitto -v 1468107949: mosquitto version 1.4.9 (build date 08/06/2016 11:59:29.51) starting 1468107949: Using default config. 1468107949: Opening ipv6 listen socket on port 1883. 1468107949: Opening ipv4 listen socket on port 1883. 1468107949: New connection from 192.168.0.2 on port 1883. 1468107949: New client connected from 192.168.0.2 as lens_p4tRRdv0C3DTmZ00JAoxawHqi cM (c1, k120, u'iotUser'). 1468107949: Sending CONNACK to lens_p4tRRdv0C3DTmZ00JAoxawHqicM (0, 0) 1468107975: Received PUBLISH from lens_p4tRRdv0C3DTmZ00JAoxawHqicM (d0, q0, r0, m0, 'arduino/topic', ... (24 bytes))
I test with the MQTTLens to publish one message and the result is succeeded, so the MQTT protocol is working fine!
The problem is that after i grab some basic example from PubSubClient and work around a bit I see that this code is not working, I not receive any message from the arduino to the broker.
The code is very simple, but not work well, who can I fix this code to put the arduino publish and subcribe some topic, look the code:
Who is missing or is wrong?
The pubsubclient nor support Arduino Mega? Who is wrong with my code?
Thanks in advance