Forum Replies Created
-
AuthorPosts
-
DynamoBenParticipantCurious I’ve not see that before. There is a non-blocking reconnect every 5 seconds but that shouldn’t hold anything else up. If I get some time I will try to reproduce this on my hardware (I’m not using Blynk though). Beyond that you could try changing the following to increase the retry interval:
From:
if (now – mqttLastReconnectAttempt > 5000)To:
if (now – mqttLastReconnectAttempt > 30000)
DynamoBenParticipantGlad to hear it’s working well for you. Thanks for the update!
DynamoBenParticipantOG is setup to take readings every 4 seconds via the webpage, however it looks like mqtt is reporting readings every 1 second. Do you know how to get mqtt to publish every 4 seconds and so i can test if this fixes the issue?
I put the MQTT publish commands in the same function as the OG readings (void check_status()), so if you are set to 4 seconds it sends every 4 seconds. Not sure why you are seeing 1 second updates.
Sounds to me like there are bigger issues going on that are outside the MQTT code changes, I’m wondering if the issues have to do with your Mosquitto server config or maybe another device is publishing to that same topic? Not sure.
DynamoBenParticipantI’m not sure what the root cause might be; I’m using the same variable (“distance”) that is being written to the log, webpage, and to Blynk.
On mine I’m seeing the number move a little (from 145-147) but not wide changes like you are seeing on your bench.
DynamoBenParticipantHave you done the Blynk modification?
https://github.com/OpenGarage/OpenGarage-Firmware/tree/master/Modifications
DynamoBenParticipantHe means phone app which can be found on Google Play or Apple App Store.
If you have having issues with Blynk I would suggest starting a new thread so others can help troubleshoot.
DynamoBenParticipantYes just “GarageDoor” no slashes. Also its worth noting that I’ve not tested user/pass since I’m not doing access control on my server at the moment.
DynamoBenParticipantI’ve added distance, the only file that changed was main.cpp. Enjoy!
Attachments:
You must be logged in to view attached files.
DynamoBenParticipantOK things are now functional; the rearchitecting of Blynk threw things off a bit.
This is the latest version from Github with MQTT added. The only files that change are main.cpp and you need a modified Arduino parent file (it needs the PubSubClient include).
The MQTT server IP is at the top of main.cpp along with the topic, you will want to update those (if you are doing access control username/password are there too). If “Button” is sent on the topic then the door will be activated; this is hardcoded right now so if you need to change it it’s in “void mqtt_callback.”
It’s worth noting that I’ve hard coded the MQTT port number to 1883 (the default), if you are using a different port you will need to change that too.
Enjoy and let me know if you have any questions.
Attachments:
You must be logged in to view attached files.
DynamoBenParticipantWill do, however I tried merging the latest changes to the project with my code and now it’s broken so I need to fix that first.
- This reply was modified 8 years ago by DynamoBen.
DynamoBenParticipantAh OK that helps, thanks!
DynamoBenParticipantSo if two users have the app and control the same door how does the geofencing work? First person to leave the fence closes the door or both users must leave?
DynamoBenParticipantI have had working MQTT code for a few months now. What is missing at this point is the UI config options. If someone wants to work on that part I can post my code someplace. Just let me know.
NOTE: I’m sending unencrypted messages to the server, I’ve not tried to do anything with TLS.
- This reply was modified 8 years ago by DynamoBen.
-
AuthorPosts