Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SHT30/DS18B20 errors and warnings in the logs
#11
yes, use a new 1 meter DS18B20 to test whether work well.
Reply
#12
(10-01-2024, 02:41 AM)admin Wrote: yes, use a new 1 meter DS18B20 to test whether work well.

I connected a new sensor with a 1-meter wire. I tested the sensor for over 1 hour and still see the warning in the logs...

   
   
Reply
#13
can you change to use another GPIO port for testing?
Reply
#14
(10-10-2024, 11:48 PM)admin Wrote: can you change to use another GPIO port for testing?

Everything is the same, only there are more warnings in a shorter time.
Any guesses as to why this is happening? I bought the A2 board expecting it would fit my needs, including using only one DS18B20 sensor (because there is everything needed for this), but I get warnings in the sensor operation, so I can't be sure it is working properly.

   
Reply
#15
ok, tomorrow i will test DS18B20 with KC868-A2.
Reply
#16
I tested this sensor with the D1 mini board using a 4K7 pull-up resistor. More than 1 hour passed and I did not receive any warning in the logs.

   
   
Reply
#17
I have tested KC868-A2 board with GPIO33 for DS18B20
   
   
here is webpage:
   
here is my ESPHome config file:
   
you can test with my yaml file (just replace DS18B20 sensor ID by yourself):
Code:
esphome:
  name: a2

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "YnmQggQsfd7jvFefoMqNCpBtb63RXtotS+mSBQVIhY8="

# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

switch:
  - platform: gpio
    name: "a2-light1"
    pin: 15
    inverted: False
    id: relay_1  # Assign ID to relay 1

  - platform: gpio
    name: "a2-light2"
    pin: 2
    inverted: False

binary_sensor:
  - platform: gpio
    name: "a2-input1"
    pin:
      number: 36
      inverted: true

  - platform: gpio
    name: "a2-input2"
    pin:
      number: 39
      inverted: true

external_components:
  - source:
      type: git
      url: https://github.com/ssieb/esphome
      ref: onewire
    components: [ gpio ]
    refresh: 1min

#dallas:
one_wire:
- platform: gpio
   pin: GPIO33
   id: sensor_1

sensor:
  - platform: dallas_temp
    one_wire_id: sensor_1
    address: 0xc1012263977a9928
    filters:
    - lambda: return x * (9.00/5.00) + 32.00;
    name: "Temperature #1"
    unit_of_measurement: "°F"
    icon: "mdi:temperature-fahrenheit"
    device_class: "temperature"
    accuracy_decimals: 2

web_server:
  port: 80

# UART configuration for SIM7600E
uart:
  id: uart_2
  tx_pin: GPIO5
  rx_pin: GPIO13
  baud_rate: 115200

interval:
  - interval: 200ms  # Shorten the interval to reduce blocking time
    then:
      - lambda: |-
          static std::string uart_buffer;
          uint8_t c;
          int count = 0;
          const int max_reads = 10;  // Limit the number of bytes read per interval

          while (id(uart_2).available() && count < max_reads) {
            if (id(uart_2).read_byte(&c)) {
              uart_buffer += (char)c;
              count++;

              // Log each received character (optional for debugging)
              ESP_LOGD("UART", "Received: %c", (char)c);

              // Check if we have received the "RING" signal
              if (uart_buffer.find("RING") != std::string::npos) {
                ESP_LOGI("SIM7600", "Incoming call detected, turning on relay 1.");
                id(relay_1).turn_on();  // Turn on relay 1
                uart_buffer.clear();  // Clear the buffer after processing
              }

              // Clear the buffer if it gets too large
              if (uart_buffer.length() > 100) {
                uart_buffer.clear();
              }
            }
          }
yaml file download: 
.txt   A2-DS18B20-HA.txt (Size: 2.57 KB / Downloads: 35)
Reply
#18
Perhaps you misunderstood me. I receive data from the sensor, but from time to time the sensor sends a warning in the logs “Scratch pad checksum invalid!” and the connection with it is lost for one sensor update interval (in my case, 5 seconds). This can happen either 3-5 minutes after launching or 15-20 minutes later, there is no regularity. To make sure that everything is fine, you need to connect the detector and leave the log for 1 hour, and then check if everything is fine. But the fact that these warnings appear in the logs must mean something. As I mentioned above, I don't get these warnings on my other D1 Mini board.

Your example didn't work either. Could something on the A2 board be damaged and affect the warnings from the DS18B20 sensor?
Reply
#19
my code is update every 1 minute, you can change to smaller.
KC868-A2 1-wire circuit, only use by 4 resistance for two GPIO ports.
R11,R12: 4.7K
R13,R14: 100ohm
   
Maybe you can use electric ferrochrome to repair the resistor pad and the gpio pad related to the esp32 module.
Reply
#20
Hmm... can you tell me in more detail what exactly I have to do? I don't know what ferrochrome is or what to do with it.

Are you suggesting that there might be a problem with the resistors? I can solder other 4.7K and 100Ω resistors in their place, but I have standard resistors with legs, not SMD. But before that, can I somehow make sure that the resistors on the board are not working properly?
Reply


Forum Jump:


Users browsing this thread: