• 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
#1
I've connected the 433mhz reciever on my pi. But every time when I press on a button of the remote, it is always unit 31

here is the code.
Code:
{
"code": {
"id": 31,
"unit": 31,
"state": "on"
},
"origin": "receiver",
"protocol": "archtech_old"
}
{
"code": {
"id": 31,
"unit": 31,
"state": "on"
},
"origin": "receiver",
"protocol": "sartano"
}
Here is the information that I got from pilight-learn:
Code:
header: 4
pulse: 4
footer: 38
rawLength: 50
binaryLength: 12

on-off bit(s): 11
all bit(s):
unit bit(s): 4 5 6 7

Raw code:
295 1180 295 1180 295 1180 1180 295 295 1180 295 1180 295 1180 1180 295 295 1180 1180 295 295 1180 1180 295 295 1180 1180 295 295 1180 1180 295 295 1180 295 1180 295 1180 1180 295 295 1180 1180 295 295 1180 1180 295 295 11210
Raw simplified:
On: 01010110010101100110010101010101010101100110011001
Off: 01010110010101100110010101010101010101100110011001
All: 01010110010101100100010001000100010101100110011001
Unit 1: 01010110010101100101010101010101010101100110011001
Unit 2: 01010110010101100110010101010101010101100110011001
Unit 3: 01010110010101100110011001100110010101100110011001
Binary code:
On: 101001111000
Off: 101001111001
All: 101000001000
Unit 1: 101011111000
Unit 2: 101001111000
Unit 3: 101000001000
 
Reply
#2
Can you try the following for me. In protocols/arctech_old.c change this:
Code:
void arctechOldParseBinary(void) {
    int unit = binToDec(arctech_old.binary, 0, 4);
    int state = arctech_old.binary[11];
    int id = binToDec(arctech_old.binary, 5, 9);
    arctechOldCreateMessage(id, unit, state);
}
to this:
Code:
void arctechOldParseBinary(void) {
    int i = 0;
    printf("\n\n");
    for(i=0;i<arctech_old.length/4;i++) {
        printf("%d", arctech_old.binary[i]);
    }
    printf("\n\n");

    int unit = binToDec(arctech_old.binary, 0, 4);
    int state = arctech_old.binary[11];
    int id = binToDec(arctech_old.binary, 5, 9);
    arctechOldCreateMessage(id, unit, state);
}

And in protocols/sartano.c, change this:
Code:
void sartanoParseBinary(void) {
    int unit = binToDec(sartano.binary, 0, 4);
    int state = sartano.binary[10];
    int check = sartano.binary[11];
    int id = binToDec(sartano.binary, 5, 9);
    if(check != state)
        sartanoCreateMessage(id, unit, state);
}
to this:
Code:
void sartanoParseBinary(void) {
    int i = 0;
    printf("\n\n");
    for(i=0;i<sartano.length/4;i++) {
        printf("%d", sartano.binary[i]);
    }
    printf("\n\n");

    int unit = binToDec(sartano.binary, 0, 4);
    int state = sartano.binary[10];
    int check = sartano.binary[11];
    int id = binToDec(sartano.binary, 5, 9);
    if(check != state)
        sartanoCreateMessage(id, unit, state);
}

Then do:
Code:
make clean
make
make install
pilight-daemon -D

The last command will let the daemon run in debug mode. Press a button and check if you find the binary number between all debug messages, just like in the output of the learner. Can you post these?

Also let me know what unit and id code you where expecting with every button.
 
Reply
#3
I get errors when I do that:

