Arduino Huzzar 8266Wifi - MQTT

Hi

I decided to switch my MQTT Broker from an old Raspberry Pi2 running Jessie Light and Mosquito 2.1.14
to a new Raspberry Pi3 running Stretch and Mosquito 2.1.15.

My Adafruit Huzzar 8266Wifi connects no problem to my Old Pi2 but for the life of me I cannot get it to connect to the new Pi3 MQTT Broker.

I built the Mosquito 2.1.15 on the Pi 3 from sources without error and I can communicate with it from my old Pi2 and from mqtt_spy running on my MacBook.

I am using mqtt_esp8266 sketch example when communicating.

I do not have, nor do I want an mqtt bridged system.

All that changes is the MQTT_SERVER IP between the two.

I have even built 2.1.14 on the Pi3 to ensure that the mosquitto version is not causing the problem.

Any help / suggestions ( clean ones only please) would be gratefully received.

Thanks

On a Pi running the latest raspbian disto 4.14.34-v7+ dated Apr 16, 2018, the mosquitto version installed from the repos is 1.4.10. The latest version on Download | Eclipse Mosquitto is 1.4.15.

2.1.15 does not appear to be a valid mosquitto version. It might be a repackaging of mosquitto with its own version number. I would try installing mosquitto from the repos.

Or enable verbose/debug logging in the /etc/mosquitto/mosquitto.conf file then examine the mosquitto log file. There may be helpful messages explaining why clients are failing to connect.

Or use wireshark/tcpdump to capture and examine MQTT packets.

Sorry the version number was a typo

I have used mqtt_spy and can connect to and publish and subscribe to messages without error connecting to either the Pi2 or Pi3 Mosquitto broker. My mqtt_spy is running on my MacBook. So I am fairly sure it is not a Mosquitto issue. BTW the distro does not support websockets hence my build from source.

My ESP8266 has the same IP address when attempting to connect to either broker.

I also tried the PubSub library with the same results. The error code returned when connecting to the Pi3 broker was -2 !!

On thing I did try was to use the Ping.ping() library on my board and found that despite the ESP8266 being allocated an IP address I could not ping the new pi3 Mosquitto broker, hence the no connect! However when connecting to the old pi2 Mosquitto broker, it connected ok and clearly Ping worked. I could Ping the Pi3 broker from another computer without problems so I know it was online.

I will continue to investigate.

Thanks.

Hi All,

I have found the problem !! It looks like it was a rogue wifi AP on my network Grrr. Thanks for the ideas and sorry for the hassle.

Regards
Terry