User Tools

Site Tools


rsl366_v5_0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rsl366_v5_0 [2015/11/27 22:09] (current)
Line 1: Line 1:
 +**RSL366**
 +
 +==== Feature Support====
 +^Feature^Support^
 +|Sending|{{http://​wiki.pilight.org/​lib/​images/​supported.gif}}|
 +|Receiving|{{http://​wiki.pilight.org/​lib/​images/​supported.gif}}|
 +|Config|{{http://​wiki.pilight.org/​lib/​images/​supported.gif}}|
 +
 +==== Supported Brands ====
 +^Brand^Protocol^
 +|Rising Sun RSL366|rsl366|
 +|PROmax|rsl366|
 +
 +==== Sender Arguments ====
 +<​code>​
 +-s --systemcode=systemcode ​   control a device with this systemcode
 +-u --programcode=programcode ​ control a device with this programcode
 +-t --on                       send an on signal
 +-f --off                      send an off signal
 +</​code> ​
 +
 +==== Config ====
 +<​code>​
 +        "​living":​ {
 +                "​name":​ "​Living",​
 +                "​switch":​ {
 +                        "​name":​ "​Switch",​
 +                        "​protocol":​ [ "​rsl366"​ ],
 + "​id":​ [{
 + "​systemcode":​ 4,
 + "​programcode":​ 1
 + }],
 +                        "​state":​ "​off"​
 +                }
 +
 +        }
 +</​code>​
 +
 +==== Optional Settings ====
 +
 +^Setting^Default^Format^Description^
 +|gui-readonly|0|1 or 0|Disable controlling this device from the GUIs|
 +
 +==== Notes ====
 +The RSL366 switches come with two dials, one selecting the Systemcode (1 to 4) and the Programcode (1 to 4). The systemcode allows one remote to control up to 16 switches. The systemcode parameter designates the dial on top of the back side of the switch, and the small lever on the back of the remote. The programcode parameter designates the lower dial on the back of the switch, and the individual buttons on the face of the remote. So if your switch has the higher dial set to 4, and the lower one set to 1, you should use:
 +
 +<​code>​
 +systemcode: 4
 +programcode:​ 1
 +</​code>​
 +
 +==== Protocol ====
 +
 +This protocol sends 50 pulses like this
 +<​code>​
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 390 1170
 +390 1170 390 1170
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 1170 390
 +390 13260
 +</​code>​
 +
 +It has no ''​header''​ and the last 2 pulses are the ''​footer''​. The footer is not used for further processing. The next step is to transform this output into 12 groups of 4 pulses (and thereby dropping the ''​footer''​ pulses).
 +
 +<​code>​
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 390 1170
 +
 +390 1170 390 1170
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 1170 390
 +
 +390 1170 1170 390
 +390 1170 1170 390
 +390 1170 1170 390
 +
 +390 1170 1170 390
 +</​code>​
 +
 +If we now look at carefully at these groups you can distinguish two types of groups:
 +  - ''​390 1170 1170 390''​
 +  - ''​390 1170 390 1170''​
 +
 +  - The first group is defined by a low 1st and low 4th pulse, and we call it **low**.
 +  - The second group has a high 2nd and 4th pulse, and we call it **high**. ​
 +
 +We then get the following output:
 +
 +<​code>​
 +LLLH HLLL LL LL
 +</​code>​
 +
 +All H's can be translated to 1. All L's can be translated to 0.
 +
 +Each (group) of numbers has a specific meaning:
 +  * Systemcode: 1 till 4
 +  * Programcode:​ 5 till 8
 +  * 9 to 11 are always low and don't convey any information
 +  * State: 12 (state)
 +
 +<​code>​
 +0001 1000 000 0
 +</​code>​
 +
 +  * The ''​SystemCode''​ is defined as position of the pulse group that bears the **high** signal in the first grouping (i.e. if the third pulse group is high then systemcode is 3)
 +  * The ''​ProgramCode''​ is defined as the position of the pulse group that bears the **high** signal in the second grouping (i.e. if the second pulse group is high then systemcode is 2)
 +  * The ''​State''​ defines whether a devices needs to be turned On or Off. If it bears the **high** pulse group - the device must be turned off, if it bears the **low** pulse group it must be turned on
 +
 +So this code represents:
 +
 +  * SystemCode: 4
 +  * ProgramCode:​ 1
 +  * State: On
 +
 +Another example:
 +
 +  * Unit: 1
 +  * ID: 3
 +  * State: Off
 +
 +<​code>​
 +1000 0010 000 1
 +</​code>​
 +
 +
 +
 +==== Miscellaneous ====
 +These are the same switches that can be controlled using [[https://​code.google.com/​p/​rc-switch/​|rc-switch]],​ which Pi-port is here: [[https://​github.com/​r10r/​rcswitch-pi]]. ​
 +
 +Although out of scope for the pilight project, the following may be useful if you are starting with controlling RF switches with a Pi, and want a simple and small program to test your transmitter and RS366 hardware, before directly diving into pilight. ​
 +
 +Both above mentioned projects seem to be inactive, but the Pi version can be handy because it is very small and easy to compile and test. RCSwitch supports three kind of switches. Luckily, RSL366 switches are supported and referred to as 'Type B' (in the nomenclatura of RCSwitch). ​
 +
 +The RCSwitch software seems to be working, but the accompanying test program '​send.cpp',​ which was written with Type B switches in mind, has a programming error. It will always yield a segmentation fault ('fuck it, ship it'). You can easily correct this flaw if you change the data type from variable '​systemCode'​ from string to integer. ​
 +
 +The send.cpp test program uses GPIO0 (header pin 11) for the output to the transmitter (hardcoded into variable PIN). Many RF443 tutorials use the RxD pin (header 6), which seems to be more conveniently placed, close to header pins 2 (5V) and header pin 4 (GND). Since RCSwitch uses the wiringPi library, header pin number '​4'​ needs to be converted to '​15'​. Details about that are here [[http://​wiringpi.com/​pins/​]]. ​
 +
 +For a flexible pin solution for the test program it suffices to read the PIN variable from the input line too. Both mentioned changes are reflected below:
 +
 +Original code:
 +<​code>​
 +    int PIN = 0;
 +    char* systemCode = argv[1];
 +</​code>​
 +Fixed code:
 +<​code>​
 +    int PIN = atoi(argv[4]);​
 +    int systemCode = atoi(argv[1]);​
 +</​code>​
 +Example of calling the altered test program: ​
 +<​code>​
 +./send 1 4 1 15 
 +</​code>​
 +Once you have established with this program that your hardware is able to send commands to the switch, and you want to do something more than just schedule on/off jobs (in crontab), you are ready to explore pilight. ​
 +
  
rsl366_v5_0.txt ยท Last modified: 2015/11/27 22:09 (external edit)