User Tools

Site Tools


fhz1000pc

This is an old revision of the document!


FHZ1000PC

fhz1000pc

FHZ 1000 PC (and the newer version FHZ 1300 PC) is an interface device between the FS20 radio protocol and a PC via an USB interface. It is sold by Conrad in Sweden (http://www.conrad.se), Germany and probably in many other countries.

Hardware

fhz1000pc inside

FHZ1000PC has a fairly straight forward structure based on standard components. It is build around a PIC16F628 processor and uses a FT232AM chip from FTDI for USB communication. Looking at the picture above you will see from right:

  • Receiver daughter board (with red antenna)
  • Transmitter daughter board
  • PIC16F628 processor
  • FT232AM USB to serial converter
  • Unknown chip
  • USB-Connector

The software in the PIC-processor communicates with standard asynchronous serial communication with the FT232AM chip using 9600 baud, 1 stop bit and no parity.

There are some german sites where they describe how to modify the hardware:

Interfacing

The software accompanying the device when purchased from Conrad is unfortunately in German only. To make things even worse, the software has no documented external interface allowing direct access to the device. So we are left to do this interfacing ourselves. Fortunately FTDI provides both drivers and API:s to their chips for free (they live on selling the chips), so the drivers can be downloaded from their site. Through their drivers we get access to the serial communication with the PIC-processor. The protocol used here has been reversed engineered by fhz4linux. I want to access the protocol on Windows from Java, but FTDI only supply drivers for C/C++ so I also need some kind of conversion here. I actually considered writing a small C-daemon to talk TCP/IP with, but I found a nice set of Java drivers for the FT232AM-chip (D2XX-drivers) on https://jd2xx.dev.java.net. So I was finally able to write a Java class that represents a FHZ1000PC-device and allow my software to control the FS20 system.

Software

To use the interface you have to do the following steps:

  • Install the software accompanying the device (this is the easiest way to get the USB drivers installed)
  • Download the D2XX-java drivers from jd2xx.dev.java.net, it is actually the files jd2xx.dll and jd2xx.jar you need. I had to use the 2005-version since I got problems with the 2006-build.
  • Download my fhz1000pc interface class, and you are all set to talk Java to FHZ1000PC.

Example

public class HomeManager {
   static int houseCode = FHZ1000PC.StringFS20ToInt("11112433");
   static byte lamp = (byte)FHZ1000PC.StringFS20ToInt("1113");
   static byte button = (byte)FHZ1000PC.StringFS20ToInt("1141");
   static FHZ1000PC port;
   public static void main(String[] args) {
      try {
         port = new FHZ1000PC();
         port.fs20Init();
         // Turn the lamp off
         port.sendFS20Command(houseCode, lamp, FHZ1000PC.COMMAND_OFF);
         port.registerEventListener(new FS20EventListener(){
            public void fs20Event(FS20Event event){
               if ((event.getHouseCode() == houseCode) && (event.getButton() == button)){
                  try {
                     // If I receive a command from the button, resend it to the lamp
                     port.sendFS20Command(houseCode, lamp, event.getFunction());
                  }
                  catch  (IOException e){
                     e.printStackTrace();
                  }
               }
            }
         });
         Thread.sleep(10000);
      }
      catch (IOException e){
         e.printStackTrace();
      }
      catch (InterruptedException e){
         e.printStackTrace();
      }
   }
}
fhz1000pc.1206364533.txt.gz · Last modified: 2018/11/03 02:57 (external edit)