Open Alexvrse opened 4 years ago
I changed the code, added an error handler, see the attached diff file
Now, after entering any command after starting the example, the program does not crash, but produces the following error:
haier-ac-remote@0.1.2 run:example /home/pi/test/haier-ac-remote/packages/haier-ac-remote
DEBUG=* node ./dist/examples/index.js
haier-ac:state { haier-ac:state currentTemperature: 21, haier-ac:state targetTemperature: 21, haier-ac:state fanSpeed: 2, haier-ac:state mode: 3, haier-ac:state health: false, haier-ac:state limits: 0, haier-ac:state power: false haier-ac:state } +0ms haier-ac:sent 00000000: 00 00 27 14 00 00 00 00 00 00 00 00 00 00 00 00 ..'............. haier-ac:sent 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ haier-ac:sent 00000020: 00 00 00 00 00 00 00 00 30 34 46 41 38 33 32 41 ........04FA832A haier-ac:sent 00000030: 35 38 34 38 00 00 00 00 00 00 00 00 00 00 00 00 5848............ haier-ac:sent 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0d ................ haier-ac:sent 00000050: ff ff 0a 00 00 00 00 00 00 01 4d 02 5a ..........M.Z haier-ac:sent +0ms haier-ac:error Connection error>>> +0ms haier-ac:error Error: read ECONNRESET haier-ac:error at TCP.onStreamRead (internal/stream_base_commons.js:205:27) +2ms haier-ac:error Connection closed>>> +1ms haier-ac:error Connection closed>>> +22s
fix_econnreset.diff.zip
same thing Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:205:27) and HB restart after (
I changed the code, added an error handler, see the attached diff file
Now, after entering any command after starting the example, the program does not crash, but produces the following error:
haier-ac-remote@0.1.2 run:example /home/pi/test/haier-ac-remote/packages/haier-ac-remote
haier-ac:state { haier-ac:state currentTemperature: 21, haier-ac:state targetTemperature: 21, haier-ac:state fanSpeed: 2, haier-ac:state mode: 3, haier-ac:state health: false, haier-ac:state limits: 0, haier-ac:state power: false haier-ac:state } +0ms haier-ac:sent 00000000: 00 00 27 14 00 00 00 00 00 00 00 00 00 00 00 00 ..'............. haier-ac:sent 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ haier-ac:sent 00000020: 00 00 00 00 00 00 00 00 30 34 46 41 38 33 32 41 ........04FA832A haier-ac:sent 00000030: 35 38 34 38 00 00 00 00 00 00 00 00 00 00 00 00 5848............ haier-ac:sent 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0d ................ haier-ac:sent 00000050: ff ff 0a 00 00 00 00 00 00 01 4d 02 5a ..........M.Z haier-ac:sent +0ms haier-ac:error Connection error>>> +0ms haier-ac:error Error: read ECONNRESET haier-ac:error at TCP.onStreamRead (internal/stream_base_commons.js:205:27) +2ms haier-ac:error Connection closed>>> +1ms haier-ac:error Connection closed>>> +22s
fix_econnreset.diff.zip