Das Module NETIO230 führt bei der Bedienung (on/off) zu folgender Fehlermeldung:
Zitatfhemweb.js line 772:
SyntaxError: JSON.parse: bad control character in string literal at line 1 column 20 of the JSON data
Gibt's da irgendeine Lösung, zumal das äquivalente Modul NetIO230B auch nicht läuft?
Kannst du bitte die Rcvd: Zeile davor aus der JS Console zeigen?
11:52:26.048 Inform-channel opened (HTTP) with filter Netio2 fhemweb.js:363:5
11:52:26.125 Rcvd: fhemweb.js:363:5
11:53:07.932 FW_cmd:/fhem?cmd.Netio2=set Netio2 on&XHR=1 fhemweb.js:363:5
11:53:07.973 Rcvd: ["Netio2","off","<div id=\u0022Netio2\u0022 title=\u0022off\u0022 class=\u0022col2\u0022><a href=\u0022/fhem?cmd.Netio2=set Netio2 ...(272) fhemweb.js:363:5
11:53:07.984 Rcvd: ["Netio2","off","<div id=\u0022Netio2\u0022 title=\u0022off\u0022 class=\u0022col2\u0022><a href=\u0022/fhem?cmd.Netio2=set Netio2 ...(272) fhemweb.js:363:5
11:53:07.987 Rcvd: ["Netio2-_lastNotice","set Netio2 (on|off): failed response:�\u0008\u0008�O#X\u0000\u0003index.html\u0000��Qo�0\u000cǟw�\u0022�6\u...(1464) fhemweb.js:363:5
11:53:08.061 Rcvd: ["Netio2-_lastNotice-ts","2017-02-22 11:53:07","2017-02-22 11:53:07"] fhemweb.js:363:5
11:53:08.063 Rcvd: ["Netio2","off","<div id=\u0022Netio2\u0022 title=\u0022off\u0022 class=\u0022col2\u0022><a href=\u0022/fhem?cmd.Netio2=set Netio2 ...(272) fhemweb.js:363:5
11:53:08.066 Rcvd: ["Netio2-socket1","",""] fhemweb.js:363:5
SyntaxError: JSON.parse: bad control character in string literal at line 1 column 61 of the JSON data[Weitere Informationen] fhemweb.js:772:13
SyntaxError: JSON.parse: bad control character in string literal at line 1 column 20 of the JSON data[Weitere Informationen] fhemweb.js:772:13
11:53:44.868 Rcvd: ["Netio2-socket1-ts","2017-02-22 11:53:07","2017-02-22 11:53:07"] fhemweb.js:363:5
11:53:44.873 Rcvd: ["Netio2-state","off","off"] fhemweb.js:363:5
11:53:44.875 Rcvd: ["Netio2-state-ts","2017-02-22 11:53:07","2017-02-22 11:53:07"] fhemweb.js:363:5
11:53:44.878 Rcvd: ["#FHEMWEB:WEB_192.168.1.130_58204","$('#saveCheck').css('visibility','hidden')",""]
Das Modul setzt Reading/etc-Werte auf Binaer. Ich empfehle es dringend im Modul stattdessen Hex zu verwenden, normalerweise kann man damit eher was anfangen, und es nervt nicht anderswo.
In diesem Fall war es "^_" (0x1f, unsichtbar in HTML), was dem JSON-Parser aufgestossen ist.
Ich habe die Menge der geschuetzten Daten in 01_FHEMWEB.pm ausgedehnt, von [\x00-\x19\x22\x5c] auf [\x00-\x1f\x22\x5c\7f], weiss nicht mehr, warum die alte Menge so "klein" war. Damit sollte der JSON Parser kein Problem mehr haben.
OK, alles klar und danke!