Sentry – the software part

Powershell and the Sentry Hardware – how to interface.

Serial port access using Powershell – as covered in the article entitled Powershell and serial ports for the Sentry Project does not cover that actual syntax of the commands required to send instruction to the Sentry project hardware only the basic serial IO commands available.

So digging deeper to look at the command outputs formats for the Sentry device and the powershell commands to issue them gives the following simple script to open the port issue some commands for output and close the port:

# clear the power shell output pane
# setup the serial port
$port = new-Object System.IO.Ports.SerialPort COM1,9600,None,8,two
# ensure closed from any previous debugging
# output status message to the powershell pane
write “Starting”
# open the serial port

# clear all displays
# note the `r inside the quotes which escapes the special character for carriage return
# first clear the LCD screen
# then clear the two matrices
# sleep for a few seconds
start-sleep -s 3
# write the @ symbol to both matrices
# clear the lcd panel

start-sleep -s 3
#write B to first matrix and A to second

#put the current time in String variable
[STRING]$tnow = get-date -displayhint time
# write “showtime” to first line of LCD
# important to pause and let panel catch up before this next command
start-sleep -s 3
# move cursor to first postion on second line of LCD panel
start-sleep -s 3
# write “showtime2” to second line
start-sleep -s 3
# clear displays and close port



So this code shows the means of interfacing between Powershell and the Sentry Hardware to display output. The next article in the series will show the interaction between Powershell – Intellipool Network Monitor (INM) and the Sentry Hardware.