HM-CFG-USB-2 with HMLAND not working

Hi,
I have a raspberry pi 2 with an HM-CFG-USB-2 stick. I already installed hmcfgusb and it seems like it’s working ok:

[code]USB < 0x0000: 4b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 K…
USB < 0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
USB < 0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
USB < 0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

USB > 0x0000: 48 09 48 4d 2d 55 53 42 2d 49 46 03 c7 0a 4c 45 H.HM-USB-IF…LE
USB > 0x0010: 51 31 31 39 37 37 30 38 30 84 b2 00 00 00 00 56 Q11977080…V
USB > 0x0020: 3e ea 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 >…
USB > 0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
2015-03-12 20:21:02.139049: LAN < HHM-USB-IF,03C7,LEQ1197708,3084B2,000000,00563EEA,0000
HHM-USB-IF,03C7,LEQ1197708,3084B2,000000,00563EEA,0000
usb-transfer took 49ms![/code]
I configured Homegear to use the hmland interface:

[code]# The device family this interface is for
[HomeMaticBidCoS]

Specify an unique id here to identify this device in Homegear

id = hmland

When default is set to “true” Homegear will assign this device

to new peers.

default = true

Options: cul, cc1100, coc, cuno, hmcfglan, hmlgw

deviceType = hmcfglan

IP address of your HM-CFG-LAN

host = localhost

Port number your HM-CFG-LAN listens on. Normally 1000.

port = 1234

Put the AES key printed on your HM-CFG-LAN here

lanKey = 00112233445566778899AABBCCDDEEFF

Specify a 16 byte (32 characters) long AES key here to protect your wireless communication

!!! IMPORTANT: Never ever lose this key. That would render your devices useless.

To remove the key from your devices, you need to factory reset them

rfKey = 00112233445566778899AABBCCDDEEFF

With each key change currentRFKeyIndex needs to be

incremented by 1. Default value is 1.

currentRFKeyIndex = 1

When you change rfKey, put the old key here. To

change the key Homegear needs to know the old and

the new one.

!!! Do not set oldRFKey when you set rfKey for the first time !!!

##oldRFKey = 00112233445566778899AABBCCDDEEFF

Default: responseDelay = 95

Should be “95” for CUL or COC, “100” for TI CC1101 and “60” for HM-CFG-LAN or HM-LGW

responseDelay = 60[/code]
But I am not able to pair any devices.
When I start homegear on the command line I get the following output:

