rstrouse / ESPSomfy-RTS

A controller for Somfy RTS shades and blinds
The Unlicense
430 stars 32 forks source link

Now starting with USB power adaptar #286

Closed luismalddonado closed 4 months ago

luismalddonado commented 4 months ago

Hardware

ESP32 ESP-WROOM-32 NodeMCU

Firmware version

2.4.0

Application version

2.4.0

What happened? What did you expect to happen?

First of all thanks for this amazing software. But I have a problem using an ESP32 ESP-WROOM-32 NodeMCU Dev Kit C with Chip CP2102: Application does not start when USB power adaptar is used. There are other two situation that make the application works well:

But when starting with USB power adaptar and with Transceiver connected it does not start

How to reproduce it (step by step)

1. Plug in ESP32 with power adaptar
2. ping ESP32 and wait
3. Web interface never gets accesible

Logs

ping to ESP32. I cannot provide Arudino logs, because when using PC USB port, it works well
Pinging 192.168.3.25 with 32 bytes of data:
Request timed out.   <--- ESP32 powered on via USB power adapter
Request timed out.
Request timed out.
Reply from 192.168.3.25: bytes=32 time=9ms TTL=255
Reply from 192.168.3.25: bytes=32 time=1ms TTL=255
Reply from 192.168.3.25: bytes=32 time=1ms TTL=255
Reply from 192.168.3.25: bytes=32 time=1ms TTL=255
Reply from 192.168.3.25: bytes=32 time=4ms TTL=255
Reply from 192.168.3.25: bytes=32 time=1ms TTL=255
Reply from 192.168.3.25: bytes=32 time=3ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=4ms TTL=255
Reply from 192.168.3.25: bytes=32 time=8ms TTL=255
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=6ms TTL=255
Reply from 192.168.3.25: bytes=32 time=7ms TTL=255
Reply from 192.168.3.25: bytes=32 time=5ms TTL=255
Reply from 192.168.3.25: bytes=32 time=4ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=1ms TTL=255
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.3.25: bytes=32 time=8ms TTL=255
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.3.25: bytes=32 time=4ms TTL=255
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.3.10: Destination host unreachable.
Reply from 192.168.3.10: Destination host unreachable.
Reply from 192.168.3.10: Destination host unreachable.
Reply from 192.168.3.10: Destination host unreachable.
Reply from 192.168.3.25: bytes=32 time=1308ms TTL=255
Reply from 192.168.3.25: bytes=32 time=4ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=3ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=16ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=1ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=1ms TTL=255
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.3.25: bytes=32 time=8ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=4ms TTL=255
Reply from 192.168.3.25: bytes=32 time=5ms TTL=255
Reply from 192.168.3.25: bytes=32 time=2ms TTL=255
Reply from 192.168.3.25: bytes=32 time=9ms TTL=255
Reply from 192.168.3.25: bytes=32 time=1ms TTL=255
Request timed out.
Request timed out.
Request timed out.
rstrouse commented 4 months ago

Which pins are you using for the Transceiver? Those periods of request timed out suggest that the esp32 is rebooting when it tries to initialize the radio.

luismalddonado commented 4 months ago

The proposed ones:

  Transceiver      ESP32

1 GND GND 2 VCC 3v3 3 GDO0 GPIO 13 4 CSN GPIO 5 5 SCK GPIO 18 6 MOSI GPIO 23 7 MISO GPIO 19 8 GDO2 GPIO 12

As I mentioned if a start with the Transceiver without power and power it later everything works.

This are the logs when I start from USB port at a PC:

Startup/Boot.... Mounting File System... File system mounted successfully Chip Model ESP32- Preference IP Free Entries: 469 SECURITY Type:0 Username:[] Password:[] Pin:[] Permissions:0 Connection Type: 1 NTP Settings pool.ntp.org TZ:CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00 WIFI Settings SSID: [DOMOTICACASA] PassPhrase: [xxxxxxxxxxxx]

Launching web server... Creating Web MicroServices... WiFi Mode: 0 Scanned 12 Networks... *0: DOMOTICACASA (-40dBm) CH:7 MAC:xxxxxxxxxxx xxxxxxxxxxx

Socket Server Started... Max Heap: 110580 Free Heap: 183916 Min Heap: 181688 Connecting to AP Set hostname to:toldos


