Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Wifilight: offset is out of bounds

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Wifilight: offset is out of bounds

    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      Wibilo last edited by

      • Adaptername: wifilight
      • Link zu Adapterrepository: https://github.com/iobroker-community-adapters/ioBroker.wifilight
      • Adapterversion: 2.0.3
      • js-controller Version: 7.0.6
      • Admin Version: 7.6.17
      • Hardwaresystem: Pi4
      • Arbeitsspeicher: 8GB
      • Festplattenart: SSD
      • Betriebssystem: Linux
      • Nodejs-Version: 20.19.0
      • NPM-Version: 10.8.2
      • Installationsart: Skript
      • Image, Docker genutzt: Ja
      • Ort, Name der Imagedatei: https://github.com/buanet/ioBroker.docker/blob/v10.0.0/debian12/Dockerfile

      Hallo
      ich habe seit einiger Zeit Probleme mit dem Wifilight Adapter.

      wifilight.0
      	15528	2025-07-08 21:46:06.775	info	terminating
      wifilight.0
      	15528	2025-07-08 21:46:06.271	debug	[192.168.178.240] onClose hasError=false client=192.168.178.240:5577
      wifilight.0
      	15528	2025-07-08 21:46:06.268	warn	Terminated (UNCAUGHT_EXCEPTION): Without reason
      wifilight.0
      	15528	2025-07-08 21:46:06.267	debug	Plugin sentry destroyed
      wifilight.0
      	15528	2025-07-08 21:46:06.265	info	terminating
      wifilight.0
      	15528	2025-07-08 21:46:06.264	debug	unload: 192_168_178_240
      wifilight.0
      	15528	2025-07-08 21:46:06.259	error	offset is out of bounds
      wifilight.0
      	15528	2025-07-08 21:46:06.258	error	RangeError: offset is out of bounds at Uint8Array.set (<anonymous>) at WifiLight.onData (/opt/iobroker/node_modules/iobroker.wifilight/main.js:1024:25) at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.wifilight/main.js:639:45) at Socket.emit (node:events:524:28) at Socket.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Socket.Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:191:23)
      wifilight.0
      	15528	2025-07-08 21:46:06.257	error	uncaught exception: offset is out of bounds
      wifilight.0
      	15528	2025-07-08 21:46:06.254	debug	raw data: ff ff 03 00 00 46
      wifilight.0
      	15528	2025-07-08 21:46:06.253	debug	raw data length: 6
      wifilight.0
      	15528	2025-07-08 21:46:06.213	error	offset is out of bounds
      wifilight.0
      	15528	2025-07-08 21:46:06.213	error	RangeError: offset is out of bounds at Uint8Array.set (<anonymous>) at WifiLight.onData (/opt/iobroker/node_modules/iobroker.wifilight/main.js:1024:25) at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.wifilight/main.js:639:45) at Socket.emit (node:events:524:28) at Socket.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Socket.Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:191:23)
      wifilight.0
      	15528	2025-07-08 21:46:06.212	error	uncaught exception: offset is out of bounds
      wifilight.0
      	15528	2025-07-08 21:46:06.199	debug	raw data: ff ff
      wifilight.0
      	15528	2025-07-08 21:46:06.199	debug	raw data length: 2
      wifilight.0
      	15528	2025-07-08 21:46:06.186	debug	[192.168.178.240] onData: {"on":true,"progNo":97,"progOn":true,"progSpeed":29,"red":0,"green":0,"blue":0,"white":0}
      wifilight.0
      	15528	2025-07-08 21:46:06.185	debug	[192.168.178.240] onData: raw: 81 04 23 61 21 1d 00 00 00 00 00 00 00 00
      wifilight.0
      	15528	2025-07-08 21:46:06.184	debug	raw data: 61 21 1d
      wifilight.0
      	15528	2025-07-08 21:46:06.183	debug	raw data length: 3
      wifilight.0
      	15528	2025-07-08 21:46:06.171	debug	raw data: 04 23
      wifilight.0
      	15528	2025-07-08 21:46:06.169	debug	raw data length: 2
      wifilight.0
      	15528	2025-07-08 21:46:06.150	debug	raw data: 81
      wifilight.0
      	15528	2025-07-08 21:46:06.149	debug	raw data length: 1
      wifilight.0
      	15528	2025-07-08 21:46:06.114	debug	[192.168.178.240] write: 81 8a 8b 96
      wifilight.0
      	15528	2025-07-08 21:46:06.101	debug	self.client.connect: connected
      wifilight.0
      	15528	2025-07-08 21:46:06.100	debug	[192.168.178.240] write: 81 8a 8b 96
      wifilight.0
      	15528	2025-07-08 21:46:06.095	debug	[192.168.178.240] 192.168.178.240 connected
      wifilight.0
      	15528	2025-07-08 21:46:05.654	info	starting. Version 2.0.3 in /opt/iobroker/node_modules/iobroker.wifilight, node: v20.19.0, js-controller: 7.0.6
      wifilight.0
      	15528	2025-07-08 21:46:05.029	debug	Plugin sentry Initialize Plugin (enabled=true)
      wifilight.0
      	15528	2025-07-08 21:46:04.945	debug	States connected to redis: 127.0.0.1:9000
      wifilight.0
      	15528	2025-07-08 21:46:04.883	debug	States create User PubSub Client
      wifilight.0
      	15528	2025-07-08 21:46:04.882	debug	States create System PubSub Client
      wifilight.0
      	15528	2025-07-08 21:46:04.848	debug	Redis States: Use Redis connection: 127.0.0.1:9000
      wifilight.0
      	15528	2025-07-08 21:46:04.772	debug	Objects connected to redis: 127.0.0.1:9001
      wifilight.0
      	15528	2025-07-08 21:46:04.757	debug	Objects client initialize lua scripts
      wifilight.0
      	15528	2025-07-08 21:46:04.591	debug	Objects create User PubSub Client
      wifilight.0
      	15528	2025-07-08 21:46:04.589	debug	Objects create System PubSub Client
      wifilight.0
      	15528	2025-07-08 21:46:04.495	debug	Objects client ready ... initialize now
      wifilight.0
      	15528	2025-07-08 21:46:03.832	debug	Redis Objects: Use Redis connection: 127.0.0.1:9001
      

      Hardware ist ein LD382 (bei der automatischen Erkennung wird er allerdings regelmäßig als LD382A erkannt, habe aber beide Einstellungen mit gleichem Ergebnis ausprobiert).
      Downgrade des Adapters bis zur letzten noch verfügbaren Version 1.3.3 bringt gleiches Verhalten.
      Der Adapter lief in einer alten Version über Jahre fehlerfrei (soweit ich mich erinnern kann 😋 ). Ich meine, es ging mit der Version 1.3 los, dass Kommandos nicht mehr zuverlässig ausgeführt wurden.
      Der Log Auszug oben stammt vom Adapterstart.
      Manchmal wir folgende Log-Ausgabe erzeugt (siehe warning):

      	2026	2025-07-08 20:26:07.422	info	terminating
      wifilight.0
      	2026	2025-07-08 20:26:07.386	error	offset is out of bounds
      wifilight.0
      	2026	2025-07-08 20:26:07.385	error	RangeError: offset is out of bounds at Uint8Array.set (<anonymous>) at WifiLight.onData (/opt/iobroker/node_modules/iobroker.wifilight/main.js:1024:25) at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.wifilight/main.js:639:45) at Socket.emit (node:events:524:28) at Socket.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Socket.Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:191:23)
      wifilight.0
      	2026	2025-07-08 20:26:07.384	error	uncaught exception: offset is out of bounds
      wifilight.0
      	2026	2025-07-08 20:26:07.356	warn	State value to set for "wifilight.0.192_168_178_240.progNo" has value "97" greater than max "56"
      wifilight.0
      	2026	2025-07-08 20:26:06.450	info	starting. Version 2.0.3 in /opt/iobroker/node_modules/iobroker.wifilight, node: v20.19.0, js-controller: 7.0.6
      wifilight.0
      

      Ich hatte das Problem zwischenzeitlich wegen anderer Prioritäten nicht weiter verfolgt. Ich möchte den Wifi Controller aber nur ungern austauschen, da er ziemlich unzugänglich verbaut ist.

      Jemand eine Idee?

      Bernd1967 1 Reply Last reply Reply Quote 0
      • arteck
        arteck Developer Most Active last edited by

        issue auf GIT für den Entwickler anlegen

        1 Reply Last reply Reply Quote 1
        • Bernd1967
          Bernd1967 @Wibilo last edited by Bernd1967

          @Wibilo
          Die "raw data length" sind teilweise sehr ungewöhnlich im Log.
          Mal 1,2 oder 3 Byte....
          Kann es sein das die Wifi Verbindung schlecht ist ?

          P.S.:
          Bei der Adapterversion 2.0.3
          Ich hatte auch Probleme mit meinem Wifi Adapter mit nicht unterstützter Bytefolge.
          Ich hatte festgestellt das wenn einmal eine falsche Bytelänge oder Bytefolge gesendet wurde der "Datenzeiger" an einer falschen Position war.
          In der main.js hatte ich dann in der Function "onData(data)" folgende Zeile geändert:

          this.dataBuffer.pos -= lengthRead;
          

          Durch:

          this.dataBuffer.pos -= data.length;
          

          Falls Du dir das zutraust kannste das mal testen.

          mcm1957 1 Reply Last reply Reply Quote 0
          • W
            Wibilo last edited by

            @bernd1967 Vielen Dank! 👍 😊
            Ich war so mutig und habe deinen Änderungsvorschlag mal ausprobiert - und er funktioniert!
            Ich habe daher ein Issue für den Adapter auf github eröffnet: Error: RangeError: offset is out of bounds

            1 Reply Last reply Reply Quote 0
            • mcm1957
              mcm1957 @Bernd1967 last edited by

              @bernd1967 said in Wifilight: offset is out of bounds:

              @Wibilo
              Die "raw data length" sind teilweise sehr ungewöhnlich im Log.
              Mal 1,2 oder 3 Byte....
              Kann es sein das die Wifi Verbindung schlecht ist ?

              P.S.:
              Bei der Adapterversion 2.0.3
              Ich hatte auch Probleme mit meinem Wifi Adapter mit nicht unterstützter Bytefolge.
              Ich hatte festgestellt das wenn einmal eine falsche Bytelänge oder Bytefolge gesendet wurde der "Datenzeiger" an einer falschen Position war.
              In der main.js hatte ich dann in der Function "onData(data)" folgende Zeile geändert:

              this.dataBuffer.pos -= lengthRead;
              

              Durch:

              this.dataBuffer.pos -= data.length;
              

              Falls Du dir das zutraust kannste das mal testen.

              Gibts zu deinen Problemen ein Issue? Oder gar einen PR wenn du eh das Problem eingegrenzt hast?

              Wenn nicht - bitte leg das nächste mal ein Issue an wenn du ein Problem entdeckst. Andere werden es dir danken ...

              Bernd1967 1 Reply Last reply Reply Quote 0
              • Bernd1967
                Bernd1967 @mcm1957 last edited by

                @mcm1957

                Ja, es gibt ein Github Issue wo ich mein Problem angegeben habe: #475
                Es ist glaube ich aber nicht die endgültige Lösung da von den Programmieren das etwas anders gedacht war.
                Allerdings ist die Kommunikation dort, wie auch bei anderen Adaptern, inzwischen sehr zäh.
                Aber das ist ein anderes Thema.....

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                Support us

                ioBroker
                Community Adapters
                Donate
                FAQ Cloud / IOT
                HowTo: Node.js-Update
                HowTo: Backup/Restore
                Downloads
                BLOG

                649
                Online

                31.9k
                Users

                80.1k
                Topics

                1.3m
                Posts

                4
                6
                116
                Loading More Posts
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes
                Reply
                • Reply as topic
                Log in to reply
                Community
                Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                The ioBroker Community 2014-2023
                logo