rstrouse / ESPSomfy-RTS

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

local build issues #334

Closed alka79 closed 2 months ago

alka79 commented 2 months ago

Hi, Initially I installed the contoller via ESPHome web. That worked like a charm.

I downloaded 2.4.1 source code to build it locally. I changed FW_VERSION to 2.4.1a to notice a difference.

I could compile and upload the newly built SomfyController.ino.esp32s2.bin with the web UI. I had to manually reboot the board at the end though. The newly uploaded firmware was running with v2.4.1a.

However after using the web ui for a short while I started getting Service Errors 500. GET shade?shadeID=12 when trying to access that shade in the settings or /getsecurity randomly with endless spinning wheel. I had to manually reset the board and it worked again... for a while.

I upload twice my bin file with the same results. Since it failed, I re-uploaded via the app the official 2.4.1 bin file, and now it is back to normal.

I must be doing something wrong or use wrong settings. I use Arduino 1.8.19 on windows 10, latest versions of all libraries with an ESP32 S2 mini board. My bin file is 1 199 520 bytes. The esp32s2 you built is 1 169 104 bytes. Here are my options in the Arduino tool menu.

Unfortunately with this board, Arduino does not connect to the serial port to see the messages printed there.

Any hint ?

rstrouse commented 2 months ago

Likely your issues where the endpoint can't be found are an mDNS issues. Try using the ip address in your GETs. Also, be sure you are compiling with:

It is very odd that you are not seeing the serial port when CDC on boot is enabled.

alka79 commented 2 months ago

I use the IP address not the hostname. CDC on boot seems to work only if arduino is used to upload, at least it worked with some basic sample sketches I tried earlier. I might change for a wroover board if it is to painful with this one.

What about the Partition scheme ? I left it to the default

I run on slightly newer versions of the libs. Will try with the same as yours.

rstrouse commented 2 months ago

ArduinoJson v7+ eats up too much codespace at this point and core 3 is only in alpha. Are you using export compiled library? That should compile it with the proper CDC settings for the serial port.

alka79 commented 2 months ago

Yes I use sketch>export compile binary to get the .bin file. After some googling, I finally found a way to see serial output by using coolterm :)

I reconfigured my Arduino environment with the same core and libraries version as yours. To be exhaustive, my SmartRC-CC1101 lib is v2.5.7

I rebuilt and uploaded. It has been stable for a few hours now :)

My bin size is now 1 183 328 bytes. 14KB larger than yours just by adding an "a" to the version. Can this be explained ? maybe different compiler options ?

rstrouse commented 2 months ago

The official release of v2.4.2 fixes some UDP leakage that would cause the unit to crash after several days. Please update with that code.

alka79 commented 2 months ago

I updated today to 2.4.2 and issues with undefined groups are gone.

The update process was a bit hectic.

I had to reinstall from the start with ESP Home web. Thanks to restore of the backup file, I was quickly back on track :)

rstrouse commented 2 months ago

I noticed in the Arduino core that there was an update fix for the OTA where it would intermittently fail if there was a pause in the byte stream. It only happens under very specific conditions but I suspect that is what I have seen from users a couple of times.

I will incorporate these changes in the next release.