CC1101 module not working

Hey guys,

yesterday I tried to make my CC1101 module running on my Raspberry Pi with Homegear. However it doesn’t work. Here is my setup:
[ol]
[li]Installed the Raspberry image containing Homegear and OpenHAB from homegear.eu/downloads/rpi_homege … penhab.zip.[/li]
[li] Installed the Homegear nightlies from 2015-11-11[/li]
[li] Using the CC1101 module from aliexpress.com/item/Free-shi … 60542.html[/li]
[li] Wired the module like this (pins in paranthesis)

RPI CC1101 3V3 Power (17) <—> VCC (1) Ground (25) <—> GND (9) MOSI (19) <—> SI (3) MISO (21) <—> SO (5) CE0 (24) <—> CSN (7) CLK (23) <—> SCLK (4) GPIO25 (22) <—> GDO2 (6) [/li]
[li] Using these settings within /etc/homegear/physicalinterfaces.conf:

[code]


---------------------------- HomeMatic BidCoS ----------------------------


#######################################
########## TI CC1101 Module ##########
#######################################

The device family this interface is for

[HomeMaticBidCoS]

Specify an unique id here to identify this device in Homegear

id = My-CC1101

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

to new peers.

default = true

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

deviceType = cc1100
device = /dev/spidev0.0

Default: responseDelay = 95

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

responseDelay = 100

The interrupt pin to use. “0” for GDO0 or “2” for GDO2.

You only need to connect one of them. Specify the GPIO

you connected the interrupt pin to below.

interruptPin = 2

The GPIO GDO0 or GDO2 is connected to. Specify which GDO to use above.

gpio1 = 25

Additional TI CC1190 Config

The GPIO high gain mode of the CC1190 is connected to.

Default: -1 (disabled)

#highGainModeGpio = 5

The hexadecimal value for the PATABLE of the TI CC1101.

Default:

- Without high gain mode: 0xC2

- With high gain mode: 0x27 (maximum legally allowed setting)

#txPowerSetting = 0x27
[/code][/li][/ol]

Now performing “sudo /etc/init.d/homegear restart” outputs this:

[ ok ] Stopping Homegear: homegear.                                                                           
12/01/15 07:45:58.304 Error: Failed to export GPIO with index 2 for device "cc1100": GPIO not defined in physicel devices' settings.
12/01/15 07:45:58.307 Error: Failed to export GPIO with index 2 for device "cc1100": GPIO not defined in physicel devices' settings.
12/01/15 07:45:58.312 Error: Could not setup GPIO for device cc1100: GPIO path for index 2 is not set.
12/01/15 07:45:58.313 Error: Could not setup GPIO for device cc1100: GPIO path for index 2 is not set.
12/01/15 07:45:58.317 Failed to set direction for GPIO with index "2": GPIO not defined in physicel devices' settings.
12/01/15 07:45:58.318 Failed to set direction for GPIO with index "2": GPIO not defined in physicel devices' settings.
[....] Starting Homegear: homegear12/01/15 07:45:58.569 Loading RPC server settings from /etc/homegear/rpcservers.conf
12/01/15 07:45:58.576 Loading RPC client settings from /etc/homegear/rpcclients.conf
. ok 

Invoking “sudo homegear” outputs this:

