cc1101 tests

This commit is contained in:
Gábor Poczkodi 2024-02-28 10:31:00 +01:00
parent abc1c3aba4
commit 64baa153b4
7 changed files with 438 additions and 0 deletions

View file

@ -0,0 +1,69 @@
spi:
clk_pin: GPIO6
miso_pin: GPIO5
mosi_pin: GPIO7
sensor:
- platform: cc1101
id: transceiver
cs_pin: GPIO10
gdo0: GPIO3
gdo2: GPIO4
bandwidth: 200
frequency: 433920
rssi:
name: RSSI
lqi:
name: LQI
# https://github.com/esphome/issues/issues/2934
# c3 has four channels, two for tx, two for rx
# dummy transmitter will push rx to the third place
remote_transmitter:
- pin: GPIO21 # TX pin
carrier_duty_percent: 100%
id: dummytx
- pin: GPIO3 # GDO0
carrier_duty_percent: 100%
id: realtx
remote_receiver:
pin: GPIO4 # GDO0
dump:
- rc_switch
# Settings to optimize recognition of RF devices
tolerance: 50%
buffer_size: 2kb
filter: 250us
idle: 4ms
on_rc_switch:
- logger.log:
format: "on_rc_switch: %i %llu"
args: [x.protocol, x.code]
binary_sensor:
- platform: remote_receiver
name: "Window"
rc_switch_raw:
code: '110111110001111011100110'
filters:
- delayed_off: 1000ms
button:
- platform: template
name: "Gate"
on_press:
- cc1101.begin_tx: transceiver
- remote_transmitter.transmit_rc_switch_raw:
transmitter_id: realtx
code: '0111000110010011110110010100011111110001001011110111'
protocol:
pulse_length: 434
sync: [1,6]
zero: [1,2]
one: [2,1]
inverted: true
repeat:
times: 10
- cc1101.end_tx: transceiver

View file

@ -0,0 +1,69 @@
spi:
clk_pin: GPIO6
miso_pin: GPIO5
mosi_pin: GPIO7
sensor:
- platform: cc1101
id: transceiver
cs_pin: GPIO10
gdo0: GPIO3
gdo2: GPIO4
bandwidth: 200
frequency: 433920
rssi:
name: RSSI
lqi:
name: LQI
# https://github.com/esphome/issues/issues/2934
# c3 has four channels, two for tx, two for rx
# dummy transmitter will push rx to the third place
remote_transmitter:
- pin: GPIO21 # TX pin
carrier_duty_percent: 100%
id: dummytx
- pin: GPIO3 # GDO0
carrier_duty_percent: 100%
id: realtx
remote_receiver:
pin: GPIO4 # GDO0
dump:
- rc_switch
# Settings to optimize recognition of RF devices
tolerance: 50%
buffer_size: 2kb
filter: 250us
idle: 4ms
on_rc_switch:
- logger.log:
format: "on_rc_switch: %i %llu"
args: [x.protocol, x.code]
binary_sensor:
- platform: remote_receiver
name: "Window"
rc_switch_raw:
code: '110111110001111011100110'
filters:
- delayed_off: 1000ms
button:
- platform: template
name: "Gate"
on_press:
- cc1101.begin_tx: transceiver
- remote_transmitter.transmit_rc_switch_raw:
transmitter_id: realtx
code: '0111000110010011110110010100011111110001001011110111'
protocol:
pulse_length: 434
sync: [1,6]
zero: [1,2]
one: [2,1]
inverted: true
repeat:
times: 10
- cc1101.end_tx: transceiver

View file

@ -0,0 +1,60 @@
spi:
clk_pin: GPIO18
miso_pin: GPIO19
mosi_pin: GPIO23
sensor:
- platform: cc1101
id: transceiver
cs_pin: GPIO5
gdo0: GPIO32
gdo2: GPIO33
bandwidth: 200
frequency: 433920
rssi:
name: RSSI
lqi:
name: LQI
remote_transmitter:
- pin: GPIO32 # GDO0
carrier_duty_percent: 100%
remote_receiver:
pin: GPIO33 # GDO0
dump:
- rc_switch
# Settings to optimize recognition of RF devices
tolerance: 50%
buffer_size: 2kb
filter: 250us
idle: 4ms
on_rc_switch:
- logger.log:
format: "on_rc_switch: %i %llu"
args: [x.protocol, x.code]
binary_sensor:
- platform: remote_receiver
name: "Window"
rc_switch_raw:
code: '110111110001111011100110'
filters:
- delayed_off: 1000ms
button:
- platform: template
name: "Gate"
on_press:
- cc1101.begin_tx: transceiver
- remote_transmitter.transmit_rc_switch_raw:
code: '0111000110010011110110010100011111110001001011110111'
protocol:
pulse_length: 434
sync: [1,6]
zero: [1,2]
one: [2,1]
inverted: true
repeat:
times: 10
- cc1101.end_tx: transceiver

View file

