• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


[Fully Supported] Arctech Old
#31
A1 1111 11111000
A4 1111 00111000

B1 0111 11111000
B4 0111 00111000

C1 1011 11111000
C4 1011 00111000

D1 001111111000
D4 001100111000

E1 1101 11111000
E4 1101 00111000

F1 0101 11111000
F4 0101 00111000
...
K1 1010 11111000
K4 1010 00111000
K16 1010 00001000
...
P1 0000 11111000
P4 0000 00111000


not only 4 that is the homecode?

I also see that the group key has the same binary as the 16th unit

group on:
Code:
Raw code:
295 885 295 885 295 885 1180 295 295 885 295 885 295 885 1180 295 295 885 295 295 295 885 295 295 295 885 295 295 295 885 295 295 295 885 295 885 295 1180 1180 295 295 885 1180 295 295 885 1180 295 295 11505
Binary code:
101000001000

unit 16 on:
Code:
Raw code:
295 885 295 885 295 885 1180 295 295 1180 295 885 295 885 1180 295 295 885 1180 295 295 885 1180 295 295 1180 1180 295 295 1180 1180 295 295 1180 295 1180 295 885 1180 295 295 1180 1180 295 295 1180 1180 295 295 11505
Binary code:
101000001000
 
Reply
#32
Can you try replacing these functions in arctech_old.c and check if the values are received properly?
Code:
void arctechOldCreateMessage(int id, int unit, int state) {
    char alpha[16] = {"ABCDEFGHIJKLMNOP"};

    arctech_old.message = json_mkobject();
    json_append_member(arctech_old.message, "id", json_mknumber(id));
    json_append_member(arctech_old.message, "unit", json_mkstring(alpha[unit]));
    if(state == 0)
        json_append_member(arctech_old.message, "state", json_mkstring("on"));
    else
        json_append_member(arctech_old.message, "state", json_mkstring("off"));
}

void arctechOldParseBinary(void) {
    int unit = binToDec(arctech_old.binary, 0, 3);
    int state = arctech_old.binary[11];
    int id = binToDec(arctech_old.binary, 4, 8)+1;
    arctechOldCreateMessage(id, unit, state);
}

Didn't fix the sending yet so no need to test
 
Reply
#33
Code:
Aug 16 01:37:46] pilight-daemon: DEBUG: called archtech_old parseBinary()
[Aug 16 01:37:46] pilight-daemon: DEBUG: default freq of the lirc_rpi module set
[Aug 16 01:37:46] pilight-daemon: DEBUG: deinitialized lirc_rpi module
[Aug 16 01:37:46] pilight-daemon: DEBUG: removed stale pid_file /var/run/pilight.pid

it quits everytime I try
 
Reply
#34
And like this:
Code:
void arctechOldCreateMessage(int id, int unit, int state) {
    arctech_old.message = json_mkobject();
    json_append_member(arctech_old.message, "id", json_mknumber(id));
    json_append_member(arctech_old.message, "unit", json_mknumber(unit));
    if(state == 0)
        json_append_member(arctech_old.message, "state", json_mkstring("on"));
    else
        json_append_member(arctech_old.message, "state", json_mkstring("off"));
}

void arctechOldParseBinary(void) {
    int unit = binToDec(arctech_old.binary, 0, 3);
    int state = arctech_old.binary[11];
    int id = binToDec(arctech_old.binary, 4, 8)+1;
    arctechOldCreateMessage(id, unit, state);
}
 
Reply
#35
Note that without low-pass filter it is common to receive the wrong output from pilight-receive. I have seen the number 31 come by countless times while I did not press it.

In my experience pilight-debug is usually pretty accurate so you should rely on that and pilight-send to check if your switch does change.

Like the sartano protocol this protocol doesn't have a header and has a 2 pulse footer (old_kaku?). First get the latest code from GitHub, then try the following:

Code:
void arctechOldCreateLow(int s, int e) {
    int i;

    for(i=s;i<=e;i+=4) {
        arctech_old.raw[i]=(PULSE_LENGTH);
        arctech_old.raw[i+1]=(arctech_old.pulse*PULSE_LENGTH);
        arctech_old.raw[i+2]=(arctech_old.pulse*PULSE_LENGTH);
        arctech_old.raw[i+3]=(PULSE_LENGTH);
    }
}

void arctechOldCreateHigh(int s, int e) {
    int i;

    for(i=s;i<=e;i+=4) {
        arctech_old.raw[i]=(PULSE_LENGTH);
        arctech_old.raw[i+1]=(arctech_old.pulse*PULSE_LENGTH);
        arctech_old.raw[i+2]=(PULSE_LENGTH);
        arctech_old.raw[i+3]=(arctech_old.pulse*PULSE_LENGTH);
    }
}

arctech_old.pulse = 3.5;
Because
Code:
295 885-1180 885-1180 295 = Low
295 885-1180 295 885-1180 = High
 
Reply
#36
@Bram, good to join in on this one, but i rather fix the receiving part first, then i will check the sender.
 
Reply
#37
K1 = "id": 32, "unit": 5
K2 = "id": 31, "unit": 5
K3 = "id": 30, "unit": 5
K4 = "id": 29, "unit": 5
K16= "id": 17, "unit": 5

with curlymo his code
 
Reply
#38
Can you now leave the other function and replace this one:
Code:
void arctechOldParseBinary(void) {
    int i = 0;
    for(i=0;i<arctech_old.length/4;i++) {
        arctech_old.binary[i] ^= 1;
    }
    int unit = binToDec(arctech_old.binary, 0, 3);
    int state = arctech_old.binary[11];
    int id = binToDec(arctech_old.binary, 4, 8)+1;
    arctechOldCreateMessage(id, unit, state);
}
 
Reply
#39
Look good.

K1 = ID 1 unit 10
K2 = ID 2 unit 10
K4 = ID 4 unit 10
K16 = ID 16 unit 10

A1 = ID 1 unit 0
A16 = ID 16 unit 0

only the ON and OFF states are switched again Smile
 
Reply
#40
Can you now try these:
Code:
void arctechOldCreateMessage(int id, int unit, int state) {
    char letters[16] = {"ABCDEFGHIJKLMNO"};

    arctech_old.message = json_mkobject();
    json_append_member(arctech_old.message, "id", json_mknumber(id));
    json_append_member(arctech_old.message, "unit", json_mkstring(letters[unit]));
    if(state == 1)
        json_append_member(arctech_old.message, "state", json_mkstring("on"));
    else
        json_append_member(arctech_old.message, "state", json_mkstring("off"));
}

void arctechOldParseBinary(void) {
    int i = 0;
    for(i=0;i<arctech_old.length/4;i++) {
        arctech_old.binary[i] ^= 1;
    }
    int unit = binToDec(arctech_old.binary, 0, 3);
    int state = arctech_old.binary[11];
    int id = binToDec(arctech_old.binary, 4, 8)+1;
    arctechOldCreateMessage(id, unit, state);
}
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
Lightbulb [Fully Supported] Kaku Door sensor (AMST-606) geerttttt 52 23,809 10-12-2019, 06:57 PM
Last Post: curlymo
  [Partially Supported] TFA / Conrad Weather Yves 184 10,208 03-31-2019, 05:22 PM
Last Post: curlymo
  [Fully Supported] DHT22 IcedEarth 86 31,020 11-18-2018, 09:33 AM
Last Post: curlymo
  Switch Mumbi m-FS300 display as arctech-switch Rschnauzer 7 1,247 03-24-2018, 07:13 PM
Last Post: Rschnauzer
  [Fully Supported] Clarus Switches Marcin 69 23,893 01-30-2018, 07:10 PM
Last Post: Niek
  [Fully Supported] Remote Control Socket (RC101-U/RC201) Sean 18 10,486 01-04-2018, 06:18 AM
Last Post: ettman8
  [Fully Supported] LM75 and LM76 temperature sensor horst_dieter 64 24,709 11-19-2017, 08:54 PM
Last Post: edepi
  [Fully Supported] No-brand temp/humidity sensor (alecto_ws1700) meloen 57 34,748 12-25-2016, 09:53 PM
Last Post: creamers
  [Fully Supported] Impuls/SelectRemote Bram 113 46,901 05-28-2016, 02:53 PM
Last Post: Puuu
  [Fully Supported] KAKU ABST-604 (dusk/dawn sensor) Netopyr 15 7,576 03-04-2016, 05:43 PM
Last Post: Niek

Forum Jump:


Browsing: 1 Guest(s)