12/01/15 09:13:47.212 Loading RPC server settings from /etc/homegear/rpcservers.conf
12/01/15 09:13:47.220 Loading RPC client settings from /etc/homegear/rpcclients.conf
12/01/15 09:13:47.384 Info: Loading family module mod_miscellaneous.so
12/01/15 09:13:47.405 Info: Loading family module mod_homematicbidcos.so
12/01/15 09:13:47.501 Info: Loading family module mod_max.so
12/01/15 09:13:47.557 Info: Loading family module mod_sonos.so
12/01/15 09:13:47.590 Info: Loading family module mod_philipshue.so
12/01/15 09:13:47.620 Info: Loading family module mod_insteon.so
12/01/15 09:13:47.673 Info: Loading family module mod_homematicwired.so
12/01/15 09:13:47.748 Info: Backing up database...
12/01/15 09:13:47.770 Can't execute "PRAGMA journal_mode=DELETE": database is locked
12/01/15 09:13:47.771 Can't execute "PRAGMA journal_mode=DELETE": database is locked
12/01/15 09:13:47.979 Initializing database...
12/01/15 09:13:47.992 Initializing family controller...
12/01/15 09:13:47.993 Module HomeMatic BidCoS: Loading XML RPC devices...
12/01/15 09:13:51.264 Info: Skipping file rf_central.xml: File is not needed.
12/01/15 09:13:53.915 Info: Not initializing device family HomeMatic Wired, because no physical interface was found.
12/01/15 09:13:53.917 Info: Not initializing device family INSTEON, because no physical interface was found.
12/01/15 09:13:53.918 Info: Not initializing device family MAX!, because no physical interface was found.
12/01/15 09:13:53.919 Module Philips hue: Loading XML RPC devices...
12/01/15 09:13:53.953 Info: Not initializing device family Sonos, because no physical interface was found.
12/01/15 09:13:53.955 Module Miscellaneous: Loading XML RPC devices...
12/01/15 09:13:53.968 Loading devices...
12/01/15 09:13:53.971 Module HomeMatic BidCoS: Loading HomeMatic BidCoS device 1
12/01/15 09:13:53.978 Module HomeMatic BidCoS: Loading HomeMatic BidCoS device 2
12/01/15 09:13:53.990 Module Philips hue: Loading device 4
12/01/15 09:13:53.996 Module Philips hue: Loading peer 1
12/01/15 09:13:54.010 Module Philips hue: Loading peer 2
12/01/15 09:13:54.025 Module Philips hue: Loading peer 3
12/01/15 09:13:54.040 Module Philips hue: Loading peer 4
12/01/15 09:13:54.068 Module Miscellaneous: Loading Miscellaneous device 3
12/01/15 09:13:54.071 Start listening for packets...
12/01/15 09:13:54.073 Module HomeMatic BidCoS: TI CC110X "My-CC1101": Rf device is in use: /dev/spidev0.0
12/01/15 09:13:54.074 Module HomeMatic BidCoS: TI CC110X "My-CC1101": Rf device is in use: /dev/spidev0.0
12/01/15 09:13:54.078 Critical: At least one of the physical devices could not be opened... Exiting...
12/01/15 09:13:54.079 Critical: At least one of the physical devices could not be opened... Exiting...
12/01/15 09:13:55.999 Info: Disposing family module mod_sonos.so
12/01/15 09:13:56.126 Info: Disposing family module mod_philipshue.so
12/01/15 09:13:56.128 Info: Disposing family module mod_miscellaneous.so
12/01/15 09:13:56.130 Info: Disposing family module mod_max.so
12/01/15 09:13:56.132 Info: Disposing family module mod_insteon.so
12/01/15 09:13:56.133 Info: Disposing family module mod_homematicwired.so
12/01/15 09:13:56.135 Info: Disposing family module mod_homematicbidcos.so
12/01/15 09:13:56.146 Closing database...
12/01/15 09:13:56.149 Error: Can't execute "PRAGMA journal_mode = DELETE": database is locked
12/01/15 09:13:56.149 Error: Can't execute "PRAGMA journal_mode = DELETE": database is locked

Invoking “ls -la /sys/class/gpio/” outputs this:

total 0
drwxr-xr-x  2 root root    0 Dec  1 07:45 .
drwxr-xr-x 41 root root    0 Nov 30 22:18 ..
--w-------  1 root root 4096 Nov 30 22:19 export
lrwxrwxrwx  1 root root    0 Dec  1 07:45 gpio25 -> ../../devices/soc/20200000.gpio/gpio/gpio25
lrwxrwxrwx  1 root root    0 Nov 30 22:19 gpiochip0 -> ../../devices/soc/20200000.gpio/gpio/gpiochip0
--w-------  1 root root 4096 Nov 30 22:19 unexport

Invoking “sudo gpio -v” outputs this:

gpio version: 2.30
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Model B, Revision: 03, Memory: 512MB, Maker: Egoman 
  Device tree is enabled.
  * Root or sudo required for GPIO access.

Invoking “sudo gpio readall” outputs this:

 +-----+-----+---------+------+---+-Model B2-+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |
 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI | ALT0 | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO | ALT0 | 0 | 21 || 22 | 1 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK | ALT0 | 0 | 23 || 24 | 1 | ALT0 | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | ALT0 | CE1     | 11  | 7   |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |  28 |  17 | GPIO.17 |   IN | 0 | 51 || 52 | 0 | IN   | GPIO.18 | 18  | 29  |
 |  30 |  19 | GPIO.19 |   IN | 0 | 53 || 54 | 0 | IN   | GPIO.20 | 20  | 31  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+-Model B2-+---+------+---------+-----+-----+

Invoking “sudo gpio exports” outputs this:

GPIO Pins exported:
  25: in   1  both   

Hope I collected all needed info in order to investigate this.
Any help is appreciated and many thanks!!!

Thomas

Follow up:
I installed the latest nightlies version 0.6.0-1056 and transferred the config settings from /etc/homegear/physicalinterfaces.conf to /etc/homegear/families/homematicbidcos.conf.
Then I deleted /var/log/homegear/homegear.log and /var/log/homegear/homegear.err.

Doing a “sudo /etc/init.d/homegear restart” no homegear.err gets generated and I get this in homegear.log

