Advanced Stream Monitoring and Control - Interface with RBP?

Aaron407

Young grasshopper
Joined
Sep 28, 2017
Messages
35
Reaction score
4
I'm currently running BI with four hardwired cameras, three of which are cheap Chinese units. They work fairly well, except that they occasionally lock up and have to be power cycled. When they lock up, BI understandably shows that the stream has been lost.

Is there any way for BI to 'annunciate' an extended no-signal condition? I use a Raspberry Pi 3 for a number of other things, and I'm wondering if it would be possible to communicate with it in some way for this extended no-signal condition. I would then use the Pi to trigger an external relay that would power cycle the PoE switch that ties in the cameras.

Is something like this possible? I'm not sure where to start on the BI side for monitoring the streams and to get it to annunciate and talk to the Pi. Once the Pi has the signal, the rest would be easy.

I see that there are a lot of watchdog options. Maybe I'll look into the possibility of running a windows putty session with a premade script to trigger the pi's relay when there's a watchdog trigger. Anyone else's input would be great, though.
 
Last edited:

awsum140

Known around here
Joined
Nov 14, 2017
Messages
1,254
Reaction score
1,128
Location
Southern NJ
You may like to tinker, but why re-invent the wheel? Just use push or email notifications right from the BI watchdog for each of those cheapie Chinese cameras. Clean and simple with no auxiliary devices to get in the way.
 

Aaron407

Young grasshopper
Joined
Sep 28, 2017
Messages
35
Reaction score
4
The issue is that, when they lock up, they won't accept a login of any kind. Unless I'm missing something, there would then be no way for the BI watchdog to send a reboot command. I already have the watchdog set to send a reboot command after 5 consecutive timeouts, but it doesn't work with these cameras. I'm guessing that they're cheap to the point that they don't accept external commands like that, only through the "CMS" interface, but they can't be logged into even from there when they lock up. The only way that I've found to get them up and running again is to cycle their power, which I'm hoping to automate.

Anyway, at this point, I have a windows batch file created. When I run it, it pushes an ssh command through putty's plink to run a script on the pi, so that side works. The issue I'm having is that BI doesn't seem to want to trigger that script file. I have it set in the watchdog profile for one of the cameras to run the file after 7 timeouts as a watchdog trigger, but it doesn't seem to run it. It works fine if I manually run it, though. I'll have to do more testing since I'm starting off with a camera not running, which may cause the watchdog to handle things differently.
 

mat200

IPCT Contributor
Joined
Jan 17, 2017
Messages
13,962
Reaction score
23,272
@Aaron407

FYI - there is networking power "strips" which you can use to remotely power equipment on and off.

Tho, I'd be tempted to just replace the cameras with better ones if it is indeed the camera which is failing.

Maybe useful to determine the cause of failure... it could be as simple as a memory leak in the cameras - so having the cameras reboot themselves daily may resolve that, or firmware updates.
 

Aaron407

Young grasshopper
Joined
Sep 28, 2017
Messages
35
Reaction score
4
Yeah, I'm not looking to use networking power strips. I would tie in the power supply wiring for the PoE switch that powers the camera to a relay that's controlled by the pi. I do something similar for disabling a driveway alarm of ours.

I think the cause of the failure is simply that they're cheap cameras, and all three of them lock up at different times. However, they are often flawless for weeks at a time, so I'm hesitant to replace them if I can simply add this watchdog control. I already have them rebooting daily and they have the newest firmware, so this is the next step to keep things up and running without having to wait for the daily reboot.
 

AKE

n3wb
Joined
Feb 21, 2017
Messages
6
Reaction score
3
The cheapest option is use a wifi wall plug switch that can accept commands via mqtt. The sonoff brand switches are $15, have the esp8266 wifi chip, and can be flashed with opensource firmware such as espeasy or tasmota. These can respond to mqtt or http messages to flip an internal relay in the switch. Run a script on the dvr computer that sends a mqtt reset signal every 5 days or so at 5am and you will have flawless power cycling. You dont even have to interface with BI, just do a fixed interval reset every few days or have the script ping the cameras ip and if doesn't get a response, send a reset signal.

https://www.amazon.com/Sonoff-Electrical-Household-Appliances-Compatible/dp/B076Q6PZCV/ref=sr_1_11?s=lamps-light&ie=UTF8&qid=1527271065&sr=1-11&keywords=sonoff&th=1
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.
Top