CUL

This module supports the CUL devices with CULFW running on them.
It's very early code, and not finished, usable yet.
If you want to help me finish it, go right ahead...

http://fhem.de provides a well tested implementation of the CUL and quite a few interfaces.

CUNO

There are different type of devices, this is the CUNO, but there are others only supporting USB for example.

  • CSM-Radio - m644 cpu with 868/433 MHz radio (or equivalent Zigbee module)
  • USB - MCP2200 (ACM)
  • OneWire? host DS2482 @ RJ10 - 4p4c
  • Ethernet - ENC28J60 with PoE option
  • MicroSD connector
  • Bootloader switch
  • 3x multi purpose led
  • MiniUSB / RJ45 sockets
  • 6ISP connector
  • RP-SMA edge-pinheader
  • Powered over USB or Ethernet
  • Plastic housing available

How to flash firmware in CUNO

Install required software.

$ sudo apt-get install avrdude avr-libc

Check port, insert the USB-Cable while pressing the micro-switch on the back.

 ls -l /dev/ttyA*
crw-rw---- 1 root dialout 166, 0 2011-09-01 19:29 /dev/ttyACM0

Download firmware and unpack

$ cd ~install
$ wget http://www.koeniglich.de/culfw/culfw-1.61.tar.gz
$ tar xzvf culfw-1.61.tar.gz
$ cd CUL_VER_161

Or if you want to download the latest revision, you need to use CVS download

$ sudo apt-get install cvs
$ cvs -d:pserver:anonymous@cvs.berlios.de:/cvsroot/culfw login 
$ cvs -z3 -d:pserver:anonymous@cvs.berlios.de:/cvsroot/culfw co culfw
$ cd culfw

Continue with flash


$ vi CHANGED
$ cd Devices/CUNO
$ ls
apps-conf.h  Bootloader    CUNO.c    makefile
board.h      clock-arch.h  CUNO.hex  uip-conf.h
$ vi makefile

change port

AVRDUDE_PORT to /dev/ttyACM0 -b 38400

Compile and flash firmware:

Make sure the board is in program mode, to do this insert the USB-Cable while pressing the micro-switch on the back.
Both red and green led will be lit on CC1100 module.

$  make usbprogram
Compiling C: CUNO.c
Compiling C: ../../clib/cc1100.c
Compiling C: ../../clib/clock.c
Compiling C: ../../clib/delay.c
Compiling C: ../../clib/display.c
Compiling C: ../../clib/stringfunc.c
Compiling C: ../../clib/fncollection.c
Compiling C: ../../clib/ringbuffer.c
Compiling C: ../../clib/rf_send.c
Compiling C: ../../clib/rf_asksin.c
Compiling C: ../../clib/rf_receive.c
Compiling C: ../../clib/rf_router.c
Compiling C: ../../clib/fht.c
Compiling C: ../../clib/fastrf.c
Compiling C: ../../clib/memory.c
Compiling C: ../../clib/serial.c
Compiling C: ../../clib/ttydata.c
Compiling C: ../../clib/ethernet.c
Compiling C: ../../clib/tcplink.c
Compiling C: ../../avr-uip/drivers/enc28j60/enc28j60.c
Compiling C: ../../avr-uip/drivers/enc28j60/network.c
Compiling C: ../../avr-uip/uip/uip.c
Compiling C: ../../avr-uip/uip/uip_arp.c
Compiling C: ../../avr-uip/uip/uiplib.c
Compiling C: ../../avr-uip/uip/psock.c
Compiling C: ../../avr-uip/uip/timer.c
Compiling C: ../../avr-uip/uip/uip-neighbor.c
Compiling C: ../../avr-uip/apps/dhcpc/dhcpc.c
Compiling C: ../../clib/ntp.c
Compiling C: ../../clib/spi.c
Compiling C: ../../clib/twimaster.c
Compiling C: ../../clib/onewire.c
Linking: CUNO.elf
Creating load file for EEPROM: CUNO.eep
Connecting to programmer: .
Found programmer: Id = "AVRBOOT"; type = S
    Software Version = 0.8; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=256 bytes.

Programmer supports the following devices:
    Device code: 0x46

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e960a
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "CUNO.hex" 
avrdude: input file CUNO.hex auto detected as Intel Hex
avrdude: writing flash (32830 bytes):