Successfully Connected to WiFi!!!!192.168.3.25 (-40dbm) MDNS Responder Started: serverId=CD4950 Max Heap: 110580 Free Heap: 174264 Min Heap: 168444 App Version:2.4.0 shades.cfg exists so we are using that Reading header at 0 version:22 len:76 roomSize:29 roomRecs:0 shadeSize:276 shadeRecs:3 groupSize:194 groupRecs: 0 pos:76 Applying radio settings Setting Data Pins RX:12 TX:13 Setting SPI Pins SCK:18 MISO:19 MOSI:23 CSN:5 Radio Pins Configured! Successfully set up the radio Enabled receive on Pin #12 Timing: 1 Initializing RX Queue Successfully connected MQTT client client-00005049cdef49c0 MQTT Subscribed to:shades/+/target/set MQTT Subscribed to:shades/+/tiltTarget/set MQTT Subscribed to:shades/+/direction/set MQTT Subscribed to:shades/+/mypos/set MQTT Subscribed to:shades/+/myTiltPos/set MQTT Subscribed to:shades/+/sunFlag/set MQTT Subscribed to:shades/+/sunny/set MQTT Subscribed to:shades/+/windy/set MQTT Subscribed to:shades/+/position/set MQTT Subscribed to:shades/+/tiltPosition/set MQTT Subscribed to:groups/+/direction/set MQTT Subscribed to:groups/+/sunFlag/set MQTT Subscribed to:groups/+/sunny/set MQTT Subscribed to:groups/+/windy/set Timing Net: 5646ms Check github for updates... Max Heap: 110580 Free Heap: 168356 Min Heap: 162108 Internet is Available: 1940ms [HTTPS] GET... code: 200 [HTTPS] GET... code: 200 - -1 Max Heap: 59380 Free Heap: 157412 Min Heap: 105968 Loading file /index.html Timing WebServer: 9288ms Socket [1] Disconnected! SSDP: urn:schemas-rstrouse-org:device:ESPSomfyRTS:1 - true Connected to SSDP... Timing Net: 977ms Socket [0] Disconnected! Socket [1] Connected from 192.168.3.16 url: / Socket [0] Connected from 192.168.3.10 url: / Max Heap: 63476 Free Heap: 157260 Min Heap: 105960 Setting Transceiver Json Serialize Radio JSON SCK:18 MISO:19 MOSI:23 CSN:5 RX:12 TX:13 Sending Shade Command Received:{"shadeId":2,"command":"down"} CMD:Down ADDR:1001931 RCODE:84 REPEAT:0 Enabled receive on Pin #12 Timing: 1 Sending Shade Command Received:{"shadeId":2,"command":"down"} CMD:Down ADDR:1001931 RCODE:85 REPEAT:0 Enabled receive on Pin #12 Timing: 1 Sending Shade Command Received:{"shadeId":2,"command":"my"} Moving to My Position Sending Shade Command Received:{"shadeId":2,"command":"my"} Moving to My Position Sending Shade Command Received:{"shadeId":2,"command":"up"} CMD:Up ADDR:1001931 RCODE:86 REPEAT:0 Enabled receive on Pin #12 Timing: 1

rstrouse commented 4 months ago

Lets try this. Get the web interface up then uncheck the enable radio checkbox and save the transceiver. Then hook everything up and lets see if it boots off your usb power adapter. The pins above should not have any boot dependencies.

luismalddonado commented 4 months ago

Lets try this. Get the web interface up then uncheck the enable radio checkbox and save the transceiver. Then hook everything up and lets see if it boots off your usb power adapter. The pins above should not have any boot dependencies.

Same issue with uncheck radio checkbox:

C:\Users\luism>ping -t 192.168.3.25 Pinging 192.168.3.25 with 32 bytes of data: Request timed out. Reply from 192.168.3.25: bytes=32 time=7ms TTL=255 Reply from 192.168.3.25: bytes=32 time=9ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Reply from 192.168.3.25: bytes=32 time=1ms TTL=255 Reply from 192.168.3.25: bytes=32 time=1ms TTL=255 Reply from 192.168.3.25: bytes=32 time=9ms TTL=255 Reply from 192.168.3.25: bytes=32 time=4ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Reply from 192.168.3.25: bytes=32 time=3ms TTL=255 Request timed out. Request timed out. Request timed out. Reply from 192.168.3.25: bytes=32 time=7ms TTL=255 Request timed out. Request timed out. Request timed out. Reply from 192.168.3.25: bytes=32 time=1ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Reply from 192.168.3.25: bytes=32 time=23ms TTL=255 Reply from 192.168.3.25: bytes=32 time=4ms TTL=255 Reply from 192.168.3.25: bytes=32 time=8ms TTL=255 Reply from 192.168.3.25: bytes=32 time=3ms TTL=255 Reply from 192.168.3.25: bytes=32 time=3ms TTL=255 Reply from 192.168.3.25: bytes=32 time=4ms TTL=255 Request timed out. Request timed out. Request timed out. Reply from 192.168.3.25: bytes=32 time=5ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Reply from 192.168.3.25: bytes=32 time=3ms TTL=255 Reply from 192.168.3.25: bytes=32 time=5ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Request timed out. Request timed out. Request timed out. Reply from 192.168.3.25: bytes=32 time=3ms TTL=255 Reply from 192.168.3.25: bytes=32 time=1ms TTL=255 Reply from 192.168.3.25: bytes=32 time=3ms TTL=255 Reply from 192.168.3.25: bytes=32 time=4ms TTL=255 Reply from 192.168.3.25: bytes=32 time=5ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Reply from 192.168.3.25: bytes=32 time=5ms TTL=255 Reply from 192.168.3.25: bytes=32 time=15ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Reply from 192.168.3.25: bytes=32 time=4ms TTL=255 Reply from 192.168.3.25: bytes=32 time=4ms TTL=255 Reply from 192.168.3.25: bytes=32 time=4ms TTL=255 Reply from 192.168.3.25: bytes=32 time=13ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Reply from 192.168.3.25: bytes=32 time=4ms TTL=255 Reply from 192.168.3.25: bytes=32 time=2ms TTL=255 Request timed out. Request timed out. Reply from 192.168.3.10: Destination host unreachable. Request timed out. Reply from 192.168.3.25: bytes=32 time=5ms TTL=255 Reply from 192.168.3.25: bytes=32 time=5ms TTL=255

rstrouse commented 4 months ago

This seems to indicate that either the power adapter is browning out or the connections are not quite correct. Do you have another adapter? Perhaps some pics of your connections are in order. The pic in the Wiki is a different model ESP32 from the model you have.

luismalddonado commented 4 months ago

Yes. I have tried several power adaptar and also tried with the 5V pin of the ESP32. Always same result.

I'm not handy, but I guess PINS are correct as they work under some circustances. I have reviewed them several times. I will try during this week other ESP32 models.

Thanks for you support and congratulations for this amazing project. Finally a really open solution for Somfy products!

luismalddonado commented 4 months ago

ok. With a different ESP32 board is working perfectly!!!! This issue can be closed and thamks for the support