Updated Simple ESPSomfy RTS device (markdown)

rstrouse 2023-01-23 15:18:24 -08:00
parent c9b5f80f7e
commit fe78185056

@ -1,27 +1,35 @@
This wiki will go through how to create a simple ESPSomfy RTS device for a few dollars.
# Getting Started
To get started you must create a radio device. There wiki contains full instructions on how to get this up and running. You don't need a soldering iron to make this project work. Dupont connections between the radio and the ESP32 will suffice. However, I have also included some instructions on how to make an inconspicuous radio enclosure for a few bucks.
To get started you must create a radio device. This wiki contains full instructions on how to create one for about 12 bucks. You don't need a soldering iron or some advanced knowledge of software development to make this project work. All you need are some readily available parts and some Dupont connectors. However, I have also included some instructions on how to make a more polished radio enclosure for a few bucks.
Once you have your hardware built it is simply a matter of connecting the ESP32 to your network and begin pariing your shades. The software guide in the wiki will walk you through pairing your shades, linking remotes, and configuring your shades.
Once you have your hardware built it is simply a matter of connecting the ESP32 to your network and a little bit of software configuration. Your shades will be talking in no time. The software guide in the wiki will walk you through pairing your shades, linking remotes, and configuring your shades, but for now let's build the hardware.
Originally I bought a cc1101 transceiver with a spring type antenna and could not figure out why it would not consistently receive commands from my remotes. I then went about purchasing several other transceiver modules thinking that all my code is always perfect. This hard-headedness led me to the conclusion that the timing algorithm I created to read the radio signal was not quite ready. Since I ordered every type of CC1101 transceiver I could get my hands on, I can report that any of the CC1101 transceivers work very well. I must have had an extra thumb or two when I built the orginal timing since it was dropping part of the hardware sync. In the end, all of the cheap cc1101 transceivers I bought had a range over 300 feet and through a couple of walls. I finally just stopped walking.
Your first step is to connect your transceiver to your ESP32. I did this with the use of some female to female dupont connectors for now but will be coming up with a cleaner setup and project enclosure. Next you will want to install the firmware on your ESP32 and configure the radio to match your hardware connections.
For this project you need three items. First you need an ESP32, next you need a CC1101 transceiver module, and finally you need some way to connect the two. Below is your bill of materials.
### Required Hardware
* 1 - ESP32 Module
* 1 - CC1101 Transceiver Module
* 8 - Dupont female/female connectors
## Sourcing an ESP32
I don't profess to be an expert on ESP32 models but if you get a 30-pin version of the ESP32S WROOM module from any of the online suppliers this will do nicely. The advantage of that is I have included the compiled binaries in the project so you can upload those directly without having to compile them.
If you buy one of these you can simply download the firmware and upload it to the ESP32 each time I release a software update. There is a handy uploader that is included with the firmware that will allow you to perform a remote firmware update without ever touching the module.
## Picking a CC1101 Transceiver
Originally, I bought a cc1101 transceiver with a spring type antenna and could not figure out why it would not consistently receive commands from my remotes. I then went about purchasing several other transceiver modules thinking that all my code is always perfect, so the hardware must be defective.
This hard-headedness led me to the conclusion that the timing algorithm I created to read the radio signal was not quite ready. Since I ordered every type of CC1101 transceiver I could get my hands on, I can report that every one of the CC1101 transceivers I bought work very well. I must have had an extra thumb or two when I built the original timing algorithm. This made it drop part of the hardware sync and subsequently not communicate reliably.
So, when looking for a CC1101 Transceiver get one that doesn't have to be slow-boated from some far off land although I assume they all begin life there anyway. For the final 3 production prototypes that I built I preferred the E07-M110D-SMA version over all the others. While you will have a hard time finding it listed that way it is the blue one with the duck antenna or spring antenna.
### Assembling the Hardware
You will need an ESP32 module. I used an ESP32S-WROOM-32 development board for my project. The included binary is compiled using this board. You will also need a CC1101 transceiver module. Like I explained earlier I bought several of these and they all work great. I have the blue ones with 10 pins, green ones with 8 pins, and even blue ones with 8 pins. The 10 pin versions simply have the VCC and ground pins duplicated.
Your first step is to connect your transceiver to your ESP32. I did this with the use of some female to female dupont connectors and ran it on the bench for a while. I didn't even use a breadboard to connect it. I simply connected each end of a 10cm dupont cable to make each of the 8 connections. If you can assemble furniture from a box you are more than qualified for this task.
The reason I have so many isn't so I could give you advice on every model on the market, it was because I wrote a crappy algorithm originally that I thought was perfect. They all apear to perform about the same so get a transceiver module with good availabilty from a supplier that can get it to you before your patience wears out.
If you bought one of the 10-pin transceivers, search the interweb for the wiring diagram. You will see that it is an 8 pin version but it has 2 VCC and 2 GND pins. You can use either set.
The hardest part of the inital connection is determining which pins are which on the transceiver. Sadly the first module (green 8-pin) I bought only had the pins labeled with a number. As it turns out the mapping goes like this if you bought one of these boards.
The hardest part of the inital connection is determining which pins are which on the transceiver. Sadly, many of the available modules only label the pins with a number. As it turns out the mapping goes like this if you bought one of these boards.
| Pin | Description | ESP Pin |
| --- | ----------- | ------- |
@ -36,13 +44,12 @@ The hardest part of the inital connection is determining which pins are which on
This is how I mapped mine using the V-SPI interface of the ESP32 and two innocuous pins for RX/TX. Initially I used the onboard LED pin for RX to see when data was being sent but I think that was causing interference. If you just want this to work use the pin mapping above. The other boards are much better labeled so match up the descriptions to the pin header and you will be golden.
If you must change the pin assignments then feel free to do so. You can assign them to anything you like since the software configuration will allow you to change these when you set up the radio. But beware I spent a whole lot of time reading about ESP32 pins only to realize that I got interference every time I touched the board. For cryin out loud I picked a touch pin for GDO0.
If you must change the pin assignments then feel free to do so. You can assign them to anything you like since the software configuration will allow you to change these when you set up the radio. But beware I spent a whole lot of time reading about ESP32 pins only to realize that I got interference every time I touched the board. For cryin out loud I picked a touch pin for GDO0 initially.
Here is a picture for those of you who need to see it to believe it.
![image](https://user-images.githubusercontent.com/47839015/213935879-08ba55e9-ebe9-4b53-be12-baccf310eeb4.png)
# More Polished Version
If you are like me and cannot bear to have something that looks all cobble up when you want to show it off you can create a more polished version using a breadboard, a couple of headers, and some kynar wire soldered to the back of the board. Below is a picture of the finished project. I built 3 of these out of all the radios that I bought.