Writing | ################################################## | 100% 9.60s

avrdude: 32830 bytes of flash written
avrdude: verifying flash memory against CUNO.hex:
avrdude: load data flash data from input file CUNO.hex:
avrdude: input file CUNO.hex auto detected as Intel Hex
avrdude: input file CUNO.hex contains 32830 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 9.00s

avrdude: verifying ...
avrdude: 32830 bytes of flash verified

avrdude done.  Thank you.

I had to reconfigure the IP settings after the upgrade, also DHCP client mode didn't work, so here a few notes to remind me next update:

CUNO setup:

This section describes how to setup CUN for ethernet access with the following settings:
DCHP client: off
IP address/netmask: 192.168.178.18/255.255.255.0
Gateway: 192.168.178.1
NTP server: 192.168.178.10
Time zone offset: GMT+1@

Connect CUN to your PC via USB. On Linux a device /dev/ttyACM0 will appear (on subsequent experiments, the device may be named /dev/ttyACM1, /dev/ttyACM2 and so forth). Use screen /dev/ttyACM0 to talk to CUN and screen /dev/ttyACM0 38400 for CUNO.
Enter the following commands:

V output version, e.g. V 1.61 CUNO868
Wid00 disable DHCP
Rid
Wia192.168.31.126 set IP address
Ria
Wig192.168.31.1 set gateway
Rig
Win255.255.255.0 set netmask
Rin
WiN192.168.31.2 set NTP server
RiN
Wio02 set time zone offset
Rio
En request time from NTP server

The Ri commands read back what you've just written to EEPROM.

Reboot CUNO and connect to it via telnet 192.168.178.18 2323.

FS20

Decoding of FS20 messages is working, controlling FS20 devices needs to be implemented.

EM1000

Decoding of EM1000-S, GS and GZ is working.

FHT80b

Radio heater thermostat Door window sensor

As of revision r649 decoding of FHT80 messages is working.

Settings needed to be implemented.

Day-Temp The default temperature if someone is home
Night-Temp The minimum temperature when heating is off
Desired-Temp Triggered by schema, or if you set it manually
WindowOpen-Temp When window opened temperature may drop to this value before heating is on
Mode Switch schema in FHT on/off (auto is on, man is off)
LowTemp-Offset Unknown
Manu-Temp Temperature set manually
Day Set time of FHT80
Year Set time of FHT80
Month Set time of FHT80
Hour Set time of FHT80
Minute Set time of FHT80

1-Wire

Some notes about 1-Wire support by CUNO will be put here....

Init 1-wire sub system:
2011/09/01 20:12:27 [CUL] > Oi
2011/09/06 11:11:18 [CUL] < R:BE00080171F05110
2011/09/06 11:11:18 [CUL] Unknown/unsupported message format received!
2011/09/06 11:11:18 [CUL] < R:B1000801C03FF110
2011/09/06 11:11:18 [CUL] Unknown/unsupported message format received!
2011/09/06 11:11:18 [CUL] < R:12000801C040F910
2011/09/06 11:11:18 [CUL] Unknown/unsupported message format received!
2011/09/06 11:11:18 [CUL] < D: 3
2011/09/06 11:11:18 [CUL] Unknown/unsupported message format received!
2011/09/06 11:11:18 [CUL] < OK
2011/09/06 11:11:18 [CUL] Unknown/unsupported message format received!

@2011/09/01 20:13:02 [CUL] > Rb
2011/09/01 20:13:02 [CUL] < R0000 = 01 / 1

b - Reset OneWire Bus; Returns:
0 - No Device connected
1 - One or more Devices connected
2 - Short detected on OneWire Bus
@


2011/09/06 11:13:05 [CUL] > Of
2011/09/06 11:13:07 [CUL] < R:BE00080171F05110
2011/09/06 11:13:07 [CUL] Unknown/unsupported message format received!
2011/09/06 11:13:07 [CUL] < R:B1000801C03FF110
2011/09/06 11:13:07 [CUL] Unknown/unsupported message format received!
2011/09/06 11:13:07 [CUL] < R:12000801C040F910
2011/09/06 11:13:07 [CUL] Unknown/unsupported message format received!
2011/09/06 11:13:07 [CUL] < D: 3
2011/09/06 11:13:07 [CUL] Unknown/unsupported message format received!

