rc-switch plugin

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
s4nder
Normal user
Posts: 15
Joined: 30 Sep 2016, 12:13

Re: rc-switch plugin

#41 Post by s4nder » 16 May 2017, 15:10

@Mics78; I used rc-switch 2.6.2 (straight from github) together with the ESP-easy mega dev8 release. That works for me...

@trs: Your code looks great, my own code is kinda messy with conversions/variables but for me it works. What I really use from my own code is that I can save the pulselength or repeats in the settings so you don't have to worry about that anymore.

It seems to me that lots of people want this functionality in ESP-Easy, can we somehow kindly inform the developers to include these plug-ins in upcoming ESP easy (mega?) releases?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: rc-switch plugin

#42 Post by toffel969 » 16 May 2017, 17:29

s4nder wrote: 16 May 2017, 15:10 @Mics78; I used rc-switch 2.6.2 (straight from github) together with the ESP-easy mega dev8 release. That works for me...

@trs: Your code looks great, my own code is kinda messy with conversions/variables but for me it works. What I really use from my own code is that I can save the pulselength or repeats in the settings so you don't have to worry about that anymore.

It seems to me that lots of people want this functionality in ESP-Easy, can we somehow kindly inform the developers to include these plug-ins in upcoming ESP easy (mega?) releases?
+1
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Mics78
New user
Posts: 2
Joined: 05 Mar 2017, 11:03

Re: rc-switch plugin

#43 Post by Mics78 » 23 May 2017, 19:40

Thank you.

I try to use rc-switch 2.6.2 with Arduino IDE 1.8.1 and 1.8.2 and receive an compilation's error:
C:/users/michael/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\Michael\AppData\Local\Temp\arduino_build_252850/ESPEasy.ino.elf section `.text' will not fit in region `iram1_0_seg'

collect2.exe: error: ld returned 1 exit status

If I return 2.5.2 version I have no error compilation but I have reboots my device...

I need receiver functionality in ESPEasy...

s4nder
Normal user
Posts: 15
Joined: 30 Sep 2016, 12:13

Re: rc-switch plugin

#44 Post by s4nder » 31 May 2017, 16:19

@Mics78; remove some un-needed plugins from the ESP-Easy source. The error you get means that the firmware is too big...

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: rc-switch plugin

#45 Post by ManS-H » 02 Jun 2017, 11:35

Hello All,

I've a question. Can i use this plugin for a stand alone version of Vhome Smart Home RF433MHZ Switch Shape Smart Remote Control in combination with ESP Easy, RfxCom and Domoticz?
Or did i need extra hardware for this unit?

https://nl.aliexpress.com/item/Vhome-Sm ... Title=true
Vhome.jpg
Vhome.jpg (22.88 KiB) Viewed 43119 times

oisisi
Normal user
Posts: 89
Joined: 06 Jul 2016, 13:47

Re: rc-switch plugin

#46 Post by oisisi » 05 Jun 2017, 18:35

I am now using "Plugin 144: RC-Switch TX" from the plugin playground together with the current Mega release. It works nicely with my dip switch and rotary type sockets. Regrettably, I can't get it to work with MQTT so I have to to issue get requests (e.g. http://192.168.4.151/control?cmd=RC,ON=1000010000,5).

If anyone knows the proper topic and syntax to publish the command I would be even more happy. I've tried all thinkable variations of topics and payloads (e.g. 'mosquitto_pub -t "home/esp014/cmd" -m "RC,ON=1000010000,5"' while the module is subscribed to "home/esp/#") but nothing happens.

ipua
Normal user
Posts: 11
Joined: 06 Apr 2016, 20:20

Re: rc-switch plugin

#47 Post by ipua » 06 Jun 2017, 08:18

I am using openhab and items file contains:

Code: Select all

 mqtt=">[broker:/ESP1/cmd:command:on:rfsend,1111111],>[broker:/ESP1/cmd:command:off:rfsend,22222222]

In your case - try 'mosquitto_pub -t "home/esp014/cmd" -m "rfsend,1000010000,5"
Hope this helps..

oisisi
Normal user
Posts: 89
Joined: 06 Jul 2016, 13:47

Re: rc-switch plugin

#48 Post by oisisi » 07 Jun 2017, 19:11

ipua wrote: 06 Jun 2017, 08:18 In your case - try 'mosquitto_pub -t "home/esp014/cmd" -m "rfsend,1000010000,5"
Hope this helps..
Regrettably this and variants thereof don't work. My device is named "rcswitch" so I tried `mosquitto_pub -t "home/esp014/cmd" -m "rcswitch,ON=1000010000,5"` - no dice. I think a command beginning with 'rc' is expected:

Code: Select all

    case PLUGIN_WRITE:
      {
        String command = parseString(string, 1);

        if (command == F("rc"))
        {
          String param;
          byte paramIdx = 2;

          string.replace("  ", " ");
          string.replace(" =", "=");
          string.replace("= ", "=");
I guess I have to stick to GET requests. :(

JKD
New user
Posts: 8
Joined: 27 Jan 2017, 10:04

Re: rc-switch plugin

#49 Post by JKD » 10 Jun 2017, 10:56

All command names are independent of the task names. To trigger the RCswitch you have to use the command "RC".
-> "RC,ON=1000010000,5" should work

Note: commands are only be executed on enabled tasks.

oisisi
Normal user
Posts: 89
Joined: 06 Jul 2016, 13:47

Re: rc-switch plugin

#50 Post by oisisi » 13 Jun 2017, 17:57

JKD wrote: 10 Jun 2017, 10:56 "RC,ON=1000010000,5" should work
Thanks for the advice. Regrettably it doesn't work. I can see that the payload arrives in the log:

Code: Select all

mosquitto_pub -t  "home/esp014/cmd" -m "RC,ON=1000010000,5"
shows up in the log as

Code: Select all

375247309 : MQTT : Topic: home/esp014/cmd
375247309 : MQTT : Payload: RC,ON=1000010000,5
But nothing happens.

While the get request

Code: Select all

wget -qO- "http://192.168.178.151/control?cmd=RC,ON=1000010000,5"
appears in the log as

Code: Select all

375429728 : on=1000010000
375429728 : ON
375429728 : 1000010000
375430269 : 5
and the switch is toggled.

kniazio
Normal user
Posts: 71
Joined: 12 Jun 2016, 11:12

Re: rc-switch plugin

#51 Post by kniazio » 17 Jun 2017, 12:16

The _P111_RF.ino plugin do not compile in dev10 https://github.com/letscontrolit/ESPEasy/releases.

Code: Select all

'irReceiver' was not declared in this scope
if (irReceiver != 0) break;
In dev7 version the plugin compiles
I need the dev10 version
Please help
Also use the _P035_IRTX.ino and _P016_IR.ino plugins, then it will work.
It is working now.
Thanks

JKD
New user
Posts: 8
Joined: 27 Jan 2017, 10:04

Re: rc-switch plugin

#52 Post by JKD » 19 Jun 2017, 21:23

oisisi wrote: 13 Jun 2017, 17:57
JKD wrote: 10 Jun 2017, 10:56 "RC,ON=1000010000,5" should work

Code: Select all

375247309 : MQTT : Topic: home/esp014/cmd
375247309 : MQTT : Payload: RC,ON=1000010000,5
Is your first controller "OpenHAB MQTT" ???

oisisi
Normal user
Posts: 89
Joined: 06 Jul 2016, 13:47

Re: rc-switch plugin

#53 Post by oisisi » 20 Jun 2017, 20:21

JKD wrote: 19 Jun 2017, 21:23 Is your first controller "OpenHAB MQTT" ???
No, I use PiDome MQTT format with Controller Subscribe: "home/%sysname%/#". %sysname% is esp014 and therefore I assume "home/esp014/cmd" should be interpreted.

JKD
New user
Posts: 8
Joined: 27 Jan 2017, 10:04

Re: rc-switch plugin

#54 Post by JKD » 20 Jun 2017, 21:38

oisisi wrote: 20 Jun 2017, 20:21
JKD wrote: 19 Jun 2017, 21:23 Is your first controller "OpenHAB MQTT" ???
No, I use PiDome MQTT format with Controller Subscribe: "home/%sysname%/#". %sysname% is esp014 and therefore I assume "home/esp014/cmd" should be interpreted.
That's the problem!
The log you see comes from controller.ino which is common for all controllers.
The syntax descriped above is only implemented in "OpenHAB MQTT" (CPlugin 5).
In "PiDome MQTT" (CPlugin 6) it is implementet differently - as I understand the code you must use "/Home/Floor/Location/device/<systemname>/RC,ON=1000010000,5" (<sysname> must be the 5th element!!!) - don't ask me why...

You/I/any should request a common MQTT-command handling independent of the active plugin
Last edited by JKD on 21 Jun 2017, 16:12, edited 1 time in total.

oisisi
Normal user
Posts: 89
Joined: 06 Jul 2016, 13:47

Re: rc-switch plugin

#55 Post by oisisi » 21 Jun 2017, 11:16

JKD wrote: 20 Jun 2017, 21:38 That's the problem!
The log you see comes from controller.ino which is common for all controllers.
The syntax descriped above is only implemented in "OpenHAB MQTT" (CPlugin 5).
In "PiDome MQTT" (CPlugin 6) it is implementet differently (...)
Thanks for tenaciously investigating the cause. Since I use plain MQTT / Node RED and not really a specific controller I can find a workaround.

sebi2003
New user
Posts: 6
Joined: 11 Aug 2017, 07:38

Re: rc-switch plugin

#56 Post by sebi2003 » 11 Aug 2017, 08:17

i try to compile dev11 with Arduino IDE 1.6.12 as suggested here: https://www.letscontrolit.com/wiki/inde ... are_Upload
Compiling is possible for dev11 without any plugins from the playground.
When I add _P111_RF.ino and _P112_RFTX.ino or only one of them I get exit status 1.

any suggestions? It would be nice if someone can upload a already compile dev11.bin for Nodemcu board.

Hope somebody can help

oisisi
Normal user
Posts: 89
Joined: 06 Jul 2016, 13:47

Re: rc-switch plugin

#57 Post by oisisi » 11 Aug 2017, 12:25

I used the latest files with the most recent Arduino IDE, took out a few plugins that added too much to the size, I added the two mentioned plugins and it compiled with only one warning. Try fetching the latest Arduino IDE.

sebi2003
New user
Posts: 6
Joined: 11 Aug 2017, 07:38

Re: rc-switch plugin

#58 Post by sebi2003 » 11 Aug 2017, 12:29

ok...i will try it this afternoon.
Can U upload your compiled .bin?

sebi2003
New user
Posts: 6
Joined: 11 Aug 2017, 07:38

Re: rc-switch plugin

#59 Post by sebi2003 » 11 Aug 2017, 19:24

I tried compiling the latest github ESPEasy mega source with Arduino IDE 1.8.3 and can compile ESPEasy (dev11).


When I copy _P144_RC-Switch-TX.ino from the playground it works for me, too. Same for _P112_RFTX.ino.

But when I add _P111_RF.ino i get the following error message:
exit status 1
'irReceiver' was not declared in this scope

I also considered the suggestion "Also use the _P035_IRTX.ino and _P016_IR.ino plugins, then it will work." mentioned in the post of kniazio.

Any Idea

sebi2003
New user
Posts: 6
Joined: 11 Aug 2017, 07:38

Re: rc-switch plugin

#60 Post by sebi2003 » 08 Nov 2017, 14:35

ok. I fixed it myself. As mentioned above (by by oisisi in post #57), I had to delete many standard plugins (more than 5 depends on the size) to get It compiled. It´s also necessary to get a really clean portable version of Arduino IDE with the necessary libraries. Very important to do exactly what is described in the tutorial.

OMJ
New user
Posts: 3
Joined: 10 Apr 2017, 17:38

Re: rc-switch plugin

#61 Post by OMJ » 14 Jan 2018, 11:57

Hi.

First, thanks a lot to the developer(s) for the rc-switch plugin. I have used it for more than a year with my RC sockets in combination with MQTT and Openhab and found it very stable.

However, for some reason, my commands are always repeated 3 times it seems. Despite the device setup is made with repeat=1 and the mqtt payload is always with 1

example: mymosquitto:/IOT_MASTER/cmd:command:Up:rfsend,16059141,1,24

For the control of RF sockets it does not matter to repeat a few times or more. However, in setting up LED light control with some min RF controllers, and when toggling light on/off, repeating the command is making the light blinkering and leaving the controller in and unkown state, which makes it difficult.

I have not gone trough the code in details for some easy parameters adjustments, i wanted to hear if i'm the only one having theese issues?

I found about about the minimum 3 repeats by recieving the RC signals with the original RC-switch code for arduino "RecieveDemo_Advanced":

Code: Select all

/*
  Example for receiving
  
  http://code.google.com/p/rc-switch/
  
  If you want to visualize a telegram copy the raw data and 
  paste it into http://test.sui.li/oszi/
*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(0);  // Receiver on inerrupt 0 => that is pin #2
}

void loop() {
  if (mySwitch.available()) {
    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
    mySwitch.resetAvailable();
  }
}

hugo11
Normal user
Posts: 17
Joined: 08 Nov 2016, 20:30

Re: rc-switch plugin

#62 Post by hugo11 » 04 Mar 2018, 15:01

I have also issues compiling with the _P111_RF.ino included. I tried reinstaling the IDE + removed the libraries folder and only included the ones from the ESP Easy distribution.

Still the same, any other ideas?

User avatar
enesbcs
Normal user
Posts: 587
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: rc-switch plugin

#63 Post by enesbcs » 26 Oct 2018, 22:20

sebi2003 wrote: 11 Aug 2017, 19:24 But when I add _P111_RF.ino i get the following error message:
exit status 1
'irReceiver' was not declared in this scope

I also considered the suggestion "Also use the _P035_IRTX.ino and _P016_IR.ino plugins, then it will work." mentioned in the post of kniazio.

Any Idea
Old thread, but... Apply this patch to the head of _P111 enables it to compile:

Code: Select all

#ifndef USES_P016
 int irReceiver = 0; // make sure it has value even if plugin not found
#endif    

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 34 guests