OpenGarage Forums OpenGarage Firmware Fork with MQTT, Magnetic Sensor support ,Close if left open at night – misc

This topic contains 81 replies, has 7 voices, and was last updated by  andyss 1 year, 7 months ago.

Viewing 7 posts - 76 through 82 (of 82 total)
  • Author
    Posts
  • #883

    CuriousG
    Participant

    I built me a secondary OpenGarage unit to see if I can replace it with my commercial one since I have issues with OTA updates. I’m using NodeMCU v2 8266 module and I can program your firmware just fine using ESP8266Flasher.exe. However, when I tried to include the graphics file at address 0x300000, the process would not proceed. I tried writing just the initial file and even tried including the firmware and the graphics to write and it would appear to not even start. I suppose I could try programming it with one of the other flashing utilities.

    update:
    So I just tried espytool.py and it says it programmed but it was much faster than using ESP8266Flasher.exe with bigger file. When I configured, it didn’t show any graphics through the webpage.

    C:\Users\User\Downloads>esptool.py --port COM7 -b 230400 write_flash 0x300000 Gr
    aphics-placeat00300000.bin
    esptool.py v2.2
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 230400
    Changed.
    Configuring flash size...
    Auto-detected Flash size: 4MB
    Compressed 1028096 bytes to 6810...
    Wrote 1028096 bytes (6810 compressed) at 0x00300000 in 0.3 seconds (effective 26
    615.8 kbit/s)...
    Hash of data verified.
    
    Leaving...
    Hard resetting...

    update2:

    So I was finally able to upload the SPIFFS data after compiling and selecting my correct device and using the sketch data upload option within Arduino. Initially I just tried to upload the sketch data with your compiled firmware and that didn’t work so I uploaded my compiled build then the SPIFFS afterwards. I also noticed that after the initial AP connection where it tells you your IP address, it either doesn’t reset or hard locks because I get no LED at all. I just unplug it from the USB and supply the voltage and it continues from where it should afterwards.

    Since I am using a device with 4M (3M SPIFFS), the address is different for me.

    [SPIFFS] upload : C:\Users\User\AppData\Local\Temp\arduino_build_877395/ogMainArduino.spiffs.bin
    [SPIFFS] address: 0x100000
    [SPIFFS] reset  : nodemcu
    [SPIFFS] port   : COM7
    [SPIFFS] speed  : 921600
    
    Uploading 3125248 bytes from C:\Users\User\AppData\Local\Temp\arduino_build_877395/ogMainArduino.spiffs.bin to flash at 0x00100000
    • This reply was modified 1 year, 9 months ago by  CuriousG.
    • This reply was modified 1 year, 9 months ago by  CuriousG.
    • This reply was modified 1 year, 9 months ago by  CuriousG.
    #887

    CuriousG
    Participant

    hm..trying to flash your graphics file, but it just stops almost at the beginning.
    Might have a clue as to why? thanks

    I had the same problem as you and it was due to writing in the wrong space. It will complete if you provide the right address. For me it was 0x100000. Nevertheless, even with a successful write the graphics didn’t show. I could only get it to work by uploading the firmware and then the graphics right after using Adruino.

    #977

    andyss
    Participant

    Hi all, just got my unit and playing around with it before I mount it in the garage. A few questions if anyone can help me out with an mqtt config (@lawrence_jeff). I’m successfully receiving messages to my broker (mosquitto). Can I send messages to open and close the door (activate relay) via mqtt? What are the commands / topics? Also, is username / password authentication for mqtt available or planned?

    Thanks for the great work you guys are doing.

    Andy

    (Firmware 1.0.8)

    • This reply was modified 1 year, 7 months ago by  andyss.
    • This reply was modified 1 year, 7 months ago by  andyss.
    #980

    lawrence_jeff
    Participant

    Yes you can send open, close or click to the topic /IN/STATE

    Open and close are preferred since they implement logic to make sure nothing happens if you send open and the door is already open.

    Username and password isn’t hard to add but the use case I envisioned at least was generally a private broker (like a pi) on the local network where you are already protected by the Wifi security. Are you thinking of using it with a public broker?

    #981

    andyss
    Participant

    Thanks @lawrence_jeff. The open/close/click messages work perfectly. I’m not connecting to an open broker, I have mosquitto installed on a VM with port 8883 open for owntracks using TLS + auth, and everything in my network including the OG unit connecting to 1883 locally. Mosquitto, to my knowledge, only allows anon access (no user/pass) on all listening ports or none at one time. I’ve disabled user/pass for the time being but it would be a nice to have to make everything consistent and more secure for me.

    Thanks again.

    Andy

    #985

    lawrence_jeff
    Participant

    @andyss There are probably a few things to think through on this one to avoid breaking existing implementations. I wonder if you have username and password enabled if you get an error message back specific enough to then try again with a username and password – the OG name and existing key could be then sent without requiring a UI change to hold a custom username and password…

    As long as it tried anon first this would keep it from breaking any existing code. I can’t commit to working on this anytime soon (tied up with other things but if you want to take a stab at tweaking the code to do either this or just stick in your own custom info I am happy to help you – compiling your own firmware isn’t too hard.

    #996

    andyss
    Participant

    I think it’s working pretty okay with just TLS certs and without user/pass enabled. I will delve into it a bit more when I get a chance to see if there are any errors, etc. Compiling, yeah no. Over my head unfortunately.

    Andy

Viewing 7 posts - 76 through 82 (of 82 total)

You must be logged in to reply to this topic.

OpenGarage Forums OpenGarage Firmware Fork with MQTT, Magnetic Sensor support ,Close if left open at night – misc