Webcam activates LEDs?

Yeah I am upgrading to a ring of 12 NeoPixels, this should work well with your plugin I think. I will be using a separate power source then running the NeoPixels from GPIO 18.

If you want to use OctoPrint, run them from Pin 10. Described in the plugins' docs, as you can't use PWM on pin 18 without running as root.

Hey @Charlie_Powell, I have installed your plugin, thanks for that. I have run into some issues though. The LED closest to the Vin port is always on, and I am unsure how to solve this. Also once this is fixed will I be able to turn the light on and off on command, while viewing through a camera? Just for clarification this is the neopixel model I am using: https://core-electronics.com.au/neopixel-ring-12-x-ws2812-5050-rgb-led-with-integrated-drivers.html?utm_source=google_shopping&gclid=Cj0KCQjw-uH6BRDQARIsAI3I-UdifHQfIp0-VPOq4HPBnH0Z89uNsxZrdQ_PjFCoyt0qN8UFm27WHiIaAsbCEALw_wcB

Thanks!

:wave: @Tiefling!

Someone else reported an issue with the first LED, and it turned out to be their level shifter.

You could give that a go, or if not maybe it is an issue with that individual LED.

The on and off command is not implemented automatically when switching to the camera tab, but there are buttons in the navbar that you can use to turn them on and off.

Automatically turning it on is something on my list but it's not going to get looked at all that soon.

This drifted off from the origial question "How to switch on when stream/shot is watched?" to how to control raspi GPIOs. Sadly.

The original question is way more unique and also unsolved.
@supertaz came up with good ideas, but well, still no solution.

I myself tried to modufy ustreamer for this purpose.
While it works, the author of ustreamer pointed out that the http-forward solution is the cleaner solution.

If anyone has the skills, please help me:

I've made a little script based on a tutorial I found:
Sennevds/flask-video-streaming: Supporting code for my article on video streaming with Flask. (github.com)
This triggers a GPIO pin when someone access the stream and when there's no activity anymore and deactivate the pin.

This is first time I used flask so I don't know if this code is good but it works for me

Great work!
I like how it turns the whole streaming off when no one is watching!
It is pretty delayed though. I will try the other cameras (only tried CAMERA=pi)

PS: Len on snapshot is not implemented. You need to add:

PPS: Way better with v4l2. But heavy load on pi4.
image
I think it octopi will manage though:
FYI: I needed to build https://github.com/jnohlgard/python-v4l2capture from source, could not install the packages.

PPPS: Reducing resolution to 640x480 drops load to ~50%. You can also reduce fps for more performance. It also seems more responsive than octopi default mjpg-streamer. Great!

Yeah I disabled it on snapshot because I use the snapshot url in Home Assistant and the light would constantly turn on.
I've fixed this by disabling this in the script and in Octolapse I added 2 scripts to turn on the light just before taking a snapshot.

Is there an easy way to turn on the led while watching from the camera with Octoprint? I read it, but I didn't understand it.

@mryusufcan I improved this project a little bit:

It now has some documentation.
(Also renamed for this specific purpose)
If you have any questions or issues, please file a github issue.

1 Like

thank you, but I don't understand the codes.I can't.

Turn on and off via calling commands using Putty work
Soon as I add below bold code below; OctoPrint will no longer start :-:
server:
firstRun: false
onlineCheck:
enabled: true
pluginBlacklist:
enabled: true
secretKey: XYX
seenWizards:
backup: null
corewizard: 4
tracking: null

system:
actions:

action: lon
command: /usr/local/bin/scripts/light_on.sh
name: Turn Light On
action: loff
command: /usr/local/bin/scripts/light_off.sh
name: Turn Light Off
temperature:
profiles:

  • bed: 100
    ....

Any help?

It is probably an issue with the indentation, which we can't work out posted here. If you use the preformatted text option with three backticks like:

```
Your content
```

It will preserve the indentation correctly.

Thanking You:
back ticks result in

The OctoPrint server is currently not running

If you just started up your Raspberry Pi, please wait a couple of seconds, then try to refresh this page.

If the issue persists, please log into your Raspberry Pi via SSH and check the following:

  • Verify that the process is running: ps -ef | grep -i octoprint | grep -i python should show a python process:

pi@octopi:~ $ ps -ef | grep -i octoprint | grep -i python
pi 1441 1 6 11:12 ? 00:00:15 /home/pi/oprint/bin/python
/home/pi/oprint/bin/octoprint --host=127.0.0.1 --port=5000

  • If it isn't, the question is why. Take a look into ~/.octoprint/logs/octoprint.log , there might be an error logged in there that helps to determine what's wrong.
  • You might also want to try if you can restart the server (if no obvious error is visible): sudo service octoprint restart .

If all that doesn't help to trouble shoot the issue, you can seek support on the OctoPrint Community Forum. Please provide your OctoPi and OctoPrint versions as well as your octoprint.log and explain what you already tried and observed as detailed as possible.

Code in config.yaml (Back ticks don't show here for me)
backup: null
corewizard: 4
tracking: null

system:
actions:

action: lon
command: /usr/local/bin/scripts/light_on.sh
name: Turn Light On
action: loff
command: /usr/local/bin/scripts/light_off.sh
name: Turn Light Off


> Blockquote

temperature:
  profiles:
  seenWizards:
  seenWizards:
    backup: null

The backtick key is next to the "one" key (or one if I use a single backtick) and we are talking about how to post the file here, not adding backticks to the file.

Three backticks before and after this line.

Just to make sure we can examine the indentation, you can also attach the file here after editing out any sensitive stuff (API key, etc.).

I believe there is an OctoPrint Plugin to control what I want;

I need to look it up

Thanking you 2000%

heres are some Plugins that May help
Control Lights, not all :

Control Wyze (not in the plugin lists)

OctoLight
OctoRelay
OctoPrint-Enclosure

Are you sure? OctoPrint-Wyze

1 Like

Plugins More OctoPrint-Wyze = nothing

You may install it manual:

https://github.com/eshapiro42/OctoPrint-Wyze/archive/main.zip

1 Like