├── tests ├── __init__.py ├── fakes │ ├── fake_octopi.txt │ ├── fake_model.txt │ ├── fake_octopiuptodate.txt │ ├── fake_camerastack_usb.txt │ ├── fake_camerastack_libcamera.txt │ └── fake_camerastack_journal.txt └── test_pi_support.py ├── .git-blame-ignore-revs ├── .prettierignore ├── .eslintrc.yaml ├── translations ├── de │ └── LC_MESSAGES │ │ ├── messages.mo │ │ └── messages.po ├── README.txt └── messages.pot ├── .gitignore ├── setup.py ├── octoprint_pi_support ├── translations │ └── de │ │ └── LC_MESSAGES │ │ ├── messages.mo │ │ └── messages.po ├── static │ ├── css │ │ └── pi_support.css │ ├── clientjs │ │ └── pi_support.js │ └── js │ │ └── pi_support.js ├── templates │ ├── pi_support_navbar.jinja2 │ ├── pi_support_about_octopi.jinja2 │ ├── pi_support_about_octopiuptodate.jinja2 │ └── pi_support_settings.jinja2 ├── health_checks.py └── __init__.py ├── MANIFEST.in ├── babel.cfg ├── .github ├── dependabot.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yml │ └── bug_report.yml └── workflows │ ├── add_to_backlog.yml │ ├── process_bundles.yml │ ├── issue_automation.yml │ └── build.yml ├── .prettierrc.yaml ├── .editorconfig ├── .pre-commit-config.yaml ├── Taskfile.yml ├── README.md ├── pyproject.toml └── LICENSE /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/fakes/fake_octopi.txt: -------------------------------------------------------------------------------- 1 | 1.0.0 2 | -------------------------------------------------------------------------------- /tests/fakes/fake_model.txt: -------------------------------------------------------------------------------- 1 | Raspberry Pi Zero W Rev 1.1 2 | -------------------------------------------------------------------------------- /tests/fakes/fake_octopiuptodate.txt: -------------------------------------------------------------------------------- 1 | 1.0.0-1.9.0-20230523082504 2 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # refs to ignore during git blame, use with --ignore-revs-file 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | *.md 2 | *.css 3 | **/*.min.js 4 | build 5 | dist 6 | venv 7 | venv2 8 | venv3 9 | -------------------------------------------------------------------------------- /tests/fakes/fake_camerastack_usb.txt: -------------------------------------------------------------------------------- 1 | Available USB camera devices: 2 | /dev/v4l/by-id/usb-*-video-index0 3 | -------------------------------------------------------------------------------- /.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | env: 2 | browser: true 3 | jquery: true 4 | es6: true 5 | parserOptions: 6 | ecmaVersion: 2018 7 | -------------------------------------------------------------------------------- /translations/de/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoPrint/OctoPrint-PiSupport/HEAD/translations/de/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.swp 3 | .idea 4 | *.iml 5 | build 6 | dist 7 | *.egg* 8 | .DS_Store 9 | *.zip 10 | .local_debug* 11 | .vscode 12 | .pytest_cache 13 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | # we define the license string like this to be backwards compatible to setuptools<77 4 | setuptools.setup(license="AGPL-3.0-or-later") 5 | -------------------------------------------------------------------------------- /octoprint_pi_support/translations/de/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoPrint/OctoPrint-PiSupport/HEAD/octoprint_pi_support/translations/de/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | recursive-include octoprint_pi_support/templates * 3 | recursive-include octoprint_pi_support/translations * 4 | recursive-include octoprint_pi_support/static * 5 | -------------------------------------------------------------------------------- /babel.cfg: -------------------------------------------------------------------------------- 1 | [python: */**.py] 2 | 3 | [jinja2: */**.jinja2] 4 | silent=false 5 | extensions=jinja2.ext.do, octoprint.util.jinja.trycatch 6 | 7 | [javascript: */**.js] 8 | extract_messages = gettext, ngettext 9 | -------------------------------------------------------------------------------- /octoprint_pi_support/static/css/pi_support.css: -------------------------------------------------------------------------------- 1 | #octopi_support_footer { 2 | white-space: nowrap; 3 | } 4 | 5 | .pi_support_state_pulsate { 6 | animation: pulsate 1s ease-out; 7 | animation-iteration-count: infinite; 8 | } 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Set update schedule for GitHub Actions 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: "github-actions" 6 | directory: "/" 7 | schedule: 8 | # Check for updates to GitHub Actions every week 9 | interval: "weekly" 10 | -------------------------------------------------------------------------------- /.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | printWidth: 90 2 | tabWidth: 4 3 | semi: true 4 | trailingComma: "none" 5 | singleQuote: false 6 | quoteProps: consistent 7 | bracketSpacing: false 8 | overrides: 9 | - files: ["*.yaml", "*.yml", "*.json", "*.less"] 10 | options: 11 | tabWidth: 2 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: 🤔 Have questions or need support? 4 | url: https://community.octoprint.org 5 | about: Please get in touch on the OctoPrint Community Forums! 6 | - name: 💸 Want to donate? 7 | url: https://support.octoprint.org 8 | about: Please take a look at the various options to support OctoPrint's development financially! 9 | -------------------------------------------------------------------------------- /tests/fakes/fake_camerastack_libcamera.txt: -------------------------------------------------------------------------------- 1 | Available cameras 2 | ----------------- 3 | 0 : ov5647 [2592x1944] (/base/soc/i2c0mux/i2c@1/ov5647@36) 4 | Modes: 'SGBRG10_CSI2P' : 640x480 [30.00 fps - (0, 0)/0x0 crop] 5 | 1296x972 [30.00 fps - (0, 0)/0x0 crop] 6 | 1920x1080 [30.00 fps - (0, 0)/0x0 crop] 7 | 2592x1944 [30.00 fps - (0, 0)/0x0 crop] 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | end_of_line = lf 8 | charset = utf-8 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | indent_style = space 12 | max_line_length = 90 13 | 14 | [**.py] 15 | indent_size = 4 16 | 17 | [**.js] 18 | indent_size = 4 19 | 20 | [**.yaml] 21 | indent_size = 2 22 | 23 | [**.less] 24 | indent_size = 2 25 | -------------------------------------------------------------------------------- /.github/workflows/add_to_backlog.yml: -------------------------------------------------------------------------------- 1 | name: Add issues/PRs to backlog automatically 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | - transferred 8 | pull_request_target: 9 | types: 10 | - opened 11 | 12 | jobs: 13 | add-to-project: 14 | name: Add issue or PR to OctoPrint Backlog project 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/add-to-project@main 18 | with: 19 | project-url: https://github.com/orgs/OctoPrint/projects/6 20 | github-token: ${{ secrets.BACKLOG_PROJECT_ACCESS }} 21 | -------------------------------------------------------------------------------- /.github/workflows/process_bundles.yml: -------------------------------------------------------------------------------- 1 | name: "Process systeminfo bundles" 2 | on: 3 | issues: 4 | types: [opened, edited] 5 | issue_comment: 6 | types: [created, edited] 7 | 8 | jobs: 9 | process-bundles: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: OctoPrint/actions/process-systeminfo-bundles@main 13 | with: 14 | github-token: ${{ secrets.GITHUB_TOKEN }} 15 | repo: ${{ github.repository }} 16 | comment: ${{ github.event.comment.id }} 17 | issue: ${{ github.event.issue.number }} 18 | body: ${{ github.event_name == 'issue_comment' && github.event.comment.body || github.event.issue.body }} 19 | -------------------------------------------------------------------------------- /octoprint_pi_support/static/clientjs/pi_support.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | if (typeof define === "function" && define.amd) { 3 | define(["OctoPrintClient"], factory); 4 | } else { 5 | factory(global.OctoPrintClient); 6 | } 7 | })(this, function (OctoPrintClient) { 8 | var OctoPrintPiSupportClient = function (base) { 9 | this.base = base; 10 | }; 11 | 12 | OctoPrintPiSupportClient.prototype.get = function (opts) { 13 | return this.base.get(this.base.getSimpleApiUrl("pi_support")); 14 | }; 15 | 16 | OctoPrintClient.registerPluginComponent("pi_support", OctoPrintPiSupportClient); 17 | return OctoPrintPiSupportClient; 18 | }); 19 | -------------------------------------------------------------------------------- /octoprint_pi_support/templates/pi_support_navbar.jinja2: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: ^(octoprint_firmware_check/translations|extras/|translations/|.*\.css|.*\.svg) 2 | repos: 3 | - repo: https://github.com/pre-commit/pre-commit-hooks 4 | rev: v4.4.0 5 | hooks: 6 | - id: end-of-file-fixer 7 | - id: trailing-whitespace 8 | - id: check-case-conflict 9 | - id: check-json 10 | - id: check-yaml 11 | - id: check-toml 12 | - id: check-merge-conflict 13 | - id: fix-encoding-pragma 14 | args: ["--remove"] 15 | - repo: https://github.com/asottile/pyupgrade 16 | rev: v3.3.1 17 | hooks: 18 | - id: pyupgrade 19 | args: ["--py37-plus"] 20 | - repo: https://github.com/astral-sh/ruff-pre-commit 21 | rev: v0.4.2 22 | hooks: 23 | - id: ruff 24 | args: ["--fix"] 25 | - id: ruff-format 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v3.0.0-alpha.4 28 | hooks: 29 | - id: prettier 30 | - repo: https://github.com/pre-commit/mirrors-eslint 31 | rev: v8.33.0 32 | hooks: 33 | - id: eslint 34 | additional_dependencies: 35 | - eslint@7.19.0 36 | - eslint-plugin-es5@v1.3.0 37 | files: \.js$ 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: ✨ Request a feature 2 | description: Request a new feature to implement in Pi Support 3 | title: "[Request]" 4 | labels: 5 | - request 6 | - triage 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: > 11 | **Thank you for wanting to request a feature in Pi Support!** 12 | - type: textarea 13 | attributes: 14 | label: Is your feature request related to a problem? Please describe. 15 | description: A clear and concise description of what the problem is. Eg, "I'm always frustrated when [...]". 16 | validations: 17 | required: true 18 | - type: textarea 19 | attributes: 20 | label: Describe the solution you'd like 21 | description: A clear and concise description of what you want to happen. 22 | validations: 23 | required: true 24 | - type: textarea 25 | attributes: 26 | label: Describe alternatives you've considered 27 | description: A clear and concise description of any alternative solutions or features you've considered. 28 | - type: textarea 29 | attributes: 30 | label: Additional context 31 | description: Add any other context, file uploads and/or screenshots about the feature request here. 32 | -------------------------------------------------------------------------------- /translations/README.txt: -------------------------------------------------------------------------------- 1 | Your plugin's translations will reside here. The provided setup.py supports a 2 | couple of additional commands to make managing your translations easier: 3 | 4 | babel_extract 5 | Extracts any translateable messages (marked with Jinja's `_("...")` or 6 | JavaScript's `gettext("...")`) and creates the initial `messages.pot` file. 7 | babel_refresh 8 | Reruns extraction and updates the `messages.pot` file. 9 | babel_new --locale= 10 | Creates a new translation folder for locale ``. 11 | babel_compile 12 | Compiles the translations into `mo` files, ready to be used within 13 | OctoPrint. 14 | babel_pack --locale= [ --author= ] 15 | Packs the translation for locale `` up as an installable 16 | language pack that can be manually installed by your plugin's users. This is 17 | interesting for languages you can not guarantee to keep up to date yourself 18 | with each new release of your plugin and have to depend on contributors for. 19 | 20 | If you want to bundle translations with your plugin, create a new folder 21 | `octoprint_firmware_check/translations`. When that folder exists, 22 | an additional command becomes available: 23 | 24 | babel_bundle --locale= 25 | Moves the translation for locale `` to octoprint_firmware_check/translations, 26 | effectively bundling it with your plugin. This is interesting for languages 27 | you can guarantee to keep up to date yourself with each new release of your 28 | plugin. 29 | -------------------------------------------------------------------------------- /octoprint_pi_support/templates/pi_support_about_octopi.jinja2: -------------------------------------------------------------------------------- 1 |

{{ _('About OctoPi') }}

2 | 3 |

The ready-to-go Raspberry Pi image with OctoPrint

4 | 5 |

Version {{ plugin_pi_support_octopi_version }}, running on {{ plugin_pi_support_model }}

6 | 7 | 11 | 12 |

13 | © 2013-{{ now.strftime("%Y") }} The OctoPi Authors 14 |

15 | 16 |

17 | OctoPi is free software: you can redistribute it and/or modify 18 | it under the terms of the GNU General Public License as published by 19 | the Free Software Foundation, either version 3 of the License, or 20 | (at your option) any later version. 21 |

22 |

23 | OctoPi is distributed in the hope that it will be useful, 24 | but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | GNU General Public License for more details. 27 |

28 |

29 | For a copy of the GNU General Public License, see 30 | www.gnu.org/licenses/gpl-3.0.en.html. 31 |

32 | -------------------------------------------------------------------------------- /octoprint_pi_support/health_checks.py: -------------------------------------------------------------------------------- 1 | from . import ( 2 | _UNRECOMMENDED_MODELS, 3 | get_proc_dt_model, 4 | has_default_password, 5 | is_model_any_of, 6 | ) 7 | 8 | try: 9 | import octoprint.plugins.health_check.checks as checks 10 | except ImportError: 11 | try: 12 | # in case we extract it into a standalone plugin in the future... 13 | import octoprint_health_check.checks as checks 14 | except ImportError: 15 | # apparently the plugin is disabled 16 | checks = None 17 | 18 | if checks is not None: 19 | 20 | class PiSupportHealthCheck(checks.HealthCheck): 21 | def __init__(self, plugin, settings: dict): 22 | super().__init__(settings) 23 | self._plugin = plugin 24 | 25 | class PiUndervoltageHealthCheck(PiSupportHealthCheck): 26 | key = "pi_undervoltage" 27 | 28 | def perform_check(self, force=False): 29 | state = self._plugin.get_throttle_state() 30 | 31 | if state["current_undervoltage"]: 32 | return checks.CheckResult(result=checks.Result.ISSUE, context=state) 33 | elif state["past_undervoltage"]: 34 | return checks.CheckResult(result=checks.Result.WARNING, context=state) 35 | 36 | class PiUnsupportedHealthCheck(PiSupportHealthCheck): 37 | key = "pi_unsupported" 38 | 39 | def perform_check(self, force=False): 40 | model = get_proc_dt_model() 41 | if is_model_any_of(model, *_UNRECOMMENDED_MODELS): 42 | return checks.CheckResult(result=checks.Result.WARNING) 43 | 44 | class PiDefaultPasswordHealthCheck(PiSupportHealthCheck): 45 | key = "pi_default_password" 46 | 47 | def perform_check(self, force=False): 48 | if has_default_password(): 49 | return checks.CheckResult(result=checks.Result.WARNING) 50 | 51 | all_checks = [ 52 | PiUndervoltageHealthCheck, 53 | PiUnsupportedHealthCheck, 54 | PiDefaultPasswordHealthCheck, 55 | ] 56 | 57 | else: 58 | all_checks = [] 59 | -------------------------------------------------------------------------------- /octoprint_pi_support/templates/pi_support_about_octopiuptodate.jinja2: -------------------------------------------------------------------------------- 1 |

{{ _('About OctoPi-UpToDate') }}

2 | 3 |

The up-to-date version of OctoPi

4 | 5 |

Build {{ plugin_pi_support_octopiuptodate_build_short }} with "{{ plugin_pi_support_octopi_camera_stack }}", based on OctoPi {{ plugin_pi_support_octopi_version }}, running on {{ plugin_pi_support_model }}

6 | 7 | 13 | 14 |

15 | © 2021-{{ now.strftime("%Y") }} The OctoPi-UpToDate Authors 16 |

17 | 18 |

19 | OctoPi-UpToDate is free software: you can redistribute it and/or modify 20 | it under the terms of the GNU General Public License as published by 21 | the Free Software Foundation, either version 3 of the License, or 22 | (at your option) any later version. 23 |

24 |

25 | OctoPi-UpToDate is distributed in the hope that it will be useful, 26 | but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | GNU General Public License for more details. 29 |

30 |