If you enable HMS DS1820 support, it start sending these messages, and doesn't stop doing that, they flood.
So as I look at it now, 1-Wire support of CUNO is useless.

2011/09/06 11:20:53 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:53 [CUL] < HF00101300200FF
2011/09/06 11:20:53 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:53 [CUL] < HF00201350200FF
2011/09/06 11:20:53 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:53 [CUL] < HF00301400200FF
2011/09/06 11:20:53 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:53 [CUL] < HF00101350200FF
2011/09/06 11:20:53 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:53 [CUL] < HF00201350200FF
2011/09/06 11:20:53 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:53 [CUL] < HF00301400200FF
2011/09/06 11:20:53 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:54 [CUL] < HF00101350200FF
2011/09/06 11:20:54 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:54 [CUL] < HF00201350200FF
2011/09/06 11:20:54 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:54 [CUL] < HF00301400200FF
2011/09/06 11:20:54 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:54 [CUL] < HF00101350200FF
2011/09/06 11:20:54 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:54 [CUL] < HF00201350200FF
2011/09/06 11:20:54 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:54 [CUL] < HF00301400200FF
2011/09/06 11:20:54 [CUL] Unknown/unsupported message format received!
2011/09/06 11:20:54 [CUL] < HF00101300200FF
2011/09/06 11:20:54 [CUL] Unknown/unsupported message format received!

Related Resources

FHT80

  • Added by rdnzl almost 6 years ago

    Status update:

    FS20 decoding is working.
    2011/08/30 08:49:58 [CUL] < F51B73011E7
    2011/08/30 08:49:58 [CUL] FS20 message received with address '51B730' (221234241411) and command 'On' rssi: 231

    EM1000 is working.
    2011/08/30 09:05:57 [CUL] < E0101E30100000000001B
    2011/08/30 09:05:57 [CUL] EM message received sensor 'EM1000-S' [01] with address '01' cumulated value: 0100 last: 0000 top: 0000 msg count: 227

    FHT TFK (door/window sensor) decoding is also working.
    2011/08/30 08:53:57 [CUL] < TABDA9502F4
    2011/08/30 08:53:57 [CUL] FHT TFK message received with address 'ABDA95', status 'Closed' and battery level 'Ok'

  • Added by rdnzl almost 6 years ago

    FHT80 decoding is 99.9% done.

    2011/08/31 09:02:47 [CUL] < T1E1900A60006
    2011/08/31 09:02:47 [CUL] FHT message received with address '1E19' command 'Actuator' (0) value 'SyncNow' RSSI: 6
    2011/08/31 09:02:47 [CUL] < T594A4269C022
    2011/08/31 09:02:47 [CUL] FHT message received with address '594A' command 'Measured-Low' (42) value '19.2' RSSI: 34
    2011/08/31 09:02:47 [CUL] < T594A43690022
    2011/08/31 09:02:47 [CUL] FHT message received with address '594A' command 'Measured-High' (43) value '0' RSSI: 34
    2011/08/31 09:02:47 [CUL] < T594A44690022
    2011/08/31 09:02:47 [CUL] FHT message received with address '594A' command 'Warnings' (44) value '0' RSSI: 34
    2011/08/31 09:02:47 [CUL] Warnings: None, Battery: Ok LowTemp: Ok Sensor: Ok Window: Closed
    

Updated by: rdnzl, Updated over 1 year ago
Access count: 72963 since 2011-08-25

Attached Files

cuno.jpg (81.9 KB) rdnzl, 08/27/2011 04:12 PM

FHT80b.jpg - Radio heater thermostat (10.6 KB) rdnzl, 08/30/2011 09:26 AM

FHT80TF-2.jpg - Door window sensor (6.47 KB) rdnzl, 08/30/2011 09:26 AM

FS20remote.jpg (20 KB) rdnzl, 08/31/2011 09:21 AM

EM1000-GZ.png (51 KB) rdnzl, 08/31/2011 09:27 AM

65530_EM1000GZ_GZS_um.pdf (423 KB) rdnzl, 04/24/2012 02:08 PM

compatibility-matrix-v0.1.jpg (101 KB) rdnzl, 04/24/2012 02:14 PM

Also available in: PDF HTML TXT