Closed DeveloperTK closed 4 years ago
Hi,
Did you tried to serial print the result of:
house.toCharArray(house2, 5);
device.toCharArray(device2, 5);
state.toCharArray(state2, 5);
before injecting it into RCSwitch commands?
yes that gave me
11111
00010
1
as expected
Declare only the char array size that you need:
char* house2;
char* device2;
char* state2;
And be careful about null terminator
manually executing the command turns the switch on/off.
Could you elaborate on what do you mean by manually, please?
Could you post the whole code also?
And be careful about null terminator
Thank you that resolved the problem. I ended up doing this:
char house2[6];
char device2[6];
char state2[2];
house.toCharArray(house2, 6);
device.toCharArray(device2, 6);
state.toCharArray(state2, 2);
Hi, I am currently writing a program, where an RCSwitch can be controlled by HTTP Requests. I wrote some code in order to parse the GET Argument:
Then I convert the strings to
char*
and try to call theRCSwitch::switchOn
function:Then somehow, it spits out this:
which translates to this:
(espRFWebControl.ino line 141 is
trans.switchOn(house2, device2);
)