@ -0,0 +1,60 @@
spi:
clk_pin: GPIO36
miso_pin: GPIO37
mosi_pin: GPIO35
sensor:
- platform: cc1101
id: transceiver
cs_pin: GPIO34
gdo0: GPIO8
gdo2: GPIO9
bandwidth: 200
frequency: 433920
rssi:
name: RSSI
lqi:
name: LQI
remote_transmitter:
- pin: GPIO8 # GDO0
carrier_duty_percent: 100%
remote_receiver:
pin: GPIO9 # GDO0
dump:
- rc_switch
# Settings to optimize recognition of RF devices
tolerance: 50%
buffer_size: 2kb
filter: 250us
idle: 4ms
on_rc_switch:
- logger.log:
format: "on_rc_switch: %i %llu"
args: [x.protocol, x.code]
binary_sensor:
- platform: remote_receiver
name: "Window"
rc_switch_raw:
code: '110111110001111011100110'
filters:
- delayed_off: 1000ms
button:
- platform: template
name: "Gate"
on_press:
- cc1101.begin_tx: transceiver
- remote_transmitter.transmit_rc_switch_raw:
code: '0111000110010011110110010100011111110001001011110111'
protocol:
pulse_length: 434
sync: [1,6]
zero: [1,2]
one: [2,1]
inverted: true
repeat:
times: 10
- cc1101.end_tx: transceiver

View file

@ -0,0 +1,60 @@
spi:
clk_pin: GPIO36
miso_pin: GPIO37
mosi_pin: GPIO35
sensor:
- platform: cc1101
id: transceiver
cs_pin: GPIO34
gdo0: GPIO8
gdo2: GPIO9
bandwidth: 200
frequency: 433920
rssi:
name: RSSI
lqi:
name: LQI
remote_transmitter:
- pin: GPIO8 # GDO0
carrier_duty_percent: 100%
remote_receiver:
pin: GPIO9 # GDO0
dump:
- rc_switch
# Settings to optimize recognition of RF devices
tolerance: 50%
buffer_size: 2kb
filter: 250us
idle: 4ms
on_rc_switch:
- logger.log:
format: "on_rc_switch: %i %llu"
args: [x.protocol, x.code]
binary_sensor:
- platform: remote_receiver
name: "Window"
rc_switch_raw:
code: '110111110001111011100110'
filters:
- delayed_off: 1000ms
button:
- platform: template
name: "Gate"
on_press:
- cc1101.begin_tx: transceiver
- remote_transmitter.transmit_rc_switch_raw:
code: '0111000110010011110110010100011111110001001011110111'
protocol:
pulse_length: 434
sync: [1,6]
zero: [1,2]
one: [2,1]
inverted: true
repeat:
times: 10
- cc1101.end_tx: transceiver

View file

@ -0,0 +1,60 @@
spi:
clk_pin: GPIO18
miso_pin: GPIO19
mosi_pin: GPIO23
sensor:
- platform: cc1101
id: transceiver
cs_pin: GPIO5
gdo0: GPIO32
gdo2: GPIO33
bandwidth: 200
frequency: 433920
rssi:
name: RSSI
lqi:
name: LQI
remote_transmitter:
- pin: GPIO32 # GDO0
carrier_duty_percent: 100%
remote_receiver:
pin: GPIO33 # GDO0
dump:
- rc_switch
# Settings to optimize recognition of RF devices
tolerance: 50%
buffer_size: 2kb
filter: 250us
idle: 4ms
on_rc_switch:
- logger.log:
format: "on_rc_switch: %i %llu"
args: [x.protocol, x.code]
binary_sensor:
- platform: remote_receiver
name: "Window"
rc_switch_raw:
code: '110111110001111011100110'
filters:
- delayed_off: 1000ms
button:
- platform: template
name: "Gate"
on_press:
- cc1101.begin_tx: transceiver
- remote_transmitter.transmit_rc_switch_raw:
code: '0111000110010011110110010100011111110001001011110111'
protocol:
pulse_length: 434
sync: [1,6]
zero: [1,2]
one: [2,1]
inverted: true
repeat:
times: 10
- cc1101.end_tx: transceiver

View file

@ -0,0 +1,60 @@
spi:
clk_pin: D5
miso_pin: D6
mosi_pin: D7
sensor:
- platform: cc1101
id: transceiver
cs_pin: D8 # GPIO15
gdo0: D1 # GPIO5
# gdo2: not used with ESP8266
bandwidth: 200
frequency: 433920
rssi:
name: RSSI
lqi:
name: LQI
remote_transmitter:
- pin: D1 # GDO0
carrier_duty_percent: 100%
remote_receiver:
pin: D1 # GDO0
dump:
- rc_switch
# Settings to optimize recognition of RF devices
tolerance: 50%
buffer_size: 2kb
filter: 250us
idle: 4ms
on_rc_switch:
- logger.log:
format: "on_rc_switch: %i %llu"
args: [x.protocol, x.code]
binary_sensor:
- platform: remote_receiver
name: "Window"
rc_switch_raw:
code: '110111110001111011100110'
filters:
- delayed_off: 1000ms
button:
- platform: template
name: "Gate"
on_press:
- cc1101.begin_tx: transceiver
- remote_transmitter.transmit_rc_switch_raw:
code: '0111000110010011110110010100011111110001001011110111'
protocol:
pulse_length: 434
sync: [1,6]
zero: [1,2]
one: [2,1]
inverted: true
repeat:
times: 10
- cc1101.end_tx: transceiver