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 #14

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

I cannot get it working #14

arkest1 opened this issue Nov 3, 2024 · 2 comments

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants