VMaxx / RepetierIntegration

Plugin for Cura to allow printing and monitoring
GNU Affero General Public License v3.0
39 stars 11 forks source link

cura crashing when webcam is enabled in repetier-server FREE #47

Open fajabird opened 3 years ago

fajabird commented 3 years ago

currently I need to configure the webcam in repetier-server because else this plugin will not show the webcam stream, although the stream is always available (when there is a working cam) under the well known URL http://<IP>:8080/?action=stream so there are two options

  1. please fix the crash (see log below)
  2. allow to configure webcam independently from what repetier-server is reporting in the getPrinterConfig result. Maybe test for the URL instead?

2020-11-22 21:56:42,113 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=listPrinter 2020-11-22 21:56:42,114 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [669]: listPrinter JSON: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:42,114 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [672]: JSON Dump: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:42,132 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=stateList 2020-11-22 21:56:44,076 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.get [1011]: get request: stateList 2020-11-22 21:56:44,077 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.get [1011]: get request: listPrinter 2020-11-22 21:56:44,111 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=listPrinter 2020-11-22 21:56:44,112 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [669]: listPrinter JSON: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:44,112 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [672]: JSON Dump: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:44,112 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=stateList 2020-11-22 21:56:45,445 - WARNING - [MainThread] UM.Qt.QtApplication.onQmlWarning [406]: file:///home/artur/.local/share/cura/4.8/plugins/RepetierIntegration/DiscoverRepetierAction.qml:722: TypeError: Type error 2020-11-22 21:56:45,448 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction.getPrinterList [256]: getPrinterList:http://http//repetier-server:3344//printer/info 2020-11-22 21:56:45,457 - WARNING - [MainThread] UM.Qt.QtApplication.onQmlWarning [406]: file:///home/artur/.local/share/cura/4.8/plugins/RepetierIntegration/DiscoverRepetierAction.qml:157: ReferenceError: objectListFooter is not defined 2020-11-22 21:56:45,495 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction._onRequestFinished [465]: Received no or empty reply 2020-11-22 21:56:45,999 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction.testApiKey [282]: Trying to access Repetier instance at http://repetier-server:3344/ with the provided API key. 2020-11-22 21:56:45,999 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction.testApiKey [283]: Using TronxyX1 as work_id 2020-11-22 21:56:45,999 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction.testApiKey [284]: Using 8437620d-f368-4e02-95ca-3e51a92f5f7e as api_key 2020-11-22 21:56:46,041 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction._onRequestFinished [469]: http://repetier-server:3344//printer/api/TronxyX1?a=getPrinterConfig&apikey=8437620d-f368-4e02-95ca-3e51a92f5f7e 2020-11-22 21:56:46,050 - DEBUG - [MainThread] cura.PrinterOutput.NetworkedPrinterOutputDevice._createNetworkManager [318]: Creating network manager 2020-11-22 21:56:46,057 - INFO - [MainThread] UM.OutputDevice.OutputDeviceManager.addOutputDevice [171]: Output Device TronxyX1 already added 2020-11-22 21:56:46,069 - INFO - [MainThread] UM.OutputDevice.OutputDeviceManager.addOutputDevice [171]: Output Device TronxyX1 already added 2020-11-22 21:56:46,071 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.get [1011]: get request: stateList 2020-11-22 21:56:46,072 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.get [1011]: get request: listPrinter 2020-11-22 21:56:46,073 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.connect [296]: Connection with instance TronxyX1 with url http://repetier-server:3344/ started 2020-11-22 21:56:46,074 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.get [1011]: get request: getPrinterConfig 2020-11-22 21:56:46,077 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction._onRequestFinished [505]: API key accepted by Repetier. 2020-11-22 21:56:46,078 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction._onRequestFinished [510]: http://repetier-server:3344//printer/api/TronxyX1?a=getPrinterConfig&apikey=8437620d-f368-4e02-95ca-3e51a92f5f7e 2020-11-22 21:56:46,079 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction._onRequestFinished [511]: {'general': {'name': 'TronxyX1', 'eepromType': 'repetier', 'softwarePower': True, 'pauseSeconds': 120, 'firmwareName': 'Repetier-Firmware', 'pauseHandling': 0, 'doorHandling': 1, 'logHistory': True, 'heatedBed': False, 'printerVariant': 'cartesian', 'useOwnModelRepository': True, 'active': True, 'defaultVolumetric': False, 'slug': 'TronxyX1', 'model': '', 'useModelFromSlug': '', 'sdcard': True, 'tempUpdateEvery': 1, 'numFans': 1}, 'properties': {}, 'heatedBeds': [], 'shape': {'gridColor': '#454545', 'marker': [], 'gridSpacing': 10.0, 'basicShape': {'radius': 100, 'x': 0, 'xMin': 0.0, 'yMin': -10.0, 'color': '#dddddd', 'shape': 'rectangle', 'y': 0, 'yMax': 145.0, 'xMax': 155.0}}, 'heatedChambers': [], 'quickCommands': [{'name': 'Run PID tuning', 'command': 'M106 E0 S0 ; all fan off\nM303 E0 S240 C5 ; run PID autotune for 220°C'}, {'name': 'Store PID values', 'command': 'M301 P6.77 I0.33 D35.08 ; store values\nM500 ; save to EEPROM'}], 'responseEvents': [], 'webcams': [{'timelapseSelected': 2, 'reloadInterval': 3.0, 'timelapseHeight': 0.1, 'timelapseLayer': 1, 'orientation': 0, 'method': 3, 'timelapseFramerate': 30, 'timelapseInterval': 20.0, 'snapshotDelay': 800, 'snapshotY': 145.0, 'pos': 0, 'forceSnapshotPosition': False, 'timelapseBitrate': 1000, 'dynamicUrl': 'http://repetier-server:8080/?action=stream', 'snapshotX': 77.5, 'timelapseMethod': 1, 'staticUrl': 'http://repetier-server:8080/?action=snapshot'}], 'extruders': [{'cooldownPerSecond': 0.5, 'alias': '', 'changeSlowDistance': 20.0, 'changeFastDistance': 20.0, 'lastTemp': 240, 'num': 0, 'retractSpeed': 30.0, 'heatupPerSecond': 2.0, 'filamentDiameter': 1.75, 'offset': 0, 'extrudeSpeed': 2.0, 'offsetX': 0.0, 'supportTemperature': True, 'temperatures': [{'name': 'ABS 245', 'temp': 245}, {'name': 'PLA 210', 'temp': 210}, {'name': 'PLA 195', 'temp': 195}], 'tempMaster': 0, 'maxSpeed': 50.0, 'toolType': 0, 'acceleration': 5000.0, 'eJerk': 20.0, 'maxTemp': 260, 'offsetY': 0.0, 'toolDiameter': 0.4}], 'recover': {'firmwarePowerlossSignal': '', 'enabled': False, 'maxTimeForAutocontinue': 300, 'replayExtruderSwitches': False, 'reactivateBedOnConnect': True, 'procedure': 'G28 X0 Y0', 'runOnConnect': 'G28 X0 Y0', 'delayBeforeReconnect': 30, 'extraZOnFirmwareDetect': 0.0}, 'connection': {'powerOffMaxTemperature': 50, 'password': '', 'connectionMethod': 0, 'pipe': {'file': ''}, 'continueAfterFastReconnect': True, 'lcdTimeMode': 4, 'powerOffIdleMinutes': 0, 'resetScript': '', 'serial': {'baudrate': 115200, 'device': '/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9ILTJBB-if00-port0', 'usbreset': 0, 'connectionDelay': 0, 'visibleWithoutRunning': False, 'inputBufferSize': 127, 'rts': 1, 'malyanHack': False, 'communicationTimeout': 30.0, 'dtr': 1, 'pingPong': False}, 'ip': {'address': '', 'port': 23}}, 'movement': {'xMax': 155.0, 'zPrintAcceleration': 400.0, 'G11ExtraDistance': 0.0, 'G10LongDistance': 50.0, 'maxZSpeed': 4.0, 'xyTravelAcceleration': 400.0, 'yHome': 0.0, 'defaultAcceleration': 10000.0, 'zTravelAcceleration': 400.0, 'G10Speed': 50.0, 'xMin': 0.0, 'movebuffer': 16, 'yEndstop': True, 'invertZ': False, 'zJerk': 0.30000000000000004, 'zEndstop': True, 'zMin': 0.0, 'G10Distance': 3.0, 'G11ExtraLongDistance': 0.0, 'yMax': 145.0, 'zMax': 155.0, 'zSpeed': 2.0, 'xySpeed': 100.0, 'allEndstops': True, 'defaultRetractAcceleration': 4000.0, 'xHome': 0.0, 'xyPrintAcceleration': 400.0, 'xyJerk': 20.0, 'timeMultiplier': 1.0, 'yMin': -10.0, 'zHome': 0.0, 'G10ZLift': 0.0, 'invertX': False, 'invertY': False, 'maxXYSpeed': 400.0, 'xEndstop': True, 'defaultTravelAcceleration': 10000.0, 'G11Speed': 50.0}} 2020-11-22 21:56:46,080 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction._onRequestFinished [528]: DiscoverRepetierAction: webcams: 1 2020-11-22 21:56:46,080 - DEBUG - [MainThread] RepetierIntegration.DiscoverRepetierAction._onRequestFinished [531]: DiscoverRepetierAction: Checking streamurl 2020-11-22 21:56:46,183 - CRITICAL - [MainThread] cura.CrashHandler.init [66]: An uncaught error has occurred! 2020-11-22 21:56:46,187 - CRITICAL - [MainThread] cura.CrashHandler.init [69]: Traceback (most recent call last): 2020-11-22 21:56:46,191 - CRITICAL - [MainThread] cura.CrashHandler.init [69]: File "/home/artur/.local/share/cura/4.8/plugins/RepetierIntegration/DiscoverRepetierAction.py", line 532, in _onRequestFinished 2020-11-22 21:56:46,196 - CRITICAL - [MainThread] cura.CrashHandler.init [69]: stream_url = json_data["webcams"][0]["dynamicUrl"].replace("127.0.0.1",re.findall( r'[0-9]+(?:.[0-9]+){3}', reply.url().toString())[0]) 2020-11-22 21:56:46,201 - CRITICAL - [MainThread] cura.CrashHandler.init [69]: IndexError: list index out of range 2020-11-22 21:56:46,270 - INFO - [MainThread] UM.OutputDevice.OutputDeviceManager.addOutputDevice [171]: Output Device TronxyX1 already added 2020-11-22 21:56:46,274 - INFO - [MainThread] UM.OutputDevice.OutputDeviceManager.addOutputDevice [171]: Output Device TronxyX1 already added 2020-11-22 21:56:46,275 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=stateList 2020-11-22 21:56:46,275 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=listPrinter 2020-11-22 21:56:46,276 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [669]: listPrinter JSON: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:46,276 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [672]: JSON Dump: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:46,277 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=getPrinterConfig 2020-11-22 21:56:46,277 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [761]: RepetierOutputDevice: Detected Repetier 90.X 2020-11-22 21:56:46,277 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [765]: RepetierOutputDevice: Checking streamurl 2020-11-22 21:56:46,277 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [781]: Set Repetier camera url to http://repetier-server:8080/?action=stream 2020-11-22 21:56:46,278 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=getPrinterConfig 2020-11-22 21:56:46,278 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [761]: RepetierOutputDevice: Detected Repetier 90.X 2020-11-22 21:56:46,279 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [765]: RepetierOutputDevice: Checking streamurl 2020-11-22 21:56:46,279 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [781]: Set Repetier camera url to http://repetier-server:8080/?action=stream 2020-11-22 21:56:46,279 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=stateList 2020-11-22 21:56:48,077 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.get [1011]: get request: stateList 2020-11-22 21:56:48,078 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.get [1011]: get request: listPrinter 2020-11-22 21:56:48,112 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=listPrinter 2020-11-22 21:56:48,113 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [669]: listPrinter JSON: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:48,113 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [672]: JSON Dump: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:48,117 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=stateList 2020-11-22 21:56:50,076 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.get [1011]: get request: stateList 2020-11-22 21:56:50,077 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice.get [1011]: get request: listPrinter 2020-11-22 21:56:50,112 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=listPrinter 2020-11-22 21:56:50,113 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [669]: listPrinter JSON: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:50,114 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [672]: JSON Dump: {'active': True, 'name': 'TronxyX1', 'slug': 'TronxyX1', 'job': 'none', 'online': 0, 'pauseState': 0, 'paused': False} 2020-11-22 21:56:50,115 - DEBUG - [MainThread] RepetierIntegration.RepetierOutputDevice._onRequestFinished [559]: reply.url() = http://repetier-server:3344/printer/api/TronxyX1?a=stateList

VMaxx commented 3 years ago

What version of repetier server are you using?