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

Feature Request : uMQTTBroker #1

Open
happytm opened this issue Sep 25, 2019 · 5 comments
Open

Feature Request : uMQTTBroker #1

happytm opened this issue Sep 25, 2019 · 5 comments
Labels
Core related DevTime: Never Maybe it will never be implemented, unless some volunteer do that. enhancement New feature or request

Comments

@happytm
Copy link

happytm commented Sep 25, 2019

I think it will be useful addition to implement standalone gateway if there is no internet connection and using only wifi & not espnow feature.I tested this broker for few days and it is very reliable. Link is below:

https://github.com/martin-ger/uMQTTBroker/blob/master/examples/uMQTTBrokerSampleOOFull/uMQTTBrokerSampleOOFull.ino

Thanks.

@enesbcs
Copy link
Owner

enesbcs commented Sep 25, 2019

Interesting, but i do not really understand how and why? This code looks like a simple serial to MQTT gateway, which is nothing to do with this ESPNow sensor project.

@enesbcs enesbcs added the invalid This doesn't seem right label Sep 25, 2019
@happytm
Copy link
Author

happytm commented Sep 25, 2019

This is simply mqtt broker. So if activated you can make option in firmware to get rid of all controller code related to MQTT and instead use umqttbroker library to handle mqtt part. If anyone wants to use your code without espnow protocol and they do not want to use ESPEasy firmware which even does not compile under arduino right now can use your fork of espeasy and disable espnow feature and enable wifi feature with umqtt broker. That way they have standalone system for home automation with most of the old features of espeasy inluding rule engine but not all new complications came in last 2 years with espeasy firmware.

Thanks.

@happytm
Copy link
Author

happytm commented Sep 25, 2019

uMQTTBroker is also a bridge to external second mqtt broker like local broker on raspberry pi or any public broker in cloud. So when internet is available it can communicate with outside world via MQTT or when there is no internet it can still do all automation locally over MQTT protocol.

Thanks

@enesbcs enesbcs added enhancement New feature or request and removed invalid This doesn't seem right labels Sep 26, 2019
@enesbcs
Copy link
Owner

enesbcs commented Sep 26, 2019

I see your point now. So MQTT can be an alternative for ESPNow. But uMQTTBroker if i understand correctly is a server-like (receiver) method, but most ESPEasy plugins only sends data (sender), except the Rule engine of course. How do you imagine data flow inside the core program?

@happytm
Copy link
Author

happytm commented Sep 26, 2019

I have implemented uMQTT broker with simple modification to another minimal fork of ESPEasy (ESPCoreRules). In this implementation the main controller where uMQTT is installed as a broker is called receiver. The controller act as Station & AP at the same time and receive messages from remote sensors which have sender code installed.Once message is received at receiver the broker publish the sensor data automatically so broker installed at RPIEasy capture this MQTT messages and further process it. So there is no physical connection required between Raspberry PI and ESP8266 receiver device. In my test the sender devices take only 200 to 230 milliseconds to send data and then they can go to sleep for predefined minutes to save power. Sender devices can get message from Receiver device if sent by receiver when they wake up and can perform certain actions when they wake up next time or change sleep time to few seconds and wake up to perform those actions.

Remember I am learning to code in arduino so it could be very bad code but for my test purpose it works reliably. Please test my repo and help me improve the code.

The code is at following link:

https://github.com/happytm/ESPCoreRules

On receiver side only setting required is ssid and password for access point the receiver will connect to and on sender side it will need receiver devices's ssid and channel.If you need to do further setting on receiver device instruction are here to do it over webserver:

https://github.com/SmartNodeRules/Documentation/wiki/SampleRules

Thanks

@enesbcs enesbcs added Core related DevTime: Never Maybe it will never be implemented, unless some volunteer do that. labels Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core related DevTime: Never Maybe it will never be implemented, unless some volunteer do that. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants