esphome-cc1101 icon indicating copy to clipboard operation
esphome-cc1101 copied to clipboard

not able to send

Open ageurtse opened this issue 1 year ago • 63 comments

hello i have aa cc1101 hooked up to a wemos D1 mini.

when hooking up i could recieve some data.

but when i resend this data there is nothing happening, the lights wont turn on. what could be wrong, how to find out what is wrong.

below is my yaml file

# --- start default settings ---
esphome:
  name: 118-rf-tranceiver
  includes:
    - cc1101.h
  libraries:
    - SPI
    - "SmartRC-CC1101-Driver-Lib"
    
esp8266:
  board: d1_mini_lite

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pwd

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "rf fallback"
    password: !secret esphome_pwd
  
  manual_ip:
    static_ip: 192.168.1.118
    gateway: 192.168.1.1
    subnet: 255.255.255.0

captive_portal:

# Enable logging
logger:

api:
  password: !secret esphome_api

ota:
  password: !secret esphome_ota

web_server:
  port: 80


# --- End default settings ---

# --- Start of custom sensors ---

sensor:
  - platform: custom
    lambda: |-
      auto my_sensor = new CC1101(
        D5, // SCK
        D6, // MISO
        D7, // MOSI
        D8, // CSN
        D1, // GDO0
        D2, // GDO2
        200, // bandwidth_in_khz
        433.92 // freq_in_mhz
      );
      App.register_component(my_sensor);
      return {my_sensor};
    sensors:
      id: transciver
      internal: true
remote_transmitter:
  - pin: D1 # This is GDO0
    carrier_duty_percent: 100%

remote_receiver:
  - pin: D1 # This is GDO0
      # on the esp8266 use any of D1,D2,D5,D6,D7,Rx
      # Don't use D3,D4,D8,TX, boot often fails.
      # Can't be D0 or GPIO17 b/c no interrupts
    dump: rc_switch
      
binary_sensor:
  - platform: remote_receiver
    name: Garage
    rc_switch_raw:
      code: "0011000100001110101001111000"
      protocol: 1
button:
  - platform: template
    name: Garage
    on_press:
      - lambda: get_cc1101(transciver).beginTransmission();
      - remote_transmitter.transmit_rc_switch_raw:
          code: "0011000100001110101001111000"
          protocol: 1
      - lambda: get_cc1101(transciver).endTransmission();
      - lambda: get_cc1101(transciver).beginTransmission();
      - remote_transmitter.transmit_rc_switch_raw:
          code: "0011000100001110101001111000"
          protocol: 1
      - lambda: get_cc1101(transciver).endTransmission();
      
      - lambda: get_cc1101(transciver).beginTransmission();
      - remote_transmitter.transmit_rc_switch_raw:
          code: "0011000100001110101001111000"
          protocol: 1
      - lambda: get_cc1101(transciver).endTransmission();
      - lambda: get_cc1101(transciver).beginTransmission();
      - remote_transmitter.transmit_rc_switch_raw:
          code: "001100010000111010100111100"
          protocol: 1
      - lambda: get_cc1101(transciver).endTransmission();

ageurtse avatar Aug 16 '22 18:08 ageurtse