Giter Club home page Giter Club logo

octoprint-gcodesystemcommands's Introduction

OctoPrint GCode System Commands

This OctoPrint plugin adds the ability to define GCode commands that execute local system commands.

GCodeSystemCommands

Setup

Install the plugin using Plugin Manager from Settings

octoprint-gcodesystemcommands's People

Contributors

kantlivelong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

octoprint-gcodesystemcommands's Issues

configuration missing after reboot

Hello,

many thanks for your plugin. I use your plugin to shutdown my printer after finished the print. A few days ago i upate your plugin to version 1.0.0.
After Update the configured command are lost after reboot. I uninstall completely and install again, but the problem is the same. Sometimes the configuration ist lost without reboot?!
I use octoprint 1.4.0 on a raspi 3 with an updated octopi 0.17.
Any idea to help? Thanks.

regards,

Turtle

Sending Gcode System Commands to powered off printer

I replaced my power supply with an ATX and am using the Pi to control a relay which turns the power to the printer on and off. I wrote a simple script (turnon, turnoff) to send the signal to the proper pins (17 and 27) to control the relay. The commands work perfectly in SSH, and I made a Gcode System command to send the signals to the pins (gpio -g write 17 1 && gpio -g write 27 1, and gpio -g write 17 0 && gpio -g write 27 0)

The turnoff command works thru a remote signal by sending an OCTO100 command to Octoprint, but, when the printer is powered off, I can't send the OCTO101 to turn it back on. The only way I can remotely turn it back on is thru SSH

I can send a "connect" command to a printer that's disconnected, is there any way I can send my OCTO101 command to a printer that's powered off since the command actually goes to the Pi and not the printer ?

What is the OCTO prefix, I'm confused?

Hi sorry for the stupid question, but what is the OCTO prefix? How would I make this run a command, for example, when a print job starts, or pauses, or stops, or gets an error, or (ideally) each 10% of completion (to display progress across 10 LEDs)?

Are those scenarios possible with your plugin?

Thanks!

Can't run scripts asynchronously

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'}

Trouble Gertting Plugin To Execute

What were you doing?

I am using this plugin to execute two python scripts through shell scripts, which are designed to use a servo through an Adafruit Servohat to deploy and retract a brass brush over the print bed to clean the nozzle before each print. This was working on a previous printer, but can not seem to get it to function moved over here. Note: I have rebuilt my Octopi onto an 8 GB Pi 4B+, it was functional on the Pi 3 B, but began having problems (not related to this plugin) so moved it up to the faster processor/more memory.

I have also gone through the entire community forum and tried every permutation fix even close to my problem with no success.


OctoPrint version : 1.7.2
OctoPi version : 0.18.0

I have validated the validity of both the .sh files and their respective .py files by running them successfully from the command line after ssh'ing into the pi.

/home/pi/deploy.py
import time
from adafruit_servokit import ServoKit
kit = ServoKit(channels=16)
kit.servo[0].angle = 110

/home/pi/retract.py
import time
time.sleep(25) # delay retract 25 seconds
from adafruit_servokit import ServoKit
kit = ServoKit(channels=16)
kit.servo[0].angle = 0

/home/pi/deploy.sh
#!/bin/bash
sudo python3 /home/pi/deploy.py

/home/pi/retract.sh
#!/bin/bash
sudo python3 /home/pi/retract.py

OCTO Command Lines
OCO10 /home/pi/deploy.sh
OCTO20 /home/pi/retract.sh

NOTE: sudoers file aliases ezpi (user logged into octoprint with) to %admin, root

What did you expect to happen?

After the extruder reset to the wipe position (back left corner of the bed) and the bed dropped 10mm to clear the brush, I expected the brush to deploy and then after a 24 second time delay, to then retract before it went on to auto-level and print.

What happened instead?

Extruder went to wipe position, went through wipe motions and then on to auto-level pre-print, brush did not deploy/retract.

Version of OctoPrint-GCodeSystemCommands

1.0.1

Operating System running OctoPrint

Pi Raspbian - 5.1.63-V71+

Printer model & used firmware incl. version

Latest Ender 5 Plus, Firmware as shipped two months ago.

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

Forgive me, I am unsure how to link to my octoprint.log file, or how to put the plugin into debug mode. I have pasted ONLY the operative lines from my log here:
2021-12-05 10:31:13,506 - werkzeug - INFO - 127.0.0.1 - - [05/Dec/2021 10:31:13] "GET /?action=snapshot HTTP/1.1" 200 -
2021-12-05 10:31:18,518 - octoprint.plugins.detailedprogress - INFO - Message: ETA 12/05 10.47AM
2021-12-05 10:31:18,907 - octoprint.plugins.gcodesystemcommands - INFO - Executing command ID: 10
2021-12-05 10:31:18,991 - octoprint.plugins.gcodesystemcommands - INFO - Command ID 10 returned: 1
2021-12-05 10:31:19,063 - octoprint.plugins.gcodesystemcommands - INFO - Executing command ID: 20
2021-12-05 10:31:19,138 - octoprint.plugins.gcodesystemcommands - INFO - Command ID 20 returned: 1
2021-12-05 10:31:19,206 - werkzeug - INFO - 127.0.0.1 - - [05/Dec/2021 10:31:19] "GET /?action=snapshot HTTP/1.1" 200 -
2021-12-05 10:31:19,703 - octoprint.plugins.octoeverywhere - INFO - NotificationsHandler successfully sent 'progress'; ETA: 911
2021-12-05 10:31:24,104 - werkzeug - INFO - 127.0.0.1 - - [05/Dec/2021 10:31:24] "GET /?action=snapshot HTTP/1.1" 200 -
2021-12-05 10:31:28,520 - octoprint.plugins.detailedprogress - INFO - Message: Good accuracy
2021-12-05 10:31:34,347 - werkzeug - INFO - 127.0.0.1 - - [05/Dec/2021 10:31:34] "GET /?action=snapshot HTTP/1.1" 200 -
2021-12-05 10:31:38,523 - octoprint.plugins.detailedprogress - INFO - Message: 7.01% complete
2021-12-05 10:31:41,767 - octoprint.util.comm - INFO - Cancelling job on behalf of user ezpi

