This is an implementation of the somfy RTS protocol to control
window blinds using the goodwatch. Contributed by
Naton Talon and Guillaume Weghsteen.
With the RTS protocol, each remote has a unique id and a rolling code
associated. We a button is pressed, a packet is broadcasted and the
window blinds around are triggered depending on if the id is registered as
one of their controler(s) and if the rolling code matches.
This app lets you register your goodwatch as a new remote for your blind.
It will have its own rolling code and so will not desynchronize your real
remote. To register and use a remote:
- put the blind is learn mode by holding the red button at the back of an
already adopted remote. The shader will go up and down to mean it's in
learn mode.
- on the watch, press for instance '3' to select id '3' and then press '=' to
send the 'register' packet. The shaders will go up and down. From now on,
the shader will accept packets from your watch from your id '3'.
- you can now press '/' to go up, '*' for the 'MY' button, and '-' to go down.
If you want to change id (let's say 5), press 5 and then the command you want.
Rolling codes are updated per id.
Since the protocol contains rolling codes, checksums and is obfuscated, the
packets are recomputed for every keypress.
The packet is made of a prefix (wake up + preamble) to with manchester encoded
data is appended. The data itself is xor obfuscated. Take a look at
https://pushstack.wordpress.com/somfy-rts-protocol/ for more information.
The GoodWatch firmware is in this directory. You will find user-level
applications in the apps/ subdirectory, while *.c in the root
directory contain low-level drivers.
To add your own application, for one of the smaller examples, such as
stopwatch.c. Your app must provide functions for _init() (to run
at startup), _draw() (to run every quarter-second for rendering),
and _exit() which should just return 0 unless you need to intercept
the Mode button, in which case it may return 1 to delay the exit. Add
these three functions to a line of the apps[] structure in
applist.h.
In general, we try not to over-abstract the hardware because we don't
intend the design to be portable away from the CC430. Include
<msp430.h> if you need to access the CC430's IO registers or
"api.h" for all the standard functions of the GoodWatch firmware.