03/12/15 20:45:11.068 Loading RPC server settings from /etc/homegear/rpcservers.conf 03/12/15 20:45:11.070 Loading RPC client settings from /etc/homegear/rpcclients.conf 03/12/15 20:45:11.079 Info: Loading family module mod_homematicwired.so 03/12/15 20:45:11.096 Info: Loading family module mod_insteon.so 03/12/15 20:45:11.116 Info: Loading family module mod_max.so 03/12/15 20:45:11.134 Info: Loading family module mod_miscellaneous.so 03/12/15 20:45:11.147 Info: Loading family module mod_philipshue.so 03/12/15 20:45:11.163 Info: Loading family module mod_homematicbidcos.so 03/12/15 20:45:11.214 Module HomeMatic BidCoS: LAN-Konfigurationsadapter "hmland": Info: Enabling AES encryption for communication with HM-CFG-LAN. 03/12/15 20:45:11.214 Initializing database... 03/12/15 20:45:11.222 Initializing family controller... 03/12/15 20:45:11.222 Module HomeMatic BidCoS: Loading XML RPC devices... 03/12/15 20:45:12.051 Info: Not initializing device family HomeMatic Wired, because no physical interface was found. 03/12/15 20:45:12.052 Info: Not initializing device family INSTEON, because no physical interface was found. 03/12/15 20:45:12.052 Info: Not initializing device family MAX!, because no physical interface was found. 03/12/15 20:45:12.053 Info: Not initializing device family Philips hue, because no physical interface was found. 03/12/15 20:45:12.053 Module Miscellaneous: Loading XML RPC devices... 03/12/15 20:45:12.055 Loading devices... 03/12/15 20:45:12.056 Module HomeMatic BidCoS: Loading HomeMatic BidCoS device 1 03/12/15 20:45:12.059 Module HomeMatic BidCoS: Loading HomeMatic BidCoS device 2 03/12/15 20:45:12.062 Module Miscellaneous: Loading Miscellaneous device 3 03/12/15 20:45:12.063 Start listening for packets... 03/12/15 20:45:12.064 Initializing RPC client... 03/12/15 20:45:12.064 Info: Connecting to host localhost on port 1234... 03/12/15 20:45:12.065 Starting XML RPC server RPCServer1 listening on 0.0.0.0:2001... 03/12/15 20:45:12.071 Starting XML RPC server RPCServer2 listening on 0.0.0.0:2002, SSL enabled... 03/12/15 20:45:12.071 RPC Server (Port 2001): Info: RPC Server started listening on address 0.0.0.0 and port 2001 03/12/15 20:45:12.074 Info: Connected to host localhost on port 1234. Client number is: 1 03/12/15 20:45:12.086 Starting XML RPC server RPCServer3 listening on 0.0.0.0:2003, SSL enabled, authentification enabled... 03/12/15 20:45:12.087 RPC Server (Port 2002): Info: RPC Server started listening on address 0.0.0.0 and port 2002 03/12/15 20:45:12.099 Starting CLI server... 03/12/15 20:45:12.099 RPC Server (Port 2003): Info: RPC Server started listening on address 0.0.0.0 and port 2003 03/12/15 20:45:12.099 Initializing event handler... 03/12/15 20:45:12.099 Loading events... 03/12/15 20:45:12.100 Startup complete. 03/12/15 20:45:13.070 Module HomeMatic BidCoS: LAN-Konfigurationsadapter "hmland": Error: Error communicating with HM-CFG-LAN. AES is enabled but no IV was send from HM-CFG-LAN. Please use the HomeMatic LAN Interface Configurator to re-enable AES. 03/12/15 20:45:13.071 Module HomeMatic BidCoS: LAN-Konfigurationsadapter "hmland": Error: Error communicating with HM-CFG-LAN. AES is enabled but no IV was send from HM-CFG-LAN. Please use the HomeMatic LAN Interface Configurator to re-enable AES.
As I understand, it is not possible to use AES with the HM-CFG-USB-2. But how do I disable AES in Homegear? When I comment out the AES key lines, I get an error at startup.

Hey that’s not true. Only the AES encryption of the LAN communication is not supported (and not needed as the daemon runs locally). The wireless (BidCoS) AES handshakes are supported. To make the communication with the hmland work, you need to comment out the line starting with “lanKey =” in your physicalinterfaces.conf. “rfKey” needs to be set though, otherwise it won’t work.

So your config should look like this:

[HomeMaticBidCoS]
id = hmland
default = true
deviceType = hmcfglan
host = localhost
# Port number of the hmland
port = 1234
# lanKey is not supported by the hmland
# lanKey = 00112233445566778899AABBCCDDEEFF
rfKey = 00112233445566778899AABBCCDDEEFF
currentRFKeyIndex = 1
responseDelay = 60

Cheers,

Sathya

Ah ok, I wasn’t aware of that.

Great, that’s what I was looking for! It is working now, thank you very much. That hint should go in your wiki.

Great :smiley:

Definitely… :unamused:

Hello,

as a newby on Homegear I installed Homegear and HMLAN. Looking at the wiki and forum was difficult to find the installation parts and configuration infos. Then I find the Wiki entry homegear.eu/index.php/HM-CFG-USB. So I add this to my physicalinterfaces.conf. This results in that no module for HM-CFG-USB was not found. Further investigation in Google shows me this forum entry. In them [HM-CFG_USB] was changed to [HomeMaticBidCoS] this results in that Homegear is starting well, but the error log shows:

Module HomeMatic BidCoS: LAN-Konfigurationsadapter “hmland”: Error: First packet from HM-CFG-LAN does not start with “HHM-LAN-IF” or has wrong structure.

Any Hints what wrong in my installation?

Thanks Rainer

My physicalinterfaces.conf

[code]#######################################
############# HM-CFG-USB #############
#######################################

The device family this interface is for

#[HM-CFG-USB]
[HomeMaticBidCoS]

Specify an unique id here to identify this device in Homegear

id = hmland

When default is set to “true” Homegear will assign this device

to new peers.

default = true

Homegear devicetype

deviceType = hmcfglan

#device = /dev/hidraw0

IP address running the hmland service

host = 127.0.0.1

Port number of the hmland service

port = 1234

Specify a 16 byte (32 characters) long AES key here to protect your wireless communication

