bstuff / haier-ac-remote

72 stars 15 forks source link

Feature/ possible fix econnreset #10

Closed bstuff closed 4 years ago

bstuff commented 4 years ago

possibly fixes #3

exotsk commented 4 years ago

[6/6/2020, 3:20:01 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules [6/6/2020, 3:20:02 PM] [HB Supervisor] Started Homebridge v1.1.0 with PID: 15642 [6/6/2020, 3:20:03 PM] Loaded config.json with 2 accessories and 0 platforms. [6/6/2020, 3:20:03 PM] --- [6/6/2020, 3:20:04 PM] Loaded plugin: homebridge-dummy@0.4.1 [6/6/2020, 3:20:04 PM] Registering accessory 'homebridge-dummy.DummySwitch' [6/6/2020, 3:20:04 PM] --- [6/6/2020, 3:20:04 PM] Loaded plugin: homebridge-haier-ac@0.2.1 [6/6/2020, 3:20:04 PM] Registering accessory 'homebridge-haier-ac.HaierAC' [6/6/2020, 3:20:04 PM] --- [6/6/2020, 3:20:06 PM] Loaded plugin: homebridge-mqttthing@1.1.15 [6/6/2020, 3:20:06 PM] Registering accessory 'homebridge-mqttthing.mqttthing' [6/6/2020, 3:20:06 PM] --- [6/6/2020, 3:20:06 PM] Loaded plugin: homebridge-config-ui-x@4.21.0 [6/6/2020, 3:20:06 PM] Registering platform 'homebridge-config-ui-x.config' [6/6/2020, 3:20:06 PM] --- [6/6/2020, 3:20:06 PM] Loading 2 accessories... [6/6/2020, 3:20:06 PM] [Living Room Conditioner] Initializing HaierAC accessory... [6/6/2020, 3:20:06 PM] [admin] Initializing mqttthing accessory... [6/6/2020, 3:19:43 PM] Homebridge is running on port 51017. [6/6/2020, 3:19:51 PM] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:205:27) [6/6/2020, 3:19:51 PM] Got SIGTERM, shutting down Homebridge... [6/6/2020, 3:19:54 PM] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:205:27) [6/6/2020, 3:19:56 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null

after any operation. AC is on by SmartAir2 app

exotsk commented 4 years ago
    const o$ = rxjs_1.fromEvent(theParser, 'parseCompleted').pipe(operators_1.filter((v) => v.seq === seq), operators_1.take(1), operators_1.mapTo(true), operators_1.timeout(this.timeout));
    this._seq = (this._seq + 1) % 256;
    send(this._client, cmd);
    return o$.toPromise().catch(() => {
        this._connect();
        return false;
    });

in HaierAC.js persented