31 | For a copy of the GNU General Public License, see 32 | www.gnu.org/licenses/gpl-3.0.en.html. 33 |

34 | 35 | {% include "pi_support_about_octopi.jinja2" %} 36 | -------------------------------------------------------------------------------- /Taskfile.yml: -------------------------------------------------------------------------------- 1 | # https://taskfile.dev 2 | 3 | version: "3" 4 | 5 | env: 6 | LOCALES: ["de"] # list your included locales here, e.g. ["de", "fr"] 7 | TRANSLATIONS: "octoprint_pi_support/translations" # translations folder, do not touch 8 | 9 | tasks: 10 | install: 11 | desc: Installs the plugin into the current venv 12 | cmds: 13 | - "python -m pip install -e .[develop]" 14 | 15 | test: 16 | desc: Run the plugin's test suite 17 | cmds: 18 | - "python -m pytest" 19 | 20 | ### Build related 21 | 22 | build: 23 | desc: Builds sdist & wheel 24 | cmds: 25 | - python -m build --sdist --wheel 26 | 27 | build-sdist: 28 | desc: Builds sdist 29 | cmds: 30 | - python -m build --sdist 31 | 32 | build-wheel: 33 | desc: Builds wheel 34 | cmds: 35 | - python -m build --wheel 36 | 37 | ### Translation related 38 | 39 | babel-new: 40 | desc: Create a new translation for a locale 41 | cmds: 42 | - task: babel-extract 43 | - | 44 | pybabel init --input-file=translations/messages.pot --output-dir=translations --locale="{{ .CLI_ARGS }}" 45 | 46 | babel-extract: 47 | desc: Update pot file from source 48 | cmds: 49 | - pybabel extract --mapping-file=babel.cfg --output-file=translations/messages.pot --msgid-bugs-address=i18n@octoprint.org --copyright-holder="The OctoPrint Project" . 50 | 51 | babel-update: 52 | desc: Update translation files from pot file 53 | cmds: 54 | - for: 55 | var: LOCALES 56 | cmd: pybabel update --input-file=translations/messages.pot --output-dir=translations --locale={{ .ITEM }} 57 | 58 | babel-refresh: 59 | desc: Update translation files from source 60 | cmds: 61 | - task: babel-extract 62 | - task: babel-update 63 | 64 | babel-compile: 65 | desc: Compile translation files 66 | cmds: 67 | - pybabel compile --directory=translations 68 | 69 | babel-bundle: 70 | desc: Bundle translations 71 | preconditions: 72 | - test -d {{ .TRANSLATIONS }} 73 | cmds: 74 | - for: 75 | var: LOCALES 76 | cmd: | 77 | locale="{{ .ITEM }}" 78 | source="translations/${locale}" 79 | target="{{ .TRANSLATIONS }}/${locale}" 80 | 81 | [ ! -d "${target}" ] || rm -r "${target}" 82 | 83 | echo "Copying translations for locale ${locale} from ${source} to ${target}..." 84 | cp -r "${source}" "${target}" 85 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pi Support 2 | 3 | The Pi Support plugin provides additional information about your Pi in the UI and also 4 | alerts you about undervoltage or overheating issues observed on your Pi or if your Pi is 5 | unsupported. If you are running OctoPi, the Pi Support plugin will also provide additional 6 | information about that. 7 | 8 | OctoPrint will only load this plugin when it detects that it is being run on a 9 | Raspberry Pi. 10 | 11 | This plugin was bundled right with OctoPrint's sources until version 1.6.0. It has been 12 | extracted into a standalone project to allow for a different release cycle, but is still 13 | considered a bundled plugin. 14 | 15 | ## Setup 16 | 17 | The plugin is part of the core dependencies of OctoPrint 1.6.0+ and will be installed automatically alongside it. 18 | 19 | In case you want to manually install it into an older version for whatever reason, install via the bundled 20 | [Plugin Manager](https://docs.octoprint.org/en/main/bundledplugins/pluginmanager.html) 21 | or manually using this URL: 22 | 23 | https://github.com/OctoPrint/OctoPrint-PiSupport/archive/main.zip 24 | 25 | To install and/or rollback to a specific version ``, either use this URL in the plugin manager: 26 | 27 | https://github.com/OctoPrint/OctoPrint-PiSupport/archive/.zip 28 | 29 | or run 30 | 31 | pip install OctoPrint-PiSupport== 32 | 33 | in your OctoPrint virtual environment, substituting `` accordingly. 34 | 35 | ## Events 36 | 37 | ### plugin_pi_support_throttle_state 38 | 39 | *(as `Events.PLUGIN_PI_SUPPORT_THROTTLE_STATE`)* 40 | 41 | A change in throttle state was detected. 42 | 43 | Payload: 44 | * `raw_value`: The raw throttle state value as received from `vcgencmd get_throttled` 45 | * `current_undervolate`: Whether there is currently an undervoltage condition 46 | * `past_undervoltage`: Whether there has been an undervoltage condition since last boot 47 | * `current_overheat`: Whether there is currently an overheat condition 48 | * `past_overheat`: Whether there has been an overheat condition since last boot 49 | * `current_issue`: Whether there is currently an undervoltage or overheat condition 50 | * `past_issue`: Whether there has been either an undervoltage or overheat condition since last boot 51 | 52 | ## Helpers 53 | 54 | ### get_throttled 55 | 56 | Access to `get_throttle_state`, to retrieve the current throttle state. Returns a `dict` 57 | with the same fields as the `PLUGIN_PI_SUPPORT_THROTTLE_STATE` event payload. By setting 58 | the keyword argument `run_now` set to `True`, the throttle state will be refreshed before 59 | returning. 60 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools>=67", 4 | ] 5 | build-backend = "setuptools.build_meta" 6 | 7 | [project] 8 | name = "OctoPrint-PiSupport" 9 | version = "2025.7.23" 10 | dynamic = ["license"] 11 | description = "Provides additional information about your Pi in the UI" 12 | authors = [ 13 | { name = "Gina Häußge", email = "gina@octoprint.org" }, 14 | ] 15 | requires-python = ">=3.7,<4" 16 | dependencies = [] 17 | 18 | [project.entry-points."octoprint.plugin"] 19 | pi_support = "octoprint_pi_support" 20 | 21 | [project.urls] 22 | Homepage = "https://github.com/OctoPrint/OctoPrint-PiSupport" 23 | 24 | [project.optional-dependencies] 25 | develop = [ 26 | "pytest", 27 | "ddt", 28 | "mock", 29 | "pre-commit", 30 | "go-task-bin", 31 | ] 32 | 33 | [project.readme] 34 | file = "README.md" 35 | content-type = "text/markdown" 36 | 37 | [tool.setuptools] 38 | include-package-data = true 39 | 40 | [tool.setuptools.packages.find] 41 | include = ["octoprint_pi_support", "octoprint_pi_support.*"] 42 | 43 | [tool.ruff] 44 | exclude = [ 45 | # standard stuff 46 | ".bzr", 47 | ".direnv", 48 | ".eggs", 49 | ".git", 50 | ".git-rewrite", 51 | ".hg", 52 | ".ipynb_checkpoints", 53 | ".mypy_cache", 54 | ".nox", 55 | ".pants.d", 56 | ".pyenv", 57 | ".pytest_cache", 58 | ".pytype", 59 | ".ruff_cache", 60 | ".svn", 61 | ".tox", 62 | ".venv", 63 | ".vscode", 64 | "__pypackages__", 65 | "_build", 66 | "buck-out", 67 | "build", 68 | "dist", 69 | "node_modules", 70 | "site-packages", 71 | "venv", 72 | ] 73 | 74 | line-length = 90 75 | indent-width = 4 76 | 77 | # Assume Python 3.7 78 | target-version = "py37" 79 | 80 | [tool.ruff.lint] 81 | select = ["B", "C", "E", "F", "I", "W", "B9"] 82 | ignore = [ 83 | "E203", 84 | "E231", 85 | "E265", 86 | "E266", 87 | "E402", 88 | "E501", 89 | "E731", 90 | "E741", 91 | "W605", 92 | "C901", 93 | ] 94 | fixable = ["I", "C4", "E"] 95 | 96 | # Allow unused variables when underscore-prefixed. 97 | dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" 98 | 99 | [tool.ruff.lint.isort] 100 | known-first-party = [ 101 | "octoprint_file_check", 102 | ] 103 | 104 | [tool.ruff.format] 105 | quote-style = "double" 106 | indent-style = "space" 107 | skip-magic-trailing-comma = false 108 | line-ending = "lf" 109 | 110 | # Enable auto-formatting of code examples in docstrings. Markdown, 111 | # reStructuredText code/literal blocks and doctests are all supported. 112 | # 113 | # This is currently disabled by default, but it is planned for this 114 | # to be opt-out in the future. 115 | docstring-code-format = false 116 | 117 | # Set the line length limit used when formatting code snippets in 118 | # docstrings. 119 | # 120 | # This only has an effect when the `docstring-code-format` setting is 121 | # enabled. 122 | docstring-code-line-length = "dynamic" 123 | -------------------------------------------------------------------------------- /octoprint_pi_support/templates/pi_support_settings.jinja2: -------------------------------------------------------------------------------- 1 |

{{ _('Pi Support') }}

2 | 3 |

{{ _('Please restart OctoPrint after changing any of this plugin\'s settings.') }}

