Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot get it working #5

Open
arkest1 opened this issue Nov 3, 2024 · 29 comments
Open

I cannot get it working #5

arkest1 opened this issue Nov 3, 2024 · 29 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@arkest1
Copy link

arkest1 commented Nov 3, 2024

This code is really what I was looking for. Still had an old project via MySensors, but want to replace all with ESPHome.

I spend almost all weekend, but I cannot get it to work. I created the directory and stored the fancontol.h in the ITHO directrory. I updated the itho.yaml with some miror things like fixed IP, Wifi etc. Than I upload it to the ESP, this all goes well. After a successfull upload the board does not come online any more, so no option for logging. So I have no clue where to start with debugging.
Could this have anything to do with updates from ESPHome itself?
If I do a reset I get this:
[21:26:08]sdd��|�$�|��� ��l� c|������{�c� #��'o�dog��� b�x��l{lsdp�g��� �� d �� �c�o�|�� ��� b��no�d��$����og�l���gs�ۓn �cl��lx�o��� {�ܜ������c '�|��� b��no�� l����g'�l ���n{���o �#����{��o �#����� �l��8�d���o��l������n�{��n|� d ��l��#��� �|�s��l�o���o��l���s�l�d��� �[I][logger:034]: Log initialized [21:26:08][C][safe_mode:079]: There have been 4 suspected unsuccessful boot attempts [21:26:08][I][app:029]: Running through setup()...

I tested with multiple devices, Wemos mini and other ESP's

my code:

substitutions:
  device_name: fancontrol
  ip: "192.168.1.57"
esphome:
  name: "${device_name}"
  includes: 
    - ITHO/fancontrol.h
  libraries: 
    - SPI  
    - https://github.com/CoMPaTech/esphome_itho.git
    - Ticker
         
esp8266:
  board: d1_mini
    framework:
    version: recommended
    
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: "${ip}"
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  ap:
    ssid: "${device_name} Hotspot"
    password: !secret wifi_password_ap    

captive_portal:

logger:

api: 
  encryption:
    key: "9g1nRsrINKAgjFMMduIf2eqRQeRQf3kXMLRPiHZXYhM="  


ota:
  platform: esphome
  password: !secret OTA_password

fan:
  - platform: speed
    speed_count: 3
    id: mech_vent_fan
    output: mech_vent
    name: "Mechanische ventilatie"
    restore_mode: NO_RESTORE
    on_turn_on:
    - logger.log: "Fan Turned On, setting to 10min!"
    - switch.turn_on: fansendt1

    on_turn_off:
    - logger.log: "Fan Turned Off, setting to low speed!"
    - switch.turn_on: fansendlow


output:
  - platform: template
    id: mech_vent
    type: float
    write_action:
      - if:
          condition:
            lambda: return ((state == 0));
          then:
            # action for off
            - logger.log: "Fan set to low speed"
            - switch.turn_on: fansendlow
      - if:
          condition:
            lambda: return ((state > 0) && (state < .34));
          then:
            # action for low
            - logger.log: "Fan set to low speed"
            - switch.turn_on: fansendlow
      - if:
          condition:
            lambda: return ((state > .34) && (state < .67));
          then:
            # action for medium
            - logger.log: "Fan set to medium speed"
            - switch.turn_on: fansendmedium

      - if:
          condition:
            lambda: return ((state == 1));
          then:
            # action for high
            - logger.log: "Fan set to high speed"
            - switch.turn_on: fansendhigh


switch:
  - platform: restart
    name: "${device_name} Restart"
    id: herstart

  - platform: custom
    lambda: |-
      id(mech_vent).set_level(0.33);
      auto fansendlow = new FanSendLow();
      App.register_component(fansendlow);
      return {fansendlow};

    switches:
      name: "FanSendLow"
      id: fansendlow

  - platform: custom
    lambda: |-
      id(mech_vent).set_level(0.66);
      auto fansendmedium = new FanSendMedium();
      App.register_component(fansendmedium);
      return {fansendmedium};

    switches:
      name: "FanSendMedium"
      id: fansendmedium

  - platform: custom
    lambda: |-
      id(mech_vent).set_level(1);
      auto fansendhigh = new FanSendHigh();
      App.register_component(fansendhigh);
      return {fansendhigh};

    switches:
      name: "FanSendHigh"
      id: fansendhigh

  - platform: custom
    lambda: |-
      id(mech_vent).set_level(1);
      auto fansendt1 = new FanSendIthoTimer1();
      App.register_component(fansendt1);
      return {fansendt1};

    switches:
      name: "FanSendTimer1"
      id: fansendt1

  - platform: custom
    lambda: |-
      id(mech_vent).set_level(1);
      auto fansendt2 = new FanSendIthoTimer2();
      App.register_component(fansendt2);
      return {fansendt2};

    switches:
      name: "FanSendTimer2"

  - platform: custom
    lambda: |-
      id(mech_vent).set_level(1);
      auto fansendt3 = new FanSendIthoTimer3();
      App.register_component(fansendt3);
      return {fansendt3};

    switches:
      name: "FanSendTimer3"

  - platform: custom
    lambda: |-
      auto fansendjoin = new FanSendIthoJoin();
      App.register_component(fansendjoin);
      return {fansendjoin};
    switches:
      name: "FanSendJoin"

text_sensor:
  - platform: custom
    lambda: |-
      auto fanrecv = new FanRecv();
      App.register_component(fanrecv);
      return {fanrecv->fanspeed,fanrecv->fantimer,fanrecv->remoteid1,fanrecv->remoteid2,fanrecv->lastid};

    text_sensors:
      - name: "FanSpeed"
        on_value:
          then:
            lambda: |-
              ESP_LOGD("main", "The current version is %s", x.c_str());
              if (strcmp(x.c_str(),"Low")==0) {
                  // id(mech_vent).set_level(0.33);
                  // id(mech_vent).set_level(0);
                  ESP_LOGD("main", "Updating speed to low - mocked");
              }
              if (strcmp(x.c_str(),"Medium")==0) {
                  // id(mech_vent).set_level(0.67);
                  // id(mech_vent).set_level(2);
                  ESP_LOGD("main", "Updating speed medium - mocked");
              }
              if (strcmp(x.c_str(),"High")==0) {
                  // id(mech_vent).set_level(3);
                  ESP_LOGD("main", "Updating speed high - mocked");
              }
      - name: "FanTimer"
      - name: "RemoteID1"
      - name: "RemoteID2"
      - name: "LastID"


sensor:
  - platform: uptime
    name: ${device_name} FanControl Uptime
  - platform: wifi_signal
    name: ${device_name} WiFi Signal
    update_interval: 120s
@laamstys
Copy link

laamstys commented Dec 2, 2024

I've the same issue, the c1011 is not connected to the esp while booting.
Do you have any idea what the cause is?

@arkest1
Copy link
Author

arkest1 commented Dec 2, 2024

I've the same issue, the c1011 is not connected to the esp while booting. Do you have any idea what the cause is?

For me the ESP is not booting if I upload the code. For some reason I can complile, but the ESP seems to not boot.

@CoMPaTech
Copy link
Owner

Not sure why it wouldn't boot, I think I have mine updated up to 2024.11 without issues, but I'll can check to update it coming weekend to rebuild it from scratch.

@CoMPaTech CoMPaTech added bug Something isn't working good first issue Good for newcomers labels Dec 19, 2024
@arkest1
Copy link
Author

arkest1 commented Dec 20, 2024

I tried again on an ESP32-C2 and a wemos D1 mini. Both are not booting. Do you see anything in my code that is wrong?

@CoMPaTech
Copy link
Owner

Just updated to the latest ESPhome and for me it build just successfully, configuration looks good, there are a few minor things that are different when I clean up my (working) configuration and yours displayed, could you check? (Left representing yours, right the working one I have).

The captive portal obviously doesn't matter, but maybe the platform type and board should be moved nowadays?

Scherm­afbeelding 2024-12-22 om 15 20 06

@arkest1
Copy link
Author

arkest1 commented Dec 25, 2024

Thanks for looking into this. I still have the same issue (did all the above suggestions). Do you know if you can boot if the radio is not attached? I wonder if the radio can be an issue, but without the radio attached I also cannot boot up. I does not come online, the upload is successfull, but it will not boot up.

@CoMPaTech
Copy link
Owner

I'm actually trying to completely rewrite it into an 'external component' spotting that 'custom' components are deprecated - but that nevertheless should 'just work'. I have no clue why it won't boot - I see the same garbage in serial logging on mine on bootup (but I guess that's auto speed sensing doing it's thing) then neatly booting up

@arkest1
Copy link
Author

arkest1 commented Dec 25, 2024

If I use Very_Verose logging, I get the following output:

`{ll��|�d�|���d�b<������s�c�#��no�$gn����c�p��ds$sdx�n����d�����c�g�|�������c��'o�d��$`����no�$`���'{���o�bd��$p�'����s�ܜ������c�o�<���c��'o��d`����'od`���gs�ۓo�#��`��;��g�cĒ`�����l����d`���g��d������g��s��'|�d��l ��c�����|�;��l�o���o��l ���{�d�l����
[17:03:47]SDK:2.2.2-dev(38a443e)/Core:3.1.2=30102000/lwIP:STABLE-2_1_3_RELEASE/glue:1.2-65-g06164fb/BearSSL:b024386
[17:03:47][I][logger:034]: Log initialized
[17:03:47][C][safe_mode:079]: There have been 4 suspected unsuccessful boot attempts
[17:03:47][I][app:029]: Running through setup()...
[17:03:47][V][app:030]: Sorting components by setup priority...
[17:03:47][VV][scheduler:063]: set_interval(name='', interval=60000, offset=364)
[17:03:47][VV][scheduler:063]: set_interval(name='update', interval=60000, offset=10457)

so after the garbage It still does something.

@arkest1
Copy link
Author

arkest1 commented Dec 25, 2024

not sure if it helps, but if I use an ESP32 C3 board I get a lot of errors:

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/itho.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing fancontrol (board: esp32-c3-devkitm-1; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.4
|-- SPI @ 2.0.0
|-- esphome_itho @ 0.0.0+20241220224619.sha.cf74ced
|-- Ticker @ 2.0.0
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.6
|-- ArduinoJson @ 6.18.5
Compiling .pioenvs/fancontrol/src/main.cpp.o
Compiling .pioenvs/fancontrol/libd51/esphome_itho/CC1101.cpp.o
Compiling .pioenvs/fancontrol/libd51/esphome_itho/IthoCC1101.cpp.o
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp: In member function 'void CC1101::select()':
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:24:19: error: 'LOW' was not declared in this scope
  digitalWrite(SS, LOW);
                   ^~~
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:24:2: error: 'digitalWrite' was not declared in this scope
  digitalWrite(SS, LOW);
  ^~~~~~~~~~~~
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:24:2: note: suggested alternative: 'spiWrite'
  digitalWrite(SS, LOW);
  ^~~~~~~~~~~~
  spiWrite
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp: In member function 'void CC1101::deselect()':
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:28:19: error: 'HIGH' was not declared in this scope
  digitalWrite(SS, HIGH);
                   ^~~~
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:28:2: error: 'digitalWrite' was not declared in this scope
  digitalWrite(SS, HIGH);
  ^~~~~~~~~~~~
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:28:2: note: suggested alternative: 'spiWrite'
  digitalWrite(SS, HIGH);
  ^~~~~~~~~~~~
  spiWrite
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp: In member function 'void CC1101::spi_waitMiso()':
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:33:11: error: 'digitalRead' was not declared in this scope
     while(digitalRead(MISO) == HIGH) yield();
           ^~~~~~~~~~~
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:33:32: error: 'HIGH' was not declared in this scope
     while(digitalRead(MISO) == HIGH) yield();
                                ^~~~
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:33:38: error: 'yield' was not declared in this scope
     while(digitalRead(MISO) == HIGH) yield();
                                      ^~~~~
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp: In member function 'void CC1101::reset()':
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:44:2: error: 'delayMicroseconds' was not declared in this scope
  delayMicroseconds(5);
  ^~~~~~~~~~~~~~~~~
.piolibdeps/fancontrol/esphome_itho/CC1101.cpp:53:2: error: 'delay' was not declared in this scope
  delay(10);
  ^~~~~
Compiling .pioenvs/fancontrol/lib64d/WiFi/WiFiAP.cpp.o
*** [.pioenvs/fancontrol/libd51/esphome_itho/CC1101.cpp.o] Error 1
In file included from .piolibdeps/fancontrol/esphome_itho/IthoCC1101.cpp:5:
.piolibdeps/fancontrol/esphome_itho/IthoCC1101.h:108:3: error: 'String' does not name a type; did you mean 'stdin'?
   String getLastIDstr();
   ^~~~~~
   stdin
.piolibdeps/fancontrol/esphome_itho/IthoCC1101.cpp:989:8: error: no declaration matches 'String IthoCC1101::getLastIDstr()'
 String IthoCC1101::getLastIDstr() {
        ^~~~~~~~~~
.piolibdeps/fancontrol/esphome_itho/IthoCC1101.cpp:989:8: note: no functions named 'String IthoCC1101::getLastIDstr()'
In file included from .piolibdeps/fancontrol/esphome_itho/IthoCC1101.cpp:5:
.piolibdeps/fancontrol/esphome_itho/IthoCC1101.h:72:7: note: 'class IthoCC1101' defined here
 class IthoCC1101 : protected CC1101
       ^~~~~~~~~~
*** [.pioenvs/fancontrol/libd51/esphome_itho/IthoCC1101.cpp.o] Error 1
In file included from src/main.cpp:78:
src/fancontrol.h: In member function 'virtual void FanRecv::setup()':
src/fancontrol.h:41:15: error: 'D1' was not declared in this scope
       pinMode(D1, INPUT);
               ^~
src/fancontrol.h:41:15: note: suggested alternative: 'A1'
       pinMode(D1, INPUT);
               ^~
               A1
*** [.pioenvs/fancontrol/src/main.cpp.o] Error 1
========================== [FAILED] Took 7.78 seconds ==========================

@CoMPaTech
Copy link
Owner

Looks like it's not picking up the 'found libraries' that I'm ingesting - I'm trying to write it more towards the external_component ... problem is I haven't yet found a proper way to change a hardcoded reference to 'D1' (yeah, it's in the config yaml, but changing it doesn't change the actual call yet).
But at least you could try if this will create a bootable version? From your above logging it shouldn't even try to upload the bootable code though ....

Anyway, if you have a D1 mini - with connection to D1, you could give https://github.com/CoMPaTech/esphome_ct/blob/main/components/cc1101/README.md a whirl

@CoMPaTech
Copy link
Owner

Right - your comment was on a esp32 - that might make more things troublesome with the older code I think - If time allows I'll run it on an m5 or generic esp32 (my s3's and c3's are all in use) - it's one of the oldest projects so still running on an esp8266 here

Forgot to mention, but not all works (as included in the readme - only base functionality could work)

@CoMPaTech
Copy link
Owner

I've just updated the new repo to also consume the set port number from the yaml :)

@arkest1
Copy link
Author

arkest1 commented Dec 26, 2024

I tried the new repo, but I think I do something wrong. It cannot find the fan. See the result from a clean build:

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/itho.yaml...
INFO Unable to import component c1101.fan: No module named 'esphome.components.c1101'
Failed config

fan.c1101: [source /config/esphome/itho.yaml:46]
  
  Platform not found: 'fan.c1101'.
  platform: c1101
  speed_count: 3
  name: Mechanical Fan
  data_pin: D1
  map_off_to_zero: True

my code now looks like this:

substitutions:
  device_name: fancontrol
  ip: '192.168.1.57'

external_components:
  - source: 
      type: git
      url: https://github.com/CoMPaTech/esphome_ct
    # refresh: 3600s # only set this briefly otherwise it just refreshes daily, see https://esphome.io/components/external_components#external-components-refresh for setting refresh too low


esphome:
  name: '${device_name}'

esp8266:
  board: d1_mini
  framework:
    version: recommended
    
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: "${ip}"
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  ap:
    ssid: '${device_name} Hotspot'
    password: !secret wifi_password_ap    

captive_portal:

logger:
  level: VERY_VERBOSE

web_server:
  port: 80

ota:
  platform: esphome
  password: !secret OTA_password


fan:
  - platform: "c1101"
    speed_count: 3
    name: "Mechanical Fan"
    data_pin: D1
    map_off_to_zero: True

Anything i'm missing?

@CoMPaTech
Copy link
Owner

I got hung up on that as well yesterday, but blamed it on still tinkering with the repo. But I do see one of my typos ... it's supposed to be cc1101 not c1101 - does that yield a different result? (Sorry!)

fan:
  - platform: "cc1101"

@arkest1
Copy link
Author

arkest1 commented Dec 26, 2024

I got one step further, but now it still gives some errors during compiling:

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/itho.yaml...
INFO Updating https://github.com/CoMPaTech/esphome_ct@None
INFO Generating C++ source...
INFO Compiling app...
Processing fancontrol (board: d1_mini; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.6
|-- ArduinoJson @ 6.18.5
Compiling .pioenvs/fancontrol/src/esphome/components/cc1101/CC1101.cpp.o
Compiling .pioenvs/fancontrol/src/esphome/components/cc1101/IthoCC1101.cpp.o
Compiling .pioenvs/fancontrol/src/esphome/components/cc1101/fan.cpp.o
In file included from src/esphome/components/cc1101/CC1101.cpp:5:
src/esphome/components/cc1101/CC1101.h:10:10: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://registry.platformio.org/search?q=header:SPI.h
*
*************************************************************

   10 | #include <SPI.h>
      |          ^~~~~~~
compilation terminated.
In file included from src/esphome/components/cc1101/IthoCC1101.h:9,
                 from src/esphome/components/cc1101/IthoCC1101.cpp:5:
src/esphome/components/cc1101/CC1101.h:10:10: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://registry.platformio.org/search?q=header:SPI.h
*
*************************************************************

   10 | #include <SPI.h>
      |          ^~~~~~~
compilation terminated.
Compiling .pioenvs/fancontrol/src/esphome/components/esp8266/core.cpp.o
*** [.pioenvs/fancontrol/src/esphome/components/cc1101/CC1101.cpp.o] Error 1
*** [.pioenvs/fancontrol/src/esphome/components/cc1101/IthoCC1101.cpp.o] Error 1
In file included from src/esphome/components/cc1101/IthoCC1101.h:9,
                 from src/esphome/components/cc1101/fan.cpp:3:
src/esphome/components/cc1101/CC1101.h:10:10: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://registry.platformio.org/search?q=header:SPI.h
*
*************************************************************

   10 | #include <SPI.h>
      |          ^~~~~~~
compilation terminated.
*** [.pioenvs/fancontrol/src/esphome/components/cc1101/fan.cpp.o] Error 1
========================== [FAILED] Took 3.14 seconds ==========================

@CoMPaTech
Copy link
Owner

Good finding, we'd still need two libs in there, i.e.

esphome:
  name: something
  platform: ESP8266
  board: d1_mini_lite
  libraries:
    - SPI
    - Ticker

@CoMPaTech
Copy link
Owner

though not sure about ticker, but that's still in mine

@arkest1
Copy link
Author

arkest1 commented Dec 26, 2024

Yes, that did the trick, it does need ticker (without it failed). So now it compiles and uploads successful, but unfortunately it still does not boots up. I use as (chinese) Wemos D1 mini. Tried 3 different ones that do work with other ESPHome projects. So i do not think it's that hardware.
Anything you can think of? What is the exact board you uses? I might can order another one. The output of the logging is as follows:

[13:25:07]{ll��<�l�<���$��c<������s�#��c��g'�l'o���c�p��dsdrlx�o�����l�����c'�|������c��gn�dćd`����og�$`���gs�ۓncl��lx�o���{�ܜ������c'�|���b��no��d`����gnl`���n{���g��b��`��;��o�b��`�������d`���g��l������o�;��o|��l�l`��c�����|�{��d�g��g�l`���{�l�l����
[13:25:07]SDK:2.2.2-dev(38a443e)/Core:3.1.2=30102000/lwIP:STABLE-2_1_3_RELEASE/glue:1.2-65-g06164fb/BearSSL:b024386
[13:25:07][I][logger:034]: Log initialized
[13:25:07][C][safe_mode:079]: There have been 2 suspected unsuccessful boot attempts
[13:25:07][I][app:029]: Running through setup()...
[13:25:07][V][app:030]: Sorting components by setup priority...
[13:25:07][VV][scheduler:063]: set_interval(name='', interval=60000, offset=16352)
[13:25:07][D][cc1101_fan:033]: restoring
[13:25:07][D][fan:120]: 'Mechanical Fan' - Sending state:
[13:25:07][D][fan:121]:   State: ON
[13:25:07][D][fan:123]:   Speed: 0

@CoMPaTech
Copy link
Owner

I'm using an old one, but apparently both of my. wireless transmitters are out of battery - will swap batteries after the family-shizzle later tonight. It looks like it booted up successfully though? Does the fan become available in HA (or did you not yet add it)?

@CoMPaTech
Copy link
Owner

ow, and chips ... I need to make a button for you as you won't have this transmitter 'joined' to unit ... my bad, that isn't helpful. I'll recheck tonight to create some buttons.

@CoMPaTech
Copy link
Owner

Hitting a wall on adding buttons (ie generalising the RF_code shared between fan and buttons) ... will retry sometime tomorrow

@arkest1
Copy link
Author

arkest1 commented Dec 26, 2024

I'm using an old one, but apparently both of my. wireless transmitters are out of battery - will swap batteries after the family-shizzle later tonight. It looks like it booted up successfully though? Does the fan become available in HA (or did you not yet add it)?

It still got stuck after those first messages. It also stays offline in ESPhome and does not show up in HA, so it looks like it stops during it's boot. no clue why, I'm not a programmer, so difficult to debug other than what I get from the logging itself.

@CoMPaTech
Copy link
Owner

Just a heads-up ... still not getting better code with a simple button to join (which you would need for setting up the first time). Not sure why it locks up on your side, does it 'auto-reboot' a couple of times or does it just freeze up?

@arkest1
Copy link
Author

arkest1 commented Dec 30, 2024

Thanks for all the effort so far.
It just freezes, the output I show before is all I get. If I reboot I get exactly the same output. Tried multiple D1 minis and a nodeMCU v3. They all give the same result. I I reboot the device from the local logging, it get stuck after the same output.

@CoMPaTech
Copy link
Owner

This is what I roughly see - note that even with the latest update of the new repo, it still doesn't listen properly on my side, but at least it should provide you with the buttons -> https://github.com/CoMPaTech/esphome_ct/blob/main/components/cc1101/cc1101.yaml

What I see in the logging (first pressing TImer3 -> then just off again):

[12:02:13][D][c1101_fan:181]: There is a packet
[12:02:13][D][c1101_fan:187]: Unknown Itho packet found
[12:02:13][D][sensor:093]: 'FanControl Uptime': Sending state 48.31200 s with 0 decimals of accuracy
[12:02:23][D][sensor:093]: 'FanControl Signal': Sending state -36.00000 dBm with 0 decimals of accuracy
[12:02:32][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[12:02:53][D][button:010]: 'Run Timer for 30 Minutes' Pressed.
[12:02:53][D][cc1101_fan:157]: RF called witht 3, sending Timer3
[12:02:53][W][component:237]: Component api took a long time for an operation (170 ms).
[12:02:53][W][component:238]: Components should block for at most 30 ms.
[12:03:05][D][fan:021]: 'Mechanical Fan' - Setting:
[12:03:05][D][fan:024]:   State: OFF
[12:03:05][D][cc1101_fan:088]: Call state: ON, speed: -1
[12:03:05][D][cc1101_fan:113]: RF called witht 0 while last is -1 and speed assumed at -1
[12:03:05][D][cc1101_fan:070]: Publishing state: 1

@CoMPaTech CoMPaTech transferred this issue from CoMPaTech/esphome_c1101 Dec 30, 2024
@CoMPaTech
Copy link
Owner

Moved you issue from the old repository to this new one. As custom components are deprecated (but still work) - and some users had issues, I decided to start on making a more proper external component. The current code is 'working' but still less than optimal.

@arkest1
Copy link
Author

arkest1 commented Dec 30, 2024

could you test if the esp boots without the C1011 board attached? it might be that it get stock because my chip is defect?

@CoMPaTech
Copy link
Owner

If (with latest code) I disconnect the power (vcc) to the board - I still see 'restoring' and the mechanical fan state but nothing else - it seems stuck, it doesn't necessarily crash

@arkest1
Copy link
Author

arkest1 commented Dec 30, 2024

Its working !!
At the end the only thing I could think of was an issue with the C1011. I still had a spare one and connected this to the board. After flashing, the board did not boot, when i disconnected the power and connected it again it booted up! So it seems that you cannot run the code without good C1011 connected.
I'm glad its is working, and thanks a lot for all the effort.
By the way, the connection button is working well, even so the 10, 20, 30 minutes timers. (although did not test the length)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants