• 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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Strange issues with kaku_switch and v8.1.4
#1
hi,

i'm using the stable version with rpi2 and an arduino nano connected, 433Mhz sender and reciever attached.

i'm trying to switch 2 KaKu Switches.

1. Issue - Only the very first input through web interface is executed.
For example: The switch is turned off. I start pilight service. Klick on "on" in the webinterface and the switch turns on. Fine. if i try to turn it off via web, nothing happens (i can see the nano blinking, so its recieving something).
If i restart the service, i'm able to turn the switch off, but not on again.
Restarting the nano didn't fix it.

Edit: Another action seems to work a few minutes later.

2. Issue
Its not possible to control the second switch, nether on nor off and even not if its the very first action.

BUT: The commands from the original remote are correctly detected, if i press the button, the slider on the webpage turns on or off. So ID and configuration seems ok.

If i use the original remote, the first action on the webinterface works again.

This is my config:

Code:
{
       "devices": {
               "wallsocket_one": {
                       "protocol": [ "kaku_switch" ],
                       "id": [{
                               "id": 13599744,
                               "unit": 1
                       }],
                       "state": "off"
               },
               "wallsocket_two": {
                       "protocol": [ "kaku_switch" ],
                       "id": [{
                               "id": 13599744,
                               "unit": 2
                       }],
                       "state": "off"
               }
       },
       "rules": {},
       "gui": {
               "wallsocket_one": {
                       "name": "Funksteckdose 1",
                       "group": [ "Steckdosen" ],
                       "media": [ "all" ],
                       "readonly": 0
               },
               "wallsocket_two": {
                       "name": "Funksteckdose 2",
                       "group": [ "Steckdosen" ],
                       "media": [ "all" ],
                       "readonly": 0
               }
       },
       "settings": {
               "log-level": 6,
               "pid-file": "/var/run/pilight.pid",
               "log-file": "/var/log/pilight.log",
               "standalone": 1,
               "webserver-enable": 1,
               "webserver-root": "/usr/local/share/pilight/webgui",
               "webserver-http-port": 5001,
               "webserver-https-port": 5002,
               "webserver-cache": 1,
               "whitelist": "",
               "gpio-platform": "none"
       },
       "hardware": {
               "433nano": {
                       "comport": "/dev/ttyUSB1"
               }
       },
 
Reply
#2
i tried using gpio without filter. Its not working at all.
I measured the data pin from the sender against gnd and there was always a signal but the switch didn'*t do anything.

I attached the nano and again measured the data pin from the sender. There is not always a signal if i hit the button in the web interface, just from time to time, but every time the led on the nano blinks, so its receiving something. The nano is flashed using the source on github, compiled it with an up to date arduino ide.


Edit
i did
sudo apt-get remove pilight --purge -f

and installed it again.
Its a bit better now, i can control switch one if there is a delay from about 10 secs between different action (not perfect, but better).
Switch 2 still cannot be controlled, but with the original remote, key presses are detected and the slider on the webpage is updated correctly.

Edit
After restarting the service its as bad as before.
It seems to work completly random.
 
Reply
#3
I did some further testing.

i flashed nano firmware again using the hex in the packages.
now i'm able to send, but recieving isn't working anymore...

2 out of 3 Smartware SH5-RPS-36A cannot be used through pilight. All switches are working fine with the remote, but only one can be controlled by pilight. I cross checked different unit numbers but it makes no difference. My guess is that maybe the frequency by nano sender is a bit out of range so 2 switches didn't recognise the signal. Another reason might be, that the timings in the protocol might be slightly different from the ones of the remote.
Its not Possible to use the learn option from pilight-send. Nothing happens.

Original remote is Smartware SH5-TDR-F, 433.92MHz
 
Reply
#4
What was the last pilight version that worked without issues?
 
Reply
#5
This is a fresh set up, so i can't tell if earlier versions worked better.
 
Reply
#6
Just install previous versions and check if they work better in your opinion  Smile
 
Reply
#7
Hi,

as i'm still a linux beginner i need to figure out how to install previuos versions Wink

i did some testing. The non function switches is a result of "wrong" pulse length in the arctech library.

i wrote an arduino sketch to control those devices based on information in the wiki. i only changed pulse length to 260 instead of 315. With 260, the switches worked fine, with 310 nothing happened. In my script a pulselen of 280 or more begin to work unstable / randomly.



Here is the sketch:

Code:
/*
 Example for different sending methods
 
 https://github.com/sui77/rc-switch/
 
*/

// #include <RCSwitch.h>

// RCSwitch mySwitch = RCSwitch();
int RFPin = 5;
int pulselen = 260;

void setup() {  
 Serial.begin(9600);
 
 // Transmitter is connected to Arduino Pin #10  
 // mySwitch.enableTransmit(10);
 
 // Optional set protocol (default is 1, will work for most outlets)
  //mySwitch.setProtocol(2);

 // Optional set pulse length.
  //mySwitch.setPulseLength(320);
 
 // Optional set number of transmission repetitions.
 // mySwitch.setRepeatTransmit(15);
 
 pinMode(RFPin, OUTPUT);
}

void send_smartware_bit(boolean isOne){

 if (isOne) {
   digitalWrite(RFPin, HIGH);
   delayMicroseconds(pulselen);
   digitalWrite(RFPin, LOW);
   delayMicroseconds(pulselen * 5);
   digitalWrite(RFPin, HIGH);
   delayMicroseconds(pulselen);
   digitalWrite(RFPin, LOW);
   delayMicroseconds(pulselen);
   //Serial.print("1");
 }
 else {
   digitalWrite(RFPin, HIGH);
   delayMicroseconds(pulselen);
   digitalWrite(RFPin, LOW);
   delayMicroseconds(pulselen);
   digitalWrite(RFPin, HIGH);
   delayMicroseconds(pulselen);
   digitalWrite(RFPin, LOW);
   delayMicroseconds(pulselen * 5);
   //Serial.print("0");
 }

}

void send_smartware(unsigned long address, byte unit, boolean state, byte repeats){

 for (int8_t i = repeats; i >= 0; i--) {
   //send Startcode
   digitalWrite(RFPin, HIGH);
   delayMicroseconds(pulselen);
   digitalWrite(RFPin, LOW);
   delayMicroseconds(pulselen * 10); // + (pulselen >> 1)); // Actually 10.5T insteat of 10.44T. Close enough.
 
   // send address
   for (int8_t i=25; i>=0; i--) {
      send_smartware_bit((address >> i) & 1);
   }
 
   //send group bit
   // No group bit
   send_smartware_bit(false);
   
   // Switch on | off
   send_smartware_bit(state);
 
   // send unit
   for (int8_t i=3; i>=0; i--) {
      send_smartware_bit(unit & 1<<i);
   }
 
   //send Endcode
   digitalWrite(RFPin, HIGH);
   delayMicroseconds(pulselen);
   digitalWrite(RFPin, LOW);
   delayMicroseconds(pulselen * 40);

 }
}

void loop() {
 /* Same switch as above, but using decimal code */
 send_smartware(13599744, 1, 1, 2);
 delay(5000);
 send_smartware(13599744, 1, 0, 2);
 delay(5000);
 send_smartware(13599744, 2, 1, 2);
 delay(5000);
 send_smartware(13599744, 2, 0, 2);
 delay(5000);
}


In case of the other issue: i'm using an arduino nano clone with ch340. i've read that it causes some trouble with pilight. Sadly i cannot understand the nano code on your github page, maybe a reimplementation for ch340 will do the trick. Do you have any documentation what is send over serial in case of sending and receiving signals?
 
Reply
#8
Installing previous versions is documented in the manual.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  hardware module issues in nightly apartmedia 17 865 04-05-2019, 06:59 PM
Last Post: curlymo
  Issues receiving RF OrangeTang 8 840 05-13-2018, 09:27 AM
Last Post: curlymo
  Elro 800 issues after upgrade to 8.0.9 TomiB 2 556 01-29-2018, 10:12 PM
Last Post: TomiB
  Wired PIR sensor as Switch and strange behaviour migsun 1 968 10-10-2016, 10:57 PM
Last Post: migsun
  strange behavior of pilight shgmongo 2 1,152 08-03-2016, 06:18 PM
Last Post: shgmongo
  problem with kaku_switch gerste 1 1,082 11-23-2015, 10:03 PM
Last Post: terrar
  [Questions]Some issues with configuration temp 2 1,596 06-14-2015, 06:39 PM
Last Post: pilino1234
  Strange behavior of pilight time troccolo 15 5,497 04-22-2015, 05:59 AM
Last Post: troccolo
  Issues installing pilight on freenas wmn79 24 8,869 04-16-2015, 08:02 PM
Last Post: wmn79

Forum Jump:


Browsing: 1 Guest(s)