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

No way to start in awake mode #29

Open
loxK opened this issue Sep 4, 2021 · 3 comments
Open

No way to start in awake mode #29

loxK opened this issue Sep 4, 2021 · 3 comments

Comments

@loxK
Copy link

loxK commented Sep 4, 2021

I cannot get it to work. I run it in ubuntu 20.04 AMD64 in a python virtualenv

I get it running and can send commands to it:
# python3 ClassicMQTT/ClassicMQTT/code/Python/classic_mqtt.py --classic [IP] --classic_name classic-150-1 --mqtt [IP] --mqtt_root /midnite --mqtt_user midnite --mqtt_pass *******

2021-09-04 16:09:46,253:INFO:classic_mqtt:classic_mqtt starting up...
2021-09-04 16:09:46,256:INFO:classic_mqtt:classicHost = [IP]
2021-09-04 16:09:46,257:INFO:classic_mqtt:classicPort = 502
2021-09-04 16:09:46,257:INFO:classic_mqtt:classicName = classic-150-1
2021-09-04 16:09:46,257:INFO:classic_mqtt:mqttHost = [IP]
2021-09-04 16:09:46,257:INFO:classic_mqtt:mqttPort = 1883
2021-09-04 16:09:46,257:INFO:classic_mqtt:mqttRoot = midnite
2021-09-04 16:09:46,257:INFO:classic_mqtt:mqttUser = midnite
2021-09-04 16:09:46,257:INFO:classic_mqtt:mqttPassword = **********
2021-09-04 16:09:46,257:INFO:classic_mqtt:awakePublishRate = 5
2021-09-04 16:09:46,257:INFO:classic_mqtt:snoozePublishRate = 300
2021-09-04 16:09:46,257:INFO:classic_mqtt:awakePublishLimit = 60
2021-09-04 16:09:46,257:DEBUG:classic_mqtt:snoozeCycleLimit: 60
2021-09-04 16:09:46,257:INFO:classic_mqtt:Connecting with clientId=midnite_mqttclient_589
2021-09-04 16:09:46,258:INFO:classic_mqtt:Connecting to MQTT 10.39.199.28:1883
2021-09-04 16:09:46,264:DEBUG:classic_mqtt:MQTT connected OK Returned code=0
2021-09-04 16:09:46,265:DEBUG:classic_mqtt:Subscribed to /midnite/classic-150-1/cmnd/#
2021-09-04 16:09:46,266:DEBUG:classic_mqtt:Starting main loop...
2021-09-04 16:12:02,902:DEBUG:classic_mqtt:Received MQTT message {"WAKEPUBLISHRATE":3000, "STAYAWAKE":TRUE}
2021-09-04 16:12:02,902:DEBUG:classic_mqtt:{'wakePublishRate': 3000, 'stayAwake': True}
2021-09-04 16:12:02,902:DEBUG:classic_mqtt:StayAwake received, setting stayAwake to True
2021-09-04 16:12:02,903:DEBUG:classic_mqtt:wakePublishRate message received, setting rate to 3
2021-09-04 16:12:02,903:DEBUG:classic_mqtt:Updating snoozeCycleLimit to 100

But it doesn't seem to send stats to the mqtt, it stays as it forever. I also don't understand that snooze thing, it doens't seem documented.

image

@loxK
Copy link
Author

loxK commented Sep 4, 2021

Okay, found it, I needed to send {"wake"} to cmnd. I am not interested in the snooze feature. Is it possible to start it in wake state forever ?

@graham22
Copy link
Member

graham22 commented Sep 4, 2021 via email

@loxK loxK closed this as completed Sep 5, 2021
@loxK loxK reopened this Sep 5, 2021
@loxK
Copy link
Author

loxK commented Sep 5, 2021

Nice, thank you. But because doing this closes and reopens the connection to the Classic, there is an additional delay. So when setting to 3 second, it really updates every 6 seconds.


2021-09-05 11:28:30,380:INFO:classic_mqtt:awakePublishRate = 3
2021-09-05 11:28:30,380:INFO:classic_mqtt:snoozePublishRate = 3
2021-09-05 11:28:30,380:INFO:classic_mqtt:awakePublishLimit = 60
2021-09-05 11:28:30,380:DEBUG:classic_mqtt:snoozeCycleLimit: 1
2021-09-05 11:28:30,380:INFO:classic_mqtt:Connecting with clientId=midnite_mqttclient_971
2021-09-05 11:28:30,381:INFO:classic_mqtt:Connecting to MQTT [ip]:1883
2021-09-05 11:28:30,382:DEBUG:classic_mqtt:MQTT connected OK Returned code=0
2021-09-05 11:28:30,382:DEBUG:classic_mqtt:Starting main loop...
2021-09-05 11:28:30,383:DEBUG:classic_mqtt:Subscribed to midnite/classic150/cmnd/#
2021-09-05 11:28:30,383:DEBUG:classic_mqtt:Received MQTT message {"WAKEPUBLISHRATE":3000, "STAYAWAKE":TRUE}
2021-09-05 11:28:30,384:DEBUG:classic_mqtt:{'wakePublishRate': 3000, 'stayAwake': True}
2021-09-05 11:28:30,384:DEBUG:classic_mqtt:StayAwake received, setting stayAwake to True
2021-09-05 11:28:30,384:DEBUG:classic_mqtt:wakePublishRate message received, setting rate to 3
2021-09-05 11:28:30,384:DEBUG:classic_mqtt:Updating snoozeCycleLimit to 1
2021-09-05 11:28:36,383:DEBUG:classic_mqtt:Opening the modbus Connection
2021-09-05 11:28:36,398:DEBUG:classic_mqtt:Closing the modbus Connection, we are in Snooze mode
2021-09-05 11:28:36,398:DEBUG:classic_mqtt:Got data from Classic at [ip]:502
2021-09-05 11:28:36,399:DEBUG:classic_mqtt:Publishing: midnite/classic150/stat/readings
2021-09-05 11:28:36,400:DEBUG:classic_mqtt:Publishing: midnite/classic150/stat/info
2021-09-05 11:28:42,385:DEBUG:classic_mqtt:Opening the modbus Connection
2021-09-05 11:28:42,398:DEBUG:classic_mqtt:Closing the modbus Connection, we are in Snooze mode
2021-09-05 11:28:42,398:DEBUG:classic_mqtt:Got data from Classic at [ip]:502
2021-09-05 11:28:42,398:DEBUG:classic_mqtt:Publishing: midnite/classic150/stat/readings
2021-09-05 11:28:42,399:DEBUG:classic_mqtt:Publishing: midnite/classic150/stat/info

loxK added a commit to loxK/ClassicMQTT that referenced this issue Sep 5, 2021
@loxK loxK changed the title No sending mqtt stats No way to start in awake mode Sep 6, 2021
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