Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-mqtt-gpio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Alexander Wellbrock
python-mqtt-gpio
Commits
a370abf4
Commit
a370abf4
authored
Oct 20, 2017
by
bwduncan
Committed by
Ellis Percival
Oct 20, 2017
Browse files
Options
Downloads
Patches
Plain Diff
Fix MQTT loop thread crash. (remove on_disconnect) (#21)
parent
75aa35bc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pi_mqtt_gpio/server.py
+0
-17
0 additions, 17 deletions
pi_mqtt_gpio/server.py
with
0 additions
and
17 deletions
pi_mqtt_gpio/server.py
+
0
−
17
View file @
a370abf4
...
@@ -77,22 +77,6 @@ class ConfigValidator(cerberus.Validator):
...
@@ -77,22 +77,6 @@ class ConfigValidator(cerberus.Validator):
return
str
(
value
)
return
str
(
value
)
def
on_disconnect
(
client
,
userdata
,
rc
):
"""
Called when MQTT client disconnects. Attempts to reconnect indefinitely
if disconnection was unintentional.
:param client: MQTT client instance
:param userdata: Any user data set in client
:param rc: The disconnection result (0 is intentional disconnect)
:return: None
:rtype: NoneType
"""
_LOG
.
warning
(
"
Disconnected from MQTT server with code: %s
"
%
rc
)
while
rc
!=
0
:
sleep
(
RECONNECT_DELAY_SECS
)
rc
=
client
.
reconnect
()
def
on_log
(
client
,
userdata
,
level
,
buf
):
def
on_log
(
client
,
userdata
,
level
,
buf
):
"""
"""
Called when MQTT client wishes to log something.
Called when MQTT client wishes to log something.
...
@@ -364,7 +348,6 @@ def init_mqtt(config, digital_outputs):
...
@@ -364,7 +348,6 @@ def init_mqtt(config, digital_outputs):
except
Exception
:
except
Exception
:
_LOG
.
exception
(
"
Exception while handling received MQTT message:
"
)
_LOG
.
exception
(
"
Exception while handling received MQTT message:
"
)
client
.
on_disconnect
=
on_disconnect
client
.
on_connect
=
on_conn
client
.
on_connect
=
on_conn
client
.
on_message
=
on_msg
client
.
on_message
=
on_msg
client
.
on_log
=
on_log
client
.
on_log
=
on_log
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment