rstrouse / ESPSomfy-RTS

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

Hardware ESP not getting to run. Tried 2 ESPs, 3 CC1101, still licking the frozen flagpole #254

Closed fft1010 closed 4 months ago

fft1010 commented 5 months ago

Hi, I am stuck, and I think it is the hardware pin on my ESP. I could get the Software to connect to my WLAN at home, I can read the Somfy remote controls with my Hardware (Up,Down, My, Pro), but if I want to send data, it says radio not initialized. I learned that this has something to do with the TX/RX. I really quadrouple checked for the last days, and now I am out of any more ideas what to do.

I have the CC1101 that looks excatly the same than this here on the docs, but my ESP is IMHO slightly different.

I have no real clue with hardware, but I assume that my pins on the board are different. See here the esp-used-pin-layput Pin layout from the ESP board. The ESP board is from AZdelivery, a german based company.

The numbers are the pin numbers from the CC1101 tranciever.

What I forgot to say: I switch TX/RX wires and also on the software (all 4 combination). With no luck. I tested with another ESP (same manufacturer) with no luck. I also used firmware binary V2.2.2 with no luck. New ESP (directly from China) are under its way, but I do still hope I am just too plain stupid :-)

And what I totally forgot: Awesome firmware! I am a total fan with my now 5 days journey; learned a lot.

Is there anyone that can enlighten me? Many thanks! Juergen

rstrouse commented 5 months ago

First lets verify which transceiver you have. Take a pic or verify that it says E07-M1101D. Typically, the radio not initialized message is either because the one or more of the 4 SPI pins are not correctly connected or the Enable Radio checkbox was not checked. The radio will initialize if the RX and TX pins are incorrect.

fft1010 commented 5 months ago

Hi rstouse, many thanks for the help. I can't believe it: It now works. I would have sworn, that I had the very same setup I have right now already tested. Testsetup: Two identical systems than I run "Pair share" in one, and than I see the "Prog" at the other. Both see my somfy remote. So now I can dig further with my shades. Again: Many thanks for everything.

Juergen

fft1010 commented 5 months ago

Hi, just tested the first shade. It worked immediately. Many Many thanks!

Juergen

fft1010 commented 5 months ago

Anywhere I can sent a Pizza to or something similar?

rstrouse commented 5 months ago

No need for Pizza. Just glad you found some utility in it.

fft1010 commented 5 months ago

Hi, ok, than I thought, I'll give you a good laugh and start the "worst first case" competition :-) See my "pre-alpha" to protect the system from the cats. I just put the Antenna to this place to only have one picture. The antenna has a 2m wire (round about) so I can set it everywhere I need it. Works very well.

case-V1

Again: You really made my day/week I was totally happy yesterday to get everything running. There are still some little problems, which I now try to fix.

Thank you Juergen

rstrouse commented 5 months ago

That's fresh... and vacuum sealed. More importantly it works.

DeIdstaaner commented 5 months ago

Hi rstrouse,

sorry I might seem like a complete idiot, but I don't understand what happened.

Last summer I came across your project, bought an ESP32-WROOM 32 from AZ-Delivery, installed the firmware (worked like a charme!) configured everything, installed an update now and then, and it just worked. Brilliant! Last week I realized after some months when I didn't change the system that there is a version 2.3.1. So I updated SomfyController.ino.esp32.bin to 2.3.1 from 2.2.1 which was the last I had installed. The update went through, but it showed only the rotating dots. Reboot, no change.

After cursing I tried to start from scratch and used https://web.esphome.io/ website to install everything fresh. The flashing finishes with a success message, but I can't access the device. The Wifi ESPSomfy RTS never shows up.

Then I tried to install a ESPHome first by using the "Prepare for first use" button, and it worked. I could access the then available Wifi, I can enter the required IP and can access it via my home network. I can even do the OTA update by loading the SomfyController.ino.esp32.bin file. But then nothing works.

I also tried Arduino IDE 1.8, but probably didn't understand how to configure it correctly.

I now ran out of options solving this by myself.

What I don't get in the first place: Why did it work last summer without any (!) issues and doesn't do the trick now?

fft1010 commented 5 months ago

HI, I am new, but to me it seems, there is still the old version on the ESP. I personally used the esptool to install it. My main problem there was do get the ESP into download more. I only could get it into boot more by pressing the boot button on the ESP, THAN pressing boot button and release it, still keeping boot button pressed. Than start the esptool like described here: https://github.com/rstrouse/ESPSomfy-RTS/wiki/Installing-the-Firmware#using-esptoolpy including flash_id and erase_flash, than flash the newest binary from the repository (2.3.2)

For all of the three commands above, I had to put the ESP into download mode.

Than you will IMHO have a clean new version, and can continue here: https://github.com/rstrouse/ESPSomfy-RTS/wiki/Configuring-the-Software

thanks Juergen

DeIdstaaner commented 5 months ago

Progress report. I finally found out how to use Arduino IDE correctly (or at least better) and managed to install my old firmware again, restore the settings and have it at least basically working. During that process I found an error in the code which stopped Arduino compiling. I'm not really into this, but it where 2 problems with the call of elechouse_C1101.setGDO. One transmitted only one parameter, while it expected two, and on call was misspelled as ...setGDO0. I solved that by reasoning what could be righht and it worked. But I must admit that I didn't fully analyze what this function is used for.

Now I don't have the courage to try updating it again...

rstrouse commented 5 months ago

@DeIdstaaner If you are using the Arduini IDE I suspect you have an old version of the CC1101 library installed. The signatures for these methods are as follows. setGDO is called to set both GDO0 and GDO2 whereas setGDO0 only sets a single GDO0 pin. ESPSomfyRTS will multiplex on that pin.

  void setGDO(byte gdo0, byte gdo2);
  void setGDO0(byte gdo0);

Just curious why you went the route of using Arduino. Onboarding from the ESPHome website is very simple if you use the proper zip file containing the onboard firmware for your specific chip series (as indicated in the instructions).
https://github.com/rstrouse/ESPSomfy-RTS/wiki/Installing-the-Firmware

However, if you attempt to use ESPHome and flash only the firmware .bin file you will not have all the necessary partition data to run the software.

fft1010 commented 5 months ago

@DeIdstaaner ,

you wrote:

Now I don't have the courage to try updating it again...

I am a real rooky with ESP-Somfy-RTA and HA. But if you have the hardware running, and know that it works on the "physical" layer, and if you now have a running system that runs "half way", I would a.) make a backup of the settings b1.) Buy a new ESP and flash it from scratch (the non courage version), install it with WLAN (really easy!! The software works like a charm. I did it one week before, and it is really absolutely straight forward.) Install the backup from above, exchange the old ESP with the new one. Used the phone to hook it to the ESP, configured there the local WLAN, disconnected and ESPSomfy showed up. (I think a minute or so max) OR b2.) flash the old over and install the backup. Configuration to get the ESP to hook up into the lokal WLAN is a 2 minutes job.

For flashing I personally would use shell and esptool.py, as there you IMHO see more. I could not get the browser install work, and it only said: DOES NOT WORK. (something similar). When on the shell, I could directly use a termin (putty on windows) to see if the ESP is "there", and is listening for download. I also saw the three commands that esptool was running and could step thru and see, if every command worked.

My major problem was to get the ESP to get in download (program) mode (also have an AZ delivery one.) I could only make it to get in download mode by

press boot button on ESP (keep pressing) -> press and release EN button on EN (still holding boot button). Start esptool and release boot button when esptool tries to stablish a connection.

than to all three epstool command I was referring to above. Than you have a brandnew ESPSomfy-RTS, you need to put again into the WLAN, ... But again: This is really easy.

thanks Juergen

luckyzor commented 5 months ago

Hello, I'm having the same issue with exactly the same board and cc1101. What did you do to put it working?? I've already checked the connections twice and still no radio connected :/ don't know what to do

rstrouse commented 5 months ago

@luckyzor In 100% of the cases where the radio would not initialize so far it has been a wiring issue or the user forgot to check the enable radio checkbox. The radio will not initialize if the SCLK, CSN, MOSI, or MISO pins are not connected to the correct pin on the transceiver. I assume you have an E07-M1101D transceiver. All of these so far have been blue in color.

There are 8 pins and it is easy to connect the wrong pin on the transceiver to the wrong pin on the ESP32. You need to then match these up to the configuration on the transceiver page. Take some pics of your board and your transceiver and I will help you find your issue.

luckyzor commented 5 months ago

Well I changed the esp32 and it worked. When investigating the esp32 not working, there was an issue with the soldering on one of the pins.... Well now I have 2 esp32 with espsomfyrts xD Hope I don't need 2, I really don't live in a bunker 😅

Thanks for the help and sorry, it was a hw issue at my side.

My somfy motors will be installed in 4 days, hope this will work, they will install 5 rts somfy solar blinds and 4 rts hybrid somfy blinds (Its a mix of rts and physical button, they call it hybrid)

rstrouse commented 5 months ago

@DeIdstaaner did you get up and running? I am afraid that we have different issues going on in the same thread so I missed what you were doing. First, you did not download the SomfyController.onboard.esp32.bin.zip file. You cannot initially flash with the files that end in ino.espxx.bin. Those do not contain all the items to make the software work the first time. They are only for updates.

Next you installed ESPHome stub software. The instructions say to ignore the prepare for first use button and click on install. Then select the extracted bin file that matches your chip series using the install button. Please review the wiki and let me know if you have any questions.

https://github.com/rstrouse/ESPSomfy-RTS/wiki/Installing-the-Firmware

DeIdstaaner commented 4 months ago

Success! That was my mistake. Since the ...ino.espxx.bin files inside and outside of the zip have the same name I falsely assumed that they where the same files. But as rtsrouse wrote these are different! After extracting and installing the ...bin file it worked flawlessly with the esphome.io website, I could restore the previous backup and update it to the newest version. As it is very often the case: the problem was between my ears.... Thanks

rstrouse commented 4 months ago

Awesome! I am going to close this one out.