Driver
Hook up a sensor to the USB adapter.
Install the driver from here.
Install Java runtime, 64-bit.
Run the OneWireViewer_x64.exe found in C:\Program Files\Maxim Integrated Products\1-Wire Drivers x64.
See that the adapter and probe work.
SDK
Install the 1-Wire SDK for Windows.
Find the OneWireAPI.NET.dll . . . this is the API which is written in J# for Framework 2.0.
Find the vjredist.exe and install that.
Make the GetTemps app, found in ...\OWNetSDK\Examples\OW.NET\VB.NET\GetTemps, work.
SQL
Install SQL 2014 Express -- well, good luck with that!
1/2018, change to SQL Server Developer, 2017
Remove previous version(s) of SQL first! I removed SQL 2008 after installing 2014 and it got quite messed up. Ditto when going to 2017.
Testing
A small test program was written to scan the network and show temperatures and switch states. For the relay board. . . had to call getLevel, not getLatchState, to see if input switch was open or closed (true if closed). Guess that's because input is not powered and wired to the +5v terminal (?). The test program is used to develop classes for the other components:
Database
Collection Server
Web App
Database
Goals:
Store history of temperature changes and door open/close times.
Define device attributes.
Feed web page displays.
Tables:
Devices -- about each sensor or relay channel
idDevice
Address, varchar(16)
dType, int (1=temperature sensor, 2=switch input, 3=relay)
Channel (0-7, relay only)
Label, varchar(16), short name
Desc, varchar(80), description
State
0=inactive (ignore)
1=active (replied to last poll)
2=missing (no reply or error on last poll)
dtAdded, datetime, when record added
dtState, datetime, when state updated
iValue, int, value changed to this
if temp sensor, degrees F * 10
if switch, 0=closed, 1=open
dtValue, datetime, when value changed
iPrevValue, int, previous value replaced by iValue (used to show how long a door was open or how fast a temperature is changing)
dtPrevValue, datetime, date previous value was set.
Error, varchar(500), device error message
dtError, datetime, when error was thrown
History -- record for each time a temperature, switch state, or relay changes from previous value
idHistory
idDevice
iValue
dtValue
Alarms -- information about alarms (?schedule)
idDevice
tbd
Server
On start:
scan for all devices
lookup in Devices table
log missing devices, set state 2
save initial state and value for each in DB and locally.
Keeps last value for each device, updates database only on changes
Application settings:
IntervalRelay, time (ms) to sleep before next check of relay switch values, starting with 200ms.
IntervalTemp, minimum time (seconds) to check temperatures, starting with 60s.
LogLevel, 1-4 for debugging.
Notes and Problems
Version 1 of OWCollector working 2/7/15. Had to copy 3 J++ DLL's to bin directory.
Dynamically reload application settings; do My.Settings.Reset() instead of My.Settings.Reload()
Not stopping via service manager.
Web App
Had to follow instructions at http://support.microsoft.com/kb/2915218 to get working on IIS.