12/01/15 12:36:17.032 Info: Loading family module mod_miscellaneous.so
12/01/15 12:36:17.085 /etc/homegear/families/miscellaneous.conf
12/01/15 12:36:17.087 Info: Loading family module mod_homematicbidcos.so
12/01/15 12:36:17.232 /etc/homegear/families/homematicbidcos.conf
12/01/15 12:36:17.247 Info: Loading family module mod_max.so
12/01/15 12:36:17.344 /etc/homegear/families/max.conf
12/01/15 12:36:17.345 Info: Loading family module mod_sonos.so
12/01/15 12:36:17.415 /etc/homegear/families/sonos.conf
12/01/15 12:36:17.419 Info: Loading family module mod_philipshue.so
12/01/15 12:36:17.480 /etc/homegear/families/philipshue.conf
12/01/15 12:36:17.488 Info: Loading family module mod_insteon.so
12/01/15 12:36:17.569 /etc/homegear/families/insteon.conf
12/01/15 12:36:17.604 Info: Loading family module mod_homematicwired.so
12/01/15 12:36:17.665 /etc/homegear/families/homematicwired.conf
12/01/15 12:36:17.674 Info: Settings up physical interfaces and GPIOs...
12/01/15 12:36:17.686 Info: Dropping privileges to user homegear (104) and group homegear (106)
12/01/15 12:36:17.686 Info: Homegear is (now) running as user with id 104 and group with id 106.
12/01/15 12:36:17.859 Info: Backing up database...
12/01/15 12:36:18.211 Initializing database...
12/01/15 12:36:18.227 Initializing licensing controller...
12/01/15 12:36:18.228 Loading licensing controller data...
12/01/15 12:36:18.228 Initializing family controller...
12/01/15 12:36:18.228 Module HomeMatic BidCoS: Loading XML RPC devices...
12/01/15 12:36:21.571 Info: Skipping file rf_central.xml: File is not needed.
12/01/15 12:36:24.350 Info: Not initializing device family HomeMatic Wired, because no physical interface was found.
12/01/15 12:36:24.351 Info: Not initializing device family Insteon, because no physical interface was found.
12/01/15 12:36:24.351 Info: Not initializing device family MAX!, because no physical interface was found.
12/01/15 12:36:24.352 Module Philips hue: Loading XML RPC devices...
12/01/15 12:36:24.387 Module Sonos: Loading XML RPC devices...
12/01/15 12:36:24.451 Module Miscellaneous: Loading XML RPC devices...
12/01/15 12:36:24.464 Loading devices...
12/01/15 12:36:24.466 Module HomeMatic BidCoS: Loading HomeMatic BidCoS device 1
12/01/15 12:36:24.474 Module Philips hue: Loading device 4
12/01/15 12:36:24.478 Module Philips hue: Loading peer 1
12/01/15 12:36:24.492 Module Philips hue: Loading peer 2
12/01/15 12:36:24.504 Module Philips hue: Loading peer 3
12/01/15 12:36:24.516 Module Philips hue: Loading peer 4
12/01/15 12:36:24.537 Module Sonos: Created Sonos central with id 0 and serial number VSC3569551
12/01/15 12:36:24.539 Module Miscellaneous: Loading Miscellaneous central 3
12/01/15 12:36:24.541 Start listening for packets...
12/01/15 12:36:24.560 Initializing RPC client...
12/01/15 12:36:24.561 Starting XML RPC server RPCServer1 listening on 0.0.0.0:2001...
12/01/15 12:36:24.564 Module Sonos: Event server "My-Sonos-1234": Info: Started listening on address 192.168.77.10 and port 7373
12/01/15 12:36:24.574 Starting XML RPC server RPCServer2 listening on 0.0.0.0:2002, SSL enabled...
12/01/15 12:36:24.585 RPC Server (Port 2001): Info: RPC Server started listening on address 0.0.0.0 and port 2001
12/01/15 12:36:24.619 Starting XML RPC server RPCServer3 listening on 0.0.0.0:2003, SSL enabled, authentication enabled...
12/01/15 12:36:24.624 RPC Server (Port 2002): Info: RPC Server started listening on address 0.0.0.0 and port 2002
12/01/15 12:36:24.656 Starting CLI server...
12/01/15 12:36:24.657 Initializing event handler...
12/01/15 12:36:24.657 Loading events...
12/01/15 12:36:24.662 RPC Server (Port 2003): Info: RPC Server started listening on address 0.0.0.0 and port 2003
12/01/15 12:36:24.663 Startup complete. Waiting for physical interfaces to connect.
12/01/15 12:36:24.664 All physical interfaces are connected now.
12/01/15 12:36:24.664 Starting UPnP server...
12/01/15 12:36:24.669 Info: UPnP server: Binding to address: 192.168.77.10
12/01/15 12:36:24.671 UPnP Server: Info: Started listening.

So looks like the CC1101 got initialized correctly right? How can I verify that everything is working fine?

Hey smarthomie,

there was a bug in Homegear that’s why it wasn’t working (it would’ve worked if you would’ve set gpio2 in the config).

See if you receive packets from devices.

Cheers,

Sathya