Showing posts with label 1-Wire. Show all posts
Showing posts with label 1-Wire. Show all posts

Thursday, November 19, 2009

Configuration Change Required

If you're using a Subversion snapshot of the code and keeping it up to date, you'll have to change the configuration for 1-Wire device factory:

  • Was: net.sf.dz3.device.sensor.impl.onewire.DeviceFactory
  • Now: net.sf.dz3.device.sensor.impl.onewire.OwapiDeviceFactory

Saturday, November 14, 2009

DZ3 Configuration: 1-Wire Sensors

Being too excited about the fact that OWAPI code started working again, I forgot to mention how to configure it for use with not just loggers, but to actually do something useful. Here:

<bean id="device_factory"
class="net.sf.dz3.device.sensor.impl.onewire.DeviceFactory"
init-method="start">
<constructor-arg index="0" value="/dev/ttyUSB0"/>
<constructor-arg index="1" value="regular"/>
</bean>

<bean id="temperature_sensor-6500000055FF1A26"
factory-bean="device_factory"
factory-method="getTemperatureSensor">
<constructor-arg value="6500000055FF1A26"/>
</bean>

The temperature_sensor-6500000055FF1A26 bean can be used in further configuration as usual.

NOTE: If you're inclined to fiddle with configuration before the GUI configurator is out, you might just as well get familiar with Spring Framework, if you aren't already. A powerful tool. All you need for now is the IoC container configuration.

Wednesday, November 11, 2009

DZ3 Instrumentation Release: What's In, What's Not

Any large working system has inevitably evolved from a small working system.

-- Source lost in time

WHAT'S IN
  • 1-Wire Sensors. Temperature and humidity for now;
  • Shell Sensor. If you can extract information from your hardware via shell script, this is what you use to make it available to DZ;
  • Thermostat;
  • Zone Controller;
  • HVAC Unit abstraction;
  • Damper Controller for bang-bang dampers;
  • Damper Controller for modulating dampers;
  • Complete data logging for every measurement point in between, including hysteresis and PID controllers inside of thermostat;
  • JMX instrumentation (quite comprehensive) and control (limited for now).
WHAT'S NOT

Unfortunately, some essential stuff -
  • Servo controller integration;
  • HVAC Unit driver;
  • GUI;
  • Scheduler
And some not so essential -
  • DAC & Core talking over TCP;
  • Obviously, sensor discovery over LAN;
  • xAP, xPL loggers (try, they most probably work, but I haven't checked).
Reason for this is that I wanted to clean up issues accumulated over years, and make sure that the system is completely transparent, can be monitored, and bugs can be seen visually (and most of them are). So the net result of this effort, so far, is a working stable system with no actual outputs (other than data loggers). You can watch it, but you can't touch it.

SO HOW IS IT USEFUL?

Well, if you've never had DZ installed because it was too complex to install and configure, the day of Instrumentation Release is your lucky day. What is already done is a turnkey acceptance of all the sensor network with no configuration beyond 1-Wire adapter port name necessary. Hang the sensors on the wall, start DZ3 and watch your house's thermal behavior in gory details.

If you do already have some variant of DZ installed and connected to actuators, then hold off for a short while, the good stuff is coming.

WHAT'S NEXT?

Exactly what is missing from this release:
  • Servo controller integration;
  • HVAC Unit driver;
  • JMX instrumentation allowing to actually control the thermostat setpoints.
GUI and scheduler ports are still on a back burner for now, the priority is a stable and working system, not a nice looking system.

UPDATE: released.

Tuesday, November 10, 2009

DZ3 Instrumentation Release: Early Access

1-Wire sensor access works in the Subversion code, go for trunk/dz3-master directory tree.

Here's a simple configuration file to have a turnkey logger for all of your existing 1-Wire sensor network, with JMX instrumentation to boot:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

<bean id="device_factory" class="net.sf.dz3.device.sensor.impl.onewire.DeviceFactory" init-method="start">
<constructor-arg index="0" value="/dev/ttyUSB0"/>
<constructor-arg index="1" value="regular"/>
</bean>

<!-- Loggers -->
<bean id="rrdtool" class="java.io.File">
<constructor-arg type="java.lang.String" value="/usr/bin/rrdtool"/>
</bean>
<bean id="rrdbase_onewire" class="java.io.File">
<constructor-arg type="java.lang.String" value="./rrd-onewire"/>
</bean>
<bean id="rrdlogger_onewire" class="net.sf.jukebox.datastream.logger.impl.rrd.RrdLogger" init-method="start">
<constructor-arg index="0" type="java.util.Set">
<set>
<ref bean="device_factory"/>
</set>
</constructor-arg>
<constructor-arg index="1" type="java.io.File" ref="rrdbase_onewire"/>
<constructor-arg index="2" type="java.io.File" ref="rrdtool"/>
</bean>

<!-- JMX configuration -->
<bean id="jmx-wrapper" class="net.sf.jukebox.jmx.JmxWrapper">
<constructor-arg index="0" type="java.util.Set">
<set>
<ref bean="device_factory"/>
</set>
</constructor-arg>
</bean>
</beans>

Just watch the paths, that's all.

Instrumentation Release itself will be finalized either late tonight, or tomorrow. The difference between now and then is that the path from DeviceFactory to TemperatureSensor is currently broken. The rest of the system (if configured) will work, except for the actual physical control - actuators haven't been ported yet.

UPDATE: release source is tagged in Subversion. The path in question has been created, obviously.

Sunday, November 8, 2009

OWAPI Refactoring, Round 2

I've done it once already. Haven't seen the code for a while, and when I looked at it again, I didn't like what I saw.

This is not going to be a lengthy process, just a quick walkthrough with a primary purpose to bring the OWAPI code base up to DZ3 coding standards.

DZ2 code base used OWAPI 1.00 as a base, and this is exactly what is being refactored further. Since that time, a new release came out, OWAPI 1.10. It doesn't look like changes between 1.00 and 1.10 are significant as far as DZ is concerned, and don't really care at this time, for there are reasons that look tangible enough to me:

  • Primary goal at this time is to release the complete working installation of DZ3 as soon as possible;
  • It looks like enthusiasm for 1-Wire sensor networks is dwinding;
  • OWPAI 1.10 still doesn't support the 1-Wire USB Adapter under Linux, and my workstation already doesn't have a serial port;
  • New sensor networ standards are coming out, and 1-Wire is just one of them.
If it turns out that there's a significant demand for features offered by OWAPI 1.10, well, there's always a diff(1) and patch(1).