OpenMQTTGateway | MQTT gateway for ESP8266 , ESP32 , Sonoff RF Bridge
kandi X-RAY | OpenMQTTGateway Summary
kandi X-RAY | OpenMQTTGateway Summary
OpenMQTTGateway project goal is to concentrate in one firmware different technologies and protocols, decreasing by the way the number of physical bridges needed, and hiding the different technologies singularity behind a simple & wide spread communication protocol; MQTT.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of OpenMQTTGateway
OpenMQTTGateway Key Features
OpenMQTTGateway Examples and Code Snippets
Community Discussions
Trending Discussions on OpenMQTTGateway
QUESTION
I have a python script that I am trying to execute with PAHO MQTT.
Aim:
- When the python script is executed at the beginning I want my python scrip to print "bad".
- This should stop until when "hello" is received in the payload.
- Once "hello" is received in the payload, I want it to print "good" for 20 seconds and during those 20 seconds any other messages received in the topic should be ignored including "hello".
- After the 20 seconds I want the script to continue printing "bad" but only once and the cycle continues.
Here is my script:
...ANSWER
Answered 2020-Jul-18 at 07:45I use loop_start()
and loop_stop()
instead of loop_forever()
and then between start
and stop
I can create own loop which can check messages and print text.
I use variable state
to control if code is before first hello
(state = "start"
) or it gets hello
and now it has to check time and repeate text "good" (state = "hello"
) or it has 20 seconds after hello
and it has print nothing (state = "other")
Inside on_message
I only change state to hello
when I get message hello
and old state is different then hello
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install OpenMQTTGateway
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page