we try to forward our rfid tag over https, the first time this works but the second time the forwarding fails (we think the handshake cannot be made), the third time it works again but the 4th time then again not … . this is our Yalm file:
esphome:
name: esp-reader
friendly_name: ESP-Gust
esp32:
board: esp32dev
framework:
type: arduino
http_request:
useragent: esphome/device
timeout: 1s
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
password: "..."
wifi:
ssid: ...
password: ...
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "..."
password: "..."
captive_portal:
binary_sensor:
- platform: gpio
pin:
number: 15
mode: INPUT_PULLUP # uses an internal pullup resistor to pull the pin back the HIGH when the button is not pressed
filters:
- invert # ensures HIGH -> OFF/ LOW -> ON
- delayed_on_off: 10ms # makes sure the transition is smooth
name: "Button"
device_class: running
switch:
- platform: gpio
pin: 2
name: "Status LED"
spi:
clk_pin: GPIO18
mosi_pin: GPIO23
miso_pin: GPIO19
rc522_spi:
id: rfid_rc522
cs_pin: GPIO5
on_tag:
then:
- http_request.post:
verify_ssl: False
url: 'https://..../users/test'
headers:
Content-Type: 'application/json'
name: 'christoph'
body: !lambda |-
std::string payload = "{\"tag_id\": \"" + x + "\"}";
return payload;
and this is the log:
[12:19:33][W][http_request:087]: HTTP Request failed; URL: https://10.108.17.136:1337/users/test; Error: send header failed; Duration: 3 ms
[12:19:33][D][rc522:263]: Found new tag '91-0D-FD-1D'
[12:19:39][D][http_request:099]: HTTP Request completed; URL: https://10.108.17.136:1337/users/test; Code: 200; Duration: 961 ms
[12:19:39][D][rc522:263]: Found new tag '91-0D-FD-1D'
[12:19:39][W][component:214]: Component rc522 took a long time for an operation (0.98 s).
[12:19:39][W][component:215]: Components should block for at most 20-30ms.