Fixed: can now receive messages after reconnect to MQTT broker
This commit is contained in:
@@ -10,10 +10,13 @@ All notable changes to this project will be documented in this file.
|
||||
Security : in case of vulnerabilities.
|
||||
|
||||
## [1.0.0] - 2023-01-13
|
||||
First working version.
|
||||
- First working version.
|
||||
|
||||
## [1.0.1] - 2023-01-14
|
||||
Changed: aprs_status (published on the MQTT broker) now returns actual state of transmision (sending, retrying, send or failed) instead if just 'ready' and 'busy'.
|
||||
- Changed: aprs_status (published on the MQTT broker) now returns actual state of transmision (sending, retrying, send or failed) instead if just 'ready' and 'busy'.
|
||||
|
||||
## [1.1.0] - 2023-07-08
|
||||
Added: APRS nodes can now be polled to get there actual status. An extra section in the YAML configuration file is added for this functionality.
|
||||
- Added: APRS nodes can now be polled to get there actual status. An extra section in the YAML configuration file is added for this functionality.
|
||||
|
||||
## [1.1.1] - 2024-01-04
|
||||
- Fixed: after reconnect to MQTT broker messages from broker were not received.
|
||||
|
@@ -164,7 +164,14 @@ def connect_mqtt():
|
||||
else:
|
||||
print("Failed to connect, return code %d\n", rc)
|
||||
# Set Connecting Client ID
|
||||
client = mqtt_client.Client(mqtt.client_id)
|
||||
# After reconnect messages from the MQTT broker where not received.
|
||||
# clean_session: a boolean that determines the client type.
|
||||
# If True, the broker will remove all information about this client
|
||||
# when it disconnects. If False, the client is a durable client and
|
||||
# subscription information and queued messages will be retained when
|
||||
# the client disconnects.
|
||||
# client = mqtt_client.Client(mqtt.client_id)
|
||||
client = mqtt_client.Client(mqtt.client_id, clean_session=False)
|
||||
#client.username_pw_set(username, password)
|
||||
client.on_connect = on_connect
|
||||
client.connect(mqtt.broker, mqtt.port)
|
||||
@@ -490,6 +497,7 @@ def run():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
#sys.stdout = sys.stderr = open('debug.log', 'w')
|
||||
sys.stdout = sys.stderr = open('/home/marcel/aprs-mqtt-bridge_debug.log', 'w')
|
||||
|
||||
run()
|
||||
|
||||
|
Reference in New Issue
Block a user