Hi, I’m looking for information on using the RS232 external trigger for a camera (or two).
What is the difference between DIO and Global DIO?
What camera trigger settings are required for RS232?
Writing some code to identify motion – easy (I’m even considering of adding some code that identifies if the object is taller that wide or smaller and wider than tall (i.e. Person/animal (birds will be a whole different problem, but not impossible if it looks at the legs)). Trying to send an external trigger to Blue Iris is turning out to be beyond me. Initially I was going to send a command over the network but came to the conclusion that I couldn’t send a command to port 81 AND have the webserver running on the same port, which is essential for me as I monitor the program via the webserver. Being able to specify a different port for external triggers would be so nice. And so I decided to go down the RS232 route, despite that feeling ‘oh, so last century’. I wrote a little Powershell script to send the commands so that I could set up BI. I didn’t expect that to be so tricky. BI shows the ‘Current input bits’ in the’ Digital IO and IoT’ tab but something appeared to be wrong. Not only can I not get the camera to trigger but the timing of the BI system seems wrong, when going from bit 1 to bit 0 (bit 2 to bit 0 seems to work as expected, but still doesn’t trigger the camera). I have checked the Powershell script into Putty and it works as expected (2 seconds between bytes – like clockwork). So then I added my other camera so that I could see if that made any difference. The commands are sent every two seconds but for BI to go from byte1 to byte0 is 8 seconds longer than it should be, so I guess there is one bug. Initially I was sending 1 – 0 – 2 – 0, but sending 2 – 0 – 1 -0 highlights the difference.
Below are the settings:
System Digital IO and IoT Tab
DIO Configure run action 1
DIO Configure run action 2
DIO Configure run action 3
Camera Main
Camera Action tab
Here is my test script:
#---------------------------------------
# Serial port test
$port = new-Object System.IO.Ports.SerialPort COM5,9600,None,8,one # COM4-BI COM5-Powershell
$port.Open()
$data = [int]1 # Byte to send to BI
$port.Write([byte[]] ($data), 0, 1)
write-host "1"
Start-Sleep -s 2 #
$data = [int]0 # Byte to send to BI
$port.Write([byte[]] ($data), 0, 1)
write-host "2"
Start-Sleep -s 2 #
$data = [int]2 # Byte to send to BI
$port.Write([byte[]] ($data), 0, 1)
write-host "3"
Start-Sleep -s 2 #
$data = [int]0 # Byte to send to BI
$port.Write([byte[]] ($data), 0, 1)
write-host "4"
Start-Sleep -s 2
write-host "Done"
$port.Close()
#---------------------------------------
Here are the results from running the above: (Damn, the original files from yesterday are gone. But, I am sure I can reproduce them. BI was reporting a connection that seemed to have past the first hurdle. Time to run a virus scan on my new server, just in case. But that process seems to have reset my RamDrive. Why a Ram Drive? I use programs that manipulate images from BI. Its way faster using a Ram Drive than either a SSD or HDD, but gets reset on Reboot. They scan/manipulate the results of a .bmp image that is converted from BI’s .jpg’s. I am using Imagemagick to do the heavy lifting. I can convert a BI .jpg by sending IM a ‘Command Line’ instruction to convert some of it into a .bmp. From there I can either search for the yellow/orange pixels that indicate motion or use IM to create a .bmp file resulting from differences between sequential images (to show contiguous motion or diffence) i.e subtract img2.bmp from img1.bmp and create img3.bmp. I use it for tracking my dogs. They move into an area. Maybe sleep some. Then go somewhere else. All under surveillance (mostly))
Pass A 1 - 0 - 2 - 0
DIO1 Set Action.20210828_204344
DIO1 Clear Action.20210828_204355 (11 seconds)
Pass B 2 - 0 - 1 - 0
DIO2 Set Action.20210828_204424
DIO2 Clear Action.20210828_204427 (3 seconds)
DIO1 Set Action.20210828_204428 (1 second)
DIO1 Clear Action.20210828_204439 (11 seconds)
Pass C Sanity check 2 - 0 - 1 - 0
DIO2 Set Action.20210828_204455
DIO2 Clear Action.20210828_204457 (2 seconds)
DIO1 Set Action.20210828_204459 (2 seconds)
DIO1 Clear Action.20210828_204509 (10 seconds)
Pass D 1 - 0 - 2 - 0
DIO1 Set Action.20210828_204533
DIO1 Clear Action.20210828_204544 (11 seconds)