sudo ./power_scraper.py :0: UserWarning: You do not have a working installation of the service_identity module: 'cannot import name 'verify_ip_address' from 'service_identity.pyopenssl' (/usr/lib/python3/dist-packages/service_identity/pyopenssl.py)'. Please install it from and make sure all of its dependencies are satisfied. Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification. Many valid certificate/hostname mappings may be rejected. Setting up EmonCMS not connected DEBUG:pymodbus.client.asynchronous.twisted:Client connected to modbus server DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x0 0x7 0xde DEBUG:pymodbus.transaction:Adding transaction 1 DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x0 0x7 0xde DEBUG:pymodbus.factory:Factory Response[WriteSingleRegisterResponse: 6] DEBUG:pymodbus.transaction:Getting transaction 1 DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x0 0x0 0x72 DEBUG:pymodbus.transaction:Adding transaction 2 DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x2 0x0 0x0 0x0 0xe7 0x1 0x4 0xe4 0x9 0x70 0x0 0xc 0x0 0x0 0x10 0xb8 0x4 0x88 0x0 0x1 0x0 0x1 0x13 0x85 0x0 0x27 0x0 0x2 0x0 0x2a 0x0 0xb 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x15 0x96 0xff 0xf8 0xff 0xfb 0x0 0x2f 0x0 0x2f 0x0 0x2f 0x0 0x0 0x0 0x0 0x0 0x54 0x74 0x18 0x0 0x0 0x0 0x0 0x87 0xe7 0x0 0x0 0x0 0x1 0x0 0x5a 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xfa 0x12 0xff 0xff 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x98 0x68 0x0 0xc2 0x0 0x1 0x0 0xda 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x29 0x9b 0x0 0x2 DEBUG:pymodbus.factory:Factory Response[ReadInputRegistersResponse: 4] DEBUG:pymodbus.transaction:Getting transaction 2 DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x52 0x13 0x88 DEBUG:pymodbus.transaction:Adding transaction 3 Initial discharge power is 0, additional from phase is 0 solax1 In range for single phase Phase 1 power is 0 solax1 to discharge at 0.0W DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0x4 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x51 0x0 0x0 DEBUG:pymodbus.transaction:Adding transaction 4 DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x52 0x13 0x88 DEBUG:pymodbus.factory:Factory Response[WriteSingleRegisterResponse: 6] DEBUG:pymodbus.transaction:Getting transaction 3 DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x0 0x0 0x72 DEBUG:pymodbus.transaction:Adding transaction 5 DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x5 0x0 0x0 0x0 0xe7 0x1 0x4 0xe4 0x9 0x73 0xff 0xf6 0x0 0x0 0x10 0x57 0x4 0x99 0x0 0x1 0x0 0x1 0x13 0x86 0x0 0x27 0x0 0x2 0x0 0x29 0x0 0xb 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x15 0x96 0xff 0xfb 0xff 0xfd 0x0 0x2f 0x0 0x2f 0x0 0x2f 0x0 0x0 0x0 0x0 0x0 0x54 0x74 0x18 0x0 0x0 0x0 0x0 0x87 0xe7 0x0 0x0 0x0 0x1 0x0 0x5a 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xfa 0x20 0xff 0xff 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x98 0x68 0x0 0xc2 0x0 0x1 0x0 0xda 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x29 0x9b 0x0 0x2 DEBUG:pymodbus.factory:Factory Response[ReadInputRegistersResponse: 4] DEBUG:pymodbus.transaction:Getting transaction 5 Initial discharge power is 0.0, additional from phase is 0 solax1 In range for single phase Phase 1 power is 0 solax1 to discharge at 0.0W DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0x6 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x51 0x0 0x0 DEBUG:pymodbus.transaction:Adding transaction 6 DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x6 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x51 0x0 0x0 DEBUG:pymodbus.factory:Factory Response[WriteSingleRegisterResponse: 6] DEBUG:pymodbus.transaction:Getting transaction 6 DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0x7 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x0 0x0 0x72 DEBUG:pymodbus.transaction:Adding transaction 7 DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x7 0x0 0x0 0x0 0xe7 0x1 0x4 0xe4 0x9 0x72 0xff 0xf8 0x0 0x0 0x10 0x80 0x4 0x97 0x0 0x1 0x0 0x1 0x13 0x87 0x0 0x27 0x0 0x2 0x0 0x2a 0x0 0xb 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x15 0x96 0xff 0xf9 0xff 0xfc 0x0 0x2f 0x0 0x2f 0x0 0x2f 0x0 0x0 0x0 0x0 0x0 0x54 0x74 0x18 0x0 0x0 0x0 0x0 0x87 0xe7 0x0 0x0 0x0 0x1 0x0 0x5a 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xfa 0x1b 0xff 0xff 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x98 0x68 0x0 0xc2 0x0 0x1 0x0 0xda 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x29 0x9b 0x0 0x2 DEBUG:pymodbus.factory:Factory Response[ReadInputRegistersResponse: 4] DEBUG:pymodbus.transaction:Getting transaction 7 Initial discharge power is 0.0, additional from phase is 0 solax1 In range for single phase Phase 1 power is 0 solax1 to discharge at 0.0W DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0x8 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x51 0x0 0x0 DEBUG:pymodbus.transaction:Adding transaction 8 DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x8 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x51 0x0 0x0 DEBUG:pymodbus.factory:Factory Response[WriteSingleRegisterResponse: 6] DEBUG:pymodbus.transaction:Getting transaction 8 DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0x9 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x0 0x0 0x72 DEBUG:pymodbus.transaction:Adding transaction 9 DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x9 0x0 0x0 0x0 0xe7 0x1 0x4 0xe4 0x9 0x73 0x0 0xd 0x0 0x0 0x10 0xad 0x4 0x78 0x0 0x1 0x0 0x1 0x13 0x86 0x0 0x27 0x0 0x2 0x0 0x2a 0x0 0xb 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x15 0x96 0xff 0xfa 0xff 0xfc 0x0 0x2f 0x0 0x2f 0x0 0x2f 0x0 0x0 0x0 0x0 0x0 0x54 0x74 0x18 0x0 0x0 0x0 0x0 0x87 0xe7 0x0 0x0 0x0 0x1 0x0 0x5a 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xfa 0x22 0xff 0xff 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x98 0x68 0x0 0xc2 0x0 0x1 0x0 0xda 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x29 0x9b 0x0 0x2 DEBUG:pymodbus.factory:Factory Response[ReadInputRegistersResponse: 4] DEBUG:pymodbus.transaction:Getting transaction 9 Initial discharge power is 0.0, additional from phase is 0 solax1 In range for single phase Phase 1 power is 0 solax1 to discharge at 0.0W DEBUG:pymodbus.client.asynchronous.twisted:send: 0x0 0xa 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x51 0x0 0x0 DEBUG:pymodbus.transaction:Adding transaction 10 DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0xa 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x51 0x0 0x0 DEBUG:pymodbus.factory:Factory Response[WriteSingleRegisterResponse: 6] DEBUG:pymodbus.transaction:Getting transaction 10 ^CShutdown DEBUG:pymodbus.client.asynchronous.twisted:Client disconnected from modbus server: [Failure instance: Traceback (failure with no frames): : Connection to the other side was lost in a non-clean fashion: Connection lost. ] DEBUG:pymodbus.transaction:Getting transaction 4 Unhandled error in Deferred: Critical: {'isError': True, 'log_logger': , 'log_level': , 'log_namespace': 'twisted.internet.defer', 'log_source': None, 'log_format': 'Unhandled error in Deferred:', 'log_time': 1613982184.2080264} (debug: C: Deferred was created: C: File "./power_scraper.py", line 123, in C: reactor.run() C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1283, in run C: self.mainLoop() C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1295, in mainLoop C: self.doIteration(t) C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/epollreactor.py", line 235, in doPoll C: log.callWithLogger(selectable, _drdw, selectable, fd, event) C: File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 103, in callWithLogger C: return callWithContext({"system": lp}, func, *args, **kw) C: File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 86, in callWithContext C: return context.call({ILogContext: newCtx}, func, *args, **kw) C: File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 122, in callWithContext C: return self.currentContext().callWithContext(ctx, func, *args, **kw) C: File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 85, in callWithContext C: return func(*args,**kw) C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite C: why = selectable.doRead() C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 243, in doRead C: return self._dataReceived(data) C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 249, in _dataReceived C: rval = self.protocol.dataReceived(data) C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 103, in dataReceived C: unit=unit) C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket C: self._process(callback) C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/framer/socket_framer.py", line 181, in _process C: callback(result) # defer or push to a thread? C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 126, in _handleResponse C: handler.callback(reply) C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 460, in callback C: self._startRunCallbacks(result) C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks C: self._runCallbacks() C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks C: current.result = callback(current.result, *args, **kw) C: File "/home/pi/PowerScraper/Inputs/SolaxModbus.py", line 198, in solaxRegisterCallback C: completionCallback(vals) C: File "./power_scraper.py", line 58, in outputActions C: output.send(vals) C: File "/home/pi/PowerScraper/Outputs/SolaxBatteryControl.py", line 244, in send C: self.dischargeAt(vals['#SolaxClient'], inverter, period, inverter['DischargePower']) C: File "/home/pi/PowerScraper/Outputs/SolaxBatteryControl.py", line 84, in dischargeAt C: result = client.write_register(0x51, power) C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/common.py", line 92, in write_register C: return self.execute(request) C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 114, in execute C: return self._buildResponse(request.transaction_id) C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 142, in _buildResponse C: d = defer.Deferred() I: First Invoker was: I: File "./power_scraper.py", line 123, in I: reactor.run() I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1283, in run I: self.mainLoop() I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1292, in mainLoop I: self.runUntilCurrent() I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 935, in runUntilCurrent I: self.fireSystemEvent("shutdown") I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 721, in fireSystemEvent I: event.fireEvent() I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 434, in fireEvent I: DeferredList(beforeResults).addCallback(self._continueFiring) I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 322, in addCallback I: callbackKeywords=kw) I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 311, in addCallbacks I: self._runCallbacks() I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks I: current.result = callback(current.result, *args, **kw) I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 447, in _continueFiring I: callable(*args, **kwargs) I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 706, in disconnectAll I: failure.Failure(main.CONNECTION_LOST)) I: File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 103, in callWithLogger I: return callWithContext({"system": lp}, func, *args, **kw) I: File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 86, in callWithContext I: return context.call({ILogContext: newCtx}, func, *args, **kw) I: File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 122, in callWithContext I: return self.currentContext().callWithContext(ctx, func, *args, **kw) I: File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 85, in callWithContext I: return func(*args,**kw) I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 519, in connectionLost I: self._commonConnection.connectionLost(self, reason) I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 327, in connectionLost I: protocol.connectionLost(reason) I: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 93, in connectionLost I: ConnectionException('Connection lost during request'))) ) Traceback (most recent call last): Failure: pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Connection lost during request Critical: {'log_failure': , 'debugInfo': ' C: Deferred was created:\n C: File "./power_scraper.py", line 123, in \n C: reactor.run()\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1283, in run\n C: self.mainLoop()\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1295, in mainLoop\n C: self.doIteration(t)\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/epollreactor.py", line 235, in doPoll\n C: log.callWithLogger(selectable, _drdw, selectable, fd, event)\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 103, in callWithLogger\n C: return callWithContext({"system": lp}, func, *args, **kw)\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 86, in callWithContext\n C: return context.call({ILogContext: newCtx}, func, *args, **kw)\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 122, in callWithContext\n C: return self.currentContext().callWithContext(ctx, func, *args, **kw)\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 85, in callWithContext\n C: return func(*args,**kw)\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite\n C: why = selectable.doRead()\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 243, in doRead\n C: return self._dataReceived(data)\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 249, in _dataReceived\n C: rval = self.protocol.dataReceived(data)\n C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 103, in dataReceived\n C: unit=unit)\n C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket\n C: self._process(callback)\n C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/framer/socket_framer.py", line 181, in _process\n C: callback(result) # defer or push to a thread?\n C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 126, in _handleResponse\n C: handler.callback(reply)\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 460, in callback\n C: self._startRunCallbacks(result)\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks\n C: self._runCallbacks()\n C: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks\n C: current.result = callback(current.result, *args, **kw)\n C: File "/home/pi/PowerScraper/Inputs/SolaxModbus.py", line 198, in solaxRegisterCallback\n C: completionCallback(vals)\n C: File "./power_scraper.py", line 58, in outputActions\n C: output.send(vals)\n C: File "/home/pi/PowerScraper/Outputs/SolaxBatteryControl.py", line 244, in send\n C: self.dischargeAt(vals[\'#SolaxClient\'], inverter, period, inverter[\'DischargePower\'])\n C: File "/home/pi/PowerScraper/Outputs/SolaxBatteryControl.py", line 84, in dischargeAt\n C: result = client.write_register(0x51, power)\n C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/common.py", line 92, in write_register\n C: return self.execute(request)\n C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 114, in execute\n C: return self._buildResponse(request.transaction_id)\n C: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 142, in _buildResponse\n C: d = defer.Deferred()\n I: First Invoker was:\n I: File "./power_scraper.py", line 123, in \n I: reactor.run()\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1283, in run\n I: self.mainLoop()\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1292, in mainLoop\n I: self.runUntilCurrent()\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 935, in runUntilCurrent\n I: self.fireSystemEvent("shutdown")\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 721, in fireSystemEvent\n I: event.fireEvent()\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 434, in fireEvent\n I: DeferredList(beforeResults).addCallback(self._continueFiring)\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 322, in addCallback\n I: callbackKeywords=kw)\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 311, in addCallbacks\n I: self._runCallbacks()\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks\n I: current.result = callback(current.result, *args, **kw)\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 447, in _continueFiring\n I: callable(*args, **kwargs)\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 706, in disconnectAll\n I: failure.Failure(main.CONNECTION_LOST))\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 103, in callWithLogger\n I: return callWithContext({"system": lp}, func, *args, **kw)\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 86, in callWithContext\n I: return context.call({ILogContext: newCtx}, func, *args, **kw)\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 122, in callWithContext\n I: return self.currentContext().callWithContext(ctx, func, *args, **kw)\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 85, in callWithContext\n I: return func(*args,**kw)\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 519, in connectionLost\n I: self._commonConnection.connectionLost(self, reason)\n I: File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 327, in connectionLost\n I: protocol.connectionLost(reason)\n I: File "/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py", line 93, in connectionLost\n I: ConnectionException(\'Connection lost during request\')))\n', 'log_logger': , 'log_level': , 'log_namespace': 'twisted.internet.defer', 'log_source': None, 'log_format': '(debug: {debugInfo})', 'log_time': 1613982184.2090247}