Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local and remote #24

Open
msillano opened this issue Feb 3, 2018 · 2 comments
Open

Local and remote #24

msillano opened this issue Feb 3, 2018 · 2 comments

Comments

@msillano
Copy link

msillano commented Feb 3, 2018

(continue)
I make a simple 'flow' in node red: a catch-all with debug echo, and 3 commands: blink, toggle, off.
2018-02-03 200517 shot
All looks working.
But I don't see the commands I expect in debug window.
To be more explicit I change 2 lines: 53 and 95 (about). I replace remote payload:
publish remote $status_topic $relay_status retained with
publish remote $status_topic "{Time:" | $timestamp | ",Power:" | $relay_status | "}" retained

In debug window i see:
2018-02-03 200532 shot

and on console only
2018-02-03 201720 shot
No echo of remotes commands. For remotes commands I expect a remote echo and a local echo. (?) But this can be a Putty problem.

Maybe I am confused between 'local' and 'remote', but how to send status to mosquitto?
More:
the lines: publish local $status_topic $relay_status retained looks to me useless. None uses the 'local' status topic, the program uses only 'local' commands.
Best regards.
m.s.

@martin-ger
Copy link
Owner

I assume 192.168.178.23 is your mosquitto? In the terminology of the project this would be the remote broker. Somewhat strange, that the external IP of the ESP is 192.168.0.53 - different network?

Your setup is: NodeRed publishs and subscribes to the mosquitto and the ESP subscribes also to the mosquitto?

Try to add some dummy remote publication on the status topic right in the "on mqttconnect". Do you see that?

Try to lock into the published topics on the ESP with "mosquitto_sub -h <ESP_ip> -t "#"

There is no need for the external mosquitto. You can also try to publish the command topic directly on the ESP.

@msillano
Copy link
Author

msillano commented Feb 4, 2018

The main PC (192.168.178.23) is connected to WiFiRouter via LAN, and 192.168.0.53 is the sonoff via WIFI. (I use a Sonoff-basic). First time this value was done by the router, then I make it fix.

In production i will have many sonoff+esp_matt, using script to implement simple logic 'fail-safe' (e.g. water pump and level switch), using a central Raspberry (24/7) with mosquitto and a hi-level standard web interface, plus mySQL for logging.

But I fond my mistake: the node-red was linked to 192.168.0.53:1883 (the ESP broker) and not to mosquitto (192.168.178.23:1883) broker. !!!!!!!!
For that I seen local messages and not remote ones.

Very stupid, sorry.
Apologize for your time.
Now messages works as expected.

Thanks for your patience and I beg pardon for my poor english :(
Best Regards
Marco Sillano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants