Tagged: 

Viewing 25 posts - 1 through 25 (of 29 total)
  • Author
    Posts
  • #105

    Anonymous
    Guest

    I figured that having MQTT support might be of use to a few people, including myself. The addition of MQTT was pretty trivial (using PubSubClient http://pubsubclient.knolleary.net/)…thus far. Is this something you want to incorporate into the released version? If so please let me know I’m happy to share what I have.

    #154

    Ray
    Keymaster

    I am not very familiar with MQTT (followed a few tutorials and so on). Please share what you have, and we are definitely interested in incorporating MQTT into future firmwares. I am sure many users would appreciate it too.

    #278

    tomgle
    Participant

    I have been playing with MQTT and some MQTT topics for open Garage as well. I’m also tossing the blynk stuff and cloud integration overboard and hopefully will use Nodered in it’s place. I have the open Garage hardware and am anxious to program it with straight Arduino code without nodemcu or esptool. Can I do that without bricking the thing? I’m hoping I can eventually program it like an Adafruit Huzzah i.e. hookup the programmer and upload it straight from the IDE.

    #282

    Ray
    Keymaster

    You should be free to explore without worrying about bricking the thing — ESP8266 comes with a built-in bootloader that’s very robust. I’ve never seen a case where the bootloader is corrupted. Because OpenGarage firmware supports over the air (OTA) update, there is actually no need to update firmware through the USB cable — of course you still need the USB cable to provide power — but the firmware can be uploaded through the webpage. Also, OpenGarage firmware is written in Arduino with ESP8266 core, it does not use Lua / nodemcu at all.

    • This reply was modified 3 years, 6 months ago by Ray.
    #284

    chickenmad
    Participant

    Would love any code you have as a starting point and would share back what I make. I have an audio notification that announces the garage door as opened and MQTT would align with the ESP8266/nrlf24l01 sensor network in the greater house.

    Also – as the device is overhead i use the distance as a triple state – distance to garage door = open, distance to car roof = closed and dads car is home, distance to floor is closed and dads car is gone. Had to move the sensor to be directly over the flat part of my Suburban as over my wifes MDX the reflection would cause the readings to be all over the place.
    Garageio appears to be similar to this product but using a laser mounted to the bottom of the garage door opener. I am ordering a PIR sensor and using it with an 8266 to see if I can sense when a car is approaching the garage and alert that someone has arrived (we have no windows to see our driveway)

    • This reply was modified 3 years, 6 months ago by chickenmad.
    #290

    Gompka
    Participant

    Also interested in the mqtt code, would like to run my own mqtt server instead of relying on blynk.

    #300

    DynamoBen
    Participant

    I 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 3 years, 6 months ago by DynamoBen.
    #318

    Gompka
    Participant

    Ben if you could send me your code or upload it here i would appreciate it. My email is [email protected]

    #322

    DynamoBen
    Participant

    Will 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 3 years, 5 months ago by DynamoBen.
    #324

    DynamoBen
    Participant

    OK 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.

    • This reply was modified 3 years, 5 months ago by DynamoBen.
    • This reply was modified 3 years, 5 months ago by DynamoBen.
    Attachments:
    You must be logged in to view attached files.
    #327

    chickenmad
    Participant

    Awesome thanks!!!

    #329

    Gompka
    Participant

    Ben thank you for the code, it will same me a lot of time and swearing lol. I will load it up when i get home and let you know how it goes.

    #332

    DynamoBen
    Participant

    I’ve added distance, the only file that changed was main.cpp. Enjoy!

    Attachments:
    You must be logged in to view attached files.
    #349

    Gompka
    Participant

    Hey Ben, thank you for the files, i compiled and uploaded and seems like everything opengarage relate is working but i’m not getting anything on my mqtt broker. The topic is just “GarageDoor” right? I changed the mqtt server and added my username and password, am I missing anything else?

    #350

    DynamoBen
    Participant

    Yes 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.

    #351

    Gompka
    Participant

    Ben, I have a spare esp8266 that i will rig up as a pseudo open garage so that i don’t have to run back and forth to the garage when its 14F here in Chicago lol. I’ll do some testing and report back. Thanks again.

    #373

    chickenmad
    Participant

    Gompka and DynamoBen – using the Arduino IDE and getting errors of:

    redefinition of ‘BlynkWifi Blynk’
    main.cpp:519: error: ‘class UpdaterClass’ has no member named ‘reset’
    main.cpp:815: error: no matching function for call to ‘BlynkWifi::begin(const char*)’
    and others….

    assuming I have the wrong libraries loaded or IDE wont work here….my brain tells me this is something really obvious and dumb.

    #374

    DynamoBen
    Participant
    #375

    chickenmad
    Participant

    nope and that would explain it!!!!

    #389

    Gompka
    Participant

    Ben, i removed the user/pass and it seems to be working. Not sure if it was just the user pass or the way i have mosquito setup. Anyway, now that open garage is publishing to mqtt the issue i’m having is the distance variables it is printing are strange. I have it on my test bench and sitting stationary and it publishes 147, 256, 145,260 and like that back and forth which causes open/close/open close messages. However, if i go to the built in OG webpage that Ray made the distance is a steady 147 and the status stays closed. Any idea, what could be causing this strange distance behavior?

    #390

    DynamoBen
    Participant

    I’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.

    #391

    Gompka
    Participant

    I’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.

    Ben, OG 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?

    • This reply was modified 3 years, 4 months ago by Gompka.
    #393

    DynamoBen
    Participant

    OG 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.

    #394

    Gompka
    Participant

    Ben, i think you just nailed it. I put your mqtt code on my main opengarage that is setup in my garage last month, but it wasn’t working. I am now working with another open garage on my test bench, and i just realized that now that mqtt is working, i bet that both open garage units are sending mqtt messages to the same topic. I will test this when i get home. Thanks for your help, its always the simple things that cause these issues lol. I am learning a great deal as I go thought.

    That is exactly what is happening, they are both publishing to the same topic! I was able to log in remotely and take a look. I will report back once i change the topic names, i’m certain things will work properly though. Thanks again Ben!

    • This reply was modified 3 years, 4 months ago by Gompka.
    • This reply was modified 3 years, 4 months ago by Gompka.
    • This reply was modified 3 years, 4 months ago by Gompka.
    #418

    Gompka
    Participant

    I have been using your mqtt addition with home assistant for 2 garages for over a month now and it is working flawlessly. Thanks again for the help Ben!

Viewing 25 posts - 1 through 25 (of 29 total)
  • You must be logged in to reply to this topic.