Zum Inhalt springen

← - Lambda FAQ & Fehlerbehebung | Inhaltsverzeichnis

FAQ & Fehlerbehebung

Häufig gestellte Fragen und Lösungen für typische Probleme bei der Arbeit mit DimmerLink.


Verbindungsprobleme

Keine Antwort vom Gerät

Symptoms: I send a command, but there's no response.

Mögliche Ursachen und Lösungen:

Ursache Lösung
Fehlendes Startbyte (UART) 0x02 am Anfang des Befehls hinzufügen
Falsche Baudrate (UART) 115200 Baud einstellen
TX/RX vertauscht Gekreuzte Verdrahtung prüfen: TX→RX, RX→TX
Schnittstelle in anderem Modus Gerät im I2C-Modus? Auf UART umschalten
Falsche Adresse (I2C) Standardadresse ist 0x50 (kann geändert sein)
Keine Pull-up-Widerstände (I2C) 4,7 kΩ Widerstände an SDA und SCL hinzufügen
Keine Stromversorgung VCC und GND prüfen

I2C-Diagnose:

bash
# Linux/Raspberry Pi
i2cdetect -y 1

Wenn das Gerät funktioniert, erscheint die Adresse 50 in der Tabelle.

UART-Diagnose:

python
import serial
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1)
ser.write(bytes([0x02, 0x52]))  # Request frequency
print(ser.read(2).hex())  # Expect "0032" or "003c"

I2C Doesn't See Device

Symptome: i2cdetect zeigt eine leere Tabelle, Adresse 0x50 wird nicht angezeigt.

Lösungen:

  1. Check pull-up resistors - Raspberry Pi: built-in 1.8kΩ usually sufficient - Other boards: add external 4.7kΩ

  2. Check wiring
    SDA → SDA (not crossed!) SCL → SCL

  3. Check wire length - I2C: maximum 30 cm without buffers - For longer distances use UART

  4. Check if I2C is enabled
    bash # Raspberry Pi sudo raspi-config # Interface Options → I2C → Enable

  5. Check bus number
    bash ls /dev/i2c-* # May be i2c-0 or i2c-1 i2cdetect -y 0 # try different bus


Permission Denied (Linux)

Symptome: PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'

Lösung:

bash
# Add user to groups
sudo usermod -a -G dialout,i2c $USER

# Log out and back in, or reboot
logout

Gerät antwortet nicht nach Schnittstellenwechsel

Symptoms: After SWITCH_I2C command (0x5B) or SWITCH_UART (via I2C), device doesn't respond.

Ursache: Das ist normales Verhalten. Nach dem Umschalten der Schnittstelle wird die alte Schnittstelle deaktiviert.

Lösungen:

  1. After UART → I2C: - Connect to device via I2C - Default address: 0x50 (or previously configured) - Check: i2cdetect -y 1

  2. After I2C → UART: - Connect to device via UART - Speed: 115200, 8N1

  3. If you changed the I2C address: - Scan the bus: i2cdetect -y 1 - Device will be at the new address

Beispiel Umschaltung UART → I2C:

python
import serial
from smbus2 import SMBus

# 1. Send switch command via UART
ser = serial.Serial('COM3', 115200, timeout=1)
ser.write(bytes([0x02, 0x5B]))  # SWITCH_I2C
resp = ser.read(1)
if resp and resp[0] == 0x00:
    print("Switched to I2C")
ser.close()

# 2. Now work via I2C
bus = SMBus(1)
freq = bus.read_byte_data(0x50, 0x20)
print(f"Mains frequency: {freq} Hz")

Protokollfehler

Fehler 0xFC — EEPROM-Schreibfehler

Ursache: Einstellungen konnten nicht im nichtflüchtigen Speicher gespeichert werden.

Possible causes:
- Flash memory problem
- Power supply voltage too low

Solution:
- Check power supply voltage (minimum 2.7V for Flash write)
- Retry the command


Fehler 0xF9 — Syntaxfehler

Ursache: Unbekannter Befehl oder ungültiges Format.

Prüfen Sie:

  1. Startbyte — Befehl muss mit 0x02 beginnen
  2. Command code — use only valid codes: - 0x53 (SET) - 0x47 (GET) - 0x43 (CURVE) - 0x51 (GETCURVE) - 0x52 (FREQ) - 0x58 (RESET) - 0x5B (SWITCH_I2C)

Beispiel eines korrekten Befehls:

plaintext
Correct:   02 53 00 32  (SET brightness 50%)
Incorrect: 53 00 32     (no start byte)
Incorrect: 02 99 00     (unknown command 0x99)

Fehler 0xFD — Ungültiger Index

