Blue Iris Serial to/from Arduino (Inputs and Outputs).

Mattias

Young grasshopper
Nov 1, 2015
35
8
I’ve seen some examples of Arduino code for trigger Blue Iris on the forum, but don’t think I’ve seen anyone that uses both write and read from/to Blue Iris. Anyhow I think Blue Iris is great software and wanted to share my Arduino code and maybe someone can use the hole or part of it. I’m a beginner at coding so it isn’t pretty but I hope it’s rather easy to follow. See attached file for the code.

Set GCE electronics protocol in the Digital I/O tab in Blue Iris.
I've used this code on an Arduino Uno.

Basically this is how the code works if you don’t do any changes in it.

Trigger Output from Blue Iris Alerts. (Rewriting the code and you can get 4 additional outputs)
In Blue Iris -> “Set digital output bits (1+2+4+8)”
If Blue Iris is set to 1 => Arduino I/O pin 10 will be high for the triggered time. (Set as Output pin in Arduino)
If Blue Iris is set to 2 => Arduino I/O pin 11 will be high for the triggered time. (Set as Output pin in Arduino)
If Blue Iris is set to 4 => Arduino I/O pin 12 will be high for the triggered time. (Set as Output pin in Arduino)
If Blue Iris is set to 8 => Arduino I/O pin 13 will be high for the triggered time. (Set as Output pin in Arduino)

Trigger Input to Blue Iris camera Motion/trigger (Mostly what I'm using this program to, PIR sensors that triggers the cameras)
In Blue Iris set “Trigger with DIO input bits” to 1,2,4,8,16,32,64 or 128
If Arduino I/O pin 2 (Set as Input pin in Arduino) will be high then Blue Iris will trigger on => 1
If Arduino I/O pin 3 (Set as Input pin in Arduino) will be high then Blue Iris will trigger on => 2
If Arduino I/O pin 4 (Set as Input pin in Arduino) will be high then Blue Iris will trigger on => 4
If Arduino I/O pin 5 (Set as Input pin in Arduino) will be high then Blue Iris will trigger on => 8
If Arduino I/O pin 6 (Set as Input pin in Arduino) will be high then Blue Iris will trigger on => 16
If Arduino I/O pin 7 (Set as Input pin in Arduino) will be high then Blue Iris will trigger on => 32
If Arduino I/O pin 8 (Set as Input pin in Arduino) will be high then Blue Iris will trigger on => 64
If Arduino I/O pin 9 (Set as Input pin in Arduino) will be high then Blue Iris will trigger on => 128

How to connect it electrically you find on several forums, I use relays to separate the signals between the Arduino and my PIR sensors.
 

Attachments

  • Like
Reactions: opus too
Hello Mattias
I built up a box with the same functionality but with a different sketch from this forum. I reloaded the box with your code (a few pin changes required) and it works as advertised. My system covers several buildings and a USB interface is a bit too limiting. Hence the Encore USB/ethernet print server in the upper left corner of the box. This works like a charm but has a problem for 24/7 service. The IP port lease expires and drops the connection. I'ts over my skill level to hack the print server. Two part question: Would you add an ethernet I/O to your sketch. Just put it in parallel with the COM port so user can drive either. I think that this is pretty simple with your skill set (Arduino coding)
2016-02-03 14.08.05.jpg

I can connect the ethernet input with BI using a com0com bridge in my PC. The box needs to go in the attic so its beyond the USB cable limit.
Thanks for your contribution.
Eric
 
Nice little project you have!
Right now I don’t have any intent to update with similar functionality. But, I’ve found out something I didn’t know before and that is that it’s possible to trigger Blue Iris through the web-server with external web command. Like “http://login:pass@ip.ip.ip.ip:port/admin?camera=NAMEOFCAMERA&trigger” then the specific camera will trigger so my new project will try and do an ethernet solution to trigger through this interface instead. And if I understand correct I think this will work for your implementation also! I’m a beginner at this so don’t know if I will manage to do it but I will post the Arduino code if I solve it.
 
Hello Mattias
Thank you for that tidbit (http://login:pass@ip.ip.ip.ip:port/admin?camera=NAMEOFCAMERA&trigger”) but still leaves the relay side of the interface to deal with. A question: Why didn't you just emulate the sealevel 120e on the Arduino platform. Sealevel even has a test program that can be used to validate Arduino code.

Right this minute I can't get BI to respond to GCE commands, clicking the trigger box is the only thing that works, can't get BI to answer to ASCII.
Eric
 
Hi, Well don't know anything about the sealevel device.

Strange that BI dosen't answer to ASCII for me this has never failed. Check so Blue Iris really are connected to the Arduino...

About you interface I've now done another program that can use both inputs and outputs through the ethernet on the Arduino if you have an ethernet shield. See my post "Arduino Uno with Ethernet shield INPUT/OUTPUT to Blue Iris."
 
Thank You Mattias!! Works great! This is getting to be a very additive ....hobby. BI does rock. More cameras, I need more cameras.
John