Hey there !
Firstly, I would like to thanks the Octoprint developpers because this platform is just so useful and very pleasant to use. Also, please pardon my english (I'm french)
My brother came recently and took his Ender 3 with him. So we now have 2 Creality Ender 3 there, this is very productive
The thing is that my brother already used the Raspbicam using Octoprint, and since, he also connected my printer too.
Since he only has one cam, he has got a crazy idea: mount the camera on a 2 axis arm to be able to see the two printers, and also to be able to see the print (So we can move the camera using arrows on the Octoprint interface).
So I modified a 2 axis STL file that was on thingiverse for a planner first, and also a Raspberry cam mount to fasten it on the arm, and BOOM
Next, we searched for plugins, tested all the possible ones, but none of them were usable for this.
So we searched if it was possible to create one, and it's pretty hard for us.
I personnaly followed the foosel tutorial, and could go until the "Hello world!" button that is sending to Wikipedia, but I couldn't continue with the URL modification since my plugin wasn't visible in the plugin tab (but visible and activated in the plugin manager).
My last idea was to modify the Enclosure plugin, but it is also too hard for me, even if I tried this using the old helloword from the foosel tutorial:
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import octoprint.plugin
import RPi.GPIO as GPIO
import time
class HelloWorldPlugin(octoprint.plugin.StartupPlugin,
octoprint.plugin.TemplatePlugin,
octoprint.plugin.SettingsPlugin):
pwm_instances = []
def on_after_startup(self):
self._logger.info("Hello World! (more: %s)" % self._settings.get(["url"]))
self.pwm_instances = []
def get_settings_defaults(self):
return dict(url="https://en.wikipedia.org/wiki/Hello_world")
def get_template_configs(self):
return [
dict(type="navbar", custom_bindings=False),
dict(type="settings", custom_bindings=False)
]
while (1) {
self.write_pwm(2, 0)
time.sleep(1)
self.write_pwm(2, 255)
time.sleep(1)
self.write_pwm(2, 0)
time.sleep(1)
self.write_pwm(2, 255)
time.sleep(1)
self.write_pwm(2, 0)
time.sleep(1)
self.write_pwm(2, 255)
time.sleep(1)
}
__plugin_name__ = "Hello World"
__plugin_pythoncompat__ = ">=2.7,<4"
__plugin_implementation__ = HelloWorldPlugin()
So that's pretty everything, don't hesitate to ask me more precisions if you need it, maybe I'm not too accurate with eveything. Thanks a lot, have a nice day !