Update 2015-08-30:
It seems that the timing of the FT232R’s bit bang mode on modern FT232R’s isn’t as good as it should be. Sometimes the pulses are way longer than they ought to be, breaking the C2 protocol.
Since this breaks the whole SER4010-USB device design, I decided to discontinue this design. If you still want to use a SI4010 with the SER4010 firmware there are various options:
- Use Cypress FX2 as programmer + any 3.3 Volt serial port/adapter.
- Use Cypress FX2 as programmer + 6.5 Volt power supply to program firmware into NVM. After that you don’t need a programmer anymore and can use any 3.3 Volt serial port/adapter.
- Buy official programmer from Silicon labs???
Personally I currently use a module with the SER4010 firmware flashed into NVM. The module is directly connected to my Raspberry PI’s internal serial port.
The SER4010-USB module is a tunable RF OOK/FSK transmitter in either the 315, 433, 868 or 915 MHz ISM band. It is controlled from a PC through USB. The encoding of the frame’s is fully done in software on the PC, while the actual modulation and sending is offloaded to the module. This allows for great flexibility in the transmitted signals, while having accurate signal timing. By being able to tune the transmitter it is possible to exactly match the receivers frequency, causing better reception/range.
Note that tuning is only effective within the frequency band for which your SI4010 module is build. In this guide it is assumed you have a module for the 433/434 MHz band.
To summarize the advantages compared to other OOK/FSK transmitter:
- Tunable to match receivers frequency, for improved range
- Connects directly through USB
- Accurate signal timing without requiring an extra micro controller and bit banging
- Full control over frame structure
This page explains how to build the SER4010-USB hardware module and how to use it. It is assumed you use Linux. Other operating systems might work but have not been tested.
Hardware
To build a SER4010-USB module you’ll need the following hardware.
- FTDI FT232RL 3.3 Volt (ebay)
- SI4010 module RFM60 (ebay; 433 MHz only) (HopeRF)
- 2x 1K resistors
- Antenna: for example Female SMA connector + external antenna
First of all make sure that the FT232RL module uses 3.3 Volt as output voltage on the VCC/3v3 and I/O lines. In my case this was configurable with a jumper.
Next connect the FT232RL module to the RFM60 module in the following way:
FT232RL SI4010
3v3 -------------- VCC
DTR ----/\1K/\---- C2CLK(/GPIO5)
CTS ----/\1K/\---- C2DAT(/GPIO4)
TXD -------------- GPIO6
RXD -------------- GPIO7
GND -------------- GND
The connections between DTR->C2CLK and CTS->C2DAT require an 1K Ohm resistor. All other pins can be directly connected.
Finally connect the antenna to the SI4010 RF_out. When using a SMA connector, make sure to keep the wiring between connector and SI4010 as short as possible or use special 50 Ohm RF wiring.
Getting the Software
To be able to use the SER4010-USB module you’ll first need to download and compile the SER4010 software and firmware. To be able to load the firmware into the SI4010 micro controller the SI4010Prog program is also required.
SI4010Prog
The SI4010Prog program is required to be able to load the firmware into the SI4010 micro controller. The software requires LibFTDI including development files to be installed. On Ubuntu this is provided by the libftdi-dev and libftdi1 packages.
To download and compile SI4010Prog run:
# git clone https://github.com/dimhoff/si4010prog.git # cd si4010prog/src # make
Compiling is currently done with a dump make file. So you might need to tweak it a little to get it to work on your system.
SER4010
To get and compile the SER4010 software tools and library run the following commands:
# git clone https://github.com/dimhoff/ser4010.git # cd ser4010/build # cmake ../ # make
Once this is successful the libser4010 library is available in the libser4010/ directory and multiple programs that can be used to control the SER4010-USB module can be found in tools/.
The compiled SER4010 firmware can be downloaded from the Git Hub SER4010 Releases page. It is also possible to compile the firmware from source. But since this requires Windows + some proprietary Silabs programs/headers, this is out of scope for this guide. For information about compiling the firmware refer to README.md.
Loading firmware
The ser4010 firmware must be loaded into the SI4010 micro controller before it is usable. This has to be done after every power cycle of device, because it is currently only possible to write the SI4010’s RAM.
NOTE: The following commands assume that there are no other FTDI USB->Serial adapters connected to your computer. If there are then you must use the ‘-d’ option of si4010prog to select the correct device.
First test if the programmer is functioning properly by running the following command and checking that the Device ID is equal to 0x24. I tested with Chip Revision 2, but other revisions might also work.
# si4010prog reset identify Resetting SI4010 Device ID: 0x24; Revision ID: 0x02
Next you can load the ser4010 firmware into the micro controller, using the following command. This takes about 30 seconds, so be patient.
# si4010prog reset prg:ser4010-0.1.hex run Resetting SI4010 Programming CODE memory using "ser4010-0.1.hex" Resuming SI4010 MCU
After having loaded the firmware we have to tell Linux to rebind the device to the ftdi_sio kernel module. To do so run the following command.
# sudo ./ftdi_rebind.sh Rebinding device 2-1.2.3.2:1.0
NOTE: This step might generate an error on some Linux distributions even though the operation succeeded. To check if the rebind was successful check if the /dev/ttyUSB0 device exists. If you have multiple USB->Serial adapters, the device number might be different.
Finally to test if the firmware is running correctly use the ser4010_dump program from the ser4010 tools directory. If you get an error about the communication being out of sync, try it again.
# ./ser4010_dump ODS settings: ------------ bModulationType: OOK (0) bClkDiv: 5 bEdgeRate: 0 bGroupWidth: 7 wBitRate: 2416 bLcWarmInt: 8 bDivWarmInt: 5 bPaWarmInt: 4 PA settings: ------------ fAlpha: 0.000000 fBeta: 0.000000 bLevel: 60 bMaxDrv: 0 wNominalCap: 256 Freq settings: ------------ frequency: 433900000.000000 freq. deviation: 127.000000
libser4010 API
The libser4010 library can be used to control the SER4010 firmware. It basically exposes the API used within the SI4010 micro controller to software running on a PC. Most documentation about the configuration options can also be found in the Si4010 Crystal-less SOC RF Transmitter Data Sheet and application note AN370 – Si4010 Software Programming Guide.
The basic flow of a program using the libser4010 library would be as follows:
- Configure ODS, PA, FDIV(in case of FSK) and transmit frequency
- Call ser4010_reconfigure() to activate the configuration
- Construct a bit string for the frame to send
- Load the frame bit string using ser4010_load_frame()
- Send the loaded frame by calling ser4010_send()
A lot of the configuration values are magic values that can be calculated with the Si4010 Calculator Spreadsheet. But most settings can probably be left on there default value. The only settings of interest are:
- ODS->bModulationType: Specifies if OOK or FSK modulation should be used
- ODS->bClkDiv & ODS->wBitRate: The combination of these two specify the bit width
- ODS->bGroupWidth: Amount of bits per byte to use minus 1. See below
- PA->bLevel: Transmit power. Default is to use maximum power, but might be interesting to change if you want less range for security/to prevent interference.
The bit string representing the frame is just a buffer of bytes in which every bit represents the logic level that should be transmitted during a bit interval. The bit string is processed starting at the least significant bit of the first byte in the buffer. The length of one bit interval is configured by the wBitRate setting in the ODS configuration.
By default all 8 bits in a byte are transmitted, but in some cases it might be easier not to use all 8 bits. The tools/ser4010_kaku.c program is an example of this, here one protocol bit encodes into 7 output bits. By telling the transmitter to only use 7 bits of a byte, we don’t have to do any shifting and accounting to fill the bit string buffer. The amount of bits per byte to actually transmit can be configured with the bGroupWidth setting in the ODS configuration.
For more documentation refer to the libser4010 header files or look at the programs in the tools/ directory.