4 | 5 |
6 |
7 |
8 | 11 | {{ _('If you check this, you will no longer get warned if you run OctoPrint on Raspberry Pi models that are not officially supported due to bad performance that can lead to failed prints. Do so at your own risk.') }} 12 |
13 |
14 | 15 |
16 |
17 | 20 | {{ _('If you check this, you will no longer get warned if you still have the default password set on your "pi" system user. This is a security risk.') }} 21 |
22 |
23 | 24 | {% if version.number and version.number.count(".") >= 2 and version.number.split(".")[:2] >= ["1", "7"] %} 25 |
26 |
27 | 30 | {{ _('If you check this, you will no longer get warned when starting prints during observed undervoltage issues. Do so at your own risk.') }} 31 |
32 |
33 | {% endif %} 34 | 35 |
36 |
37 | 40 | {{ _('This will regularly check with the Pi if something is amiss either with power regulation or CPU/GPU temperature. Disable at your own risk. You will have to re-enable this when getting assistance on the forums or Discord. Changes require a restart of OctoPrint.') }} 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 |
49 | 50 |
51 | 52 | {{ _('Defaults to /usr/bin/vcgencmd get_throttled. You usually shouldn\'t have to change this.') }} 53 |
54 |
55 | 56 |
57 |
58 | 59 | -------------------------------------------------------------------------------- /.github/workflows/issue_automation.yml: -------------------------------------------------------------------------------- 1 | name: "Issue Automation" 2 | on: 3 | issues: 4 | types: [opened, edited, closed, reopened, labeled, unlabeled] 5 | 6 | jobs: 7 | issue-automation: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/github-script@v7 11 | env: 12 | REMINDER: > 13 | Hi @${{ github.event.issue.user.login }}! 14 | 15 | 16 | It looks like you didn't upload a [system info bundle](https://community.octoprint.org/t/29887) as requested by the template. 17 | A bundle is required to further process your issue. It contains important logs and 18 | system information to be able to put your issue into context and give pointers as to 19 | what has happened. 20 | 21 | 22 | Please **edit your original post above** and upload **a bundle zip file**. Actually upload the file please and 23 | do not paste some link to a cloud provider, we want to have everything in one place here. Also do 24 | not unpack, repack or otherwise modify the bundle or its name, share it **exactly** like you get it from OctoPrint. 25 | 26 | 27 | Without the availability of a bundle, your issue will have to be closed. 28 | 29 | 30 | Thank you for your collaboration. 31 | THANKYOU: > 32 | Thank you @${{ github.event.issue.user.login }} for adding a bundle! Now this can actually get looked at. 33 | with: 34 | script: | 35 | const { REMINDER, THANKYOU } = process.env; 36 | const bundleRegex = /\[(octoprint-systeminfo-\d{14}\.zip)\]\(([^)]+)\)/g; 37 | const marker = ""; 38 | 39 | const issueLabels = await github.rest.issues.listLabelsOnIssue({ 40 | owner: context.repo.owner, 41 | repo: context.repo.repo, 42 | issue_number: context.issue.number 43 | }); 44 | let labels = issueLabels.data.map(label => label.name); 45 | 46 | const comments = await github.rest.issues.listComments({ 47 | owner: context.repo.owner, 48 | repo: context.repo.repo, 49 | issue_number: context.issue.number, 50 | }) 51 | const comment = comments.data.find(c => c.user.login === "github-actions[bot]" && c.body.includes(marker)); 52 | if (comment) { 53 | console.log("Found comment, id=" + comment.id); 54 | } else { 55 | console.log("No comment found"); 56 | } 57 | 58 | if (!labels.includes("triage") || !labels.includes("bug") || labels.includes("approved")) { 59 | console.log("Deleting comment if it exists..."); 60 | if (comment) { 61 | await github.rest.issues.deleteComment({ 62 | owner: context.repo.owner, 63 | repo: context.repo.repo, 64 | comment_id: comment.id, 65 | }) 66 | } 67 | return; 68 | } 69 | 70 | const found = !!context.payload.issue.body.match(bundleRegex); 71 | 72 | if (!found) { 73 | console.log("No bundle found, posting/updating reminder"); 74 | const text = REMINDER + "\n" + marker; 75 | if (!comment) { 76 | await github.rest.issues.createComment({ 77 | owner: context.repo.owner, 78 | repo: context.repo.repo, 79 | issue_number: context.issue.number, 80 | body: text 81 | }); 82 | } else if (comment.body !== text) { 83 | await github.rest.issues.updateComment({ 84 | owner: context.repo.owner, 85 | repo: context.repo.repo, 86 | comment_id: comment.id, 87 | body: text 88 | }); 89 | } 90 | } else if (found && comment) { 91 | console.log("Bundle found, saying thanks"); 92 | const text = REMINDER.split("\n\n").map(line => `~~${line.trim()}~~`).join("\n\n") + "\n\n" + THANKYOU + "\n" + marker; 93 | if (comment.body !== text) { 94 | await github.rest.issues.updateComment({ 95 | owner: context.repo.owner, 96 | repo: context.repo.repo, 97 | comment_id: comment.id, 98 | body: text 99 | }); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: 🐛 Report a bug 2 | description: Create a bug report to help improve Pi Support 3 | labels: 4 | - bug 5 | - triage 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: >- 10 | **Thank you for wanting to report a bug in Pi Support!** 11 | 12 | * First, be sure you are running the [latest version of the Pi Support plugin](https://github.com/OctoPrint/OctoPrint-PiSupport/releases). 13 | * You will also need to [enable debug logging on the plugin](https://docs.octoprint.org/en/main/configuration/logging_yaml.html). 14 | * This may be done through the *Settings* > *OctoPrint* > *Logging* > *Logging Levels* section. 15 | * Select the `octoprint.plugins.pi_support` name, and make sure Level is "DEBUG". 16 | * Save, then restart OctoPrint, which allows the developers to see debug information from the moment the plugin is loaded. 17 | * Finally, when submitting a bug report, you **must** [include a Systeminfo Bundle](https://community.octoprint.org/t/what-is-a-systeminfo-bundle-and-how-can-i-obtain-one/29887), generated after the point the bug occurs. This allows the developers to examine the debug logs produced from your plugin installation. 18 | 19 | Thank you for your help! 20 | - type: textarea 21 | attributes: 22 | label: The problem 23 | description: >- 24 | Describe the issue you are experiencing here. Tell us what you were trying to do 25 | step by step, and what happened that you did not expect. 26 | 27 | Provide a clear and concise description of what the problem is and include as many 28 | details as possible. 29 | placeholder: | 30 | 1. ... 31 | 2. ... 32 | 3. ... 33 | validations: 34 | required: true 35 | - type: markdown 36 | attributes: 37 | value: | 38 | ## Environment 39 | - type: input 40 | attributes: 41 | label: Version of Pi Support 42 | description: Can be found in *Settings* > *Plugin Manager*, next to "Pi Support". 43 | validations: 44 | required: true 45 | - type: input 46 | attributes: 47 | label: Version of OctoPrint 48 | description: Can be found in the lower left corner of the web interface. 49 | validations: 50 | required: true 51 | - type: input 52 | attributes: 53 | label: Operating system running OctoPrint 54 | description: >- 55 | OctoPi, Linux, Windows, MacOS, something else? With version please? OctoPi's 56 | version can be found in `/etc/octopi_version` or in the lower left corner of the 57 | web interface. 58 | validations: 59 | required: true 60 | - type: input 61 | attributes: 62 | label: Printer model & used firmware incl. version 63 | description: If applicable, always include if unsure 64 | - type: input 65 | attributes: 66 | label: Browser and version of browser, operating system running browser 67 | description: If applicable, always include if unsure 68 | - type: markdown 69 | attributes: 70 | value: | 71 | ## Logs and other files needed for analysis 72 | - type: markdown 73 | attributes: 74 | value: >- 75 | Please also be sure to upload the following files below: 76 | 77 | * Systeminfo Bundle: See [here](https://community.octoprint.org/t/what-is-a-systeminfo-bundle-and-how-can-i-obtain-one/29887) if you don't know where to find that. Just attach down below as-is. 78 | * If you are reporting an issue that involves communicating with you printer, **be sure to enable `serial.log` before reproducing and creating the Systeminfo Bundle**! 79 | * Your browser's JavaScript console, if you are reporting a problem with the user interface. See [here](https://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers) on where to find that. 80 | * If possible, screenshots or videos showing the problem, especially if you are reporting a problem with the user interface! 81 | * GCODE files with which to reproduce. 82 | 83 | Please be aware that unless at least Systeminfo Bundle is included, your bug report 84 | will not be processed and closed after a while. 85 | - type: checkboxes 86 | attributes: 87 | label: Checklist of files to include below 88 | options: 89 | - label: Systeminfo Bundle (always include!) 90 | required: true 91 | - label: Contents of the JavaScript browser console (always include in cases of issues with the user interface) 92 | - label: Screenshots and/or videos showing the problem (always include in case of issues with the user interface) 93 | - label: GCODE file with which to reproduce. 94 | - type: textarea 95 | attributes: 96 | label: Additional information & file uploads 97 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build pipeline 2 | on: 3 | push: 4 | branches: 5 | - main 6 | - devel 7 | release: 8 | types: [released] 9 | 10 | jobs: 11 | build: 12 | name: 🔨 Build distribution 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: 🏗 Set up Python 3.10 17 | uses: actions/setup-python@v5 18 | with: 19 | python-version: "3.10" 20 | - name: 🔨 Build distribution 21 | uses: OctoPrint/actions/build-dist@main 22 | with: 23 | artifact: dist 24 | 25 | pre-commit: 26 | name: 🧹 Pre-commit 27 | runs-on: ubuntu-latest 28 | steps: 29 | - uses: actions/checkout@v4 30 | - name: 🏗 Set up Python 3.10 31 | uses: actions/setup-python@v4 32 | with: 33 | python-version: "3.10" 34 | - name: 🏗 Set up dev dependencies 35 | run: | 36 | pip install -e .[develop] 37 | - name: 🚀 Run pre-commit 38 | run: | 39 | pre-commit run --all-files --show-diff-on-failure 40 | 41 | test-unit: 42 | name: 🧪 Unit tests 43 | strategy: 44 | fail-fast: false 45 | matrix: 46 | python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] 47 | runs-on: ubuntu-22.04 # change back to ubuntu-latest once we drop Python 3.7 48 | steps: 49 | - uses: actions/checkout@v4 50 | - name: 🏗 Set up Python ${{ matrix.python }} 51 | uses: actions/setup-python@v4 52 | with: 53 | python-version: ${{ matrix.python }} 54 | - name: 🏗 Set up test dependencies 55 | run: | 56 | pip install octoprint 57 | pip install -e .[develop] 58 | - name: 🚀 Run test suite 59 | run: | 60 | pytest | tee report.txt 61 | pytest_exit=${PIPESTATUS[0]} 62 | 63 | # generate summary 64 | python=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))') 65 | today=$(date +'%Y-%m-%d') 66 | now=$(date +'%H:%M') 67 | summary=$(tail -n1 report.txt | sed 's/^=*\s//g' | sed 's/\s=*$//g') 68 | 69 | cat << EOF >> $GITHUB_STEP_SUMMARY 70 | ### Test Report 71 | 72 | *generated on $today at $now under Python $python* 73 | 74 |
75 | $summary 76 | 77 | \`\`\` 78 | $(cat report.txt) 79 | \`\`\` 80 | 81 |
82 | EOF 83 | 84 | # make sure we fail if pytest fails! 85 | exit $pytest_exit 86 | 87 | test-install: 88 | name: 🧪 Installation test 89 | strategy: 90 | fail-fast: false 91 | matrix: 92 | python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] 93 | runs-on: ubuntu-22.04 # change back to ubuntu-latest once we drop Python 3.7 94 | steps: 95 | - uses: actions/checkout@v4 96 | - name: 🏗 Set up Python ${{ matrix.python }} 97 | uses: actions/setup-python@v4 98 | with: 99 | python-version: ${{ matrix.python }} 100 | - name: 🚀 Set up test dependencies & run test install 101 | run: | 102 | pip install octoprint 103 | pip install -e .[develop] 104 | 105 | test-e2e: 106 | name: 🧪 E2E tests 107 | needs: build 108 | runs-on: ubuntu-22.04 # change back to ubuntu-latest once we drop Python 3.7 & upgrade playwright 109 | strategy: 110 | fail-fast: false 111 | matrix: 112 | octoprint: ["main", "dev"] 113 | python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] 114 | exclude: 115 | - octoprint: "dev" 116 | python: "3.7" 117 | - octoprint: "dev" 118 | python: "3.8" 119 | steps: 120 | - name: ⬇ Download build result 121 | uses: actions/download-artifact@v4 122 | with: 123 | name: dist 124 | path: dist 125 | 126 | - name: 🎭 Run OctoPrint's E2E Tests 127 | uses: OctoPrint/actions/e2e@main 128 | with: 129 | ref: ${{ matrix.octoprint }} 130 | python: ${{ matrix.python }} 131 | deps: ${{ github.workspace }}/dist/*.whl 132 | suffix: "-${{ matrix.octoprint }}-py${{ matrix.python }}" 133 | 134 | publish-on-testpypi: 135 | name: 📦 Publish on TestPyPI 136 | if: github.event_name == 'release' 137 | needs: 138 | - build 139 | - pre-commit 140 | - test-install 141 | - test-unit 142 | - test-e2e 143 | runs-on: ubuntu-latest 144 | environment: 145 | name: testpypi 146 | url: https://test.pypi.org/p/OctoPrint-PiSupport 147 | permissions: 148 | id-token: write 149 | steps: 150 | - name: ⬇ Download build result 151 | uses: actions/download-artifact@v4 152 | with: 153 | name: dist 154 | path: dist 155 | - name: 🧹 Remove some stuff that won't make it through twine check 156 | run: | 157 | rm dist/*.source.tar.gz 158 | rm dist/sha512sums.txt 159 | - name: 📦 Publish to index 160 | uses: pypa/gh-action-pypi-publish@release/v1 161 | with: 162 | repository-url: https://test.pypi.org/legacy/ 163 | 164 | publish-on-pypi: 165 | name: 📦 Publish tagged releases to PyPI 166 | if: github.event_name == 'release' 167 | needs: publish-on-testpypi 168 | runs-on: ubuntu-latest 169 | environment: 170 | name: pypi 171 | url: https://test.pypi.org/p/OctoPrint-PiSupport 172 | permissions: 173 | id-token: write 174 | steps: 175 | - name: ⬇ Download build result 176 | uses: actions/download-artifact@v4 177 | with: 178 | name: dist 179 | path: dist 180 | - name: 🧹 Remove some stuff that won't make it through twine check 181 | run: | 182 | rm dist/*.source.tar.gz 183 | rm dist/sha512sums.txt 184 | - name: 📦 Publish to index 185 | uses: pypa/gh-action-pypi-publish@release/v1 186 | -------------------------------------------------------------------------------- /tests/test_pi_support.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from unittest import mock 3 | 4 | import ddt 5 | from octoprint.util.platform import CLOSE_FDS 6 | 7 | OCTOPI_VERSION = "0.14.0" 8 | 9 | OCTOPI_UPTODATE_BUILD = "0.18.0-1.7.2-20220119085355" 10 | 11 | DT_MODEL = "Raspberry Pi Model F Rev 1.1" 12 | 13 | VCGENCMD = "/usr/bin/vcgencmd get_throttled" 14 | 15 | OPEN_SIGNATURE = "builtins.open" 16 | 17 | 18 | class PiSupportTestCase(unittest.TestCase): 19 | def test_get_octopi_version(self): 20 | from octoprint_pi_support import get_octopi_version 21 | 22 | # import _fixups 23 | 24 | with mock.patch(OPEN_SIGNATURE, mock.mock_open(), create=True) as m: 25 | m.return_value.readline.return_value = OCTOPI_VERSION 26 | version = get_octopi_version() 27 | 28 | m.assert_called_once_with("/etc/octopi_version", encoding="utf-8") 29 | self.assertEqual(version, OCTOPI_VERSION) 30 | 31 | def test_get_octopiuptodate_build(self): 32 | from octoprint_pi_support import get_octopiuptodate_build 33 | 34 | with mock.patch(OPEN_SIGNATURE, mock.mock_open(), create=True) as m: 35 | m.return_value.readline.return_value = OCTOPI_UPTODATE_BUILD 36 | build = get_octopiuptodate_build() 37 | 38 | m.assert_called_once_with("/etc/octopiuptodate_build", encoding="utf-8") 39 | self.assertEqual(build, OCTOPI_UPTODATE_BUILD) 40 | 41 | def test_get_proc_dt_model(self): 42 | from octoprint_pi_support import get_proc_dt_model 43 | 44 | with mock.patch(OPEN_SIGNATURE, mock.mock_open(), create=True) as m: 45 | m.return_value.readline.return_value = DT_MODEL 46 | model = get_proc_dt_model() 47 | 48 | m.assert_called_once_with("/proc/device-tree/model", encoding="utf-8") 49 | self.assertEqual(model, DT_MODEL) 50 | 51 | def test_get_vcgencmd_throttle_state(self): 52 | from octoprint_pi_support import get_vcgencmd_throttled_state 53 | 54 | with mock.patch("sarge.get_both", mock.MagicMock()) as m: 55 | m.return_value = ("throttled=0x70005", "") 56 | state = get_vcgencmd_throttled_state(VCGENCMD) 57 | 58 | m.assert_called_once_with(VCGENCMD, close_fds=CLOSE_FDS) 59 | self.assertTrue(state.current_undervoltage) 60 | self.assertFalse(state.current_overheat) 61 | self.assertTrue(state.current_issue) 62 | self.assertTrue(state.past_undervoltage) 63 | self.assertTrue(state.past_overheat) 64 | self.assertTrue(state.past_issue) 65 | 66 | def test_get_vcgencmd_throttle_state_unparseable1(self): 67 | from octoprint_pi_support import get_vcgencmd_throttled_state 68 | 69 | with mock.patch("sarge.get_both", mock.MagicMock()) as m: 70 | m.return_value = ("", "invalid") 71 | 72 | try: 73 | get_vcgencmd_throttled_state(VCGENCMD) 74 | except ValueError: 75 | # expected 76 | pass 77 | else: 78 | self.fail("Expected ValueError") 79 | 80 | def test_get_vcgencmd_throttle_state_unparseable2(self): 81 | from octoprint_pi_support import get_vcgencmd_throttled_state 82 | 83 | with mock.patch("sarge.get_both", mock.MagicMock()) as m: 84 | m.return_value = ("throttled=0xinvalid", "") 85 | 86 | try: 87 | get_vcgencmd_throttled_state(VCGENCMD) 88 | except ValueError: 89 | # expected 90 | pass 91 | else: 92 | self.fail("Expected ValueError") 93 | 94 | 95 | @ddt.ddt 96 | class ThrottleStateTestCase(unittest.TestCase): 97 | @ddt.data( 98 | ( 99 | 0x00000, 100 | { 101 | "_undervoltage": False, 102 | "_freq_capped": False, 103 | "_throttled": False, 104 | "_past_undervoltage": False, 105 | "_past_freq_capped": False, 106 | "_past_throttled": False, 107 | "current_undervoltage": False, 108 | "past_undervoltage": False, 109 | "current_overheat": False, 110 | "past_overheat": False, 111 | "current_issue": False, 112 | "past_issue": False, 113 | }, 114 | ), 115 | ( 116 | 0x50005, 117 | { 118 | "_undervoltage": True, 119 | "_freq_capped": False, 120 | "_throttled": True, 121 | "_past_undervoltage": True, 122 | "_past_freq_capped": False, 123 | "_past_throttled": True, 124 | "current_undervoltage": True, 125 | "past_undervoltage": True, 126 | "current_overheat": False, 127 | "past_overheat": False, 128 | "current_issue": True, 129 | "past_issue": True, 130 | }, 131 | ), 132 | ( 133 | 0x50000, 134 | { 135 | "_undervoltage": False, 136 | "_freq_capped": False, 137 | "_throttled": False, 138 | "_past_undervoltage": True, 139 | "_past_freq_capped": False, 140 | "_past_throttled": True, 141 | "current_undervoltage": False, 142 | "past_undervoltage": True, 143 | "current_overheat": False, 144 | "past_overheat": False, 145 | "current_issue": False, 146 | "past_issue": True, 147 | }, 148 | ), 149 | ( 150 | 0x00006, 151 | { 152 | "_undervoltage": False, 153 | "_freq_capped": True, 154 | "_throttled": True, 155 | "_past_undervoltage": False, 156 | "_past_freq_capped": False, 157 | "_past_throttled": False, 158 | "current_undervoltage": False, 159 | "past_undervoltage": False, 160 | "current_overheat": True, 161 | "past_overheat": False, 162 | "current_issue": True, 163 | "past_issue": False, 164 | }, 165 | ), 166 | ) 167 | @ddt.unpack 168 | def test_conversion(self, input, expected_flags): 169 | from octoprint_pi_support import ThrottleState 170 | 171 | output = ThrottleState.from_value(input) 172 | 173 | for key, value in expected_flags.items(): 174 | self.assertEqual(getattr(output, key), value) 175 | 176 | def test_as_dict(self): 177 | from octoprint_pi_support import ThrottleState 178 | 179 | state = ThrottleState( 180 | undervoltage=True, 181 | throttled=True, 182 | past_undervoltage=True, 183 | past_freq_capped=True, 184 | past_throttled=True, 185 | ) 186 | 187 | self.assertDictEqual( 188 | state.as_dict(), 189 | { 190 | "current_undervoltage": True, 191 | "past_undervoltage": True, 192 | "current_overheat": False, 193 | "past_overheat": True, 194 | "current_issue": True, 195 | "past_issue": True, 196 | "raw_value": -1, 197 | }, 198 | ) 199 | -------------------------------------------------------------------------------- /translations/messages.pot: -------------------------------------------------------------------------------- 1 | # Translations template for OctoPrint-PiSupport. 2 | # Copyright (C) 2022 The OctoPrint Project 3 | # This file is distributed under the same license as the OctoPrint-PiSupport 4 | # project. 5 | # FIRST AUTHOR , 2022. 6 | # 7 | #, fuzzy 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: OctoPrint-PiSupport 2022.6.13\n" 11 | "Report-Msgid-Bugs-To: i18n@octoprint.org\n" 12 | "POT-Creation-Date: 2022-06-13 11:21+0200\n" 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 | "Last-Translator: FULL NAME \n" 15 | "Language-Team: LANGUAGE \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=utf-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Generated-By: Babel 2.10.1\n" 20 | 21 | #: octoprint_pi_support/__init__.py:299 22 | msgid "Allows to check for the Pi's throttling status and environment info" 23 | msgstr "" 24 | 25 | #: octoprint_pi_support/__init__.py:372 26 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:1 27 | msgid "Pi Support" 28 | msgstr "" 29 | 30 | #: octoprint_pi_support/__init__.py:545 31 | msgid "" 32 | "Without this plugin OctoPrint will no longer be able to provide " 33 | "additional information about your Pi, which will make it more tricky to " 34 | "help you if you need support." 35 | msgstr "" 36 | 37 | #: octoprint_pi_support/static/js/pi_support.js:38 38 | msgid "" 39 | "OctoPrint does not and never has supported the RPi Zero or Zero W. Use at" 40 | " least a Raspberry Pi 3 or Zero 2, or risk bad performance and failed " 41 | "prints." 42 | msgstr "" 43 | 44 | #: octoprint_pi_support/static/js/pi_support.js:43 45 | #: octoprint_pi_support/static/js/pi_support.js:104 46 | #: octoprint_pi_support/static/js/pi_support.js:139 47 | #, python-format 48 | msgid "You can read more in the FAQ." 49 | msgstr "" 50 | 51 | #: octoprint_pi_support/static/js/pi_support.js:47 52 | msgid "" 53 | "You can disable this message via Settings > Pi Support > Disable warning " 54 | "about unsupported hardware" 55 | msgstr "" 56 | 57 | #: octoprint_pi_support/static/js/pi_support.js:54 58 | msgid "Unsupported hardware detected" 59 | msgstr "" 60 | 61 | #: octoprint_pi_support/static/js/pi_support.js:77 62 | msgid "" 63 | "OctoPrint cannot check for throttling situations reported by your Pi. " 64 | "vcgencmd doesn't work as expected. Make sure the system user" 65 | " OctoPrint is running under is a member of the \"video\" group." 66 | msgstr "" 67 | 68 | #: octoprint_pi_support/static/js/pi_support.js:86 69 | msgid "Cannot check for throttling" 70 | msgstr "" 71 | 72 | #: octoprint_pi_support/static/js/pi_support.js:99 73 | msgid "" 74 | "Your Raspberry Pi is reporting insufficient power. Switch to an adequate " 75 | "power supply or risk bad performance and failed prints." 76 | msgstr "" 77 | 78 | #: octoprint_pi_support/static/js/pi_support.js:111 79 | msgid "Undervoltage detected" 80 | msgstr "" 81 | 82 | #: octoprint_pi_support/static/js/pi_support.js:134 83 | msgid "" 84 | "The default password for the system user \"pi\" has not been changed. " 85 | "This is a security risk - please login to your Pi via SSH and change the " 86 | "password." 87 | msgstr "" 88 | 89 | #: octoprint_pi_support/static/js/pi_support.js:143 90 | msgid "" 91 | "You can disable this message via Settings > Pi Support > Disable warning " 92 | "about default system password" 93 | msgstr "" 94 | 95 | #: octoprint_pi_support/static/js/pi_support.js:150 96 | msgid "Default system password not changed" 97 | msgstr "" 98 | 99 | #: octoprint_pi_support/static/js/pi_support.js:176 100 | msgid "OctoPi" 101 | msgstr "" 102 | 103 | #: octoprint_pi_support/static/js/pi_support.js:199 104 | msgid "" 105 | "Make sure your power supply and cabling are providing enough power to the" 106 | " Pi." 107 | msgstr "" 108 | 109 | #: octoprint_pi_support/static/js/pi_support.js:205 110 | msgid "Frequency capping due to overheating. Improve cooling of the CPU and GPU." 111 | msgstr "" 112 | 113 | #: octoprint_pi_support/static/js/pi_support.js:211 114 | msgid "Current issues:" 115 | msgstr "" 116 | 117 | #: octoprint_pi_support/static/js/pi_support.js:214 118 | msgid "The following issues are being observed right now:" 119 | msgstr "" 120 | 121 | #: octoprint_pi_support/static/js/pi_support.js:232 122 | msgid "Issues since boot:" 123 | msgstr "" 124 | 125 | #: octoprint_pi_support/static/js/pi_support.js:235 126 | msgid "The following issues have been observed since the Pi was booted:" 127 | msgstr "" 128 | 129 | #: octoprint_pi_support/static/js/pi_support.js:249 130 | msgid "Click the navbar icon for more information." 131 | msgstr "" 132 | 133 | #: octoprint_pi_support/static/js/pi_support.js:279 134 | msgid "Undervoltage detected, print anyway?" 135 | msgstr "" 136 | 137 | #: octoprint_pi_support/static/js/pi_support.js:281 138 | msgid "" 139 | "Your Pi is reporting undervoltage. It is not recommended to start a print" 140 | " job until an adequate power supply has been installed." 141 | msgstr "" 142 | 143 | #: octoprint_pi_support/static/js/pi_support.js:285 144 | msgid "See also the FAQ" 145 | msgstr "" 146 | 147 | #: octoprint_pi_support/static/js/pi_support.js:287 148 | msgid "Start the print job anyway?" 149 | msgstr "" 150 | 151 | #: octoprint_pi_support/static/js/pi_support.js:288 152 | msgid "No, don't print" 153 | msgstr "" 154 | 155 | #: octoprint_pi_support/static/js/pi_support.js:290 156 | msgid "Yes, print" 157 | msgstr "" 158 | 159 | #: octoprint_pi_support/static/js/pi_support.js:291 160 | msgid "Yes, print & don't warn again" 161 | msgstr "" 162 | 163 | #: octoprint_pi_support/templates/pi_support_about_octopi.jinja2:1 164 | msgid "About OctoPi" 165 | msgstr "" 166 | 167 | #: octoprint_pi_support/templates/pi_support_navbar.jinja2:1 168 | msgid "What do the symbols mean?" 169 | msgstr "" 170 | 171 | #: octoprint_pi_support/templates/pi_support_navbar.jinja2:2 172 | msgid "Undervoltage" 173 | msgstr "" 174 | 175 | #: octoprint_pi_support/templates/pi_support_navbar.jinja2:3 176 | msgid "Overheat" 177 | msgstr "" 178 | 179 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:3 180 | msgid "Please restart OctoPrint after changing any of this plugin's settings." 181 | msgstr "" 182 | 183 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:9 184 | msgid "Disable warning about unsupported hardware" 185 | msgstr "" 186 | 187 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:9 188 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:18 189 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:28 190 | msgid "Warning" 191 | msgstr "" 192 | 193 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:11 194 | msgid "" 195 | "If you check this, you will no longer get warned if you run OctoPrint on " 196 | "Raspberry Pi models that are not officially supported due to bad " 197 | "performance that can lead to failed prints. Do so at your own risk." 198 | msgstr "" 199 | 200 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:18 201 | msgid "Disable warning about default system password" 202 | msgstr "" 203 | 204 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:20 205 | msgid "" 206 | "If you check this, you will no longer get warned if you still have the " 207 | "default password set on your \"pi\" system user. This is a security risk." 208 | msgstr "" 209 | 210 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:28 211 | msgid "Disable warning about undervoltage on print start" 212 | msgstr "" 213 | 214 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:30 215 | msgid "" 216 | "If you check this, you will no longer get warned when starting prints " 217 | "during observed undervoltage issues. Do so at your own risk." 218 | msgstr "" 219 | 220 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:38 221 | msgid "" 222 | "Enable under voltage and overheat detection via vcgencmd " 223 | "get_throttled" 224 | msgstr "" 225 | 226 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:40 227 | msgid "" 228 | "This will regularly check with the Pi if something is amiss either with " 229 | "power regulation or CPU/GPU temperature. Disable at your own risk. You " 230 | "will have to re-enable this when getting assistance on the forums or " 231 | "Discord. Changes require a restart of OctoPrint." 232 | msgstr "" 233 | 234 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:45 235 | msgid "Advanced options" 236 | msgstr "" 237 | 238 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:49 239 | msgid "Command for under voltage/overheat detection" 240 | msgstr "" 241 | 242 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:52 243 | msgid "" 244 | "Defaults to /usr/bin/vcgencmd get_throttled. You usually " 245 | "shouldn't have to change this." 246 | msgstr "" 247 | 248 | -------------------------------------------------------------------------------- /tests/fakes/fake_camerastack_journal.txt: -------------------------------------------------------------------------------- 1 | -- Journal begins at Thu 2022-09-22 01:23:40 BST, ends at Wed 2023-05-24 16:28:00 BST. -- 2 | May 24 01:48:08 octopic systemd[1]: Starting camera-streamer... 3 | May 24 01:48:08 octopic camera-streamer-control[533]: Running start for camera-streamer-libcamera.service... 4 | May 24 01:48:08 octopic camera-streamer-control[533]: ... done. 5 | May 24 01:48:08 octopic camera-streamer-control[533]: Adding path unit for autolaunch of camera-streamer-usb@default 6 | May 24 01:48:08 octopic systemd[1]: Starting camera-streamer libcamera... 7 | May 24 01:48:09 octopic camera-streamer-control[533]: Running start for camera-streamer-usb-default.path... 8 | May 24 01:48:09 octopic camera-streamer-control[533]: ... done. 9 | May 24 01:48:09 octopic systemd[1]: Started camera-streamer default autolaunch. 10 | May 24 01:48:09 octopic systemd[1]: Finished camera-streamer. 11 | May 24 01:48:11 octopic sh[549]: /base/soc/i2c0mux/i2c@1/ov5647@36 12 | May 24 01:48:11 octopic systemd[1]: Started camera-streamer libcamera. 13 | May 24 01:48:15 octopic sh[589]: /usr/bin/camera-streamer Version: v0.1-21-g54f538e (54f538e) 14 | May 24 01:48:15 octopic sh[589]: [0:00:20.341406502] [589] INFO Camera camera_manager.cpp:299 libcamera v0.0.4+22-923f5d70 15 | May 24 01:48:15 octopic sh[589]: [0:00:20.411405304] [705] INFO RPI raspberrypi.cpp:1476 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media2 and ISP device /dev/media0 16 | May 24 01:48:15 octopic sh[589]: device/libcamera/device.cc: CAMERA: Device path=/base/soc/i2c0mux/i2c@1/ov5647@36 opened 17 | May 24 01:48:15 octopic sh[589]: [0:00:20.413811397] [589] INFO Camera camera.cpp:1028 configuring streams: (0) 1920x1080-YUYV 18 | May 24 01:48:15 octopic sh[589]: [0:00:20.414694522] [705] INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1920x1080-SGBRG10_1X10 - Selected unicam format: 1920x1080-pGAA 19 | May 24 01:48:15 octopic sh[589]: [0:00:20.418496866] [589] INFO Camera camera.cpp:1028 configuring streams: (0) 1920x1080-YUYV (1) 1920x1080-SGBRG10_CSI2P 20 | May 24 01:48:15 octopic sh[589]: [0:00:20.419256345] [705] INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1920x1080-SGBRG10_1X10 - Selected unicam format: 1920x1080-pGAA 21 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: CAMERA:capture: Using: 1920x1080/YUYV, buffers=2, bytesperline=3840, sizeimage=0.0MiB 22 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: CAMERA:capture: Opened 2 buffers. Memory used: 7.9 MiB 23 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: CAMERA:capture:1: Using: 1920x1080/GB10, buffers=2, bytesperline=2400, sizeimage=0.0MiB 24 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: CAMERA:capture:1: Opened 2 buffers. Memory used: 4.9 MiB 25 | May 24 01:48:15 octopic sh[589]: device/v4l2/device.c: SNAPSHOT: Device path=/dev/video31 fd=37 opened 26 | May 24 01:48:15 octopic sh[589]: device/v4l2/buffer_list.c: SNAPSHOT:output:mplane: Requested resolution=1920x1080 is unavailable. Got 1920x1088. 27 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: SNAPSHOT:output:mplane: Using: 1920x1056/YUYV, buffers=2, bytesperline=3840, sizeimage=3.9MiB 28 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: SNAPSHOT:output:mplane: Opened 2 buffers. Memory used: 0.0 MiB 29 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: SNAPSHOT:capture:mplane: Using: 1920x1056/JPEG, buffers=2, bytesperline=0, sizeimage=4.0MiB 30 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: SNAPSHOT:capture:mplane: Opened 2 buffers. Memory used: 8.0 MiB 31 | May 24 01:48:15 octopic sh[589]: device/v4l2/device.c: RESCALLER:STREAM: Device path=/dev/video12 fd=40 opened 32 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: RESCALLER:STREAM:output:mplane: Using: 1920x1080/YUYV, buffers=2, bytesperline=3840, sizeimage=4.0MiB 33 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: RESCALLER:STREAM:output:mplane: Opened 2 buffers. Memory used: 0.0 MiB 34 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: RESCALLER:STREAM:capture:mplane: Using: 1312x736/YUYV, buffers=2, bytesperline=2624, sizeimage=1.8MiB 35 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: RESCALLER:STREAM:capture:mplane: Opened 2 buffers. Memory used: 3.7 MiB 36 | May 24 01:48:15 octopic sh[589]: device/v4l2/device.c: STREAM: Device path=/dev/video31 fd=43 opened 37 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: STREAM:output:mplane: Using: 1312x736/YUYV, buffers=2, bytesperline=2624, sizeimage=1.8MiB 38 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: STREAM:output:mplane: Opened 2 buffers. Memory used: 0.0 MiB 39 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: STREAM:capture:mplane: Using: 1312x736/JPEG, buffers=2, bytesperline=0, sizeimage=4.0MiB 40 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: STREAM:capture:mplane: Opened 2 buffers. Memory used: 8.0 MiB 41 | May 24 01:48:15 octopic sh[589]: device/v4l2/device.c: VIDEO: Device path=/dev/video11 fd=46 opened 42 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: VIDEO:output:mplane: Using: 1312x736/YUYV, buffers=2, bytesperline=2624, sizeimage=1.8MiB 43 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: VIDEO:output:mplane: Opened 2 buffers. Memory used: 0.0 MiB 44 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: VIDEO:capture:mplane: Using: 1312x736/H264, buffers=2, bytesperline=0, sizeimage=0.8MiB 45 | May 24 01:48:15 octopic sh[589]: device/buffer_list.c: VIDEO:capture:mplane: Opened 2 buffers. Memory used: 1.5 MiB 46 | May 24 01:48:15 octopic sh[589]: device/device.c: CAMERA: Setting frame interval_us=0 for FPS=15 47 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: SNAPSHOT: Configuring option compressionquality (009d0903) = 80 48 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: STREAM: Configuring option compressionquality (009d0903) = 80 49 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: VIDEO: Configuring option repeatsequenceheader (009909e2) = 1 50 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: VIDEO: Configuring option videobitratemode (009909ce) = 0 51 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: VIDEO: Configuring option videobitrate (009909cf) = 2000000 52 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: VIDEO: Configuring option repeatsequenceheader (009909e2) = 5000000 53 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: VIDEO: Configuring option h264iframeperiod (00990a66) = 30 54 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: VIDEO: Configuring option h264level (00990a67) = 11 55 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: VIDEO: Configuring option h264profile (00990a6b) = 4 56 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: VIDEO: Configuring option h264minimumqpvalue (00990a61) = 16 57 | May 24 01:48:15 octopic sh[589]: device/v4l2/device_options.c: VIDEO: Configuring option h264maximumqpvalue (00990a62) = 32 58 | May 24 01:48:15 octopic sh[589]: device/links.c: ?: Link 0: CAMERA:capture[1920x1080/YUYV/2] => [SNAPSHOT:output:mplane[1920x1056/YUYV/2], RESCALLER:STREAM:output:mplane[1920x1080/YUYV/2]] 59 | May 24 01:48:15 octopic sh[589]: device/links.c: ?: Link 1: SNAPSHOT:capture:mplane[1920x1056/JPEG/2] => [SNAPSHOT-CAPTURE] 60 | May 24 01:48:15 octopic sh[589]: device/links.c: ?: Link 2: RESCALLER:STREAM:capture:mplane[1312x736/YUYV/2] => [STREAM:output:mplane[1312x736/YUYV/2], VIDEO:output:mplane[1312x736/YUYV/2]] 61 | May 24 01:48:15 octopic sh[589]: device/links.c: ?: Link 3: STREAM:capture:mplane[1312x736/JPEG/2] => [STREAM-CAPTURE] 62 | May 24 01:48:15 octopic sh[589]: device/links.c: ?: Link 4: VIDEO:capture:mplane[1312x736/H264/2] => [VIDEO-CAPTURE] 63 | May 24 01:48:16 octopic sh[589]: device/buffer_list.c: CAMERA:capture: Streaming started... Was 0 of 2 enqueud 64 | May 24 01:48:16 octopic sh[589]: device/buffer_list.c: SNAPSHOT:output:mplane: Streaming started... Was 0 of 2 enqueud 65 | May 24 01:48:16 octopic sh[589]: device/buffer_list.c: RESCALLER:STREAM:output:mplane: Streaming started... Was 0 of 2 enqueud 66 | May 24 01:48:16 octopic sh[589]: device/buffer_list.c: SNAPSHOT:capture:mplane: Streaming started... Was 0 of 2 enqueud 67 | May 24 01:48:16 octopic sh[589]: device/buffer_list.c: RESCALLER:STREAM:capture:mplane: Streaming started... Was 0 of 2 enqueud 68 | May 24 01:48:16 octopic sh[589]: device/buffer_list.c: STREAM:output:mplane: Streaming started... Was 0 of 2 enqueud 69 | May 24 01:48:16 octopic sh[589]: device/buffer_list.c: VIDEO:output:mplane: Streaming started... Was 0 of 2 enqueud 70 | May 24 01:48:16 octopic sh[589]: device/buffer_list.c: STREAM:capture:mplane: Streaming started... Was 0 of 2 enqueud 71 | May 24 01:48:16 octopic sh[589]: device/buffer_list.c: VIDEO:capture:mplane: Streaming started... Was 0 of 2 enqueud 72 | May 24 12:16:11 octopic sh[589]: util/http/http.c: HTTP8080/2: Client connected 127.0.0.1 (fd=5). 73 | May 24 12:16:11 octopic sh[589]: util/http/http.c: HTTP8080/2: Request 'GET' '/' '' 74 | May 24 12:16:11 octopic sh[589]: util/http/http.c: HTTP8080/2: Client disconnected 127.0.0.1. 75 | -------------------------------------------------------------------------------- /translations/de/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # German translations for OctoPrint-PiSupport. 2 | # Copyright (C) 2020 The OctoPrint Project 3 | # This file is distributed under the same license as the 4 | # OctoPrint-PiSupport project. 5 | # FIRST AUTHOR , 2020. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: OctoPrint-PiSupport 2022.3.28\n" 10 | "Report-Msgid-Bugs-To: i18n@octoprint.org\n" 11 | "POT-Creation-Date: 2022-06-13 11:21+0200\n" 12 | "PO-Revision-Date: 2021-06-14 18:16+0200\n" 13 | "Last-Translator: \n" 14 | "Language: de\n" 15 | "Language-Team: de \n" 16 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=utf-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Generated-By: Babel 2.10.1\n" 21 | 22 | #: octoprint_pi_support/__init__.py:299 23 | msgid "Allows to check for the Pi's throttling status and environment info" 24 | msgstr "" 25 | "Erlaubt die Abfrage des Throttlestatus und der Umgebungsinformationen des" 26 | " Raspberry Pis" 27 | 28 | #: octoprint_pi_support/__init__.py:372 29 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:1 30 | msgid "Pi Support" 31 | msgstr "Pi Support" 32 | 33 | #: octoprint_pi_support/__init__.py:545 34 | msgid "" 35 | "Without this plugin OctoPrint will no longer be able to provide " 36 | "additional information about your Pi, which will make it more tricky to " 37 | "help you if you need support." 38 | msgstr "" 39 | "Ohne dieses Plugin kann OctoPrint nicht mehr zusätzliche Informationen " 40 | "über deinen Pi Instanz zur Verfügung stellen, was es ggf. schwieriger " 41 | "macht, dir zu helfen, falls du Support brauchst." 42 | 43 | #: octoprint_pi_support/static/js/pi_support.js:38 44 | msgid "" 45 | "OctoPrint does not and never has supported the RPi Zero or Zero W. Use at" 46 | " least a Raspberry Pi 3 or Zero 2, or risk bad performance and failed " 47 | "prints." 48 | msgstr "" 49 | "OctoPrint hat noch nie den RPi Zero oder Zero W unterstützt. Verwende " 50 | "mindestens einen Raspberry Pi 3 oder Zero 2, oder riskiere schlechte " 51 | "Performance und fehlgeschlagene Druckaufträge." 52 | 53 | #: octoprint_pi_support/static/js/pi_support.js:43 54 | #: octoprint_pi_support/static/js/pi_support.js:104 55 | #: octoprint_pi_support/static/js/pi_support.js:139 56 | #, python-format 57 | msgid "You can read more in the FAQ." 58 | msgstr "" 59 | "Du kannst mehr dazu in der FAQ " 60 | "lesen." 61 | 62 | #: octoprint_pi_support/static/js/pi_support.js:47 63 | #, fuzzy 64 | msgid "" 65 | "You can disable this message via Settings > Pi Support > Disable warning " 66 | "about unsupported hardware" 67 | msgstr "" 68 | "Du kannst diese Nachricht deaktiveren über Einstellungen > Pi Support > " 69 | "Ignoriere Warnung über nicht unterstützte Hardware" 70 | 71 | #: octoprint_pi_support/static/js/pi_support.js:54 72 | msgid "Unsupported hardware detected" 73 | msgstr "Nicht unterstützte Hardware erkannt" 74 | 75 | #: octoprint_pi_support/static/js/pi_support.js:77 76 | msgid "" 77 | "OctoPrint cannot check for throttling situations reported by your Pi. " 78 | "vcgencmd doesn't work as expected. Make sure the system user" 79 | " OctoPrint is running under is a member of the \"video\" group." 80 | msgstr "" 81 | 82 | #: octoprint_pi_support/static/js/pi_support.js:86 83 | msgid "Cannot check for throttling" 84 | msgstr "" 85 | 86 | #: octoprint_pi_support/static/js/pi_support.js:99 87 | msgid "" 88 | "Your Raspberry Pi is reporting insufficient power. Switch to an adequate " 89 | "power supply or risk bad performance and failed prints." 90 | msgstr "" 91 | "Dein Raspberry Pi meldet eine zu niedrige Spannung. Wechsle auf ein " 92 | "ausreichendes Netzteil, oder riskiere schlechte Performance und " 93 | "fehlgeschlagene Druckaufträge." 94 | 95 | #: octoprint_pi_support/static/js/pi_support.js:111 96 | msgid "Undervoltage detected" 97 | msgstr "Zu niedrige Spannung" 98 | 99 | #: octoprint_pi_support/static/js/pi_support.js:134 100 | msgid "" 101 | "The default password for the system user \"pi\" has not been changed. " 102 | "This is a security risk - please login to your Pi via SSH and change the " 103 | "password." 104 | msgstr "" 105 | "Das Standardpasswort des Systemnutzers \"pi\" wurde nicht geändert. Das " 106 | "ist ein Sicherheitsrisiko - bitte melde dich bei deinem Pi über SSH an " 107 | "und ändere das Passwort." 108 | 109 | #: octoprint_pi_support/static/js/pi_support.js:143 110 | msgid "" 111 | "You can disable this message via Settings > Pi Support > Disable warning " 112 | "about default system password" 113 | msgstr "" 114 | "Du kannst diese Nachricht deaktiveren über Einstellungen > Pi Support > " 115 | "Ignoriere Warnung über Standardsystempasswort" 116 | 117 | #: octoprint_pi_support/static/js/pi_support.js:150 118 | msgid "Default system password not changed" 119 | msgstr "Standardsystempasswort nicht geändert" 120 | 121 | #: octoprint_pi_support/static/js/pi_support.js:176 122 | msgid "OctoPi" 123 | msgstr "OctoPi" 124 | 125 | #: octoprint_pi_support/static/js/pi_support.js:199 126 | msgid "" 127 | "Make sure your power supply and cabling are providing enough power to the" 128 | " Pi." 129 | msgstr "" 130 | "Stelle sicher, dass dein Netzteil und die Verkabelung dem Pi genug Strom " 131 | "liefern." 132 | 133 | #: octoprint_pi_support/static/js/pi_support.js:205 134 | msgid "Frequency capping due to overheating. Improve cooling of the CPU and GPU." 135 | msgstr "" 136 | "Heruntertaktung aufgrund von Überhitzung. Verbessere die Kühlung von CPU " 137 | "und GPU." 138 | 139 | #: octoprint_pi_support/static/js/pi_support.js:211 140 | msgid "Current issues:" 141 | msgstr "Aktuelle Probleme:" 142 | 143 | #: octoprint_pi_support/static/js/pi_support.js:214 144 | msgid "The following issues are being observed right now:" 145 | msgstr "Die folgenden Probleme werden gerade jetzt gemeldet:" 146 | 147 | #: octoprint_pi_support/static/js/pi_support.js:232 148 | msgid "Issues since boot:" 149 | msgstr "Probleme seit dem Bootvorgang:" 150 | 151 | #: octoprint_pi_support/static/js/pi_support.js:235 152 | msgid "The following issues have been observed since the Pi was booted:" 153 | msgstr "" 154 | "Die folgenden Probleme wurde seit dem letzten Bootvorgang des Pis " 155 | "gemeldet:" 156 | 157 | #: octoprint_pi_support/static/js/pi_support.js:249 158 | msgid "Click the navbar icon for more information." 159 | msgstr "Klick für weitere Informationen auf das Symbol in der Navbar." 160 | 161 | #: octoprint_pi_support/static/js/pi_support.js:279 162 | msgid "Undervoltage detected, print anyway?" 163 | msgstr "Zu niedrige Spannung erkannt, trotzdem drucken?" 164 | 165 | #: octoprint_pi_support/static/js/pi_support.js:281 166 | msgid "" 167 | "Your Pi is reporting undervoltage. It is not recommended to start a print" 168 | " job until an adequate power supply has been installed." 169 | msgstr "" 170 | "Dein Pi meldet eine zu niedrige Spannung. Es ist nicht empfohlen, einen " 171 | "Druckauftrag zu starten, bis ein ausreichendes Netzteil installiert ist." 172 | 173 | #: octoprint_pi_support/static/js/pi_support.js:285 174 | msgid "See also the FAQ" 175 | msgstr "Siehe also die FAQ" 176 | 177 | #: octoprint_pi_support/static/js/pi_support.js:287 178 | msgid "Start the print job anyway?" 179 | msgstr "Den Druck trotzdem starten?" 180 | 181 | #: octoprint_pi_support/static/js/pi_support.js:288 182 | msgid "No, don't print" 183 | msgstr "Nein, nicht drucken" 184 | 185 | #: octoprint_pi_support/static/js/pi_support.js:290 186 | msgid "Yes, print" 187 | msgstr "Ja, drucken" 188 | 189 | #: octoprint_pi_support/static/js/pi_support.js:291 190 | msgid "Yes, print & don't warn again" 191 | msgstr "Ja, drucken & nicht mehr warnen" 192 | 193 | #: octoprint_pi_support/templates/pi_support_about_octopi.jinja2:1 194 | msgid "About OctoPi" 195 | msgstr "Über OctoPi" 196 | 197 | #: octoprint_pi_support/templates/pi_support_navbar.jinja2:1 198 | msgid "What do the symbols mean?" 199 | msgstr "Was bedeuten die Symbole?" 200 | 201 | #: octoprint_pi_support/templates/pi_support_navbar.jinja2:2 202 | msgid "Undervoltage" 203 | msgstr "Zu niedrige Spannung" 204 | 205 | #: octoprint_pi_support/templates/pi_support_navbar.jinja2:3 206 | msgid "Overheat" 207 | msgstr "Überhitzung" 208 | 209 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:3 210 | msgid "Please restart OctoPrint after changing any of this plugin's settings." 211 | msgstr "" 212 | "Bitte starte OctoPrint neu, nachdem du die Einstellungen dieses Plugins " 213 | "geändert hast." 214 | 215 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:9 216 | msgid "Disable warning about unsupported hardware" 217 | msgstr "Ignoriere Warnung über nicht unterstützte Hardware" 218 | 219 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:9 220 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:18 221 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:28 222 | msgid "Warning" 223 | msgstr "Warnung" 224 | 225 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:11 226 | msgid "" 227 | "If you check this, you will no longer get warned if you run OctoPrint on " 228 | "Raspberry Pi models that are not officially supported due to bad " 229 | "performance that can lead to failed prints. Do so at your own risk." 230 | msgstr "" 231 | "Falls du das aktivierst, wird dich OctoPrint nicht mehr davor warnen, " 232 | "wenn du es auf Raspberry Pi Modellen laufen lässt, die aufgrund bekannter" 233 | " Probleme mit Performance und fehlgeschlagenen Druckaufträgen nicht " 234 | "offiziell unterstützt werden. Du tust dies auf deine eigene " 235 | "Verantwortung." 236 | 237 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:18 238 | msgid "Disable warning about default system password" 239 | msgstr "Ignoriere Warnung über Standardsystempasswort" 240 | 241 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:20 242 | msgid "" 243 | "If you check this, you will no longer get warned if you still have the " 244 | "default password set on your \"pi\" system user. This is a security risk." 245 | msgstr "" 246 | 247 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:28 248 | msgid "Disable warning about undervoltage on print start" 249 | msgstr "Ignoriere Warnung über zu niedrige Spannung beim Druckstart" 250 | 251 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:30 252 | msgid "" 253 | "If you check this, you will no longer get warned when starting prints " 254 | "during observed undervoltage issues. Do so at your own risk." 255 | msgstr "" 256 | "Wenn du das aktivierst, wird OctoPrint dich nicht mehr warnen, wenn du " 257 | "einen Druckjob startest während dein Pi zu niedrige Spannung meldet. Du " 258 | "tust dies auf deine eigene Verantwortung." 259 | 260 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:38 261 | msgid "" 262 | "Enable under voltage and overheat detection via vcgencmd " 263 | "get_throttled" 264 | msgstr "" 265 | "Erkennung zu niedriger Spannung und Überhitzung via vcgencmd " 266 | "get_throttled einschalten" 267 | 268 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:40 269 | msgid "" 270 | "This will regularly check with the Pi if something is amiss either with " 271 | "power regulation or CPU/GPU temperature. Disable at your own risk. You " 272 | "will have to re-enable this when getting assistance on the forums or " 273 | "Discord. Changes require a restart of OctoPrint." 274 | msgstr "" 275 | "Es wird regelmäßig geprüft, ob etwas mit der Spannungsversorgung oder der " 276 | "CPU/GPU Temperatur des Pis nicht stimmt. Deaktivere dies auf deine eigene " 277 | "Verantwortung. Du wirst es reaktivieren müssen, wenn du Hilfe im Forum " 278 | "oder auf Discord erbittest. Änderungen erfordern einen Neustart von " 279 | "OctoPrint." 280 | 281 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:45 282 | msgid "Advanced options" 283 | msgstr "Erweiterte Optionen" 284 | 285 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:49 286 | msgid "Command for under voltage/overheat detection" 287 | msgstr "Befehl für Spannungs-/Überhitzungserkennung" 288 | 289 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:52 290 | msgid "" 291 | "Defaults to /usr/bin/vcgencmd get_throttled. You usually " 292 | "shouldn't have to change this." 293 | msgstr "" 294 | "Standardeinstellung ist /usr/bin/vcgencmd get_throttled. Du " 295 | "solltest das gewöhnlich nicht ändern müssen." 296 | -------------------------------------------------------------------------------- /octoprint_pi_support/translations/de/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # German translations for OctoPrint-PiSupport. 2 | # Copyright (C) 2020 The OctoPrint Project 3 | # This file is distributed under the same license as the 4 | # OctoPrint-PiSupport project. 5 | # FIRST AUTHOR , 2020. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: OctoPrint-PiSupport 2022.3.28\n" 10 | "Report-Msgid-Bugs-To: i18n@octoprint.org\n" 11 | "POT-Creation-Date: 2022-06-13 11:21+0200\n" 12 | "PO-Revision-Date: 2021-06-14 18:16+0200\n" 13 | "Last-Translator: \n" 14 | "Language: de\n" 15 | "Language-Team: de \n" 16 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=utf-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Generated-By: Babel 2.10.1\n" 21 | 22 | #: octoprint_pi_support/__init__.py:299 23 | msgid "Allows to check for the Pi's throttling status and environment info" 24 | msgstr "" 25 | "Erlaubt die Abfrage des Throttlestatus und der Umgebungsinformationen des" 26 | " Raspberry Pis" 27 | 28 | #: octoprint_pi_support/__init__.py:372 29 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:1 30 | msgid "Pi Support" 31 | msgstr "Pi Support" 32 | 33 | #: octoprint_pi_support/__init__.py:545 34 | msgid "" 35 | "Without this plugin OctoPrint will no longer be able to provide " 36 | "additional information about your Pi, which will make it more tricky to " 37 | "help you if you need support." 38 | msgstr "" 39 | "Ohne dieses Plugin kann OctoPrint nicht mehr zusätzliche Informationen " 40 | "über deinen Pi Instanz zur Verfügung stellen, was es ggf. schwieriger " 41 | "macht, dir zu helfen, falls du Support brauchst." 42 | 43 | #: octoprint_pi_support/static/js/pi_support.js:38 44 | msgid "" 45 | "OctoPrint does not and never has supported the RPi Zero or Zero W. Use at" 46 | " least a Raspberry Pi 3 or Zero 2, or risk bad performance and failed " 47 | "prints." 48 | msgstr "" 49 | "OctoPrint hat noch nie den RPi Zero oder Zero W unterstützt. Verwende " 50 | "mindestens einen Raspberry Pi 3 oder Zero 2, oder riskiere schlechte " 51 | "Performance und fehlgeschlagene Druckaufträge." 52 | 53 | #: octoprint_pi_support/static/js/pi_support.js:43 54 | #: octoprint_pi_support/static/js/pi_support.js:104 55 | #: octoprint_pi_support/static/js/pi_support.js:139 56 | #, python-format 57 | msgid "You can read more in the FAQ." 58 | msgstr "" 59 | "Du kannst mehr dazu in der FAQ " 60 | "lesen." 61 | 62 | #: octoprint_pi_support/static/js/pi_support.js:47 63 | #, fuzzy 64 | msgid "" 65 | "You can disable this message via Settings > Pi Support > Disable warning " 66 | "about unsupported hardware" 67 | msgstr "" 68 | "Du kannst diese Nachricht deaktiveren über Einstellungen > Pi Support > " 69 | "Ignoriere Warnung über nicht unterstützte Hardware" 70 | 71 | #: octoprint_pi_support/static/js/pi_support.js:54 72 | msgid "Unsupported hardware detected" 73 | msgstr "Nicht unterstützte Hardware erkannt" 74 | 75 | #: octoprint_pi_support/static/js/pi_support.js:77 76 | msgid "" 77 | "OctoPrint cannot check for throttling situations reported by your Pi. " 78 | "vcgencmd doesn't work as expected. Make sure the system user" 79 | " OctoPrint is running under is a member of the \"video\" group." 80 | msgstr "" 81 | 82 | #: octoprint_pi_support/static/js/pi_support.js:86 83 | msgid "Cannot check for throttling" 84 | msgstr "" 85 | 86 | #: octoprint_pi_support/static/js/pi_support.js:99 87 | msgid "" 88 | "Your Raspberry Pi is reporting insufficient power. Switch to an adequate " 89 | "power supply or risk bad performance and failed prints." 90 | msgstr "" 91 | "Dein Raspberry Pi meldet eine zu niedrige Spannung. Wechsle auf ein " 92 | "ausreichendes Netzteil, oder riskiere schlechte Performance und " 93 | "fehlgeschlagene Druckaufträge." 94 | 95 | #: octoprint_pi_support/static/js/pi_support.js:111 96 | msgid "Undervoltage detected" 97 | msgstr "Zu niedrige Spannung" 98 | 99 | #: octoprint_pi_support/static/js/pi_support.js:134 100 | msgid "" 101 | "The default password for the system user \"pi\" has not been changed. " 102 | "This is a security risk - please login to your Pi via SSH and change the " 103 | "password." 104 | msgstr "" 105 | "Das Standardpasswort des Systemnutzers \"pi\" wurde nicht geändert. Das " 106 | "ist ein Sicherheitsrisiko - bitte melde dich bei deinem Pi über SSH an " 107 | "und ändere das Passwort." 108 | 109 | #: octoprint_pi_support/static/js/pi_support.js:143 110 | msgid "" 111 | "You can disable this message via Settings > Pi Support > Disable warning " 112 | "about default system password" 113 | msgstr "" 114 | "Du kannst diese Nachricht deaktiveren über Einstellungen > Pi Support > " 115 | "Ignoriere Warnung über Standardsystempasswort" 116 | 117 | #: octoprint_pi_support/static/js/pi_support.js:150 118 | msgid "Default system password not changed" 119 | msgstr "Standardsystempasswort nicht geändert" 120 | 121 | #: octoprint_pi_support/static/js/pi_support.js:176 122 | msgid "OctoPi" 123 | msgstr "OctoPi" 124 | 125 | #: octoprint_pi_support/static/js/pi_support.js:199 126 | msgid "" 127 | "Make sure your power supply and cabling are providing enough power to the" 128 | " Pi." 129 | msgstr "" 130 | "Stelle sicher, dass dein Netzteil und die Verkabelung dem Pi genug Strom " 131 | "liefern." 132 | 133 | #: octoprint_pi_support/static/js/pi_support.js:205 134 | msgid "Frequency capping due to overheating. Improve cooling of the CPU and GPU." 135 | msgstr "" 136 | "Heruntertaktung aufgrund von Überhitzung. Verbessere die Kühlung von CPU " 137 | "und GPU." 138 | 139 | #: octoprint_pi_support/static/js/pi_support.js:211 140 | msgid "Current issues:" 141 | msgstr "Aktuelle Probleme:" 142 | 143 | #: octoprint_pi_support/static/js/pi_support.js:214 144 | msgid "The following issues are being observed right now:" 145 | msgstr "Die folgenden Probleme werden gerade jetzt gemeldet:" 146 | 147 | #: octoprint_pi_support/static/js/pi_support.js:232 148 | msgid "Issues since boot:" 149 | msgstr "Probleme seit dem Bootvorgang:" 150 | 151 | #: octoprint_pi_support/static/js/pi_support.js:235 152 | msgid "The following issues have been observed since the Pi was booted:" 153 | msgstr "" 154 | "Die folgenden Probleme wurde seit dem letzten Bootvorgang des Pis " 155 | "gemeldet:" 156 | 157 | #: octoprint_pi_support/static/js/pi_support.js:249 158 | msgid "Click the navbar icon for more information." 159 | msgstr "Klick für weitere Informationen auf das Symbol in der Navbar." 160 | 161 | #: octoprint_pi_support/static/js/pi_support.js:279 162 | msgid "Undervoltage detected, print anyway?" 163 | msgstr "Zu niedrige Spannung erkannt, trotzdem drucken?" 164 | 165 | #: octoprint_pi_support/static/js/pi_support.js:281 166 | msgid "" 167 | "Your Pi is reporting undervoltage. It is not recommended to start a print" 168 | " job until an adequate power supply has been installed." 169 | msgstr "" 170 | "Dein Pi meldet eine zu niedrige Spannung. Es ist nicht empfohlen, einen " 171 | "Druckauftrag zu starten, bis ein ausreichendes Netzteil installiert ist." 172 | 173 | #: octoprint_pi_support/static/js/pi_support.js:285 174 | msgid "See also the FAQ" 175 | msgstr "Siehe also die FAQ" 176 | 177 | #: octoprint_pi_support/static/js/pi_support.js:287 178 | msgid "Start the print job anyway?" 179 | msgstr "Den Druck trotzdem starten?" 180 | 181 | #: octoprint_pi_support/static/js/pi_support.js:288 182 | msgid "No, don't print" 183 | msgstr "Nein, nicht drucken" 184 | 185 | #: octoprint_pi_support/static/js/pi_support.js:290 186 | msgid "Yes, print" 187 | msgstr "Ja, drucken" 188 | 189 | #: octoprint_pi_support/static/js/pi_support.js:291 190 | msgid "Yes, print & don't warn again" 191 | msgstr "Ja, drucken & nicht mehr warnen" 192 | 193 | #: octoprint_pi_support/templates/pi_support_about_octopi.jinja2:1 194 | msgid "About OctoPi" 195 | msgstr "Über OctoPi" 196 | 197 | #: octoprint_pi_support/templates/pi_support_navbar.jinja2:1 198 | msgid "What do the symbols mean?" 199 | msgstr "Was bedeuten die Symbole?" 200 | 201 | #: octoprint_pi_support/templates/pi_support_navbar.jinja2:2 202 | msgid "Undervoltage" 203 | msgstr "Zu niedrige Spannung" 204 | 205 | #: octoprint_pi_support/templates/pi_support_navbar.jinja2:3 206 | msgid "Overheat" 207 | msgstr "Überhitzung" 208 | 209 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:3 210 | msgid "Please restart OctoPrint after changing any of this plugin's settings." 211 | msgstr "" 212 | "Bitte starte OctoPrint neu, nachdem du die Einstellungen dieses Plugins " 213 | "geändert hast." 214 | 215 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:9 216 | msgid "Disable warning about unsupported hardware" 217 | msgstr "Ignoriere Warnung über nicht unterstützte Hardware" 218 | 219 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:9 220 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:18 221 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:28 222 | msgid "Warning" 223 | msgstr "Warnung" 224 | 225 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:11 226 | msgid "" 227 | "If you check this, you will no longer get warned if you run OctoPrint on " 228 | "Raspberry Pi models that are not officially supported due to bad " 229 | "performance that can lead to failed prints. Do so at your own risk." 230 | msgstr "" 231 | "Falls du das aktivierst, wird dich OctoPrint nicht mehr davor warnen, " 232 | "wenn du es auf Raspberry Pi Modellen laufen lässt, die aufgrund bekannter" 233 | " Probleme mit Performance und fehlgeschlagenen Druckaufträgen nicht " 234 | "offiziell unterstützt werden. Du tust dies auf deine eigene " 235 | "Verantwortung." 236 | 237 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:18 238 | msgid "Disable warning about default system password" 239 | msgstr "Ignoriere Warnung über Standardsystempasswort" 240 | 241 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:20 242 | msgid "" 243 | "If you check this, you will no longer get warned if you still have the " 244 | "default password set on your \"pi\" system user. This is a security risk." 245 | msgstr "" 246 | 247 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:28 248 | msgid "Disable warning about undervoltage on print start" 249 | msgstr "Ignoriere Warnung über zu niedrige Spannung beim Druckstart" 250 | 251 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:30 252 | msgid "" 253 | "If you check this, you will no longer get warned when starting prints " 254 | "during observed undervoltage issues. Do so at your own risk." 255 | msgstr "" 256 | "Wenn du das aktivierst, wird OctoPrint dich nicht mehr warnen, wenn du " 257 | "einen Druckjob startest während dein Pi zu niedrige Spannung meldet. Du " 258 | "tust dies auf deine eigene Verantwortung." 259 | 260 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:38 261 | msgid "" 262 | "Enable under voltage and overheat detection via vcgencmd " 263 | "get_throttled" 264 | msgstr "" 265 | "Erkennung zu niedriger Spannung und Überhitzung via vcgencmd " 266 | "get_throttled einschalten" 267 | 268 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:40 269 | msgid "" 270 | "This will regularly check with the Pi if something is amiss either with " 271 | "power regulation or CPU/GPU temperature. Disable at your own risk. You " 272 | "will have to re-enable this when getting assistance on the forums or " 273 | "Discord. Changes require a restart of OctoPrint." 274 | msgstr "" 275 | "Es wird regelmäßig geprüft, ob etwas mit der Spannungsversorgung oder der " 276 | "CPU/GPU Temperatur des Pis nicht stimmt. Deaktivere dies auf deine eigene " 277 | "Verantwortung. Du wirst es reaktivieren müssen, wenn du Hilfe im Forum " 278 | "oder auf Discord erbittest. Änderungen erfordern einen Neustart von " 279 | "OctoPrint." 280 | 281 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:45 282 | msgid "Advanced options" 283 | msgstr "Erweiterte Optionen" 284 | 285 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:49 286 | msgid "Command for under voltage/overheat detection" 287 | msgstr "Befehl für Spannungs-/Überhitzungserkennung" 288 | 289 | #: octoprint_pi_support/templates/pi_support_settings.jinja2:52 290 | msgid "" 291 | "Defaults to /usr/bin/vcgencmd get_throttled. You usually " 292 | "shouldn't have to change this." 293 | msgstr "" 294 | "Standardeinstellung ist /usr/bin/vcgencmd get_throttled. Du " 295 | "solltest das gewöhnlich nicht ändern müssen." 296 | -------------------------------------------------------------------------------- /octoprint_pi_support/static/js/pi_support.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | function PiSupportViewModel(parameters) { 3 | var self = this; 4 | 5 | const UNDERVOLTAGE_TITLE = gettext("Undervoltage detected"); 6 | const UNDERVOLTAGE_WARNING = gettext( 7 | "Your Raspberry Pi is reporting insufficient power. " + 8 | "Switch to an adequate power supply or risk bad " + 9 | "performance and failed prints." 10 | ); 11 | const UNDERVOLTAGE_FAQ = "https://faq.octoprint.org/pi-issues"; 12 | 13 | const ZERO_TITLE = gettext("Unsupported hardware detected"); 14 | const ZERO_WARNING = gettext( 15 | "OctoPrint does not and never has supported the " + 16 | "RPi Zero or Zero W. Use at least a Raspberry Pi 3 or Zero 2, or " + 17 | "risk bad performance and failed prints." 18 | ); 19 | const ZERO_DISABLE = gettext( 20 | "You can disable this message via Settings > " + 21 | "Pi Support > Disable warning about unsupported hardware" 22 | ); 23 | const ZERO_FAQ = "https://faq.octoprint.org/recommended-hardware"; 24 | 25 | const PASSWORD_TITLE = gettext("Default system password not changed"); 26 | const PASSWORD_WARNING = gettext( 27 | 'The default password for the system user "pi" has not ' + 28 | "been changed. This is a security risk - please login to " + 29 | "your Pi via SSH and change the password." 30 | ); 31 | const PASSWORD_DISABLE = gettext( 32 | "You can disable this message via Settings > " + 33 | "Pi Support > Disable warning about default system password" 34 | ); 35 | const PASSWORD_FAQ = "https://faq.octoprint.org/pi-default-password"; 36 | 37 | const FAQ = gettext( 38 | 'You can read more in the FAQ.' 39 | ); 40 | 41 | const generateHtml = (warning, faq, disable) => { 42 | const html = 43 | "

" + 44 | warning + 45 | "

" + 46 | _.sprintf(FAQ, { 47 | url: faq 48 | }) + 49 | "

"; 50 | 51 | if (disable) { 52 | return html + "

" + disable + "

"; 53 | } else { 54 | return html; 55 | } 56 | }; 57 | 58 | self.loginState = parameters[0]; 59 | self.access = parameters[1]; 60 | self.settings = parameters[2]; 61 | 62 | self.model = ko.observable(); 63 | 64 | self.currentUndervoltage = ko.observable(false); 65 | self.currentOverheat = ko.observable(false); 66 | self.pastUndervoltage = ko.observable(false); 67 | self.pastOverheat = ko.observable(false); 68 | self.currentIssue = ko.observable(false); 69 | self.pastIssue = ko.observable(false); 70 | 71 | self.notifications = {}; 72 | 73 | self.requestData = function () { 74 | if ( 75 | !self.loginState.hasPermission( 76 | self.access.permissions.PLUGIN_PI_SUPPORT_STATUS 77 | ) 78 | ) { 79 | return; 80 | } 81 | 82 | OctoPrint.plugins.pi_support.get().done(function (response) { 83 | // Raspberry Pi model 84 | self.model(response.model); 85 | 86 | // Unrecommended model 87 | if ( 88 | response.model_unrecommended && 89 | !self.settings.settings.plugins.pi_support.ignore_unrecommended_model() 90 | ) { 91 | if (self.notifications.unrecommended === undefined) { 92 | self.notifications.unrecommended = new PNotify({ 93 | title: ZERO_TITLE, 94 | text: generateHtml(ZERO_WARNING, ZERO_FAQ, ZERO_DISABLE), 95 | type: "error", 96 | hide: false 97 | }); 98 | } 99 | } else if (self.notifications.unrecommended !== undefined) { 100 | self.notifications.unrecommended.remove(); 101 | self.notifications.unrecommended = undefined; 102 | } 103 | 104 | // Throttle functional 105 | if (!response.throttle_functional) { 106 | var warning = gettext( 107 | "OctoPrint cannot check for throttling situations " + 108 | "reported by your Pi. vcgencmd doesn't work as expected. Make " + 109 | "sure the system user OctoPrint is running under is a member of " + 110 | 'the "video" group.' 111 | ); 112 | 113 | if (self.notifications.vcgencmd_broken === undefined) { 114 | self.notifications.vcgencmd_broken = new PNotify({ 115 | title: gettext("Cannot check for throttling"), 116 | text: "

" + warning + "

", 117 | hide: false 118 | }); 119 | } 120 | } else if (self.notifications.vcgencmd_broken !== undefined) { 121 | self.notifications.vcgencmd_broken.remove(); 122 | self.notifications.vcgencmd_broken = undefined; 123 | } 124 | 125 | // Throttle state 126 | self.fromThrottleState(response.throttle_state); 127 | if (self.currentUndervoltage() || self.pastUndervoltage()) { 128 | if (self.notifications.throttled === undefined) { 129 | self.notifications.throttled = new PNotify({ 130 | title: UNDERVOLTAGE_TITLE, 131 | text: generateHtml(UNDERVOLTAGE_WARNING, UNDERVOLTAGE_FAQ), 132 | type: "error", 133 | hide: false 134 | }); 135 | } 136 | } else if (self.notifications.throttled !== undefined) { 137 | self.notifications.throttled.remove(); 138 | self.notifications.throttled = undefined; 139 | } 140 | 141 | // SSH warn 142 | if ( 143 | response.default_password && 144 | !self.settings.settings.plugins.pi_support.ignore_default_password() 145 | ) { 146 | if (self.notifications.default_password === undefined) { 147 | self.notifications.default_password = new PNotify({ 148 | title: PASSWORD_TITLE, 149 | text: generateHtml( 150 | PASSWORD_WARNING, 151 | PASSWORD_FAQ, 152 | PASSWORD_DISABLE 153 | ), 154 | hide: false 155 | }); 156 | } 157 | } else if (self.notifications.default_password !== undefined) { 158 | self.notifications.default_password.remove(); 159 | self.notifications.default_password = undefined; 160 | } 161 | 162 | // OctoPi version 163 | $("#pi_support_footer").remove(); 164 | if (!response.octopi_version) return; 165 | 166 | if (response.octopiuptodate_build_short) { 167 | let cam_suffix = 168 | response.octopi_camera_stack == "camera-streamer" ? "cam" : ""; 169 | var octoPiVersion = $( 170 | "" 180 | ); 181 | $("#footer_version").append(octoPiVersion); 182 | } else { 183 | var octoPiVersion = $( 184 | "" 190 | ); 191 | $("#footer_version").append(octoPiVersion); 192 | } 193 | }); 194 | }; 195 | 196 | self.fromThrottleState = function (state) { 197 | self.currentUndervoltage(state.current_undervoltage); 198 | self.pastUndervoltage(state.past_undervoltage); 199 | self.currentOverheat(state.current_overheat); 200 | self.pastOverheat(state.past_overheat); 201 | self.currentIssue(state.current_issue); 202 | self.pastIssue(state.past_issue); 203 | }; 204 | 205 | self.popoverContent = ko.pureComputed(function () { 206 | var content = ""; 207 | var undervoltageParagraph = 208 | '

Undervoltage: ' + 209 | gettext( 210 | "Make sure your power supply and cabling are providing enough power to the Pi." 211 | ) + 212 | "

"; 213 | var overheatParagraph = 214 | '

Overheating: ' + 215 | gettext( 216 | "Frequency capping due to overheating. Improve cooling of the CPU and GPU." 217 | ) + 218 | "

"; 219 | 220 | if (self.currentIssue()) { 221 | content += "

" + gettext("Current issues:") + "

"; 222 | content += 223 | "

" + 224 | gettext( 225 | "The following issues are being observed right now:" 226 | ) + 227 | "

"; 228 | if (self.currentUndervoltage()) { 229 | content += undervoltageParagraph; 230 | } 231 | if (self.currentOverheat()) { 232 | content += overheatParagraph; 233 | } 234 | } 235 | 236 | if (self.currentIssue() && self.pastIssue()) { 237 | content += "
"; 238 | } 239 | 240 | if (self.pastIssue()) { 241 | content += 242 | "

" + gettext("Issues since boot:") + "

"; 243 | content += 244 | "

" + 245 | gettext( 246 | "The following issues have been observed since the Pi was booted:" 247 | ) + 248 | "

"; 249 | if (self.pastUndervoltage() && !self.currentUndervoltage()) { 250 | content += undervoltageParagraph; 251 | } 252 | if (self.pastOverheat() && !self.currentOverheat()) { 253 | content += overheatParagraph; 254 | } 255 | } 256 | 257 | content += 258 | "

" + 259 | gettext("Click the navbar icon for more information.") + 260 | "

"; 261 | 262 | return content; 263 | }); 264 | 265 | self.onStartup = 266 | self.onServerReconnect = 267 | self.onUserLoggedIn = 268 | self.onUserLoggedOut = 269 | function () { 270 | self.requestData(); 271 | }; 272 | 273 | self.onDataUpdaterPluginMessage = function (plugin, data) { 274 | if (plugin !== "pi_support") return; 275 | if (!data.hasOwnProperty("state") || !data.hasOwnProperty("type")) return; 276 | if (data.type !== "throttle_state") return; 277 | if ( 278 | !self.loginState.hasPermission( 279 | self.access.permissions.PLUGIN_PI_SUPPORT_STATUS 280 | ) 281 | ) 282 | return; 283 | 284 | self.fromThrottleState(data.state); 285 | }; 286 | 287 | self.onBeforePrintStart = function (callback) { 288 | if ( 289 | !self.settings.settings.plugins.pi_support.ignore_undervoltage_on_printstart() && 290 | (self.currentUndervoltage() || self.pastUndervoltage()) 291 | ) { 292 | showConfirmationDialog({ 293 | title: gettext("Undervoltage detected, print anyway?"), 294 | message: 295 | gettext( 296 | "Your Pi is reporting undervoltage. It is not recommended to start a print job until an adequate power supply has been installed." 297 | ) + 298 | " " + 299 | gettext("See also the FAQ") + 300 | ".", 301 | question: gettext("Start the print job anyway?"), 302 | cancel: gettext("No, don't print"), 303 | proceed: [ 304 | gettext("Yes, print"), 305 | gettext("Yes, print & don't warn again") 306 | ], 307 | onproceed: function (idx) { 308 | if (idx === 1) { 309 | self.settings.settings.plugins.pi_support.ignore_undervoltage_on_printstart( 310 | true 311 | ); 312 | self.settings.saveData(); 313 | } 314 | callback(); 315 | }, 316 | nofade: true 317 | }); 318 | return false; 319 | } 320 | }; 321 | 322 | self.getAdditionalHealthCheckHandlers = function () { 323 | return { 324 | pi_undervoltage: (result, context) => { 325 | return { 326 | title: UNDERVOLTAGE_TITLE, 327 | html: generateHtml(UNDERVOLTAGE_WARNING, UNDERVOLTAGE_FAQ), 328 | result: result 329 | }; 330 | }, 331 | pi_unsupported: (result, context) => { 332 | return { 333 | title: ZERO_TITLE, 334 | html: generateHtml(ZERO_WARNING, ZERO_FAQ), 335 | result: result 336 | }; 337 | }, 338 | pi_default_password: (result, context) => { 339 | return { 340 | title: PASSWORD_TITLE, 341 | html: generateHtml(PASSWORD_WARNING, PASSWORD_FAQ), 342 | result: result 343 | }; 344 | } 345 | }; 346 | }; 347 | } 348 | 349 | OCTOPRINT_VIEWMODELS.push({ 350 | construct: PiSupportViewModel, 351 | elements: ["#navbar_plugin_pi_support"], 352 | dependencies: ["loginStateViewModel", "accessViewModel", "settingsViewModel"] 353 | }); 354 | }); 355 | -------------------------------------------------------------------------------- /octoprint_pi_support/__init__.py: -------------------------------------------------------------------------------- 1 | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" 2 | __copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License" 3 | 4 | import os 5 | from getpass import getuser 6 | 7 | import flask 8 | import octoprint.events 9 | import octoprint.plugin 10 | import sarge 11 | from flask_babel import gettext 12 | from octoprint.access.groups import USER_GROUP 13 | from octoprint.access.permissions import Permissions 14 | from octoprint.util import RepeatedTimer 15 | from octoprint.util.platform import CLOSE_FDS 16 | 17 | _PROC_DT_MODEL_PATH = "/proc/device-tree/model" 18 | _OCTOPI_VERSION_PATH = "/etc/octopi_version" 19 | _OCTOPIUPTODATE_BUILD_PATH = "/etc/octopiuptodate_build" 20 | _NEW_CAMERA_STACK_PATH = "/etc/systemd/system/camera-streamer-usb@.service" 21 | _VCGENCMD_THROTTLE = "/usr/bin/vcgencmd get_throttled" 22 | _SSHWARN_PATH = "/run/sshwarn" 23 | 24 | _CHECK_INTERVAL_OK = 300 25 | _CHECK_INTERVAL_THROTTLED = 30 26 | 27 | 28 | def _gather_new_camerastack_files(): 29 | import logging 30 | 31 | files = {} 32 | 33 | try: 34 | os.system( 35 | "journalctl --boot -u 'camera-streamer*' > /tmp/camerastack-journal.log" 36 | ) 37 | files["camerastack-journal.log"] = "/tmp/camerastack-journal.log" 38 | except Exception: 39 | logging.getLogger(__name__).exception( 40 | "Failed to create camerastack-journal.log file" 41 | ) 42 | 43 | try: 44 | os.system( 45 | "/usr/bin/libcamera-hello --list-cameras > /tmp/camerastack-libcamera.log" 46 | ) 47 | files["camerastack-libcamera.log"] = "/tmp/camerastack-libcamera.log" 48 | except Exception: 49 | logging.getLogger(__name__).exception( 50 | "Failed to create camerastack-libcamera.log file" 51 | ) 52 | 53 | try: 54 | os.system("/usr/bin/list-usb-cameras > /tmp/camerastack-usb.log") 55 | files["camerastack-usb.log"] = "/tmp/camerastack-usb.log" 56 | except Exception: 57 | logging.getLogger(__name__).exception("Failed to create camerastack-usb.log file") 58 | 59 | return files 60 | 61 | 62 | __LOCAL_DEBUG = os.path.exists( 63 | os.path.realpath(os.path.join(os.path.dirname(__file__), "..", ".local_debug")) 64 | ) 65 | 66 | if __LOCAL_DEBUG: 67 | ### mocks & settings for local debugging 68 | base = os.path.realpath( 69 | os.path.join( 70 | os.path.dirname(__file__), 71 | "..", 72 | "tests", 73 | "fakes", 74 | ) 75 | ) 76 | debug = os.path.realpath( 77 | os.path.join(os.path.dirname(__file__), "..", ".local_debug") 78 | ) 79 | _PROC_DT_MODEL_PATH = os.path.join(base, "fake_model.txt") 80 | _OCTOPI_VERSION_PATH = os.path.join(base, "fake_octopi.txt") 81 | _OCTOPIUPTODATE_BUILD_PATH = os.path.join(base, "fake_octopiuptodate.txt") 82 | _NEW_CAMERA_STACK_PATH = os.path.join(debug, "new-camera-stack") 83 | _SSHWARN_PATH = os.path.join(debug, "sshwarn") 84 | 85 | _gather_new_camerastack_files = lambda: { # noqa: F811 86 | "camerastack-journal.log": os.path.join(base, "fake_camerastack_journal.txt"), 87 | "camerastack-libcamera.log": os.path.join(base, "fake_camerastack_libcamera.txt"), 88 | "camerastack-usb.log": os.path.join(base, "fake_camerastack_usb.txt"), 89 | } 90 | 91 | import itertools 92 | 93 | _VCGENCMD_OUTPUT = itertools.chain( 94 | iter(("0x0", "0x0", "0x50005", "0x50000", "0x70007")), 95 | itertools.repeat("0x70005"), 96 | ) 97 | _VCGENCMD_BROKEN = os.path.exists(os.path.join(debug, "vcgencmd_broken")) 98 | 99 | _CHECK_INTERVAL_OK = 10 100 | _CHECK_INTERVAL_THROTTLED = 5 101 | 102 | 103 | # see https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=147781&start=50#p972790 104 | _FLAG_UNDERVOLTAGE = 1 << 0 105 | _FLAG_FREQ_CAPPED = 1 << 1 106 | _FLAG_THROTTLED = 1 << 2 107 | _FLAG_PAST_UNDERVOLTAGE = 1 << 16 108 | _FLAG_PAST_FREQ_CAPPED = 1 << 17 109 | _FLAG_PAST_THROTTLED = 1 << 18 110 | 111 | _UNRECOMMENDED_MODELS = ("Zero", "Zero W") 112 | 113 | 114 | class ThrottleState: 115 | @classmethod 116 | def from_value(cls, value=0): 117 | if value == 0: 118 | return ThrottleState(raw_value=value) 119 | 120 | kwargs = { 121 | "undervoltage": _FLAG_UNDERVOLTAGE & value == _FLAG_UNDERVOLTAGE, 122 | "freq_capped": _FLAG_FREQ_CAPPED & value == _FLAG_FREQ_CAPPED, 123 | "throttled": _FLAG_THROTTLED & value == _FLAG_THROTTLED, 124 | "past_undervoltage": _FLAG_PAST_UNDERVOLTAGE & value 125 | == _FLAG_PAST_UNDERVOLTAGE, 126 | "past_freq_capped": _FLAG_PAST_FREQ_CAPPED & value == _FLAG_PAST_FREQ_CAPPED, 127 | "past_throttled": _FLAG_PAST_THROTTLED & value == _FLAG_PAST_THROTTLED, 128 | "raw_value": value, 129 | } 130 | return ThrottleState(**kwargs) 131 | 132 | def __init__(self, **kwargs): 133 | self._raw_value = kwargs.get("raw_value", -1) 134 | self._undervoltage = False 135 | self._freq_capped = False 136 | self._throttled = False 137 | self._past_undervoltage = False 138 | self._past_freq_capped = False 139 | self._past_throttled = False 140 | 141 | for key, value in kwargs.items(): 142 | local_key = f"_{key}" 143 | if hasattr(self, local_key) and isinstance(value, bool): 144 | setattr(self, local_key, value) 145 | 146 | @property 147 | def undervoltage(self): 148 | return self.current_undervoltage or self.past_undervoltage 149 | 150 | @property 151 | def current_undervoltage(self): 152 | return self._undervoltage 153 | 154 | @property 155 | def past_undervoltage(self): 156 | return self._past_undervoltage 157 | 158 | @property 159 | def overheat(self): 160 | return self.current_overheat or self.past_overheat 161 | 162 | @property 163 | def current_overheat(self): 164 | return self._freq_capped 165 | 166 | @property 167 | def past_overheat(self): 168 | return self._past_freq_capped 169 | 170 | @property 171 | def issue(self): 172 | return self.current_issue or self.past_issue 173 | 174 | @property 175 | def current_issue(self): 176 | return self._undervoltage or self._freq_capped or self._throttled 177 | 178 | @property 179 | def past_issue(self): 180 | return self._past_undervoltage or self._past_freq_capped or self._past_throttled 181 | 182 | @property 183 | def raw_value(self): 184 | return self._raw_value 185 | 186 | @property 187 | def raw_value_hex(self): 188 | return f"0x{self._raw_value:X}" 189 | 190 | def __eq__(self, other): 191 | if not isinstance(other, ThrottleState): 192 | return False 193 | 194 | return ( 195 | self._undervoltage == other._undervoltage 196 | and self._freq_capped == other._freq_capped 197 | and self._throttled == other._throttled 198 | and self._past_undervoltage == other._past_undervoltage 199 | and self._past_freq_capped == other._past_freq_capped 200 | and self._past_throttled == other._past_throttled 201 | and self._raw_value == other._raw_value 202 | ) 203 | 204 | def as_dict(self): 205 | return { 206 | "raw_value": self._raw_value, 207 | "current_undervoltage": self.current_undervoltage, 208 | "past_undervoltage": self.past_undervoltage, 209 | "current_overheat": self.current_overheat, 210 | "past_overheat": self.past_overheat, 211 | "current_issue": self.current_issue, 212 | "past_issue": self.past_issue, 213 | } 214 | 215 | 216 | _proc_dt_model = None 217 | 218 | 219 | def get_proc_dt_model(): 220 | global _proc_dt_model 221 | 222 | if _proc_dt_model is None: 223 | with open(_PROC_DT_MODEL_PATH, encoding="utf-8") as f: 224 | _proc_dt_model = f.readline().strip(" \t\r\n\0") 225 | 226 | return _proc_dt_model 227 | 228 | 229 | def get_vcgencmd_throttled_state(command): 230 | if __LOCAL_DEBUG: 231 | if _VCGENCMD_BROKEN: 232 | output = "" 233 | error = "VCHI initialization failed" 234 | else: 235 | output = "throttled={}".format( 236 | next(_VCGENCMD_OUTPUT) 237 | ) # mock for local debugging 238 | error = "" 239 | else: 240 | output, error = sarge.get_both(command, close_fds=CLOSE_FDS) 241 | 242 | if "throttled=0x" not in output: 243 | raise ValueError(f"Cannot parse {command!r} output: {error if error else output}") 244 | 245 | value = output[len("throttled=") :].strip(" \t\r\n\0") 246 | value = int(value, 0) 247 | return ThrottleState.from_value(value) 248 | 249 | 250 | def is_octopi(): 251 | return os.path.exists(_OCTOPI_VERSION_PATH) 252 | 253 | 254 | def is_octopiuptodate(): 255 | return os.path.exists(_OCTOPIUPTODATE_BUILD_PATH) 256 | 257 | 258 | def is_new_camerastack(): 259 | return os.path.exists(_NEW_CAMERA_STACK_PATH) 260 | 261 | 262 | def is_model_any_of(model, *args): 263 | model = model.lower() 264 | for arg in (x.lower() for x in args): 265 | if f"{arg} rev" in model or model.endswith(arg): 266 | return True 267 | return False 268 | 269 | 270 | _octopi_version = None 271 | 272 | 273 | def get_octopi_version(): 274 | global _octopi_version 275 | 276 | if _octopi_version is None: 277 | with open(_OCTOPI_VERSION_PATH, encoding="utf-8") as f: 278 | _octopi_version = f.readline().strip(" \t\r\n\0") 279 | 280 | return _octopi_version 281 | 282 | 283 | _octopiuptodate_build = None 284 | 285 | 286 | def get_octopiuptodate_build(): 287 | global _octopiuptodate_build 288 | 289 | if _octopiuptodate_build is None: 290 | with open(_OCTOPIUPTODATE_BUILD_PATH, encoding="utf-8") as f: 291 | _octopiuptodate_build = f.readline().strip(" \t\r\n\0") 292 | 293 | return _octopiuptodate_build 294 | 295 | 296 | def has_default_password(): 297 | # It would be nicer to actually fetch the hash from /etc/shadow here and verify it 298 | # has been changed, but for that we'd require super user access just to read the 299 | # file, which is just not a good idea. 300 | # 301 | # So instead we use the same mechanism that RPi OS uses to show the nag screen on the 302 | # command prompt, with the downside that it won't trigger if SSH is disabled for 303 | # whatever reason. 304 | return os.path.exists(_SSHWARN_PATH) 305 | 306 | 307 | class PiSupportPlugin( 308 | octoprint.plugin.EnvironmentDetectionPlugin, 309 | octoprint.plugin.SimpleApiPlugin, 310 | octoprint.plugin.AssetPlugin, 311 | octoprint.plugin.TemplatePlugin, 312 | octoprint.plugin.StartupPlugin, 313 | octoprint.plugin.SettingsPlugin, 314 | ): 315 | # noinspection PyMissingConstructor 316 | def __init__(self): 317 | self._throttle_state = ThrottleState() 318 | self._throttle_check = None 319 | self._throttle_undervoltage = False 320 | self._throttle_overheat = False 321 | self._throttle_check_enabled = True 322 | self._throttle_check_functional = True 323 | 324 | def initialize(self): 325 | self._throttle_check_enabled = self._settings.get_boolean( 326 | ["vcgencmd_throttle_check_enabled"] 327 | ) 328 | if not self._throttle_check_enabled: 329 | self._logger.warning( 330 | "Throttle check via vcgencmd disabled by user. Potential undervoltage or overheating issues will not be detected." 331 | ) 332 | 333 | # Additional permissions hook 334 | 335 | def get_additional_permissions(self): 336 | return [ 337 | { 338 | "key": "STATUS", 339 | "name": "Status", 340 | "description": gettext( 341 | "Allows to check for the Pi's throttling status and environment info" 342 | ), 343 | "roles": ["check"], 344 | "default_groups": [USER_GROUP], 345 | } 346 | ] 347 | 348 | # Additional bundle files hook 349 | 350 | def get_additional_bundle_files(self, *args, **kwargs): 351 | if is_octopi(): 352 | result = { 353 | "haproxy.log": "/var/log/haproxy.log", 354 | } 355 | 356 | if is_new_camerastack(): 357 | # new camera-streamer based camera stack 358 | files = _gather_new_camerastack_files() 359 | result.update(**files) 360 | 361 | else: 362 | # old mjpg-streamer based camera stack 363 | result["webcamd.log"] = "/var/log/webcamd.log" 364 | 365 | return result 366 | else: 367 | return {} 368 | 369 | ##~~ Additional health checks hook 370 | 371 | def get_additional_health_checks(self): 372 | from .health_checks import all_checks 373 | 374 | def health_check_factory(clz): 375 | def factory(settings): 376 | return clz(self, settings) 377 | 378 | factory.key = clz.key 379 | return factory 380 | 381 | return [health_check_factory(clz) for clz in all_checks] 382 | 383 | # ~~ EnvironmentDetectionPlugin 384 | 385 | def get_additional_environment(self): 386 | result = {"model": get_proc_dt_model()} 387 | 388 | self._check_throttled_state() 389 | result["throttle_check_enabled"] = self._throttle_check_enabled 390 | result["throttle_check_functional"] = self._throttle_check_functional 391 | if self._throttle_check_enabled and self._throttle_check_functional: 392 | result["throttle_state"] = self._throttle_state.raw_value_hex 393 | 394 | if is_octopi(): 395 | result["octopi_version"] = get_octopi_version() 396 | result["octopi_camera_stack"] = ( 397 | "camera-streamer" if is_new_camerastack() else "webcamd" 398 | ) 399 | 400 | if is_octopiuptodate(): 401 | result["octopiuptodate_build"] = get_octopiuptodate_build() 402 | try: 403 | build = result["octopiuptodate_build"].split("-")[-1] 404 | 405 | result["octopiuptodate_build_short"] = ( 406 | build[0:4] + "." + build[4:6] + "." + build[6:8] + "." + build[8:] 407 | ) 408 | except Exception: 409 | pass 410 | 411 | return result 412 | 413 | # ~~ SimpleApiPlugin 414 | 415 | def on_api_get(self, request): 416 | if not Permissions.PLUGIN_PI_SUPPORT_STATUS.can(): 417 | return flask.abort(403) 418 | 419 | result = self.get_additional_environment() 420 | result.update( 421 | { 422 | "throttle_enabled": self._throttle_check_enabled, 423 | "throttle_functional": self._throttle_check_functional, 424 | "throttle_state": self._throttle_state.as_dict(), 425 | "model_unrecommended": is_model_any_of( 426 | result.get("model"), *_UNRECOMMENDED_MODELS 427 | ), 428 | "default_password": has_default_password(), 429 | } 430 | ) 431 | return flask.jsonify(**result) 432 | 433 | def is_api_protected(self): 434 | return True 435 | 436 | # ~~ AssetPlugin 437 | 438 | def get_assets(self): 439 | return { 440 | "js": ["js/pi_support.js"], 441 | "clientjs": ["clientjs/pi_support.js"], 442 | "css": ["css/pi_support.css"], 443 | } 444 | 445 | # ~~ TemplatePlugin 446 | 447 | def get_template_configs(self): 448 | configs = [ 449 | { 450 | "type": "settings", 451 | "name": gettext("Pi Support"), 452 | "template": "pi_support_settings.jinja2", 453 | "custom_bindings": False, 454 | } 455 | ] 456 | 457 | if is_octopiuptodate(): 458 | configs.append( 459 | { 460 | "type": "about", 461 | "name": "About OctoPi", 462 | "template": "pi_support_about_octopiuptodate.jinja2", 463 | } 464 | ) 465 | elif is_octopi(): 466 | configs.append( 467 | { 468 | "type": "about", 469 | "name": "About OctoPi", 470 | "template": "pi_support_about_octopi.jinja2", 471 | } 472 | ) 473 | 474 | return configs 475 | 476 | def get_template_vars(self): 477 | return self.get_additional_environment() 478 | 479 | # ~~ StartupPlugin 480 | 481 | def on_startup(self, *args, **kwargs): 482 | if self._settings.get_boolean(["vcgencmd_throttle_check_enabled"]): 483 | self._check_throttled_state() 484 | self._throttle_check = RepeatedTimer( 485 | self._check_throttled_state_interval, 486 | self._check_throttled_state, 487 | condition=self._check_throttled_state_condition, 488 | ) 489 | self._throttle_check.start() 490 | 491 | # ~~ SettingsPlugin 492 | 493 | def get_settings_defaults(self): 494 | return { 495 | "vcgencmd_throttle_check_enabled": True, 496 | "vcgencmd_throttle_check_command": _VCGENCMD_THROTTLE, 497 | "ignore_unrecommended_model": False, 498 | "ignore_undervoltage_on_printstart": False, 499 | "ignore_default_password": False, 500 | } 501 | 502 | def get_settings_restricted_paths(self): 503 | return { 504 | "admin": [ 505 | ["vcgencmd_throttle_check_enabled"], 506 | ["vcgencmd_throttle_check_command"], 507 | ] 508 | } 509 | 510 | ##~~ Softwareupdate hook 511 | 512 | def get_update_information(self): 513 | return { 514 | "pi_support": { 515 | "displayName": "Pi Support Plugin", 516 | "displayVersion": self._plugin_version, 517 | # version check: github repository 518 | "type": "github_release", 519 | "user": "OctoPrint", 520 | "repo": "OctoPrint-PiSupport", 521 | "current": self._plugin_version, 522 | "stable_branch": { 523 | "name": "Stable", 524 | "branch": "main", 525 | "commitish": ["devel", "main"], 526 | }, 527 | "prerelease_branches": [ 528 | { 529 | "name": "Prerelease", 530 | "branch": "devel", 531 | "commitish": ["devel", "main"], 532 | } 533 | ], 534 | # update method: pip 535 | "pip": "https://github.com/OctoPrint/OctoPrint-PiSupport/archive/{target_version}.zip", 536 | } 537 | } 538 | 539 | # ~~ Helpers 540 | 541 | def _check_throttled_state_interval(self): 542 | if self._throttle_state.current_issue: 543 | return _CHECK_INTERVAL_THROTTLED 544 | else: 545 | return _CHECK_INTERVAL_OK 546 | 547 | def _check_throttled_state_condition(self): 548 | return self._throttle_check_enabled and self._throttle_check_functional 549 | 550 | def get_throttle_state(self, run_now=False): 551 | """Exposed as public helper.""" 552 | if run_now: 553 | self._check_throttled_state() 554 | 555 | if not self._throttle_check_enabled or not self._throttle_check_functional: 556 | return False 557 | 558 | return self._throttle_state.as_dict() 559 | 560 | def _check_throttled_state(self): 561 | if not self._throttle_check_enabled: 562 | return 563 | 564 | command = self._settings.get(["vcgencmd_throttle_check_command"]) 565 | 566 | self._logger.debug(f"Retrieving throttle state via {command!r}") 567 | try: 568 | state = get_vcgencmd_throttled_state(command) 569 | except ValueError as ex: 570 | error = str(ex) 571 | self._logger.warning(error) 572 | if "VCHI initialization failed" in error: 573 | self._logger.warning( 574 | 'Make sure the system user "{}" is in the "video" group.'.format( 575 | getuser() 576 | ) 577 | ) 578 | self._throttle_check_functional = False 579 | return 580 | 581 | if self._throttle_state == state: 582 | # no change 583 | return 584 | 585 | self._throttle_state = state 586 | 587 | if (not self._throttle_undervoltage and self._throttle_state.undervoltage) or ( 588 | not self._throttle_overheat and self._throttle_state.overheat 589 | ): 590 | message = ( 591 | "This Raspberry Pi is reporting problems that might lead to bad performance or errors caused " 592 | "by overheating or insufficient power." 593 | ) 594 | 595 | if self._throttle_state.undervoltage: 596 | self._throttle_undervoltage = True 597 | message += ( 598 | "\n!!! UNDERVOLTAGE REPORTED !!! Make sure that the power supply and power cable are " 599 | "capable of supplying enough voltage and current to your Pi." 600 | ) 601 | 602 | if self._throttle_state.overheat: 603 | self._throttle_overheat = True 604 | message += ( 605 | "\n!!! FREQUENCY CAPPING DUE TO OVERHEATING REPORTED !!! Improve cooling on the Pi's " 606 | "CPU and GPU." 607 | ) 608 | 609 | self._logger.warning(message) 610 | 611 | self._plugin_manager.send_plugin_message( 612 | self._identifier, 613 | {"type": "throttle_state", "state": self._throttle_state.as_dict()}, 614 | ) 615 | 616 | # noinspection PyUnresolvedReferences 617 | self._event_bus.fire( 618 | octoprint.events.Events.PLUGIN_PI_SUPPORT_THROTTLE_STATE, 619 | self._throttle_state.as_dict(), 620 | ) 621 | 622 | if hasattr(octoprint.events.Events, "PLUGIN_HEALTH_CHECK_UPDATE_HEALTHCHECK"): 623 | self._event_bus.fire( 624 | octoprint.events.Events.PLUGIN_HEALTH_CHECK_UPDATE_HEALTHCHECK 625 | ) 626 | 627 | 628 | def register_custom_events(*args, **kwargs): 629 | return [ 630 | "throttle_state", 631 | ] 632 | 633 | 634 | __plugin_name__ = "Pi Support Plugin" 635 | __plugin_author__ = "Gina Häußge" 636 | __plugin_description__ = "Provides additional information about your Pi in the UI." 637 | __plugin_disabling_discouraged__ = gettext( 638 | "Without this plugin OctoPrint will no longer be able to " 639 | "provide additional information about your Pi, " 640 | "which will make it more tricky to help you if you need support." 641 | ) 642 | __plugin_license__ = "AGPLv3" 643 | __plugin_pythoncompat__ = ">=2.7,<4" 644 | 645 | 646 | def __plugin_check__(): 647 | try: 648 | proc_dt_model = get_proc_dt_model() 649 | if proc_dt_model is None: 650 | return False 651 | except Exception: 652 | return False 653 | 654 | return "raspberry pi" in proc_dt_model.lower() 655 | 656 | 657 | def __plugin_load__(): 658 | plugin = PiSupportPlugin() 659 | global __plugin_implementation__ 660 | __plugin_implementation__ = plugin 661 | 662 | global __plugin_hooks__ 663 | __plugin_hooks__ = { 664 | "octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information, 665 | "octoprint.events.register_custom_events": register_custom_events, 666 | "octoprint.access.permissions": __plugin_implementation__.get_additional_permissions, 667 | "octoprint.systeminfo.additional_bundle_files": __plugin_implementation__.get_additional_bundle_files, 668 | "octoprint.plugin.health_check.get_additional_checks": __plugin_implementation__.get_additional_health_checks, 669 | } 670 | 671 | global __plugin_helpers__ 672 | __plugin_helpers__ = {"get_throttled": plugin.get_throttle_state} 673 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | --------------------------------------------------------------------------------