People Counter

Initial Revision

I am pleased to announce the release of the people counter door counter logging application. This application consists of a windows service that connects to the Watchman Electronics People Counter. It works by polling a door counter, that is connected to the computer via a serial port, at predetermined intervals (say 10 minutes or whatever interval you specify) then logging the counters on the device into a log file. Once a day, the accumulated log file can be either emailed or ftp’d to a remote server. The application is a windows service, therefore it runs without any user interaction, starting automatically when windows is started, and able to operate without intervention.

The screen shot is of the management screen, this is used to configure the comport, interval, the people counter field names as well as email server settings.

The applicationĀ has beenwritten in c#, using .Net 4.0 (newest version of .Net still compatible with Windows XP.) It consists of a windows service, which connects via a serial port to the people counter counting device. The user interface application connects to the windows service via wcf (windows communication foundation.) This allows commands to be sent to the windows service, therefore onto the people counter, and also counts from the device are forwarded onto a status window on the application. The installer is written using the wix and burn installer toolkit. The installer will automatically download and install the .Net 4.0 runtime as well as apply the msi database containing the various application files.

This application is an update of the original application by checmate software. The original software depended on having a user logged into the computer, having the software run as a windows service eliminates this requirement. The original application no longer had source code available, therefore it was necessary to do a bit of reverse engineering, fortunately it was easy enough to decompile the main executable into c# source code, from which it was possible to figure out how to communicate with the serial port, although the original developer was able to find some documentation on the serial communication which helped.

It was interesting to avail oneself of new features within c# 5.0, the improved patterns for asynchronous programming, that is, the new async/ await keywords improve readability and comprehension of asynchronous network programming code, which is a good thing.

The People Counter now delivers the capability of monitoring doors, and uploading statistics via email, all while running unattended. Later on the possibility exists of directly posting door traffic to a web service, where graphs and various statistics might be instantly displayed, and also to perhaps notify an android/ios/windows phone with real time traffic data.

Updated version

After running for awhile logging data into a csv file, afterwards either emailing or ftping the file to its destination it was decided to try logging the data into a local SQL Server Express database. In this configuration every time the counter is polled, the results are logged into a database table, data from each store can be accessed by logging into and extracting data from the table.

Screenshots of this revised application are posted below.