At what range can it transmit and is it receive (good) by a deviced like a kaku switch ?
There’s alot going what sort of antenna’s one should use to get the biggest range possible and what works in practice.
Nice project again!!
I tested it with the cheap omni directional antenna shown in the picture at the top of the page(45mm long, probably coiled).
I was able to control Somfy RTS blinds from 300 Meters away with a clear line of sight. Possibly could have gone further, but lost line of sight at that point.
Testing against a Kaku ASUN650 receiver was a bit harder since I couldn’t get a very good clear line of sight, lots of tree’s in the way. I was only able to control the KaKu device at a 70 Meters distance, with a clear line of sight. In general I do have the impression that the Kaku receivers are a lot less sensitive then the Somfy RTS receivers.
Do note that for the Kaku protocol the SER4010-USB module won’t have an incredible range advantage compared to a simple OOK 433.9 Mhz transmitter. Since Kaku operates on the frequency of these modules. For Somfy RTS, which operates at 433.4 MHz, there will be a substantial range advantage. Because the SER4010-USB doesn’t have the frequency mismatch simple OOK modules have.
Whow nice!!! Would you be interested to take a look at pilight.org ? It’s build very modular, so it wouldn’t take you much to create a hardware module that can be used by pilight. (it’s modular in a way any sender/receiver can be used) In that way you can control all your 433 stuff from one place by your phone or webgui 😉
The Somfy protocol is already in place thanks to you !
Thank you pushstack for all this stuff.
Got hardware and connected all things, but while :
./si4010prog reset identify
Resetting SI4010
Device ID: 0xff; Revision ID: 0xff
Device ID changes “randomly”, maybe a hardware issue ?
Double checked all connection, seems to be OK.
FTDI is being disconnected after running the reset identify command :
# dmesg | tail -n 1
ftdi_sio 1-1.2:1.0: device disconnected
The ‘device disconnected’ message is expected. It is from the ftdi_sio kernel driver. And is caused by si4010prog claiming the device from the kernel to be able to talk to it directly.
Yes, ID’s changing randomly might suggest a bad connection. make sure all connections are well soldered and the wires are not to long. I don’t use wire’s of more than 15 – 25cm in my test setup.
You can also uncomment the ‘C2_FTDI_DEBUG’ define in c2_bus_ftdi.c and mail the results to the e-mail address at the top of that file.
I guess you might say 15 – 25mm (no cm), so the wires I used are too long, I’ll solders with shorter ones (and give you feedback about that soon)
Hmm, got si4010prog compiling and working on OSX (removed the com.apple.driver.AppleUSBFTDI kernel extension).
ftdi_usb_open_desc failed: unable to claim usb device. Make sure the default FTDI driver is not in use
Failed to open C2 bus: ftdi_usb_open_desc failed
But still having two 0xff for device id and revision…
If got no experience with OS X, so can’t help you there. Although I should note that after programming the device you have to rebind the device to the kernel’s FTDI driver to get the serial comm’s. I don’t know if any OS other than Linux is flexible enough to allow this.
How did you do this on OSX?
Can you email me sources? andrey_popov@me.com
Thank you very much, pushstack, for all this info. I only stumbled upon your blog a couple of days ago.
I always wanted to build something to control my Somfy blinds and your blog saves me from a lot of tinkering around.
Right at the top you say you discontinued this setup and now are using firmware directly flashed into NVM. Would you be so kind to also provide specific buying recommendations regarding the programmer and power supply to use for this as you did with the remaining hardware? I am fairly new to the whole area of chip flashing (I have some experience in it but it feels like it was ages ago 😉 ) and just googling for Cypress FX2 does provide me with a whole wagonload of possible hardware and I have no clue which one to choose.
Thanks!
Manuel
The whole programming of the SI4010 is a bit fiddly. In the si4010prog repository is a document that describes how it is done. But there is a lot of room for error.
The Cypress FX2 I use is very similar to this one from eBay. You probably have to pull one of the jumpers of to disable the pirated logic analyser rom(or else tell si4010prog the correct PID/VID). But any other FX2/FX2LP should do.
As 6.5 Volt power source I currently use a very cheap adjustable buck converter like this one from eBay, in combination with an old 7.5 Volt adapter. You have to adjust it your self with a tiny screw to get 6.5 Volt output. But this is probably a bit living-on-the-edge, since I don’t expect this PSU to be very stable or precise. So if you have, or can borrow, a good adjustable power supply it would be much better.
Hmmm, maybe I give your original SER4010-USB setup a shot first. Getting my soldering skills back up etc. 😀
You said the issue is the timing of modern FT232R’s. Do you have any recommendation on what to look for if still trying to pursue this way? You wrote you tested it with a Rev. C. Any way of recognising these?
The FT232 I used were cheap ones from eBay. My current theory is that it are actually FT232 clones. I don’t know if they are still available, since FTDI started bricking them with there windows driver.
But I don’t know of an easy method to test if I indeed used a clone without bricking my FT232.
I kinda gave up on FT232R’s since the once I tested from official sources(ie. Farnell, Adafruit) don’t have stable timing. The bit length vary enormously, beyond the tolerance of the C2 protocol.
What might work is a FT232H, since they are used more widely for bit banging protocols. But for this it might be required to use a different bit banging mode.
So, if I get you right, you are saying that you (at least suspect) that you were using a fake chip and it was working and you suspect the real chips to have a bad timing, right? So I might be best off to find the cheapest, worst-rated Chinese seller to get one of these. 😀
Basically I am looking for an easy way to get my setup running. This means
* soldering is OK
* I don’t have an adjustable PSU nor do I know anyone having one (buying isn’t an option as long as I don’t see other use cases for me)
* I am not experienced in micro controller programming and feel not comfortable fiddling around with bit banging modes
This basically leaves me with the Cypress FX2 approach. If I got you right, I can use it to program the SI4010 (non-NVM) but I cannot use it as an interface afterwards, can I? That means I would end up with something like
FX2 SI4010 (e.g.) FT232RL
3v3 ————– VCC
IOB.1 —-/\1K/\—- C2CLK(/GPIO5)
IOB.0 —-/\1K/\—- C2DAT(/GPIO4)
GND ————– GND
GPIO6 ————– TXD
GPIO7 ————– RXD
where I have FX2 and FT232RL both connected to an USB port (of my Raspberry Pi) using FX2 to program the SI4010 and the FT232RL to send commands to my blinds, right?
Formatting is totally broken in my comment.
The first four connections are supposed to be between FX2 and SI4010 and the last to connections between SI4010 and FT232RL.
Yes, that sounds like it should work. Although you didn’t draw it here I assume you also connect the ground of the FTDI to the common ground. Also if you use the trunk from the repository then the I/O lines used for the C2 bus have changed to IOA.1 and IOA.2, see drivers/c2_fx2/README.md.
If you have a raspberry PI you could also try the new GPIO based driver. See drivers/c2_gpio/README.md
Actually I would have forgotten to also connect FTDI to common ground but as none of my hardware has arrived yet nothing bad has happened. 😉
The new GPIO driver is amazing news! As I mentioned I do have a Raspberry Pi and intend to use it as my blind control center. You also mention in your warning box that you have it flashed into NVM and connected directly to the internal serial port of your Raspberry Pi. Could you provide the wiring for that too? That would make all additional chips unnecessary if I get it right, wouldn’t it? (Now I am even more glad that I did neither order a FX2 nor a FT232RL yet)
Manuel, can you contact me? andrey_popov@me.com or skype: dunkle21
Guys, I really need your help
1. I compiled si4010prog on my RPi2.
2. Connected FTR to RFM60s (rev1) according to your wiring (soldered ok). But I did not attach antenna.
3. Connected to USB RPI2. (only one usb connected)
pi@raspberrypi: si4010prog reset identify
Failed to open C2 bus: Could not locate the fx2 device
Also tried “si4010prog -d fx2://dev/ttyAMA0 reset identify” or “si4010prog -d fx2://dev/ttyUSB0 reset identify”
Nothing helps
dmesg | tail -n 1
[196901.135328] usb 1-1.4: FTDI USB Serial Device converter now attached to ttyUSB1
More info:
usb_set_debug: Setting debugging level to 255 (on)
usb_os_find_busses: Found 001
usb_os_find_devices: Found 005 on 001
usb_os_find_devices: Found 003 on 001
usb_os_find_devices: Found 002 on 001
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
Failed to open C2 bus: Could not locate the fx2 device
Hi Andrei,
As far as I get it you are trying to access your FT232RL USB connector with the Cypress FX2 driver and address – this can never work. Run
si4010prog -d help
to see the help for using the FTDI FT232R based bus interface and corresponding addressing scheme. Maybe this will solve all your issues.
Regarding your request to contact you, I don’t mind to do that but I don’t even have my SI4010 delivered yet so all my experience regarding this topic is of theoretical form. 😉
Best regards
Manuel
Yes, it was my fault with FTR…
I tried to compile older version of si4010prog – but it hangs on “Programming CODE memory”
I ordered Cypress FX2, and waiting 30-60 days for it( I want to find the way to program this module.
Hm. so FT232R doesnt work, what is the wiring to PI2 GPIO ?
Pingback: SI4010 + FT232R: A 433 MHz USB Radio Transmitter | PushStack