Git Product home page Git Product logo

Comments (2)

syssi avatar syssi commented on June 27, 2024

Could you provide your complete YAML? I'm a bit confused because you mentioned CAN bus communication and a crash/reboot which isn't part of the log above.

The warning doesn't cause reboots normally.

from esphome-pipsolar.

paulsteigel avatar paulsteigel commented on June 27, 2024

Hi @syssi
I am sorry for posting on the wrong area, I tried reposting on JK-BMS. But you are so responsive so, let me post it here for you to help!

external_components_source: github://syssi/esphome-jk-bms@main
 # components
 # github://syssi/esphome-jk-bms@main  
 
esphome:
 #includes: wifi_config.cpp
 name: ${name}
 on_boot:
   then:
     - switch.turn_on: switch_charging
     - switch.turn_on: switch_discharging
     - switch.turn_on: switch_chg_float
     
# +--------------------------------------+
# | ESP32 settings                       |
# +--------------------------------------+
# For a stable Bluetooth connection keep the "esp-idf" framework
esp32:
 board: lolin_s2_mini
#  board: esp32doit-devkit-v1
#  framework:
#    type: esp-idf

# for automatic updating new ip on changes
time:
 - platform: sntp
   # ...

external_components:
 - source: ${external_components_source}
   refresh: 0s
 - source: github://pr#5586
   components: [ ota_http ]

logger:
 level: DEBUG

packages:
 extrapkg: !include ./commons/dyndns.yaml


# Please use the native `api` component instead of the `mqtt` section.
# If you use Home Assistant, the native API is more lightweight.
# If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem.
# If you don't use Home Assistant please uncomment the "reboot_timeout: 0s" option.
#api:
#  reboot_timeout: 0s

# If you don't want to use ESPHome's native API you can use MQQT instead.
# In this case don't forget to remove the 'api:' section.
mqtt:
 broker: myhome.sfdp.net.com
 username: mqtt_user
 password: abcxya
 client_id: ${name}_mqtt

# In the event of problems with the WiFi network, the ESP32 will reboot every 15 minutes to try to resolve the problem.
# If we don't want to connect the ESP32 to the WiFi network please remove the 4 lines below.

wifi:
 use_address: ${name}.freemyip.com
 ap:
   ssid: "ESP32S2Lolin"
#    password: !secret wifi_ap_password
   ap_timeout: 10min

captive_portal:

ota:
 password: abcxyz
 # Forward this TCP port to do OTA updates remotely
 port: 8266

<<: !include ./commons/ota_http.yaml

#web_server:
#  port: 80
#  log: false
#  ota: false

<<: !include ./commons/globals.yaml

output:
 - platform: gpio
   pin: 15
   id: led
   inverted: true

light:
 - platform: binary
   output: led
   id: blue_led
   name: "Blue LED"
   internal: true

# +--------------------------------------+
# | JK-BMS UART connection               |
# +--------------------------------------+

uart:
 id: uart_0
 baud_rate: 115200
 rx_buffer_size: 384
 tx_pin: ${tx_pin}
 rx_pin: ${rx_pin}
 debug:
   direction: BOTH

jk_modbus:
 id: modbus0
 uart_id: uart_0

jk_bms:
 id: bms0
 jk_modbus_id: modbus0
 update_interval:  2s
 # enable_fake_traffic: true

.....
# +--------------------------------------+
# | CAN bus script                       |
# +--------------------------------------+
canbus:
 - platform: esp32_can
   tx_pin: ${can_tx_pin}
   rx_pin: ${can_rx_pin}
   can_id: 4
   bit_rate: 500kbps
   on_frame:
   - can_id: 0x305 # Inverter ACK - SMA/LG/Pylon/Goodwe reply
     then:
       - light.toggle:
           id: blue_led
       - lambda: |-
           id(can_ack_counter) = 0;                              // Reset ACK counter
           id(can_status) = "ON";                                // Set CANBUS Status to ON
           id(canbus_status).publish_state(id(can_status));      // Publish text sensor
           ESP_LOGI("main", "received can id: 0x305 ACK");

interval:
 # activate the limits check
 #- interval: 60s
 #  then:
 #    - lambda: |-
 #        ESP_LOGI("main", "Trigger limit_check_script...");
 #        if (!id(limit_check_script).is_running()) id(limit_check_script).execute();          
       
 - interval: 120s
   then:
     - lambda: id(can_ack_counter) = 0;                          // Reset ACK counter for test inverter ACK
         
 - interval: 100ms
   then:
......

When i changed the update_interval to 2s, I saw the problem is link to MQTT also

from esphome-pipsolar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.