CC1101 and ESP32C3 supermini - trying to setup

Hello all,
Im trying to setup an ESP32 super mini with CC1101
ESP super mini: https://lastminuteengineers.com/esp32-pinout-reference/
CC1101: purchases here - https://www.aliexpress.com/item/1005006427924521.html?spm=a2g0o.order_list.order_list_main.76.50f718024pcWMd

I am trying to setup basic thing. - receiver only that will just read the codes it receives and prints them to the console possibly send them to HA as text sensor.

I believe connected it together i think correct (see the yaml file with pins numbers)

i read this post Esphome-cc1101 - unable to transmit or receive
and installed the cc1101 project from github GitHub - dbuezas/esphome-cc1101 which contains an example of receiver/transmitter yaml i took.

when i load this code to my ESP, it gets endless reboots , in the logs it says wacthdog timeout
maybe this ESP mini is to weak for this purpose?
or is there simpler configuration to achieve the above ( read RF codes and print them to console )

any help or direction to look appreciated

yaml iused

esphome:
  name: esp32c-super-mini3
  friendly_name: esp32c-super-mini3
  includes:
    - cc1101.h
  libraries:
    - SPI
    - "SmartRC-CC1101-Driver-Lib"

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino


# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "j*******************************"

ota:
  - platform: esphome
    password: "*******************"

wifi:
  ssid: KEDEM7
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.0.103
    gateway: 192.168.0.1
    subnet: 255.255.255.0
  reboot_timeout: 5min

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "KEDEMESP3"
    password: "*********"

captive_portal:

# Example configuration entry
web_server:
  port: 80
 
light:
  - platform: status_led
    name: "Status LED"
    id: esp3_status_led
    icon: "mdi:alarm-light"
    pin:
      number: GPIO8
      inverted: true
    restore_mode: ALWAYS_OFF

sensor:
  - platform: custom
    lambda: |-
      auto my_sensor = new CC1101(

        // esp8266 example
        // D5, // SCK
        // D6, // MISO
        // D7, // MOSI
        // D3, // CSN
        // D1, // GDO0

        // ESP32 Super Mini
        8, // SCK
        9, // MISO
        10, // MOSI
        2, // CSN
        20, // GDO0

        // esp32 example
        // 18, // SCK
        // 19, // MISO
        // 23, // MOSI
        // 5, // CSN
        // 32, // GDO0

        200, // bandwidth_in_khz
        433.92, // freq_in_mhz
        id(transmitter) // id of remote_transmitter
      );
      App.register_component(my_sensor);
      return {my_sensor};
    sensors:
      id: transciver
      internal: true

remote_transmitter:
  - id: transmitter
    pin:
      number: GPIO20 # This is GDO0
      allow_other_uses: true
    carrier_duty_percent: 100%

remote_receiver:
  - id: receiver
    pin:
      number: GPIO20 # This is GDO0
      allow_other_uses: true
      # 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:
      - raw
binary_sensor:
  - platform: remote_receiver
    name: Garage
    raw:
      # prettier-ignore
      code: [990,-330,330,-990,990,-330,330,-990,330,-990,330,-990,330,-990,330,-990,330,-990,990,-330,330,-990,990,-330,330,-990,330,-990,330,-990,330,-990,330,-990,330,-990,990,-330,990,-330,330,-990,330,-990,990,-330,330,-990,330]

button:
  - platform: template
    name: Garage
    on_press:
      - lambda: get_cc1101(transciver).beginTransmission();
      - remote_transmitter.transmit_raw:
          # prettier-ignore
          code: [990,-330,330,-990,990,-330,330,-990,330,-990,330,-990,330,-990,330,-990,330,-990,990,-330,330,-990,990,-330,330,-990,330,-990,330,-990,330,-990,330,-990,330,-990,990,-330,990,-330,330,-990,330,-990,990,-330,330,-990,330]
          repeat:
            times: 3
            wait_time: 4.733ms
      - lambda: get_cc1101(transciver).endTransmission();


Are you trying to catch a certain kind of devices rf codes? Why this particular rf receiver?

Also, did you happen look at the pinout for your board st any time while setting this up? Im assuming not because, you basically used unusable gpio pins. This will definitely cause problems.

this was just an example i took from web
i dont have this particular agrage door opener described there
i do want in the future to add my RF gate opener
at first, i just want to catch all RF codes, and echo them to the ESP console, so i know what to track
maybe there is a simpler configuration to do that?

Can I ask why you’re doing it this way instead of just making the devices smart and control them from HA? You’d be able to operate it in many ways as well as tracking the door/gate states if it’s activated from the original RF remote. There’s a reason you don’t see people use this method hardly at all. There are easier and better options.

yes i looked at the pinout diagram i attached the link

the configuration is in GPIO numbers, it didnt recognize for esp32 super mini the “D#” terms

not sure what you refer to here
many people have IR/RF remotes done via smart IR/RF hubs or ESP32
so the gate opener its just that
anyway, this is an old gate , the egnine there runs on AC power, i dont really want to tinker there to connect a relay

I just clicked on the link you provided for the esp32 but, yes that is the wrong one and is a full size Dev board.

With 5min of Google searching It was pretty easy to tell lots of people have been having issues with SPI and this board. It seems 2 of the 3 SPI channels are directly connected to the internal flash memory and shouldn’t be used. You are using some of those pins in your config.

Other users say these are the ones you need to use so, I’d try those.

 // ESP32 Super Mini
        4, // SCK
        5, // MISO
        6, // MOSI
        2, // CSN
        20, // GDO0

well, that’s half correct. Yes, many people do including myself but, these are for simple remotes, like the ones that come with TV’s, media center devices, fans, humidifiers, etc. They don’t use them for garage door openers or gate openers because those are made with security in mind and don’t work quite the same way or else everyone’s 15 year old neighbor could simply capture your garage door code and sneak in there to steal all your beer!

Depending on how old yours is, it may not use rolling matched codes with security 2.0 but, it’s not exactly a new technology, it’s been around for a while.

And that AC motor is controlled by…? It’s controlled with low voltage DC.

No worries though, I was just trying to help you out. If you want to go down the road less traveled and deal with all the headaches and shortcomings that comes with it, it’s yours to do with as you please.

2 Likes

thanks, i will try the new pinouts

Just a friendly tip for future projects… Stick with esp32 boards that are actually fully supported by esphome. If the author of the Github repo used an esp8266 d1-mini then you can safely assume that using a brand new board still in development probably isn’t necessary unless you like reporting issues/bugs and being part of the beta testers. You’re just asking for problems using ones not supported yet.

Right,
if you don’t want to complicate your life for nothing, at least for prototyping, use Esp Wroom32. When you have working setup, play with C3-C6-supermininanopicos or esp-01 for not getting bored.

You used that project. Why not ask there for support?

I am also unable to get RX working on an Esp32-c3 based board the ESP8685-WROOM-03 H4. It also uses GPIO20 as receive pin. I can’t get any data from the cse7766 energy meter device. It looks like you also have GPIO20 as the TX pin, should it not be GPIO21 ? I hope you get it working…

Sorry i supplied the wrong pinout
for ESP32 super mini, this is the diagram

The pins number you specified do not seems to match

// ESP32 Super Mini
        4, // SCK
        5, // MISO
        6, // MOSI
        2, // CSN
        20, // GDO0

in the diagram

SCK -> D8 -> GPIO8
MISO -> D9 -> GPIO9
MOSI -> D10 -> GPIO10
CSN -> should be connected to generic GPIO - your listing and mine is same (2)
GDO0 -> should be connected to generic GPIO -> your listing and mine is same (20)

You guys do realise that ESP32 pins are not usually relegated to one use only. For exanple,

The ESP32 has two I2C channels and any pin can be set as SDA or SCL.

and

The ADC (analog to digital converter) and DAC (digital to analog converter) features are assigned to specific static pins. However, you can decide which pins are UART, I2C, SPI, PWM, etc – you just need to assign them in the code. This is possible due to the ESP32 chip’s multiplexing feature.

Manufacturers tend to label things and/or produce pinout diagrans unnecessarily.

This resource is good, and is where I got the above quotes from.

You should visit the 100+ forum posts with people having issues with SPI and certain pins on the c3 super mini amd tell them that they are all mistaken and switching pins isnt what actually fixed their problem.

It would be good to get as good reference for all the esp32 variants. They are now no numerous.

Oh, i cant even keep up with them all, nor do I even try to anymore. For DIY smart home projects, I have yet to encounter a project where a run of the mill esp32 wroom32 or esp32 D1-mini wouldnt work and needed one of the newer S or C variants. Why people are using some of them and especially the ones not even fully supported, just for some, nothing special DIY build consisting of a couple sensors that an esp01 could support… Ill never understand the reasoning behind that decision, if there was even any reasoning to begin with. Unfortunately, I think people just see this or that one is the latest and greatest to hit the market and they thnk it will be a significant improvement or something IDK.

Clearly it isnt commonly based on an informed decision or else you wouldnt see this so frequently.

I think there is a prevalence of the newer variants on the market.

There definitely is, im just not sure why that is, atleast as far as with the DIY smart home community. I dont know anything people are doing now with new boards that couldnt be done just as well with an esp32 wroom32 that came out a few years ago or even an esp8266 in many cases.

I guess lower power requirements is one of the pro’s with some newer ones but, were not talking about huge differences here.

If you ask people why they chose the board they did. You might as well been speaking Swahili when asking because they have no clue, “its newer so, its what I need!”

It would be the only reason I would choose them over Wroom32.

This is taking out a lot of odds:
Choose Wroom32 (with micro-usb) board

esp32:
  board: esp32dev

And use always GPIOxx in pin definitions

1 Like