Giter Club home page Giter Club logo

hcpbridge's Introduction

HCPBridge

Emuliert ein Hörmann HAP 1 HCP auf dem ESP8622 bzw. ESP32 und Arduino.

Kompatible Torantriebe (HCP2-Bus - Modbus):

  • SupraMatic E/P Serie 4
  • ProMatic Serie 4

Bitte beachten, das Projekt emuliert UAP 1 HCP und ist auch nur mit der Serie 4 kompatibel! Ältere Antriebe als Serie 4 haben eine andere Pinbelegung und ein komplett anderes Protokoll.

Eigentlich war das Ziel, die Steuerung komplett nur mit einem ESP8266 zu realisieren, allerdings gibt es durch die WLAN und TCP/IP-Stackumsetzung Timeoutprobleme, die zum Verbindungsabbruch zwischen dem Antrieb und der Steuerung führen können. Durch die ISR-Version konnte das Problem zwar reduziert aber nicht komplett ausgeschlossen werden. Daher gibt es zwei weitere Versionen, die bisher stabil laufen. Eine Variante nutzt den ESP32 statt ESP8266, welcher über 2 Kerne verfügt und so scheinbar besser mit WLAN-Verbindungsproblemen zurecht kommt. Die andere Option ist ein zweiter MCU, der die MODBUS Simulation übernimmt, sodass sich der ESP8266 nur noch um die Netzwerkkommunikation und das WebInterface kümmern muss.