Ursache: Nicht existierender Dimmer-Index angegeben.

Lösung: Index 0x00 verwenden. Die aktuelle Version unterstützt nur einen Dimmer.

plaintext
Correct:   02 53 00 32  (dimmer 0)
Incorrect: 02 53 05 32  (dimmer 5 doesn't exist)

Fehler 0xFE — Ungültiger Parameter

Ursache: Parameterwert außerhalb des zulässigen Bereichs.

Check:
- Brightness: 0-100 (not 0-255!)
- Curve: 0, 1, or 2
- I2C address: 0x08-0x77

plaintext
Correct:   02 53 00 64  (brightness 100%)
Incorrect: 02 53 00 FF  (255 > 100)

Correct:   02 43 00 02  (LOG curve)
Incorrect: 02 43 00 05  (curve 5 doesn't exist)

Dimm-Probleme

Lamp Doesn't Light at Low Brightness

Symptoms: Incandescent lamp doesn't light below 25% brightness.

Ursache: Das ist normales Verhalten bei Glühlampen. Bei geringer Leistung ist die Glühfadenheizung zu niedrig für sichtbares Licht.

Lösung: Verwenden Sie bei Glühlampen eine Helligkeit von 25% und höher.


Brightness Doesn't Match Expectations

Symptome: 50% sieht aus wie 20% oder 80%.

Ursache: Falsche Dimmkurve ausgewählt.

Lösung: Wählen Sie die Kurve passend zu Ihrem Lasttyp (siehe Abschnitt unten).


GET- und SET-Format

Beide Befehle SET und GET arbeiten im gleichen Format:

  • SET akzeptiert Prozent: 0–100
  • GET gibt Prozent zurück: 0–100
python
dimmer.set_level(50)       # Set 50%
level = dimmer.get_level() # Get 50

UART vs. I2C — Was wählen?

UART limitations:
- Recommended interval between commands: 10-20 ms
- More frequent commands may cause buffer data loss
- UART is a relatively slow interface

Recommendation: If you need frequent brightness changes (smooth transitions, animations), use I2C — it's significantly faster.

python
# UART: no more than 3-5 commands/sec
for level in range(0, 101, 10):
    ser.write(bytes([0x02, 0x53, 0x00, level]))
    time.sleep(0.3)  # Minimum 200-300 ms between commands

# I2C: can be much faster
for level in range(0, 101):
    bus.write_byte_data(0x50, 0x10, level)
    time.sleep(0.01)  # 10 ms — smooth transition

Auswahl der Dimmkurve

Welche Kurve wählen?

Kurve Code Am besten für Eigenschaft
LINEAR 0 Universell Lineares Leistungsverhältnis
RMS 1 Glühlampen Lineare Helligkeit für Glühlampen
LOG 2 LED-Lampen Entspricht der Augenwahrnehmung

LINEAR (Standard)

plaintext
Power
100% │         ╱
     │       ╱
 50% │     ╱
     │   ╱
  0% │ ╱
     └──────────────
       0%   50%  100%
          Level
  • Leistung hängt linear vom Level ab
  • Universelle Option
  • Geeignet für die meisten Lasten

RMS

plaintext
Brightness
100% │         ╱
     │       ╱
 50% │     ╱
     │   ╱
  0% │ ╱
     └──────────────
       0%   50%  100%
          Level
  • Kompensiert die Nichtlinearität von Glühlampen
  • 50% Level = 50% wahrgenommene Helligkeit
  • Ideal für Glühlampen

LOG (Logarithmisch)

plaintext
Brightness
100% │              ╱
     │           ╱
 50% │       ╱
     │   ╱
  0% │╱
     └──────────────
       0%   50%  100%
          Level
  • Berücksichtigt die logarithmische Augenwahrnehmung
  • Sanfte Helligkeitsänderungen bei niedrigen Stufen
  • Empfohlen für LED-Lampen

Empfehlungen

Lasttyp Empfohlene Kurve
LED (dimmbar) LOG (2)
Glühlampe RMS (1)
Heizgerät LINEAR (0)
Motor (Ventilator) LINEAR (0)
Don't know Alle drei ausprobieren

⚠️ Wichtig: Gasentladungslampen (Halogen, Leuchtstoff, HID, Natrium) werden nicht unterstützt — sie benötigen hohe Spannung für die Zündung und Aufrechterhaltung der Entladung.

Kurve ändern:

python
# UART
ser.write(bytes([0x02, 0x43, 0x00, 2]))  # LOG

# I2C
bus.write_byte_data(0x50, 0x11, 2)  # LOG

Fehlercodes

Übersichtstabelle

Code Name Beschreibung Lösung
0x00 OK Erfolg
0xF9 ERR_SYNTAX Ungültiges Format START-Byte und Befehlscode prüfen
0xFC ERR_NOT_READY EEPROM-Schreibfehler Stromversorgung prüfen, erneut versuchen
0xFD ERR_INDEX Ungültiger Index Index 0 verwenden
0xFE ERR_PARAM Ungültiger Parameter Wertebereiche prüfen

Beispiel zur Fehlerbehandlung

Python:

python
ERROR_CODES = {
    0x00: "OK",
    0xF9: "Invalid command syntax",
    0xFC: "EEPROM write error",
    0xFD: "Invalid dimmer index",
    0xFE: "Invalid parameter value"
}

def check_response(resp):
    if not resp:
        return "No response"
    code = resp[0]
    return ERROR_CODES.get(code, f"Unknown error: 0x{code:02X}")

Arduino:

cpp
const char* getErrorMessage(uint8_t code) {
    switch (code) {
        case 0x00: return "OK";
        case 0xF9: return "Syntax error";
        case 0xFC: return "EEPROM write error";
        case 0xFD: return "Invalid index";
        case 0xFE: return "Invalid parameter";
        default: return "Unknown error";
    }
}

Kompatible Lasten

Unterstützt

Lasttyp Unterstützung Hinweise
Glühlampe Mindestens 25% für sichtbares Licht
Halogenlampe Funktioniert wie Glühlampe
LED (dimmbar) Only with "dimmable" marking
Heizgerät Resistive Last
Motor (Ventilator) Universal-/Bürstenmotoren

⚠️ Important about motors:
- ✓ Universal brush motors (vacuums, mixers, drills)
- ✗ Induction/asynchronous motors (most fans, pumps) — will hum and overheat!
If unsure about motor type — don't use dimming.

Nicht unterstützt

Lasttyp Grund
Leuchtstofflampen Gasentladung, benötigen Vorschaltgerät
HID-, Natriumlampen Gasentladung, Hochspannung
LED without "dimmable" Nicht zum Dimmen ausgelegt
Transformator-LED-Treiber Können überhitzen oder ausfallen

Lampe flackert

Symptome: Lampe blinkt oder flackert während des Betriebs.

Mögliche Ursachen und Lösungen:

Ursache Lösung
LED lamp not "dimmable" Durch dimmbare LED ersetzen
LED-Leistung zu gering Mindestlast hinzufügen (Glühlampe parallel)
Netzstörungen RC-Snubber am Dimmer-Ausgang hinzufügen
Schlechter Kontakt Alle Verbindungen prüfen

💡 Hinweis: DimmerLink beseitigt Software-Flackern. Wenn das Flackern bestehen bleibt — liegt die Ursache bei der Last oder der Verdrahtung.


Allgemeine Tipps

Checkliste vor dem Start

DimmerLink:

  • ☐ Stromversorgung angeschlossen (VCC und GND)
  • ☐ TX/RX gekreuzt angeschlossen (für UART)
  • ☐ SDA/SCL direkt angeschlossen (für I2C)
  • ☐ Pull-up-Widerstände installiert (für I2C)
  • ☐ Gerät im richtigen Modus (UART oder I2C)
  • Dimmer:

  • ☐ Z-C und Dim mit DimmerLink verbunden
  • ☐ Dimmer am AC-Netz angeschlossen (VORSICHT!)
  • ☐ Load power doesn't exceed dimmer rating
  • ☐ Last ist kompatibel (siehe Tabelle oben)
  • Minimaler Funktionstest

    UART:

    python
    import serial
    
    ser = serial.Serial('COM3', 115200, timeout=1)  # Or '/dev/ttyUSB0'
    
    # Request mains frequency
    ser.write(bytes([0x02, 0x52]))
    resp = ser.read(2)
    
    if len(resp) == 2 and resp[0] == 0x00:
        print(f"Device working! Mains frequency: {resp[1]} Hz")
    else:
        print(f"Error: {resp.hex() if resp else 'no response'}")
    

    I2C:

    python
    from smbus2 import SMBus
    
    try:
        bus = SMBus(1)
        freq = bus.read_byte_data(0x50, 0x20)
        print(f"✓ Device working! Mains frequency: {freq} Hz")
    except OSError as e:
        print(f"✗ Connection error: {e}")
        print("Check:")
        print("  - SDA/SCL wiring")
        print("  - Pull-up resistors")
        print("  - Is I2C enabled: sudo raspi-config")
    

    What's Next?

    ← - Lambda FAQ & Fehlerbehebung | Inhaltsverzeichnis