Code:
sartano.c: In function ‘sartanoCreateLow’:
sartano.c:55:6: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
sartano.c:40:9: warning: shadowed declaration is here [-Wshadow]
sartano.c: In function ‘sartanoCreateHigh’:
sartano.c:66:6: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
sartano.c:40:9: warning: shadowed declaration is here [-Wshadow]
sartano.c: In function ‘sartanoParseBinary’:
sartano.c:79:6: warning: declaration of ‘sartanoCreateUnit’ shadows a global declaration [-Wshadow]
sartano.h:28:6: warning: shadowed declaration is here [-Wshadow]
sartano.c: In function ‘sartanoCreateUnit’:
sartano.c:82:6: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
sartano.c:40:9: warning: shadowed declaration is here [-Wshadow]
sartano.c: In function ‘sartanoParseBinary’:
sartano.c:93:6: warning: declaration of ‘sartanoCreateId’ shadows a global declaration [-Wshadow]
sartano.h:29:6: warning: shadowed declaration is here [-Wshadow]
sartano.c: In function ‘sartanoCreateId’:
sartano.c:96:6: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
sartano.c:40:9: warning: shadowed declaration is here [-Wshadow]
sartano.c: In function ‘sartanoParseBinary’:
sartano.c:107:6: warning: declaration of ‘sartanoCreateState’ shadows a global declaration [-Wshadow]
sartano.h:30:6: warning: shadowed declaration is here [-Wshadow]
sartano.c:116:5: warning: declaration of ‘sartanoCreateCode’ shadows a global declaration [-Wshadow]
sartano.h:27:5: warning: shadowed declaration is here [-Wshadow]
sartano.c:150:6: warning: declaration of ‘sartanoPrintHelp’ shadows a global declaration [-Wshadow]
sartano.h:31:6: warning: shadowed declaration is here [-Wshadow]
sartano.c:157:6: warning: declaration of ‘sartanoInit’ shadows a global declaration [-Wshadow]
sartano.h:24:6: warning: shadowed declaration is here [-Wshadow]
sartano.c:182:1: error: expected declaration or statement at end of input
make[1]: *** [sartano.o] Error 1
make[1]: Leaving directory `/root/pilight/protocols'
make: *** [protocols] Error 2

and

Code:
arctech_old.c: In function ‘arctechOldCreateLow’:
arctech_old.c:53:6: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
arctech_old.c:40:9: warning: shadowed declaration is here [-Wshadow]
arctech_old.c: In function ‘arctechOldCreateHigh’:
arctech_old.c:64:6: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
arctech_old.c:40:9: warning: shadowed declaration is here [-Wshadow]
arctech_old.c: In function ‘arctechOldParseBinary’:
arctech_old.c:78:6: warning: declaration of ‘arctechOldCreateUnit’ shadows a global declaration [-Wshadow]
arctech_old.h:28:6: warning: shadowed declaration is here [-Wshadow]
arctech_old.c: In function ‘arctechOldCreateUnit’:
arctech_old.c:81:6: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
arctech_old.c:40:9: warning: shadowed declaration is here [-Wshadow]
arctech_old.c: In function ‘arctechOldParseBinary’:
arctech_old.c:92:6: warning: declaration of ‘arctechOldCreateId’ shadows a global declaration [-Wshadow]
arctech_old.h:29:6: warning: shadowed declaration is here [-Wshadow]
arctech_old.c: In function ‘arctechOldCreateId’:
arctech_old.c:95:6: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
arctech_old.c:40:9: warning: shadowed declaration is here [-Wshadow]
arctech_old.c: In function ‘arctechOldParseBinary’:
arctech_old.c:106:6: warning: declaration of ‘arctechOldCreateState’ shadows a global declaration [-Wshadow]
arctech_old.h:30:6: warning: shadowed declaration is here [-Wshadow]
arctech_old.c:118:5: warning: declaration of ‘arctechOldCreateCode’ shadows a global declaration [-Wshadow]
arctech_old.h:27:5: warning: shadowed declaration is here [-Wshadow]
arctech_old.c:153:6: warning: declaration of ‘arctechOldPrintHelp’ shadows a global declaration [-Wshadow]
arctech_old.h:31:6: warning: shadowed declaration is here [-Wshadow]
arctech_old.c:160:6: warning: declaration of ‘arctechOldInit’ shadows a global declaration [-Wshadow]
arctech_old.h:24:6: warning: shadowed declaration is here [-Wshadow]
arctech_old.c:186:1: error: expected declaration or statement at end of input
make[1]: *** [arctech_old.o] Error 1
make[1]: Leaving directory `/root/pilight/protocols'
make: *** [protocols] Error 2
 
Reply
#4
You're right, i forgot to close the loops. Try again with the new code. Those warnings can be ignored.
 
Reply
#5
Where is that new code? Checked on github but no changes?
 
Reply
#6
I edited the code in the second post of this thread.
 
Reply
#7
Oh sorry did not see that.

I now I can compile it. but no changes in output still unit 31
 
Reply
#8
But if you start the daemon in debug mode (with the -D) you should see all kinds of messages on your screen when pressing a button, but also the binary numbers. I like you to post these numbers.
 
Reply
#9
Ok I see this:

Code:
[Aug 13 20:55:59] pilight-daemon: DEBUG: called archtech_old parseBinary()


111111111111

[Aug 13 20:55:59] pilight-daemon: DEBUG: socket write succeeded: {"code":{"id":31,"unit":31,"state":"on"},"origin":"receiver","protocol":"archtech_old"}

[Aug 13 20:55:59] pilight-daemon: DEBUG: socket write succeeded: {"code":{"id":31,"unit":31,"state":"on"},"origin":"receiver","protocol":"sartano"}
only ones, no zero's. that is strange.
 
Reply
#10
Now at line 175 add:
Code:
    arctech_old.parseRaw=arctechOldParseRaw;

Also add this function above arctechOldInit(void):
Code:
function arctechOldParseRaw(void) {
    int i = 0;
    printf("\n\n");
    for(i=0;i<arctech_old.length;i++) {
        printf("%d ", arctech_old.raw[i]);
    }
    printf("\n\n");
}

Then again, post the resulting raw codes you get in debug mode.
 
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)