Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Hilfe bei Skripte von request auf httpGet umbauen

    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

    Hilfe bei Skripte von request auf httpGet umbauen

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

      @oliverio sagte in Hilfe bei Skripte von request auf httpGet umbauen:

      warum probiert ihr jetzt noch mit einer curlversion?

      der curl ist ein Test für ein anderes Script, dass alle 10 Minuten einen Timeout hat.

      liv-in-sky 1 Reply Last reply Reply Quote 0
      • liv-in-sky
        liv-in-sky @OliverIO last edited by

        @oliverio

        wir haben noch ein andres thema.

        wir machen mit dem curtl rum, damit wir die zugriffszeiten mal checken können. das script hatte wohl mit "request" keine probleme, mit hhtpget schon

        ich hwollte dieses script nunmal mit axios testen, habe aber das problem, dass ich unterschiedliche antworten-daten bekomme

        vorher:

        var request = require("request");
        function readJson(url, callback) {
            request(url, function(err, state, body) {
                if (body) {
                    var json = {};
                    if (body !== "") {
                        try {
                            json = JSON.parse(body);
                        } catch (ex) {
                            json = {};
                        }
                        if (!json) {
                            json = {};
                        }
                    }
                    callback(null, json);
                } else {
                    var error = "(" + err + ") ERROR bei Abfrage von: " + url;
                    log(error, "warn");
                    callback(error, null);
                }
            });
        }
        

        mit axios:

        async function readJson(url, callback) {log("readjson")
            await  axios.get(url,{headers:{"Content-Type": "application/json"}}).then(response => {
                const contentType = response.headers["application/json"];
                const body=response.data;
                log(response)
                log(response.data);
                log(JSON.stringify(response.data));
                log(JSON.stringify(response));
                 log( response.data.join('\n') );
                if (!response.err) {
                    var json = {};
                    if (body !== "") {
                        try {
                            json = JSON.parse(body);
                        } catch (ex) {
                            json = {};
                        }
                        if (!json) {
                            json = {};
                        }
                    }
                    callback(null, json);
                } else {
                    var error = "(" + Error + ") ERROR bei Abfrage von: " + url;
                    log(error, "warn");
                    callback(error, null);
                }
            });
        }
        

        da sind die antwort.data unterschedlich - hast du da eine idee dazu

        1 Reply Last reply Reply Quote 0
        • liv-in-sky
          liv-in-sky @Negalein last edited by

          @negalein

          lasse mal dieses script laufen und poste das log - @OliverIO kann dann den output sehen - wegen dem unterschied

          
          var url = "http://10.0.1.93/middleware.php/data.json?from=now&uuid[]=bc3edcd0-24c4-11ea-b257-bdbd9553c516&uuid[]=deda8550-24c4-11ea-b402-275ee0956365";
          //url = "http://ip.jsontest.com/?callback=showMyIP"
          //url="https://httpbin.org/get"
          //url="http://ip.jsontest.com/"
          var pfad = "Volkszaehler.";
          var idAKTUELLER_VERBRAUCH = pfad + "AKTUELLER_VERBRAUCH";
          var idAKTUELLE_ERZEUGUNG = pfad + "AKTUELLE_LIEFERUNG";
          // var idAKTUELLE_HEIZUNG = pfad + "AKTUELLE_HEIZUNG";
           
           const axios=require('axios');
          // Vorgegebene Funktion, die nur dazu dient, das JSON einzulesen
          // Angelehnt an: http://www.iobroker.net/docu/?page_id=3691
          //var request = require("request");
          
            axios.get(url,{headers:{"Content-Type": "json"}}).then(response => {
                  const contentType = response.headers["json"];
                  const body=response.data;
                  log(response)
                  log(response.data);
                  log(JSON.stringify(response.data));
                  
                 //  log( response.data.join('\n') );
                  
                  }
              );
          
          
          var request = require("request");
           request(url, function(err, state, body) {
               log("---------------------------")
               log(body)    
              });
          
          Negalein 1 Reply Last reply Reply Quote 0
          • Negalein
            Negalein Global Moderator @liv-in-sky last edited by

            @liv-in-sky sagte in Hilfe bei Skripte von request auf httpGet umbauen:

            lasse mal dieses script laufen und poste das log - @OliverIO kann dann den output sehen - wegen dem unterschied

            javascript.0	16:22:19.541	info	Start JavaScript script.js.common.VolkszaehlerNeuTest (Javascript/js)
            javascript.0	16:22:19.549	warn	script.js.common.VolkszaehlerNeuTest: request package is deprecated - please use httpGet (or a stable lib like axios) instead!
            javascript.0	16:22:19.551	info	script.js.common.VolkszaehlerNeuTest: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
            javascript.0	16:22:19.587	info	script.js.common.VolkszaehlerNeuTest: { status: 200, statusText: 'OK', headers: Object [AxiosHeaders] { server: 'nginx/1.14.2', date: 'Tue, 28 May 2024 14:22:19 GMT', 'content-type': 'application/json', 'content-length': '442', connection: 'keep-alive', 'cache-control': 'no-cache, private', 'access-control-allow-origin': '*', 'x-powered-by': 'React/alpha' }, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http', 'fetch' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'application/json, text/plain, */*', 'Content-Type': 'json', 'User-Agent': 'axios/1.7.2', 'Accept-Encoding': 'gzip, compress, deflate, br' }, method: 'get', url: 'http://10.0.1.93/middleware.php/data.json?from=now&uuid[]=bc3edcd0-24c4-11ea-b257-bdbd9553c516&uuid[]=deda8550-24c4-11ea-b402-275ee0956365', data: undefined }, request: <ref *1> ClientRequest { _events: [Object: null prototype] { error: [Array], abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: 100, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: null, _closeAfterHandlingError: false, _events: [Object], _readableState: [ReadableState], _writableState: [WritableState], allowHalfOpen: false, _maxListeners: 100, _eventsCount: 6, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, timeout: 5000, parser: null, _httpMessage: null, [Symbol(async_id_symbol)]: -1, [Symbol(kHandle)]: [TCP], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: Timeout { _idleTimeout: 5000, _idlePrev: [TimersList], _idleNext: [Timeout], _idleStart: 22210741, _onTimeout: [Function: bound ], _timerArgs: undefined, _repeat: null, _destroyed: false, [Symbol(refed)]: false, [Symbol(kHasPrimitive)]: false, [Symbol(asyncId)]: 12550793, [Symbol(triggerId)]: 12550791 }, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(shapeMode)]: true, [Symbol(kCapture)]: false, [Symbol(kSetNoDelay)]: true, [Symbol(kSetKeepAlive)]: true, [Symbol(kSetKeepAliveInitialDelay)]: 1, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0 }, _header: 'GET /middleware.php/data.json?from=now&uuid[]=bc3edcd0-24c4-11ea-b257-bdbd9553c516&uuid[]=deda8550-24c4-11ea-b402-275ee0956365 HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'Content-Type: json\r\n' + 'User-Agent: axios/1.7.2\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: 10.0.1.93\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype], keepAliveMsecs: 1000, keepAlive: true, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 2, [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/middleware.php/data.json?from=now&uuid[]=bc3edcd0-24c4-11ea-b257-bdbd9553c516&uuid[]=deda8550-24c4-11ea-b402-275ee0956365', _ended: true, res: IncomingMessage { _events: [Object], _readableState: [ReadableState], _maxListeners: 100, socket: null, httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], joinDuplicateHeaders: undefined, aborted: false, upgrade: false, url: '', method: null, statusCode: 200, statusMessage: 'OK', client: [Socket], _consuming: false, _dumped: false, req: [Circular *1], _eventsCount: 4, responseUrl: 'http://10.0.1.93/middleware.php/data.json?from=now&uuid[]=bc3edcd0-24c4-11ea-b257-bdbd9553c516&uuid[]=deda8550-24c4-11ea-b402-275ee0956365', redirects: [], [Symbol(shapeMode)]: true, [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 16, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0 }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: '10.0.1.93', protocol: 'http:', _redirectable: Writable { _events: [Object], _writableState: [WritableState], _maxListeners: 100, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _eventsCount: 3, _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'http://10.0.1.93/middleware.php/data.json?from=now&uuid[]=bc3edcd0-24c4-11ea-b257-bdbd9553c516&uuid[]=deda8550-24c4-11ea-b402-275ee0956365', [Symbol(shapeMode)]: true, [Symbol(kCapture)]: false }, [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], 'content-type': [Array], 'user-agent': [Array], 'accept-encoding': [Array], host: [Array] }, [Symbol(errored)]: null, [Symbol(kHighWaterMark)]: 16384, [Symbol(kRejectNonStandardBodyWrites)]: false, [Symbol(kUniqueHeaders)]: null }, data: { version: '0.3', data: [ [Object], [Object] ] } }
            javascript.0	16:22:19.588	info	script.js.common.VolkszaehlerNeuTest: { version: '0.3', data: [ { tuples: [Array], uuid: 'bc3edcd0-24c4-11ea-b257-bdbd9553c516', from: 1716906055000, to: 1716906115000, min: [Array], max: [Array], average: 0, consumption: 0, rows: 2 }, { tuples: [Array], uuid: 'deda8550-24c4-11ea-b402-275ee0956365', from: 1716906085000, to: 1716906115000, min: [Array], max: [Array], average: 840, consumption: 7, rows: 2 } ] }
            javascript.0	16:22:19.588	info	script.js.common.VolkszaehlerNeuTest: {"version":"0.3","data":[{"tuples":[[1716906115000,0,1]],"uuid":"bc3edcd0-24c4-11ea-b257-bdbd9553c516","from":1716906055000,"to":1716906115000,"min":[1716906115000,0],"max":[1716906115000,0],"average":0,"consumption":0,"rows":2},{"tuples":[[1716906115000,840,1]],"uuid":"deda8550-24c4-11ea-b402-275ee0956365","from":1716906085000,"to":1716906115000,"min":[1716906115000,840],"max":[1716906115000,840],"average":840,"consumption":7,"rows":2}]}
            javascript.0	16:22:19.590	info	script.js.common.VolkszaehlerNeuTest: ---------------------------
            javascript.0	16:22:19.590	info	script.js.common.VolkszaehlerNeuTest: {"version":"0.3","data":[{"tuples":[[1716906115000,0,1]],"uuid":"bc3edcd0-24c4-11ea-b257-bdbd9553c516","from":1716906055000,"to":1716906115000,"min":[1716906115000,0],"max":[1716906115000,0],"average":0,"consumption":0,"rows":2},{"tuples":[[1716906115000,840,1]],"uuid":"deda8550-24c4-11ea-b402-275ee0956365","from":1716906085000,"to":1716906115000,"min":[1716906115000,840],"max":[1716906115000,840],"average":840,"consumption":7,"rows":2}]}
            javascript.0	16:22:34.588	info	Stopping script script.js.common.VolkszaehlerNeuTest
            
            1 Reply Last reply Reply Quote 0
            • OliverIO
              OliverIO last edited by

              @liv-in-sky

              wo seht ihr nun einen unterschied?
              die beiden zeilen sind doch gleich?

              javascript.0	16:22:19.588	info	script.js.common.VolkszaehlerNeuTest: {"version":"0.3","data":[{"tuples":[[1716906115000,0,1]],"uuid":"bc3edcd0-24c4-11ea-b257-bdbd9553c516","from":1716906055000,"to":1716906115000,"min":[1716906115000,0],"max":[1716906115000,0],"average":0,"consumption":0,"rows":2},{"tuples":[[1716906115000,840,1]],"uuid":"deda8550-24c4-11ea-b402-275ee0956365","from":1716906085000,"to":1716906115000,"min":[1716906115000,840],"max":[1716906115000,840],"average":840,"consumption":7,"rows":2}]}
              javascript.0	16:22:19.590	info	script.js.common.VolkszaehlerNeuTest: ---------------------------
              javascript.0	16:22:19.590	info	script.js.common.VolkszaehlerNeuTest: {"version":"0.3","data":[{"tuples":[[1716906115000,0,1]],"uuid":"bc3edcd0-24c4-11ea-b257-bdbd9553c516","from":1716906055000,"to":1716906115000,"min":[1716906115000,0],"max":[1716906115000,0],"average":0,"consumption":0,"rows":2},{"tuples":[[1716906115000,840,1]],"uuid":"deda8550-24c4-11ea-b402-275ee0956365","from":1716906085000,"to":1716906115000,"min":[1716906115000,840],"max":[1716906115000,840],"average":840,"consumption":7,"rows":2}]}
              j
              
              liv-in-sky 1 Reply Last reply Reply Quote 0
              • liv-in-sky
                liv-in-sky @OliverIO last edited by liv-in-sky

                @oliverio oh sorry - da ich nicht testen kann und das script etwas angepaßt habe, funktioniert es jetzt - dann kann ich mit @Negalein wiede weitermachen

                vorher stand bei max und min nur das wort [array] drin

                also so:

                javascript.0	16:22:19.590	info	script.js.common.VolkszaehlerNeuTest: {"version":"0.3","data":[{"tuples":[[1716906115000,0,1]],"uuid":"bc3edcd0-24c4-11ea-b257-bdbd9553c516","from":1716906055000,"to":1716906115000,"min":[array],"max":[array],"average":0,"consumption":0,"rows":2},{"tuples":[[1716906115000,840,1]],"uuid":"deda8550-24c4-11ea-b402-275ee0956365","from":1716906085000,"to":1716906115000,"min":[array],"max":[array],"average":840,"consumption":7,"rows":2}]}
                j
                
                
                OliverIO 1 Reply Last reply Reply Quote 0
                • OliverIO
                  OliverIO @liv-in-sky last edited by

                  @liv-in-sky
                  das kann eine funktion der log ausgabe sein, die ab einer bestimmten tiefe der objektverschachtelung nur noch den typ ausgibt, obwohl es da schon noch weitergeht.
                  über die stringify ausgabe seht ihr ja, das da alles da ist.
                  die reihenfolge der properties in einem json ist nicht standardisiert, führt aber immer zum gleichen objekt. daher ist ein textbasierter vergleich meist schwierig.

                  1 Reply Last reply Reply Quote 1
                  • K
                    kukoratsch last edited by kukoratsch

                    neues Thema aufgemacht

                    1 Reply Last reply Reply Quote 0
                    • R
                      Rushmed Most Active last edited by

                      Hallo meine Herren,

                      ich muss nochmal nach dem Thema:

                      timeout of 2000ms exceeded
                      

                      fragen.

                      Wenn ich diesen Block ausführe:
                      da94fe68-5856-4054-8ca8-5e974ef43b36-grafik.png
                      bekomme ich diese Antwort:

                      javascript.0	19:17:46.172	info	Start JavaScript script.js.Matrix_Displays (Blockly)
                      javascript.0	19:17:46.207	info	script.js.Matrix_Displays: registered 69 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
                      javascript.0	19:17:46.267	info	script.js.Matrix_Displays: {"Restart":"Restarting"}
                      javascript.0	19:17:50.287	error	script.js.Matrix_Displays: timeout of 2000ms exceeded
                      

                      Der Befehl wird auf dem (Tasmota) Gerät ausgeführt und die Antwort kommt ja augenscheinlich auch im ioBroker an. Warum kommt dann hier der Error und kann ich etwas dagegen tun?

                      Danke vorab.

                      W R 2 Replies Last reply Reply Quote 0
                      • W
                        Wildbill @Rushmed last edited by Wildbill

                        @rushmed Vermutlich, weil das Gerät den Restart gleich ausführt, ohne darüber nochmal eine Rückmeldung zu geben. Also wird nach den 2 Sekunden eben der Timeout ins Log geschrieben.
                        Ich meine, wenn ich bei (einigen zumindest) Tasmota-Geräten per Webinterface einen Restart auslöse, dass dann auch die Fehlerseite aufgeht, dass die Seite nicht erreichbar wäre. Bei anderen kommt vorher noch eine Seite mit „Success“. Woran das aber liegt, dass die Success-Seite mal kommt und mal nicht und ob das immer die gleichen Geräte sind habe ich nie verfolgt, weil es mich bisher auch nicht gestört hat.

                        Gruss, Jürgen

                        EDIT: Der Restart wird ammer in beiden Fällen jeweils problemlos ausgeführt.

                        R 1 Reply Last reply Reply Quote 0
                        • R
                          Rushmed Most Active @Wildbill last edited by Rushmed

                          @wildbill Ok, aber die Antwort von Tasmota:

                          javascript.0	19:17:46.267	info	script.js.Matrix_Displays: {"Restart":"Restarting"}
                          

                          wird doch empfangen aber scheinbar nicht als Antwort interpretiert.

                          Hat @haus-automatisierung hier evtl. einen Rat?

                          W haus-automatisierung 2 Replies Last reply Reply Quote 0
                          • W
                            Wildbill @Rushmed last edited by

                            @rushmed Das stimmt allerdings, wenn man es so sieht. Keine Ahnung, ob da noch danach was „erwartet“ wird, was wegen des Reboots aber nicht kommt.

                            Gruss, Jürgen

                            1 Reply Last reply Reply Quote 0
                            • haus-automatisierung
                              haus-automatisierung Developer Most Active @Rushmed last edited by

                              @rushmed sagte in Hilfe bei Skripte von request auf httpGet umbauen:

                              Hat @haus-automatisierung hier evtl. einen Rat?

                              Tasmota ist hier zumindest immer wieder auffällig. Bitte mal die gleiche URL mit curl aufrufen und verbose aktivieren -v damit man alle Header sieht.

                              R 1 Reply Last reply Reply Quote 0
                              • R
                                Rushmed Most Active @haus-automatisierung last edited by

                                @haus-automatisierung
                                ich habe:
                                9862153b-f04f-4db7-8db4-00cf515c091f-grafik.png
                                Ausgeführt und es ist garnichts passiert. Weder wurde der Befehl ausgeführt, noch kam eine Antwort.

                                haus-automatisierung 1 Reply Last reply Reply Quote 0
                                • haus-automatisierung
                                  haus-automatisierung Developer Most Active @Rushmed last edited by

                                  @rushmed Mach das mal direkt per ssh oder auf einem anderen System. Also nicht aus Blockly heraus. Ansonsten müssen natürlich Anführungszeichen um die URL, damit die 1 am Ende noch dazu gehört (oder %20 dazwischen)

                                  R 1 Reply Last reply Reply Quote 0
                                  • R
                                    Rushmed Most Active @haus-automatisierung last edited by

                                    @haus-automatisierung

                                    pi@Smartazamba:~ $ curl -v http://192.168.178.138/cm?cmnd=Restart 1
                                    *   Trying 192.168.178.138:80...
                                    * Connected to 192.168.178.138 (192.168.178.138) port 80 (#0)
                                    > GET /cm?cmnd=Restart HTTP/1.1
                                    > Host: 192.168.178.138
                                    > User-Agent: curl/7.88.1
                                    > Accept: */*
                                    >
                                    < HTTP/1.1 200 OK
                                    < Content-Type: application/json
                                    < Server: Tasmota/14.1.0.1 (ESP8266EX)
                                    < Cache-Control: no-cache, no-store, must-revalidate
                                    < Pragma: no-cache
                                    < Expires: -1
                                    < Accept-Ranges: none
                                    < Transfer-Encoding: chunked
                                    < Connection: close
                                    <
                                    * Closing connection 0
                                    {"Restart":"1 to restart, 2 to halt"}*   Trying 0.0.0.1:80...
                                    

                                    Restart ist nicht erfolgt.

                                    haus-automatisierung 1 Reply Last reply Reply Quote 0
                                    • haus-automatisierung
                                      haus-automatisierung Developer Most Active @Rushmed last edited by

                                      @rushmed sagte in Hilfe bei Skripte von request auf httpGet umbauen:

                                      Restart ist nicht erfolgt.

                                      Weil Du wieder keine Anführungszeichen um die Url gemacht hast und die 1 am Ende für curl somit nicht zur Url gehört (sieht man auch im verbose)

                                      R 1 Reply Last reply Reply Quote 0
                                      • R
                                        Rushmed Most Active @haus-automatisierung last edited by

                                        @haus-automatisierung Sorry.

                                        pi@Smartazamba:~ $ curl -v "http://192.168.178.138/cm?cmnd=Restart 1"
                                        * Closing connection -1
                                        curl: (3) URL using bad/illegal format or missing URL
                                        
                                        
                                        haus-automatisierung 1 Reply Last reply Reply Quote 0
                                        • haus-automatisierung
                                          haus-automatisierung Developer Most Active @Rushmed last edited by

                                          @rushmed curl -v "http://192.168.178.138/cm?cmnd=Restart%201"

                                          1 Reply Last reply Reply Quote 0
                                          • R
                                            Rushmed Most Active last edited by Rushmed

                                            @haus-automatisierung sagte in Hilfe bei Skripte von request auf httpGet umbauen:

                                            curl -v "http://192.168.178.138/cm?cmnd=Restart 1"

                                            pi@Smartazamba:~ $ curl -v "http://192.168.178.138/cm?cmnd=Restart%201"
                                            *   Trying 192.168.178.138:80...
                                            * Connected to 192.168.178.138 (192.168.178.138) port 80 (#0)
                                            > GET /cm?cmnd=Restart%201 HTTP/1.1
                                            > Host: 192.168.178.138
                                            > User-Agent: curl/7.88.1
                                            > Accept: */*
                                            >
                                            < HTTP/1.1 200 OK
                                            < Content-Type: application/json
                                            < Server: Tasmota/14.1.0.1 (ESP8266EX)
                                            < Cache-Control: no-cache, no-store, must-revalidate
                                            < Pragma: no-cache
                                            < Expires: -1
                                            < Accept-Ranges: none
                                            < Transfer-Encoding: chunked
                                            < Connection: close
                                            <
                                            * Closing connection 0
                                            {"Restart":"Restarting"}p
                                            

                                            Restart wir ausgeführt.
                                            Script sendet wieder:

                                            javascript.0	22:20:34.986	error	script.js.Matrix_Displays: timeout of 2000ms exceeded
                                            

                                            Das passiert ohne Scriptneustart o.ä.. Scheinbar lauscht das Script aber empfängt nichts.
                                            Gesendet hab' ich den Befehl per Putty.

                                            haus-automatisierung 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            581
                                            Online

                                            31.8k
                                            Users

                                            80.0k
                                            Topics

                                            1.3m
                                            Posts

                                            16
                                            132
                                            9223
                                            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