Tasmota MAX_DOMOTICZ_IDX erhöhen

  • Hallo zusammen,


    ich bräuchte mal etwas Hilfe.

    Wie und wo kann ich die Anzahl der für Domoticz verfügbaren Devices (IDX) erhöhen.

    Ich betreibe einige Wemos mit 8 Relais und habe diese in Domoticz über die entspr. IDX eingebunden.

    Bisher (Version 6.6.xxx) habe ich dies durch eine Anpassung in der sonoff.h / tasmota.h vorgenommen.

    Wert von 4 auf 8 gesetzt. Hat bisher problemlos funktioniert.

    const uint8_t MAX_DOMOTICZ_IDX = 4; // Max number of Domoticz device, key and switch indices

    In der aktuellen Version (8.1.0.10) geht dies auch noch, das Kompilieren funktioniert ohne Fehler, jedoch lassen sich später keine Änderungen mehr abspeichern. So kann z.B. nicht von „Basic“ auf „Generic“ oder andere Module gewechselt werden. Diese lassen sich zwar auswählen, nach einem Neustart ist jedoch alles wieder auf dem alten Stand.

    Hat jemand einen Tipp?


    Besten Dank

    Harald

  • Hast Du das auf Github gesehen? Da wird genau das behandelt.

    https://github.com/arendst/Tasmota/issues/9034

    Besonders Theo Arends antwort gibt Aufschluß:

    Spoiler anzeigen

    Your change will break future tasmota upgrades but then that's what you've choosen.

    First, while changing MAX_DOMOTICZ_IDX from 4 to anything else you must have read the header above it saying:

    As the settings layout is a fixed area of exactly 4k memory any increase of the above values will overflow the area with unstable system result.

    In your case if you increase the value you will need to go over the settings area and find the impact of the change. You'll notice the define MAX_DOMOTICZ_IDX pops up three times in settings.h. Any increase needs extra storage space you will need to calculate how many bytes are needed for a single increment. Then find a location within the 4k settings to decrement the same amount to keep the total exactly 4k (4096 bytes). Look for variable free_f43[117] and decrement the index with your calculated number of bytes. I leave the calculation to you to get some feeling with the procedure. Oh and keep in mind to have the uint32_t variables exactly on a 4-byte binary so as the define also increases a uint16_t I would recommend to increase by steps of 2. Again, dive in C as a real ESPCustomizer and learn a lot.

    Good luck and remember any default Tasmota will binary will break your system as the settings have been moved from their default location.

    benzino77 Tasmocompiler

    Gitpod Master Release

    Gitpod Development Release

    Sonoff-Basic / Sonoff-RF / Sonoff-Touch / Sonoff S20 / PowStro Basic / MagicHome / Sonoff-RF-Bridge mit diversen 433MHz RF Sender/Empfänger / Shelly_1 / ESP-WiFi-Dimmer / Gosund SP111 / ESP12E / WEMOS D1 Mini / ESP32Cam

    Sensoren: BME280/BMP280/HC-SR501/HC-SR04/ACS712/INA219/MHZ19B/DS3231

    Alexa Sprachsteuerung

    mosquitto/bash/html/cgi auf Wyse5070

  • Naja ... da steht im Prinzip das der Speicherbereich exakt 4k groß und voll belegt ist und wenn du mehr Platz für IDX Adressen brauchst, an anderer Stelle Features mit der exakt benötigten größe raus schmeißen musst. (Vermutlich verliert deshalb dein Gerät auch seine EInstellungen weil durch deine Erweiterung die sich kompilieren ließ einfach kein Platz mehr zum sichern übrig ist)

    Wie und wo du das machst, meint Arend, bleibt dir überlassen. Er weißt noch darauf hin das auch Variablengrößen anders definiert bzw. beachtet werden müssten und rät, sich in der C Programmierung zu üben ;)

    benzino77 Tasmocompiler

    Gitpod Master Release

    Gitpod Development Release

    Sonoff-Basic / Sonoff-RF / Sonoff-Touch / Sonoff S20 / PowStro Basic / MagicHome / Sonoff-RF-Bridge mit diversen 433MHz RF Sender/Empfänger / Shelly_1 / ESP-WiFi-Dimmer / Gosund SP111 / ESP12E / WEMOS D1 Mini / ESP32Cam

    Sensoren: BME280/BMP280/HC-SR501/HC-SR04/ACS712/INA219/MHZ19B/DS3231

    Alexa Sprachsteuerung

    mosquitto/bash/html/cgi auf Wyse5070

    Einmal editiert, zuletzt von HoerMirAuf (1. September 2020 um 07:59)