-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesp8266-cc1101.yaml
65 lines (55 loc) · 1.46 KB
/
esp8266-cc1101.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
esphome:
# to find SPI for radiolib
platformio_options:
lib_ldf_mode: "deep+"
libraries:
- RadioLib
external_components:
- source:
type: git
url: https://github.com/juanboro/esphome-radiolib-cc1101
packages:
cc1101_controls: !include cc1101-controls.yaml
spi:
# these are the default SPI pins to use on ESP8266
clk_pin: D5 # CC1001 pin 5
mosi_pin: D7 # CC1001 pin 6
miso_pin: D6 # CC1001 pin 7
radiolib_cc1101:
id: mycc1101
cs_pin: D8 # CC1101 pin 4
rx_pin:
number: D2 # This is CC1101 GDO0 pin 3
allow_other_uses: true
tx_pin:
number: D2 # This is also GDO0
allow_other_uses: true
remote_receiver:
- id: rf_receiver
pin:
number: D2 # This is also GDO0
allow_other_uses: true
id: cc1101_gd0_recv
# dump: raw
#on_raw:
# Note on_raw...
# The memory size of the esp8266 is VERY small, and on_raw can just crash on creating the integer vector on
# the heap. So really, outside of either using the rc switch decoding, or writing a custom decoder, receiving is
# pretty limited on the esp8266.
remote_transmitter:
- id: rf_transmitter
pin:
number: D2 # This is GDO0
allow_other_uses: true
id: cc1101_gd0_xmit
on_transmit:
then:
- lambda: id(mycc1101).xmit();
on_complete:
then:
- lambda: id(mycc1101).recv();
carrier_duty_percent: 100%
ota:
platform: esphome
on_begin:
- lambda: id(mycc1101).standby();