Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run scripts asynchronously #25

Open
TheRiflesSpiral opened this issue Sep 3, 2023 · 1 comment
Open

Can't run scripts asynchronously #25

TheRiflesSpiral opened this issue Sep 3, 2023 · 1 comment

Comments

@TheRiflesSpiral
Copy link

TheRiflesSpiral commented Sep 3, 2023

What were you doing?

  1. Create a python script that loops indefinitely "801.py"
  2. Create a GCODE System Command (801) with the following command: /usr/bin/python3 /path/to/script/801.py&
  3. Call the python script from a GCODE file.

What did you expect to happen?

The Python script should start and the GCODE execution should continue.

What happened instead?

The Python script executes and GCODE execution is halted until the Python script process is killed.

Version of OctoPrint-GCodeSystemCommands

1.0.1

Operating System running OctoPrint

OctoPrint 1.9.2
Python 3.7.3
OctoPi 0.18.0

Printer model & used firmware incl. version

FIRMWARE_NAME:Klipper
FIRMWARE_VERSION:4c8d24a

Link to octoprint.log with octoprnt.plugins.gcodesystemcommands set to DEBUG

2023-09-03 14:32:34,761 - octoprint.startup - INFO - ****************************************************************************** 2023-09-03 14:32:34,765 - octoprint.startup - INFO - Starting OctoPrint 1.9.2 2023-09-03 14:32:34,767 - octoprint.startup - INFO - ****************************************************************************** 2023-09-03 14:32:35,347 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity changed from offline to online 2023-09-03 14:32:35,433 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity state is currently: online 2023-09-03 14:32:35,433 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 8.8.8.8:53 is working 2023-09-03 14:32:35,434 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is working 2023-09-03 14:32:35,447 - octoprint.startup - INFO - Blacklist processing done, adding 3 blacklisted plugin versions: roomtemp (any), GcodeEditor (>=0.1.1,<=0.2.8), gcodeleveling (>=0.1.0,<=0.1.1) 2023-09-03 14:32:35,464 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins, /home/pi/.octoprint/plugins and installed plugin packages... 2023-09-03 14:32:39,039 - octoprint.startup - INFO - Added settings overlay from plugin klipper 2023-09-03 14:32:39,043 - octoprint.plugin.core - INFO - Found 23 plugin(s) providing 23 mixin implementations, 48 hook handlers 2023-09-03 14:32:39,264 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval 2023-09-03 14:32:39,396 - octoprint.server - INFO - Intermediary server started 2023-09-03 14:32:39,435 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /home/pi/.octoprint/uploads... 2023-09-03 14:32:39,494 - octoprint.filemanager.storage - INFO - ... file metadata for /home/pi/.octoprint/uploads initialized successfully. 2023-09-03 14:32:39,502 - octoprint.server - INFO - Added new permission from plugin action_command_notification: PLUGIN_ACTION_COMMAND_NOTIFICATION_SHOW (needs: "Need(method='role', value='plugin_action_command_notification_show')") 2023-09-03 14:32:39,502 - octoprint.server - INFO - Added new permission from plugin action_command_notification: PLUGIN_ACTION_COMMAND_NOTIFICATION_CLEAR (needs: "Need(method='role', value='plugin_action_command_notification_clear')") 2023-09-03 14:32:39,503 - octoprint.server - INFO - Added new permission from plugin action_command_prompt: PLUGIN_ACTION_COMMAND_PROMPT_INTERACT (needs: "Need(method='role', value='plugin_action_command_prompt_interact')") 2023-09-03 14:32:39,503 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_READ (needs: "Need(method='role', value='plugin_announcements_read')") 2023-09-03 14:32:39,504 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_MANAGE (needs: "Need(method='role', value='plugin_announcements_read'), Need(method='role', value='plugin_announcements_manage')") 2023-09-03 14:32:39,505 - octoprint.server - INFO - Added new permission from plugin appkeys: PLUGIN_APPKEYS_ADMIN (needs: "Need(method='role', value='plugin_appkeys_admin')") 2023-09-03 14:32:39,505 - octoprint.server - INFO - Added new permission from plugin appkeys: PLUGIN_APPKEYS_GRANT (needs: "Need(method='role', value='plugin_appkeys_user')") 2023-09-03 14:32:39,506 - octoprint.server - INFO - Added new permission from plugin backup: PLUGIN_BACKUP_ACCESS (needs: "Need(method='role', value='plugin_backup_access')") 2023-09-03 14:32:39,506 - octoprint.server - INFO - Added new permission from plugin firmware_check: PLUGIN_FIRMWARE_CHECK_DISPLAY (needs: "Need(method='role', value='plugin_firmware_check_display')") 2023-09-03 14:32:39,506 - octoprint.server - INFO - Added new permission from plugin klipper: PLUGIN_KLIPPER_CONFIG (needs: "Need(method='role', value='plugin_klipper_admin')") 2023-09-03 14:32:39,507 - octoprint.server - INFO - Added new permission from plugin klipper: PLUGIN_KLIPPER_MACRO (needs: "Need(method='role', value='plugin_klipper_admin')") 2023-09-03 14:32:39,512 - octoprint.server - INFO - Added new permission from plugin logging: PLUGIN_LOGGING_MANAGE (needs: "Need(method='role', value='plugin_logging_manage')") 2023-09-03 14:32:39,516 - octoprint.server - INFO - Added new permission from plugin pi_support: PLUGIN_PI_SUPPORT_STATUS (needs: "Need(method='role', value='plugin_pi_support_check')") 2023-09-03 14:32:39,520 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_LIST (needs: "Need(method='role', value='plugin_pluginmanager_list')") 2023-09-03 14:32:39,522 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_MANAGE (needs: "Need(method='role', value='plugin_pluginmanager_manage')") 2023-09-03 14:32:39,524 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_INSTALL (needs: "Need(method='role', value='plugin_pluginmanager_manage'), Need(method='role', value='plugin_pluginmanager_install')") 2023-09-03 14:32:39,531 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CHECK (needs: "Need(method='role', value='plugin_softwareupdate_check')") 2023-09-03 14:32:39,533 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_UPDATE (needs: "Need(method='role', value='plugin_softwareupdate_update')") 2023-09-03 14:32:39,537 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CONFIGURE (needs: "Need(method='role', value='plugin_softwareupdate_configure')") 2023-09-03 14:32:40,684 - octoprint.util.pip - INFO - Using "/home/pi/oprint/bin/python3 -m pip" as command to invoke pip 2023-09-03 14:32:41,600 - octoprint.util.pip - INFO - Version of pip is 20.3.3 2023-09-03 14:32:41,630 - octoprint.util.pip - INFO - pip installs to /home/pi/oprint/lib/python3.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes 2023-09-03 14:32:41,631 - octoprint.util.pip - INFO - ==> pip ok -> yes 2023-09-03 14:32:41,774 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk 2023-09-03 14:32:41,804 - octoprint.plugins.softwareupdate - INFO - Loaded update log from disk 2023-09-03 14:32:41,895 - octoprint.plugin.core - INFO - Initialized 23 plugin implementation(s) 2023-09-03 14:32:41,928 - octoprint.plugins.gcodesystemcommands - DEBUG - command_definitions: [{'command': '/usr/bin/python3 /home/pi/ledactions/cabinet/801.py&', 'id': '801'}, {'command': 'sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/802.py', 'id': '802'}, {'command': 'sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/803.py', 'id': '803'}, {'command': 'sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/804.py', 'id': '804'}, {'command': 'sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/805.py', 'id': '805'}, {'command': 'sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/806.py', 'id': '806'}, {'command': 'sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/807.py', 'id': '807'}, {'command': 'sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/808.py', 'id': '808'}, {'command': 'sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/809.py', 'id': '809'}, {'command': 'sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/810.py', 'id': '810'}] 2023-09-03 14:32:41,928 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO801 = /usr/bin/python3 /home/pi/ledactions/cabinet/801.py& 2023-09-03 14:32:41,928 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO802 = sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/802.py 2023-09-03 14:32:41,928 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO803 = sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/803.py 2023-09-03 14:32:41,929 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO804 = sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/804.py 2023-09-03 14:32:41,929 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO805 = sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/805.py 2023-09-03 14:32:41,929 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO806 = sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/806.py 2023-09-03 14:32:41,929 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO807 = sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/807.py 2023-09-03 14:32:41,929 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO808 = sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/808.py 2023-09-03 14:32:41,930 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO809 = sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/809.py 2023-09-03 14:32:41,930 - octoprint.plugins.gcodesystemcommands - INFO - Add command definition OCTO810 = sh /home/pi/ledactions/cabinet/OCTO.sh /home/pi/ledactions/cabinet/810.py 2023-09-03 14:32:41,970 - octoprint - INFO - Installing webcam compat overlay for configured default webcam <octoprint.webcams.ProvidedWebcam object at 0x713fa490> 2023-09-03 14:32:41,972 - octoprint.plugin.core - INFO - 23 plugin(s) registered with the system: | Action Command Notification Support (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/action_command_notification | Action Command Prompt Support (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/action_command_prompt | Announcement Plugin (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/announcements | Anonymous Usage Tracking (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/tracking | Application Keys Plugin (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/appkeys | Backup & Restore (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/backup | Bed Leveling Wizard (0.2.5) = /home/pi/oprint/lib/python3.7/site-packages/octoprint_bedlevelingwizard | Classic Webcam (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/classicwebcam | Core Wizard (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/corewizard | Discovery (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/discovery | Error Tracking (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/errortracking | Event Manager (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/eventmanager | File Check (2021.2.23) (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint_file_check | Firmware Check (2021.10.11) (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint_firmware_check | GCODE System Commands (1.0.1) = /home/pi/oprint/lib/python3.7/site-packages/octoprint_gcodesystemcommands | GCode Viewer (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/gcodeviewer | GPIO Control (1.0.8) = /home/pi/oprint/lib/python3.7/site-packages/octoprint_gpiocontrol | Logging (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/logging | OctoKlipper (0.3.9.5) = /home/pi/oprint/lib/python3.7/site-packages/octoprint_klipper | Pi Support Plugin (2023.7.31) (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint_pi_support | Plugin Manager (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/pluginmanager | Software Update (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/softwareupdate | Virtual Printer (bundled) = /home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/virtual_printer Prefix legend: ! = disabled, # = blacklisted, * = incompatible 2023-09-03 14:32:42,016 - octoprint.environment - INFO - Detected environment is Python 3.7.3 under Linux (linux). Details: | hardware: | cores: 4 | freq: 1400.0 | ram: 915718144 | os: | bits: 32 | id: linux | platform: linux | plugins: | pi_support: | model: Raspberry Pi 3 Model B Plus Rev 1.3 | octopi_version: 0.18.0 | throttle_check_enabled: true | throttle_check_functional: true | throttle_state: '0x0' | python: | pip: 20.3.3 | version: 3.7.3 | virtualenv: /home/pi/oprint 2023-09-03 14:32:42,039 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/webassets... 2023-09-03 14:32:42,040 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/.webassets-cache... 2023-09-03 14:32:42,040 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/.webassets-manifest.json... 2023-09-03 14:32:42,204 - octoprint.plugins.klipper - WARNING - The Blueprint of this plugin is relying on the default implementation of is_blueprint_csrf_protected (newly added in OctoPrint 1.8.3), which in a future version will be switched from False to True for security reasons. Plugin authors should ensure they explicitly declare the CSRF protection status in their BlueprintPlugin mixin implementation. Recommendation is to enable CSRF protection and exempt views that must not use it with the octoprint.plugin.BlueprintPlugin.csrf_exempt decorator. 2023-09-03 14:32:42,204 - octoprint.server - WARNING - CSRF Protection for Blueprint of plugin klipper is DISABLED 2023-09-03 14:32:42,749 - octoprint.settings - WARNING - DeprecationWarning: Detected access to deprecated settings path ['webcam', 'snapshot'], returned value is derived from compatibility overlay. Please use the webcam system introduced with 1.9.0, this compatibility layer will be removed in a future release. 2023-09-03 14:32:42,778 - octoprint.server - INFO - Shutting down intermediary server... 2023-09-03 14:32:43,164 - octoprint.server - INFO - Intermediary server shut down 2023-09-03 14:32:43,169 - octoprint.events - INFO - Processing startup event, this is our first event 2023-09-03 14:32:43,170 - octoprint.events - INFO - Adding 2 events to queue that were held back before startup event 2023-09-03 14:32:43,170 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue... 2023-09-03 14:32:43,183 - octoprint.server - INFO - Starting autorefresh of serial port list 2023-09-03 14:32:43,203 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue 2023-09-03 14:32:43,225 - octoprint.plugins.softwareupdate - INFO - Fetching check overlays from https://plugins.octoprint.org/update_check_overlay.json 2023-09-03 14:32:43,241 - octoprint.server.util.watchdog - INFO - Running initial scan on watched folder... 2023-09-03 14:32:43,288 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid 2023-09-03 14:32:43,374 - octoprint.server.util.watchdog - INFO - ... initial scan done. 2023-09-03 14:32:43,505 - octoprint.server - INFO - Serial port list was updated, refreshing the port list in the frontend 2023-09-03 14:32:44,151 - octoprint.plugins.tracking - INFO - Sent tracking event system_unthrottled, payload: {'throttled_now': False, 'throttled_past': False, 'throttled_mask': 0, 'throttled_voltage_now': False, 'throttled_voltage_past': False, 'throttled_overheat_now': False, 'throttled_overheat_past': False} 2023-09-03 14:32:44,309 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on ender3v2._http._tcp.local.' for _http._tcp.local. 2023-09-03 14:32:45,267 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on ender3v2._octoprint._tcp.local.' for _octoprint._tcp.local. 2023-09-03 14:32:45,302 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on ender3v2 for SSDP 2023-09-03 14:32:45,424 - octoprint.plugins.gpiocontrol - INFO - Detected GPIO mode: 11 2023-09-03 14:32:45,535 - octoprint.server - INFO - Listening on http://127.0.0.1:5000 2023-09-03 14:32:45,850 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid 2023-09-03 14:32:46,136 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid 2023-09-03 14:32:46,150 - octoprint.server.util.sockjs - INFO - New connection from client: 2600:380:6b25:4bbe:6004:ba82:dcd:8abd 2023-09-03 14:32:46,738 - octoprint.server.util.flask - INFO - Passively logging in user pi from 2600:380:6b25:4bbe:6004:ba82:dcd:8abd 2023-09-03 14:32:46,739 - octoprint.access.users - INFO - Logged in user: pi 2023-09-03 14:32:46,837 - octoprint.util.pip - INFO - Using "/home/pi/oprint/bin/python3 -m pip" as command to invoke pip 2023-09-03 14:32:46,844 - octoprint.util.pip - INFO - pip installs to /home/pi/oprint/lib/python3.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes 2023-09-03 14:32:46,861 - octoprint.util.pip - INFO - ==> pip ok -> yes 2023-09-03 14:32:46,896 - octoprint.plugins.softwareupdate - INFO - Minimum free storage across all update relevant locations is 8.5GB. That is considered sufficient for updating. 2023-09-03 14:32:47,438 - octoprint.plugins.gpiocontrol - INFO - Configured GPIO4: active_high,default_off (Printer Power) 2023-09-03 14:32:48,237 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'base_url': 'http://ender3v2.local/', 'path': '/', 'query_string': 'l10n=en'} 2023-09-03 14:32:48,242 - octoprint.plugins.tracking - INFO - Sent tracking event pong, payload: {'version': '1.9.2', 'os': 'linux', 'bits': 32, 'python': '3.7.3', 'pip': '20.3.3', 'cores': 4, 'freq': 1400.0, 'ram': 915718144, 'pi_model': 'Raspberry Pi 3 Model B Plus Rev 1.3', 'octopi_version': '0.18.0', 'plugins': 'gpiocontrol:1.0.8,gcodesystemcommands:1.0.1,klipper:0.3.9.5,bedlevelingwizard:0.2.5'} 2023-09-03 14:32:48,981 - octoprint.plugins.tracking - INFO - Sent tracking event ping, payload: {'octoprint_uptime': 8, 'printer_state': 'OFFLINE'} 2023-09-03 14:32:49,465 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid 2023-09-03 14:32:49,790 - octoprint.plugins.tracking - INFO - Sent tracking event startup, payload: {'version': '1.9.2', 'os': 'linux', 'bits': 32, 'python': '3.7.3', 'pip': '20.3.3', 'cores': 4, 'freq': 1400.0, 'ram': 915718144, 'pi_model': 'Raspberry Pi 3 Model B Plus Rev 1.3', 'octopi_version': '0.18.0'} 2023-09-03 14:32:52,133 - octoprint.server.util.sockjs - INFO - User pi logged in on the socket from client 2600:380:6b25:4bbe:6004:ba82:dcd:8abd 2023-09-03 14:32:52,361 - octoprint.server.util.flask - INFO - Passively logging in user pi from 2600:380:6b25:4bbe:6004:ba82:dcd:8abd 2023-09-03 14:32:52,362 - octoprint.access.users - INFO - Logged in user: pi 2023-09-03 14:33:11,924 - octoprint.server.preemptive_cache - INFO - ... done in 23.69s 2023-09-03 14:33:12,302 - octoprint.server.util.sockjs - INFO - Client connection closed: 2600:380:6b25:4bbe:6004:ba82:dcd:8abd 2023-09-03 14:33:12,949 - octoprint.server.util.sockjs - INFO - New connection from client: 2600:380:6b25:4bbe:6004:ba82:dcd:8abd 2023-09-03 14:33:13,056 - octoprint.server.util.flask - INFO - Passively logging in user pi from 2600:380:6b25:4bbe:6004:ba82:dcd:8abd 2023-09-03 14:33:13,057 - octoprint.access.users - INFO - Logged in user: pi 2023-09-03 14:33:14,899 - octoprint.server.util.sockjs - INFO - User pi logged in on the socket from client 2600:380:6b25:4bbe:6004:ba82:dcd:8abd 2023-09-03 14:33:15,666 - octoprint.plugins.klipper - INFO - list_cfg_files Path: /home/pi/.octoprint/data/klipper/configs/* 2023-09-03 14:33:15,671 - octoprint.plugins.klipper - INFO - list_cfg_files 1: /home/pi/.octoprint/data/klipper/configs/printer.cfg 2023-09-03 14:33:15,699 - octoprint.plugins.klipper - INFO - list_cfg_files Path: /home/pi/*.cfg 2023-09-03 14:33:15,703 - octoprint.plugins.klipper - INFO - list_cfg_files 1: /home/pi/printer.cfg 2023-09-03 14:33:15,707 - octoprint.plugins.klipper - INFO - list_cfg_files 2: /home/pi/printer-20230812_213320.cfg 2023-09-03 14:33:15,711 - octoprint.plugins.klipper - INFO - list_cfg_files 3: /home/pi/printer-20220721_183911.cfg 2023-09-03 14:33:15,715 - octoprint.plugins.klipper - INFO - list_cfg_files 4: /home/pi/printer-20221113_105129.cfg 2023-09-03 14:33:15,718 - octoprint.plugins.klipper - INFO - list_cfg_files 5: /home/pi/printer-20230812_212224.cfg 2023-09-03 14:33:15,803 - octoprint.plugins.klipper - INFO - get_cfg_files Path: /home/pi/printer.cfg 2023-09-03 14:33:16,421 - octoprint.plugins.tracking - INFO - Sent tracking event webui_load, payload: {'browser_name': 'Chrome', 'browser_version': '116.0.0.0', 'os_name': 'Mac OS', 'os_version': '10.15.7'} 2023-09-03 14:33:25,880 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial connection" 2023-09-03 14:33:25,888 - octoprint.util.comm - INFO - Connecting to port /tmp/printer, baudrate 250000 2023-09-03 14:33:25,914 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial connection" to "Connecting" 2023-09-03 14:33:25,925 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0 2023-09-03 14:33:25,932 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0 2023-09-03 14:33:25,936 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Operational" 2023-09-03 14:33:25,998 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0 2023-09-03 14:33:26,011 - octoprint.util.comm - INFO - Printer reports firmware name "Klipper" 2023-09-03 14:33:26,011 - octoprint.util.comm - INFO - Detected Klipper firmware, enabling relevant features for issue free communication 2023-09-03 14:33:26,270 - octoprint.server - INFO - Autorefresh of serial port list stopped 2023-09-03 14:33:26,725 - octoprint.plugins.tracking - INFO - Sent tracking event printer_connected, payload: {'firmware_name': 'Klipper', 'printer_port': '/tmp/printer', 'printer_baudrate': 250000} 2023-09-03 14:33:36,577 - octoprint.printer.standard.job - INFO - Print job selected - origin: local, path: Spacers - 18mm (8).gcode, owner: pi, user: pi 2023-09-03 14:33:36,591 - octoprint.util.comm - INFO - Changing monitoring state from "Operational" to "Starting" 2023-09-03 14:33:36,601 - octoprint.printer.standard.job - INFO - Print job started - origin: local, path: Spacers - 18mm (8).gcode, owner: pi, user: pi 2023-09-03 14:33:36,956 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid 2023-09-03 14:33:36,998 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0 2023-09-03 14:33:37,021 - octoprint.util.comm - INFO - Changing monitoring state from "Starting" to "Printing" 2023-09-03 14:33:37,073 - octoprint.plugins.gcodesystemcommands - DEBUG - Command ID=801, Line=/usr/bin/python3 /home/pi/ledactions/cabinet/801.py&, Args=None 2023-09-03 14:33:37,073 - octoprint.plugins.gcodesystemcommands - INFO - Executing command ID: 801 2023-09-03 14:33:37,886 - octoprint.plugins.tracking - INFO - Sent tracking event print_started, payload: {'origin': 'local', 'file': '1176111ea8d36aa948386cb77d2bf4ff0f99df43'} 2023-09-03 14:33:38,972 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid 2023-09-03 14:33:48,145 - octoprint.util.comm - INFO - Cancelling job on behalf of user pi 2023-09-03 14:33:48,149 - octoprint.util.comm - INFO - Changing monitoring state from "Printing" to "Cancelling" 2023-09-03 14:33:48,198 - octoprint.printer.standard.job - INFO - Print job cancelled - origin: local, path: Spacers - 18mm (8).gcode, owner: pi, user: pi 2023-09-03 14:33:49,033 - octoprint.plugins.tracking - INFO - Sent tracking event print_cancelled, payload: {'origin': 'local', 'file': '1176111ea8d36aa948386cb77d2bf4ff0f99df43', 'elapsed': 11} 2023-09-03 14:33:49,645 - octoprint.plugins.tracking - INFO - Sent tracking event print_failed, payload: {'origin': 'local', 'file': '1176111ea8d36aa948386cb77d2bf4ff0f99df43', 'elapsed': 11, 'reason': 'cancelled'}

@TheRiflesSpiral
Copy link
Author

The code is hanging at this line:

output = p.communicate()[0]

subprocess is apparently hanging on to all of the subprocesses children, expecting them to exit as well.

I've also tried abstracting the python script via a shell script:

OCTO.sh:

#!/bin/bash
/home/pi/ledactions/cabinet/$1 &

Then configuring the plugin with "/home/pi/ledactions/cabinet/OCTO.sh 801.py"

Same result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant