Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. [gelöst] simpleApi kann nicht %B0 aber °

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] simpleApi kann nicht %B0 aber °

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

      Bitte 1.6.2 vom Github versuchen, sollte das Problem fixen

      1 Reply Last reply Reply Quote 0
      • K
        klassisch Most Active last edited by

        Vielen Dank, but not really_

        ! ````
        simple-api.0 2017-11-27 08:55:05.035 info http server listening on port 8087
        simple-api.0 2017-11-27 08:55:05.035 info Allow states only when user is owner: false
        simple-api.0 2017-11-27 08:55:05.034 info simpleAPI server listening on port 8087
        simple-api.0 2017-11-27 08:55:05.034 info starting. Version 1.6.2 in /opt/iobroker/node_modules/iobroker.simple-api, node: v4.8.5
        host.orangepiplus2e 2017-11-27 08:55:02.445 info instance system.adapter.simple-api.0 started with pid 5837
        host.orangepiplus2e 2017-11-27 08:54:32.359 info Restart adapter system.adapter.simple-api.0 because enabled
        host.orangepiplus2e 2017-11-27 08:54:32.356 error instance system.adapter.simple-api.0 terminated with code 0 (OK)
        simple-api.0 2017-11-27 08:54:32.283 info terminating
        simple-api.0 2017-11-27 08:54:32.224 info terminating http server on port 8087
        simple-api.0 2017-11-27 08:54:32.218 error at HTTPParser.parserOnHeadersComplete (_http_common.js:97:23)
        simple-api.0 2017-11-27 08:54:32.218 error at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:539:12)
        simple-api.0 2017-11-27 08:54:32.218 error at Server.emit (events.js:172:7)
        simple-api.0 2017-11-27 08:54:32.218 error at emitTwo (events.js:87:13)
        simple-api.0 2017-11-27 08:54:32.218 error at Server.requestProcessor (/opt/iobroker/node_modules/iobroker.simple-api/main.js:81:23)
        simple-api.0 2017-11-27 08:54:32.218 error at SimpleAPI.restApi (/opt/iobroker/node_modules/iobroker.simple-api/lib/simpleapi.js:406:79)
        simple-api.0 2017-11-27 08:54:32.218 error at decodeURIComponent (native)
        simple-api.0 2017-11-27 08:54:32.218 error URIError: URI malformed
        simple-api.0 2017-11-27 08:54:32.197 error uncaught exception: URI malformed
        simple-api.0 2017-11-27 08:54:32.146 debug
        simple-api.0 2017-11-27 08:54:32.146 debug High Humidity: 2017-11-26 09:57:19 rel Humid: 88.39%
        simple-api.0 2017-11-27 08:54:32.146 debug 192.178.99.99
        simple-api.0 2017-11-27 08:54:32.146 debug Try Decode 2: Garten-IR-T-Sky
        simple-api.0 2017-11-27 08:54:32.144 debug Decode Result 1: High humidity warning - Garten-IR-T-Sky
        simple-api.0 2017-11-27 08:54:32.143 debug Try Decode 1: High humidity warning - Garten-IR-T-Sky
        simple-api.0 2017-11-27 08:54:32.141 debug Decode Result 0: email@email.de
        simple-api.0 2017-11-27 08:54:32.138 debug Try Decode 0: email@email.de
        host.orangepiplus2e 2017-11-27 08:54:10.954 info Update repository "default" under "http://download.iobroker.net/sources-dist.json"
        iobroker 2017-11-27 08:54:10.244 info exit 0
        iobroker 2017-11-27 08:54:10.108 info upload [0] simple-api.admin /opt/iobroker/node_modules/iobroker.simple-api/admin/index.html index.html text/html
        iobroker 2017-11-27 08:54:09.967 info upload [1] simple-api.admin /opt/iobroker/node_modules/iobroker.simple-api/admin/simple-api.png simple-api.png image/png
        iobroker 2017-11-27 08:54:09.939 info got /opt/iobroker/node_modules/iobroker.simple-api/admin
        iobroker 2017-11-27 08:54:09.781 info iobroker.simple-api@1.6.2 opt/iobroker/node_modules/iobroker.simple-api

        
        Warte noch einen Moment. Eben hat es mit einem Teilstring geklappt. Das % kam durch, lass mich noch etwas schauen…
        
        Sehr seltsam. Jetzt hat die Übetrtragung ein paarmal geklappt, dann das
        
        >! ````
        simple-api.0	2017-11-27 09:06:13.075	info	http server listening on port 8087
        simple-api.0	2017-11-27 09:06:13.075	info	Allow states only when user is owner: false
        simple-api.0	2017-11-27 09:06:13.074	info	simpleAPI server listening on port 8087
        simple-api.0	2017-11-27 09:06:13.074	info	starting. Version 1.6.2 in /opt/iobroker/node_modules/iobroker.simple-api, node: v4.8.5
        host.orangepiplus2e	2017-11-27 09:06:10.503	info	instance system.adapter.simple-api.0 started with pid 5860
        host.orangepiplus2e	2017-11-27 09:05:40.430	info	Restart adapter system.adapter.simple-api.0 because enabled
        host.orangepiplus2e	2017-11-27 09:05:40.428	error	instance system.adapter.simple-api.0 terminated with code 0 (OK)
        simple-api.0	2017-11-27 09:05:40.356	info	terminating http server on port 8087
        simple-api.0	2017-11-27 09:05:40.355	error	URIError: URI malformed at decodeURI (native) at SimpleAPI.restApi (/opt/iobroker/node_modules/iobroker.simple-api/lib/simpleapi.js:397:19) at Server.requestProcessor (/opt/iobroker/node_m
        simple-api.0	2017-11-27 09:05:40.353	error	uncaught exception: URI malformed
        nut.0	2017-11-27 09:05:26.876	info	All Nut values set
        nut.0	2017-11-27 09:05:26.778	info	Start NUT update
        email.0	2017-11-27 09:04:39.738	info	sent to email@email.de
        email.0	2017-11-27 09:04:38.671	info	Send email: {"from":"email.email@gmail.com","to":"email@email.de","subject":"High humidity warning - Garten-IR-T-Sky","text":"Garten-IR-T-Sky \r\n192.178.99.99 \r\nHigh Humidity: 2017-11-2
        simple-api.0	2017-11-27 09:04:38.622	debug	Add to Response-Get: {"id":"data.0.email.text","val":"Garten-IR-T-Sky \r\n192.178.99.99 \r\nHigh Humidity: 2017-11-26 09:57:19 rel Humid: 88.39% \r\n ","value":"Garten-IR-T-Sky \r\n192.178.99.99
        simple-api.0	2017-11-27 09:04:38.603	debug	Add to Response-Get: {"id":"data.0.email.subject","val":"High humidity warning - Garten-IR-T-Sky","value":"High humidity warning - Garten-IR-T-Sky"}
        simple-api.0	2017-11-27 09:04:38.581	debug	GET-setBulk for id=data.0.email.text, oid=textused=data.0.email.text, value=Garten-IR-T-Sky 192.178.99.99 High Humidity: 2017-11-26 09:57:19 rel Humid: 88.39%
        simple-api.0	2017-11-27 09:04:38.579	debug	GET-setBulk for id=data.0.email.subject, oid=subjectused=data.0.email.subject, value=High humidity warning - Garten-IR-T-Sky
        simple-api.0	2017-11-27 09:04:38.556	debug	Values: {"data.0.email.subject":"High humidity warning - Garten-IR-T-Sky","data.0.email.text":"Garten-IR-T-Sky \r\n192.178.99.99 \r\nHigh Humidity: 2017-11-26 09:57:19 rel Humid: 88.39% \r\n ","p
        

        Ich starte jetzt mal den Browser neu und den Adapter neu. Dann sehen wir weiter.

        1 Reply Last reply Reply Quote 0
        • apollon77
          apollon77 last edited by

          Versuch nochmal. DU hast nach dem Update den Adapter nicht neu gestartet … da lief noch die Vorgängerversion 🙂 (die neue hat das Debug-Logging gar nicht mehr). Aber die läuft jetzt ... so please :-))

          1 Reply Last reply Reply Quote 0
          • K
            klassisch Most Active last edited by

            Sorry, war auch gerade dabei alles neu zu starten.

            Bisher sieht es gut aus….

            ! ````
            simple-api.0 2017-11-27 09:11:58.178 debug Add to Response-Get: {"id":"data.0.email.text","val":"Garten-IR-T-Sky \r\n192.178.99.99 \r\nHigh Humidity: 2017-11-26 09:57:19 rel Humid: 88.39% \r\n ","value":"Garten-IR-T-Sky \r\n192.178.99.9
            simple-api.0 2017-11-27 09:11:58.172 debug Add to Response-Get: {"id":"data.0.email.subject","val":"High humidity warning - Garten-IR-T-Sky","value":"High humidity warning - Garten-IR-T-Sky"}
            simple-api.0 2017-11-27 09:11:58.155 debug
            simple-api.0 2017-11-27 09:11:58.155 debug High Humidity: 2017-11-26 09:57:19 rel Humid: 88.39%
            simple-api.0 2017-11-27 09:11:58.155 debug 192.178.99.99
            simple-api.0 2017-11-27 09:11:58.155 debug GET-setBulk for id=data.0.email.text, oid=textused=data.0.email.text, value=Garten-IR-T-Sky
            simple-api.0 2017-11-27 09:11:58.149 debug GET-setBulk for id=data.0.email.subject, oid=subjectused=data.0.email.subject, value=High humidity warning - Garten-IR-T-Sky
            simple-api.0 2017-11-27 09:11:58.133 debug Values: {"data.0.email.subject":"High humidity warning - Garten-IR-T-Sky","data.0.email.text":"Garten-IR-T-Sky \r\n192.178.99.99 \r\nHigh Humidity: 2017-11-26 09:57:19 rel Humid: 88.39% \r\n ","
            simple-api.0 2017-11-27 09:11:45.691 info http server listening on port 8087
            simple-api.0 2017-11-27 09:11:45.681 info Allow states only when user is owner: false
            simple-api.0 2017-11-27 09:11:45.679 info simpleAPI server listening on port 8087
            simple-api.0 2017-11-27 09:11:45.606 info starting. Version 1.6.2 in /opt/iobroker/node_modules/iobroker.simple-api, node: v4.8.5
            simple-api.0 2017-11-27 09:11:44.714 debug statesDB connected
            simple-api.0 2017-11-27 09:11:44.574 debug objectDB connected

            1 Reply Last reply Reply Quote 0
            • K
              klassisch Most Active last edited by

              Vielen Dank nochmals! Habe noch etwas gespielt und bisher hat es funktioniert.

              Bei unerlaubten Symbolen wie dem %B0 statt dem %C2%B0 schmiert der Adapter noch ab.

              Aber es funktioniert jetzt z.B. ein gueltiges°C Symbol %e2%84%83.

              Was es alles gibt. So ists, wenn man noch mit ASCII aufgewachsen ist und sich um den neumodischen Designerkram nicht geschert hat…

              1 Reply Last reply Reply Quote 0
              • apollon77
                apollon77 last edited by

                Hast Du da nochnmal debug, dann fange ich den Fehler da auch ab und es wird dann halt einfach nicht decoded

                1 Reply Last reply Reply Quote 0
                • K
                  klassisch Most Active last edited by

                  Ja, mit der 1.6.2 kommt natürlich nicht so viel rüber

                  ! ````
                  simple-api.0 2017-11-27 09:54:05.382 info http server listening on port 8087
                  simple-api.0 2017-11-27 09:54:05.382 info Allow states only when user is owner: false
                  simple-api.0 2017-11-27 09:54:05.381 info simpleAPI server listening on port 8087
                  simple-api.0 2017-11-27 09:54:05.380 info starting. Version 1.6.2 in /opt/iobroker/node_modules/iobroker.simple-api, node: v4.8.5
                  host.orangepiplus2e 2017-11-27 09:54:02.618 info instance system.adapter.simple-api.0 started with pid 5970
                  host.orangepiplus2e 2017-11-27 09:53:32.521 info Restart adapter system.adapter.simple-api.0 because enabled
                  host.orangepiplus2e 2017-11-27 09:53:32.518 error instance system.adapter.simple-api.0 terminated with code 0 (OK)
                  simple-api.0 2017-11-27 09:53:32.385 error uncaught exception: URI malformed

                  
                  Und der Browserstring war
                  
                  >! ````
                  http://IP:8087/setBulk?data.0.email.text=Garten-IR-T-Sky%20%20%0D%0A192.178.99.99%20%0D%0AHigh%20Humidity:%202017-11-26%20%20%2009:57:19%20rel%20Humid:%2088.39%25%20%20%20%0D%0A%20%B0&prettyPrint
                  

                  Die %B0 war ganz am Ende.

                  1 Reply Last reply Reply Quote 0
                  • apollon77
                    apollon77 last edited by

                    Next try please …. sollte jetzt "warn" loggen und im zweifel einfach nicht dekodieren

                    1 Reply Last reply Reply Quote 0
                    • K
                      klassisch Most Active last edited by

                      Super, vielen Dank sieht an meinem Beispiel sehr gut aus:

                      ! ````
                      simple-api.0 2017-11-27 10:13:30.482 debug Add to Response-Get: {"id":"data.0.email.text","val":"Garten-IR-T-Sky%20%20%0D%0A192.178.99.99%20%0D%0AHigh%20Humidity:%202017-11-26%20%20%2009:57:19%20rel%20Humid:%2088.39%25%20%20%20%0D%0A%20%B0","v
                      simple-api.0 2017-11-27 10:13:30.454 debug GET-setBulk for id=data.0.email.text, oid=textused=data.0.email.text, value=Garten-IR-T-Sky%20%20%0D%0A192.178.99.99%20%0D%0AHigh%20Humidity:%202017-11-26%20%20%2009:57:19%20rel%20Humid:%2088.39%25%20
                      simple-api.0 2017-11-27 10:13:30.447 debug Values: {"data.0.email.text":"Garten-IR-T-Sky%20%20%0D%0A192.178.99.99%20%0D%0AHigh%20Humidity:%202017-11-26%20%20%2009:57:19%20rel%20Humid:%2088.39%25%20%20%20%0D%0A%20%B0","prettyPrint":true,"user":
                      simple-api.0 2017-11-27 10:13:30.446 warn Malformed URL encoding: URIError: URI malformed
                      simple-api.0 2017-11-27 10:13:30.444 warn Malformed URL encoding: URIError: URI malformed
                      simple-api.0 2017-11-27 10:13:18.274 info http server listening on port 8087
                      simple-api.0 2017-11-27 10:13:18.264 info Allow states only when user is owner: false
                      simple-api.0 2017-11-27 10:13:18.262 info simpleAPI server listening on port 8087
                      simple-api.0 2017-11-27 10:13:18.189 info starting. Version 1.6.2 in /opt/iobroker/node_modules/iobroker.simple-api, node: v4.8.5
                      simple-api.0 2017-11-27 10:13:18.103 debug statesDB connected
                      simple-api.0 2017-11-27 10:13:17.218 debug objectDB connected

                      
                      Interessant ist das
                      
                      ….````
                      %0A%20%B0","v
                      

                      Da hat er ein

                      ,"v

                      zugefügt.

                      Browserausgabe

                      ! ````
                      [
                      {
                      "id": "data.0.email.text",
                      "val": "Garten-IR-T-Sky%20%20%0D%0A192.178.99.99%20%0D%0AHigh%20Humidity:%202017-11-26%20%20%2009:57:19%20rel%20Humid:%2088.39%25%20%20%20%0D%0A%20%B0",
                      "value": "Garten-IR-T-Sky%20%20%0D%0A192.178.99.99%20%0D%0AHigh%20Humidity:%202017-11-26%20%20%2009:57:19%20rel%20Humid:%2088.39%25%20%20%20%0D%0A%20%B0"
                      }
                      ]

                      Und die email wird dann komplett "unkodiert":
                      
                      >! ````
                      Garten-IR-T-Sky%20%20%0D%0A192.178.99.99%20%0D%0AHigh%20Humidity:%202017-11-26%20%20%2009:57:19%20rel%20Humid:%2088.39%25%20%20%20%0D%0A%20%B0
                      

                      Da sieht man gleich, dass was was faul war. Weiss aber nicht, ob es so gedacht war.

                      1 Reply Last reply Reply Quote 0
                      • apollon77
                        apollon77 last edited by

                        Ist das erinfachste eas geht. Wenn es beim Dekodieren einen Fehler gibt, dann einfach nicht dekodieren.

                        Man könnte jetzt Libraries suchen die vllt "Fehlertoleranter" dekodieren … da fehlt mir aber gerade die Zeit zu 🙂

                        1 Reply Last reply Reply Quote 0
                        • K
                          klassisch Most Active last edited by

                          Ja, klar man könnte auch aus dem simpleApi einen fullApi machen … 😉

                          Herzlichen Dank für Deine Zeit!

                          Mir reicht der simplaApi (derzeit 🙂 ). Hauptsache der Adapter schmiert nicht mehr "kommentarlos" ab und bedient die erlaubten Zeichen richtig. Wahrscheinlich nutze ich ihn schon weit über sein urspruengliches "mission profile", knapp am abuse.

                          Wenn er nicht mehr kodiert, dann weiss ich gleich, dass ich in der schoenen neuen Codewelt wieder was vermasselt habe und kann zielgerichteter suchen.

                          Einen schoenen und erfolgreichen Tag noch!

                          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

                          403
                          Online

                          32.0k
                          Users

                          80.5k
                          Topics

                          1.3m
                          Posts

                          2
                          25
                          2314
                          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