User avatar
jadro
Posts: 395
Joined: Sun Oct 02, 2016 1:20 pm
Location: Croatia

MQTT client

Thu Jun 27, 2019 6:46 am

Hi folks,
Two years ago my Raspberry Pi was connected to my CloudMqtt account user and python application works with connection to that online broker.
Then I decided that is time to run ownlocal Mosquitto server and this works for two years from then. Ma python application works with no problems connected to local broker within IP of local broker.
My Raspberry Pi has No-Ip for dinamic IP and also have web server that is operable from outside of the local area (from web). Router has PORT FORWARDS and few ports are opened and this all things works great including web sockets...
My NodeMcu ESP8266 v3 (I have two same with LUA code program on it) works.

I have no BRIDGE between CloudMqtt and my Raspberry Pi broker.

Yesterday I flash new LOLIN NodeMcu ESP8266 with same program but with new user ID in mosquitto local RPi broker. I have ACL file with those two and I put new one like others that works. I also have password file for user on local broker.
I return two years ago, when those two NodeMcu works and app in LUA has connected to CloudMQTT with same topic, same pass, same users on CloudMqtt like my python rappberry Pi application. Than, when I replace my broker m20.mqtt.com with my local IP 192.168.x.x all works as espected, no problem. My local broker works, yeah, great.
My NodeMcu are stil connected today to my CloudMqtt and strange thing is that my Python client (brain) script/application receive payloads from topics from NodeMcu that is connected to CloudMqt. How It is possible? My brain app python is connected to local broker and NodeMcu on cloud broker but communicate between with no problem. My android application client is connected to my local IP (it is on wifi local) and when I hit the button, it sends payloads to NodeMcu that are connected to CloudMqtt.... Why? Is there some theory explanation for this?

Jadro
Oracle backend database developer
SmartHome IoT & Microprocessor enthusiast and hobbyist

User avatar
jadro
Posts: 395
Joined: Sun Oct 02, 2016 1:20 pm
Location: Croatia

Re: MQTT client

Sat Jun 29, 2019 8:50 pm

I did it, i put my third nodemcu lua mqtt client into local mqtt server two days ago. But strange situation stais, how can second nodemcu bee connected to web online broker and my local mqtt client gets payloads from it.
Oracle backend database developer
SmartHome IoT & Microprocessor enthusiast and hobbyist

Return to “General discussion”