Funktionen:

  • Abrufen des aktuellen Status (Tor, Licht)
  • Auslösen der Aktionen (Licht an/aus, Tor öffen, schließen, stoppen sowie Lüftungsstellung
  • WebInterface
  • WebService
  • Schalten eines Relais mit der Beleuchtung

WebInterface:

alt text

WebService:

Aktion ausführen

http://[deviceip]/command?action=[id]

Action Beschreibung
0 schließe Tor
1 öffne Tor
2 stoppe Tor
3 Lüftungsstellung
4 1/2 öffnen
5 Lampe an/an

Status abfragen:

http://[deviceip]/status

Response (JSON):

{
 "valid" : true,
 "doorstate" : 1,
 "doorposition" : 0,
 "doortarget" : 0,
 "lamp" : true,
 "debug" : 0,
 "lastresponse" : 0
}

Pinout RS485 (Plug):

alt text

  1. GND (Blue)
  2. GND (Yellow)
  3. B- (Green)
  4. A+ (Red)
  5. +25V (Black)
  6. +25V (White)

RS485 Adapter:

alt text
Zwischen A+ (Red) und B- (Green) ist ein 120 Ohm Widerstand zum terminieren des BUS!

Schaltung

alt text
ESP8266 + Arduino Combo (Bisher stabil, benötigt allerdings zwei MCU)

alt text
ESP32 (Bisher stabil durch Nutzung beider Kerne, 25V auf 5V durch LM2596S DC-DC Step Down Module)

alt text
ESP8266 ISR (instabil!, WLAN-Probleme können die ModBus-Verbindung beenden, dann ist ein Neuanlernen erforderlich)

Installation

alt text

  • Adapter am Bus anschließen (grüner Pfeil)
  • Busscan ausführen (blauer Pfeil auf off und wieder zurück auf off). Der Adapter bekommt erst dann Strom über die 25V Leitung und muss während des Busscans antworten, sonst wird der Strom wieder abgeschaltet. Im Falle eines Fehlers oder wenn der Adapter abgezogen werden soll, einfach die Busscan Prozedur (On/Off) wiederholen.

Changelog

06.03.2021: Neue Version mit Arduino Pro Mini als Co MCU 24.02.2021: Neue Version via Interrupt und für ESP32 zur Vermeidung von Timing-Problemen

hcpbridge's People

Contributors

hkiam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hcpbridge's Issues

Using this project with a plain MAX485 breakoutboard

Hi Guys,

Just got my new doors installed and made sure I could get them controlled today. I had the 6 pin connectors and some old max485 breakout boards at home. I choose to build this using only a ESP32 since I think it is powerfull enough.

When using just a max485 the direction on the bus needs to be controlled as well. The converter board shown in the readme does this automatically. This caused me some minor troubles and several hours of debugging....

Initially I could not get stuff to work. I modified the code to use Serial2 on 16/17 and added a pin that controls the max 485 direction. Several times I could get it to respond correctly.... but then the door would go into a 4 times red blink pattern till a bus scan was executed again. (I have a promatic 4)

The two things I messed up where:

  • I had added a second 120Ohm resistor, there was already one on the breakout board

  • The hardware UART write operation is asyncronous. The code fills the register but that take much less time than the write. But as I controlled the Direction pin by setting it before and after the write call I screwed up the transmission. The fix here was to add a delay based on the tx buffer length before I released the direction pin again. This finally made it work perfectly fine.

I thought I post this here as an issue in case somebody runs into similar trouble. It works great for me now, and I might play with it to add it to ESPHome in some way as I prefer control via HomeAssistant (although the webui is really pretty, well done @hkiam !!!).
Hope this helps when troubleshooting

Greetings from Vienna,
Lukas

2 Garagedoors

First of all, thanks to everyone for this great project.
I use andreaswatch's version with the ESP32, together with Home Assistant.
Except from some wifi reception that I need to fix and for some reason I had to use UART1 because UART0 just won't work.
For the rest it works great! I even made a little PCB for it.

My problem is that I have 2 garagedoors.
My knowledge is not enough to adapt the script for simultaneous use of 2 pieces in 1 Home Assistant setup.

Can someone help me out?

PCB_HCPbridge

Lampenstatus im WebUI bei manuellem Schalten nicht korrekt

Hallo,

ich habe das Problem, dass beim manuellen Schalten der Lampe im WebUI der Status nicht korrekt angezeigt wird. Die Lampe wird geschaltet, aber der Slider springt immer wieder in die "Off"-Stellung. Auf der Statusseite steht im JSON entsprechend dauerhaft "lamp":false, egal, ob die Lampe an ist, oder nicht. Bei Torfahrt zeigen Slider und JSON den korrekten Status.

Was kann die Ursache dafür sein?

Readme

„Busscan ausführen (blauer Pfeil auf off und wieder zurück auf off). “

soll das erste on heißen?

Explain how to program the esp32

Hi,
kann mir jemand erklären wie ich den esp32 programmiert bekomme. Hatte bisher nur Berührungspunkte mit Arduino IDE.

Gruß Michael

Zwischenstatus?

Danke für das geile Projekt, ist es möglich auszulesen ob der Motor aktuell fährt?

confusing explenation in README

Hi, I have just a Question, your README state that this code is only working with Series4 Hoermann Motors that normaly use HCP-2 protokol.
But your README state that it simulates a UAP1 HCP which would be for older Series 3 Motors as well

Which information is correct cause you mark the compatibility only with Series 4 in capital letters.

Upload scheiter

Hallo,
bekomme es nicht hin die Software auf den ESP32 hochzuladen.
Ich benutze Visual Studio Code mit platformio.
Ändere in der platform.ino den upload_port und starte.

Bricht immer ab mit der Fehlermeldung:
The terminal process "C:\Users\User.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1.

  • Terminal will be reused by tasks, press any key to close it.

Hat mir da einereinenTipp?

reset reason

I have the circuit with esp32 in use and it works well. I have from time to time a reset = 1. What could be the reason?

/sysinfo

{"freemem":224004,"hostname":"esp32-xxxx","ip":"192.168.xxx.xxx","ssid":"xxx","wifistatus":3,"resetreason":1}

Promatic 4 flashing red

Garage door is working, but the light on the Promatic 4 is flashing red. I also see constant communication on the RS485. Is this normal?

Zu wenig Volt am Bus?

Hallo,

ich habe das Ganze gemäß dem Diagram für den ESP32 verlötet. Beim Busscan vom Garagentor werden nur kurz ca 3V angelegt, was natürlich für den ESP32 zu wenig ist und da keine Antwort am Bus kommt wird er wieder abgedreht.
Ich habe leider kein Labornetzgerät umd die Volt am Wandler einzustellen, darum wollte ich das direkt am Gerät machen.

Habe ich mich hier irgendwo vertan, oder gibt es hier noch etwas zu beachten?

Supramatic E4 Bus Scan Fails

Hey. Great project! The hardware is up and running and flashed. (ESP32 Version).
When i connect to the Supramatic E4 the device is powered on for a couple of seconds, then it disconnects.

I tried to do a bus scan (Menu 37 - Long Press on 01 that starts the Bus scan).
While the bus scan is active the device is powered again and the web interface is accessible as well (display show: "waten auf verbindung".

unfortunately the bus scan seems to fail as it exits with 00 instead of 01 and the device is shut down / powered off again.

Any advisory what could be wrong in the case?

Error 07 Communication error

Hallo,

seit einiger Zeit kommt bei mir des Öfteren Fehler 07 (Communication error) am Antrieb, dann wird die Bewegung gestoppt oder gar nicht erst ausgeführt.
Ich benutze einen ESP32.

Kennt jemand die Problematik? Der Fehler lässt sich relativ schnell reproduzieren.
Wie kann ich am Besten debuggen?

Frage: welcher ESP32?

Hallo, offensichtlich liegt es an meinem ESP 32, den ich verwende. (WROOM)
Könnt ihr mir bitte einen entsprechenden ESP 32 empfehlen, der kompatibel ist?
Danke!

RS485 Protocol

Hi,

thank you for your great work!

Do you have some more information about the protocol used on rs485. I want to connect it to a S7-1500 Siemens plc and was hoping you can help me a bit by providing some infos.

Thanks!

SoftwareSerial.cpp

ich erhalte den Fehler: SoftwareSerial.cpp:41:27: fatal error: avr/interrupt.h: No such file or directory
compilation terminated.

nachdem ich etwas gegoogled habe wird softwareSerial wohl nicht von esp32 unterstützt, dennoch ist es so in dem ordner angegeben. ich bekomm den Sketch leider nicht auf mein esp32 :(

Idea: PCB with adapter for DHT22, BME280

Hi,
mein Hausbau steht kurz bevor und noch habe ich etwas Zeit mich mit unwichtigen Dingen zu beschäftigen :)

Da es ein Hörmanntor werden soll interessiert mich das Projekt hier sehr, daher habe ich mal eine Platine entworfen.

Mein Hauptgedanke war, dass ich kein KNX oder ESP direkt in die Garage setzen will (evtl wird das WLAN zu schwach). Da der HCP als RS485 läuft sollte es kein Problem sein die Daten per Kabel bis ins Haus zu führen. Da ich gerne noch einen Temperatur und Feuchtesensor (DHT22 oder BME280) habe ich eine Adapterplatine gezeichnet um in der Garage vom RJ12 auf RJ45 zu wechseln um genügend Adern zu haben. Gleichzeitig habe ich die Hauptplatine mit ESP32 so gedacht, dass diese auch vor Ort mit Sensoren montiert werden kann. Die Spannungsversorgung kommt immer vom Hörmann Antrieb, eine Feinsicherung könnte an dieser Stelle auch nicht schaden :)

Gibt es noch Verbesserungsvorschläge?
PS: Leiterbahnen und Abstände sind noch nicht optimiert, und alles noch nicht schön.
PS: Ein Betriebszyklenzähler (Wert auf Flashspeicher des ESPs sichern) werde ich noch implementieren. Alles per MQTT senden, und beim Starten 1x subscriben, damit der letzte gültige Wert abgefragt werden kann, falls der Flash gelöscht wurde, wäre der letzte Zählerstand wieder da.

image
image

Gruß
Andi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.