Excuse the ignorance but....

...would the flow be:

  1. Install this plugin
  2. define "Gcodes" (OCTO 10, OCTO 20,...)
  3. edit (for example) END GCODE on the slicer program and add OCTO 20?

I ask because the gcode will be sent to the firmware instead, right?

Or this plugin will intercept, execute and VOID the firmware call?

Just not working

I created a script on my Pi that toggles a pin connected to the reset button on the controller board. the script works fine but when I try to use Gxx (xx=any number) to run /usr/local/bin/reset.sh it does nothing. I get an OK in the terminal but no reset. I'm assuming I cant use any Gcode, it would have to be unassigned, correct? what am I doing wrong?

does not occur in the plugins-section

I installed the plugin via the octoprint plugin-manager. It said "succesfully installed" but it does not occur on the left in the plugins-section. So I can't enter any commands. Restarting octoprint or even rebooting the whole system does not help.

execution of GCODE macro, does not take into account waiting for commands to finish

What were you doing?

I am using the GCODE macro script to run an end-sequence of the job, ensuring cooling down, shutdown Pi and poweroff. Shutdown and poweroff are done by the Tasmota plugin and work (using the M81 gcode)..

I have the following GCODE when finishing (a single line):

@shutdown_power

Shutdown power is defined as follows (also a single line):

{% include "shutdown_tasmota.gcode" %}

The content of the gcode file is:

pi@octopi:~/.octoprint/data/gcode_macro $ cat shutdown_tasmota.gcode

M117 Cooling down
;
M109 S50 ; wait for extruder temp (cooling)
M109 R50 ; wait for extruder temp (cooling)
G4 S1
;
M104 S0  ; turn off temperature

M117 Shutdown/poweroff

M81 MK3S 1
;======================= Stop printer

Strictly speaking only one M109 R50 is needed, but I used both just to be sure the firmware is not causing a problem.

The problem is that "M81 MK3S 1" is executed, without waiting for the printer to cooldown. It looks like it is "just" executing", but not waiting for the command to complete.

By contrast: if I add the M109 to the endcode, everything works, so whithout the scipt altered, these three lines work as a workaround:

M109 S50 ;
M109 R50 ;
@shutdown_power

ALSO: If I split the commands over two macros, it works:

@cooldown
@shutdown_power

Using a prusa MK3S+, latest firmware 3.12.2
System bundle included.
octoprint-systeminfo-20230613195238.zip

How are optional parameters passed to the system command?

For example, I have a binary system command /home/pi/foo that accepts command line arguments such as /home/pi/foo a b c. If I configured the gcode command OCTO3 to execute /home/pi/foo, would sending OCTO3 a b c work and pass the gcode parameters to the binary as command line arguments?

Requirement to explicitly call sh to execute shell script : should be in config description

What were you doing?

Wanted to execute code

Iniital error was a 'returned 127'
resolved by adding absolute path to the shell script /home/pi/OctoPrint/OCTO100.sh (execution properties set to all)
Then got an error 2
resolved by adding sh in the gcode system commands to give sh /home/pi/OctoPrint/OCTO100.sh
This then executed successfully.

Version of OctoPrint-GCodeSystemCommands

1.0.1

Operating System running OctoPrint

Raspbian 10 buster
Octoprint 1.4.0
Octopi 0.17.0
Python 3.7.3

Printer moprodel & used firmware incl. version

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

does not work when called from klipper

What were you doing?

1 creat script autofile.sh in /home/pi/autofile.sh
2 creat gcode system command
image

  1. created a special octo1 macro and tried to call it ( its work!)
    image

5 add command to file profile.cfg
image

6 trying to call a command using the Test macro
image

this does not work

this does not work

What happened instead?

Version of OctoPrint-GCodeSystemCommands

Operating System running OctoPrint

Printer model & used firmware incl. version

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

wont work

What were you doing?

i made a OCTO100 GCODE command and linked it to /home/pi/Power_on.sh
in that file i have this : curl -X POST https://someLink.com
after saving and rebooting the gcode command wont work. but when i run the script it sends a post request. so it is somewhere in this application.

  1. ...
  2. ...
  3. ...

What did you expect to happen?

the smart plug to be turned on.

What happened instead?

nothing

Version of OctoPrint-GCodeSystemCommands

1.0.1

Operating System running OctoPrint

raspbian latest from octoprint website
OctoPrint version : 1.4.0
OctoPi version : 0.17.0

Printer model & used firmware incl. version

Ender 3 Pro motherboard v1.4.4 firmware 1.1.6.2

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

i cant set it to debug

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.