rfKey = 00112233445566778899AABBCCDDEEFF

With each key change currentRFKeyIndex needs to be

incremented by 1. Default value is 1.

currentRFKeyIndex = 1

Default: responseDelay = 95

responseDelay = 60
[/code]

The log

02/05/16 21:18:13.482 Info: Loading family module mod_philipshue.so 02/05/16 21:18:13.483 Info: Loading family module mod_insteon.so 02/05/16 21:18:13.485 Info: Loading family module mod_miscellaneous.so 02/05/16 21:18:13.486 Info: Loading family module mod_homematicwired.so 02/05/16 21:18:13.488 Info: Loading family module mod_homematicbidcos.so 02/05/16 21:18:13.490 Info: Loading family module mod_max.so 02/05/16 21:18:13.496 Module HomeMatic BidCoS: LAN-Konfigurationsadapter "hmland": Info: Disabling AES encryption for communication with HM-CFG-LAN. 02/05/16 21:18:13.496 Initializing database... 02/05/16 21:18:13.497 Initializing family controller... 02/05/16 21:18:13.497 Module HomeMatic BidCoS: Loading XML RPC devices... 02/05/16 21:18:13.565 Info: Not initializing device family HomeMatic Wired, because no physical interface was found. 02/05/16 21:18:13.565 Info: Not initializing device family INSTEON, because no physical interface was found. 02/05/16 21:18:13.565 Info: Not initializing device family MAX!, because no physical interface was found. 02/05/16 21:18:13.565 Info: Not initializing device family Philips hue, because no physical interface was found. 02/05/16 21:18:13.565 Module Miscellaneous: Loading XML RPC devices... 02/05/16 21:18:13.565 Loading devices... 02/05/16 21:18:13.565 Module HomeMatic BidCoS: Loading HomeMatic BidCoS device 1 02/05/16 21:18:13.565 Module HomeMatic BidCoS: Loading HomeMatic BidCoS device 2 02/05/16 21:18:13.566 Module Miscellaneous: Loading Miscellaneous device 3 02/05/16 21:18:13.566 Start listening for packets... 02/05/16 21:18:13.566 Initializing RPC client... 02/05/16 21:18:13.566 Starting XML RPC server RPCServer1 listening on 0.0.0.0:2001... 02/05/16 21:18:13.566 Info: Connecting to host 127.0.0.1 on port 1234... 02/05/16 21:18:13.566 Info: Connected to host 127.0.0.1 on port 1234. Client number is: 0 02/05/16 21:18:13.566 Starting XML RPC server RPCServer2 listening on 0.0.0.0:2002, SSL enabled... 02/05/16 21:18:13.570 Starting XML RPC server RPCServer3 listening on 0.0.0.0:2003, SSL enabled, authentification enabled... 02/05/16 21:18:13.572 RPC Server (Port 2002): Info: RPC Server started listening on address 0.0.0.0 and port 2002 02/05/16 21:18:13.572 RPC Server (Port 2001): Info: RPC Server started listening on address 0.0.0.0 and port 2001 02/05/16 21:18:13.573 Starting CLI server... 02/05/16 21:18:13.573 RPC Server (Port 2003): Info: RPC Server started listening on address 0.0.0.0 and port 2003 02/05/16 21:18:13.573 Initializing event handler... 02/05/16 21:18:13.573 Loading events... 02/05/16 21:18:13.573 Startup complete. 02/05/16 21:18:13.653 Module HomeMatic BidCoS: LAN-Konfigurationsadapter "hmland": Error: First packet from HM-CFG-LAN does not start with "HHM-LAN-IF" or has wrong structure. Please check your AES key in physicalinterfaces.conf. Stopping listening. Packet was: HHM-USB-IF,03C3,JEQ0701054,1EBE9D,9A6FFE,00039378,0000

You must add -I option to the hmland startup script.

See git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb

[quote]Important compatibility information:
If older Fhem-versions (before 2015-06-19) or Homegear before 2015-07-01 is used to connect to hmland, the -I switch might be needed to impersonate a LAN-interface (this replaces the identity string HM-USB-IF with HM-LAN-IF). eQ-3 rfd (CCU and configuration software) works without this switch. Software which needs this will not keep a stable connection open to hmland without this switch. It was the hardcoded default in versions < 0.100.[/quote]

Many Thanks, it works with the -I :smiley: