Closed dyter closed 5 years ago
Give us the raw command you want to run and I will test it.
http://192.168.0.15/control?cmd=IRSEND,RAW2,R9F7CA696AD9*669D9D9696^A3Q9D9D96969D9*669D9D9696,38,90,68 | http://192.168.0.15/control?cmd=IRSEND,RAW2,Q969D96969D969696A776969D9D9696^ABQ969D9696AD8*669D9D9696,38,90,68 http://192.168.0.15/control?cmd=IRSEND,RAW2,^15E9C9CID9CID*69CJDHC9D9^DP^16C9C9CID8DID9C9C8D9E7C9CICID9C9,38,62,51 http://192.168.0.15/control?cmd=IRSEND,RAW2,H99A494999499C7A4A494A499A894A8^9LH999495A794A8A8A*3494A8A8A499,38,138,67 50 | http://192.168.0.15/control?cmd=IRSEND,RAW2,LD5DAEADAE5DBCAE*45DAEAE5DA^DCLD5DBE9EAE5DADAE*45DAEAD5DA,38,112,47
The ESP go to overload or memory full, I do not know why
IRSEND,RAW2,Q969D96969D969696A776969D9D9696^ABQ969D9696AD8*669D9D9696,38,90,68
works fine. Also you can use IRSEND,SONY,240C
IRSEND,RAW2,LD5DAEADAE5DBCAE*45DAEAE5DA^DCLD5DBE9EAE5DADAE*45DAEAD5DA,38,112,47
works fine. Also you can use IRSEND,SONY,3B0D
IRSEND,RAW2,H99A494999499C7A4A494A499A894A8^9LH999495A794A8A8A*3494A8A8A499,38,138,67
works fine. the report from the IRrecvDumpV2 is
Timestamp : 004944.783
Encoding : UNKNOWN
Code : EBF674B3 (32 bits)
Library : v2.5.5
Raw Timing[63]:
+ 2420, - 506, + 1280, - 638, + 592, - 566, + 564, - 594,
+ 1226, - 626, + 538, - 620, + 1226, - 802, + 1038, - 630,
+ 590, - 638, + 564, - 570, + 590, - 660, + 566, - 592,
+ 1248, - 670, + 1120, - 592, + 566, - 658, + 1140, - 20684,
+ 2402, - 580, + 1280, - 566, + 564, - 594, + 676, - 690,
+ 1042, - 536, + 564, - 660, + 1118, - 660, + 1116, - 660,
+ 588, - 572, + 588, - 570, + 566, - 594, + 590, - 636,
+ 1118, - 658, + 1120, - 660, + 566, - 594, + 1226
uint16_t rawData[63] = {2420, 506, 1280, 638, 592, 566, 564, 594, 1226, 626, 538, 620, 1226, 802, 1038, 630, 590, 638, 564, 570, 590, 660, 566, 592, 1248, 670, 1120, 592, 566, 658, 1140, 20684, 2402, 580, 1280, 566, 564, 594, 676, 690, 1042, 536, 564, 660, 1118, 660, 1116, 660, 588, 572, 588, 570, 566, 594, 590, 636, 1118, 658, 1120, 660, 566, 594, 1226}; // UNKNOWN EBF674B3
So perhaps there is another problem? Also keep in mind that i used MQTT to send the commands and not http, so perhaps the problem is there.
EDIT: Aslo you have enabled many sensors, perhaps thats why you have issues.
IRSEND,SONY,540C,15 ... doesn't work for me since ESPEasy_IR function exist
So I reflashed the 20190216 for the another test and I found the bug: When I send http://192.168.0.15/control?cmd=IRSEND,RAW2,^18BJB9BJB9BJD99*59BJBJB9B9^BD^19AJBBBHAABJB9BAA9B9AAA9BJBJAAA9,38,60,60 power command on my Sony, in the log I have:
HTTP: IRSEND,RAW2,^18BJB9BJB9BJD99*59BJBJB9B9^BD^19AJBBBHAABJB9BAA9B9AAA9BJBJAAA9,38,60,60 126092: Invalid RAW2 B32 encoding!
My sony doesn't powered and the TSOP4838 IR crash ! I need to reboot the ESP
After this reset, when I do a new IR make with TSOP4838, the new RAW doesn't work on my Sony
not work
the new RAW code http://192.168.0.15/control?cmd=IRSEND,RAW2,^17CJC9CJC9CLBCA8C*49CJCJC9C9^DM^17CJDCBKA9CJC9C9C9D*39CJCJC9C9,38,62,50 crash the TSOP4838
Sometime I have message Low memory. Cannot display webpage :-( when I want to go web page
Has this ever worked? And if so, in what version was it working?
My guess is that the HTTP ?cmd=etc is too many chars for the command to get through HTTP? I have tested MQTT up to 250 chars with no problems tomorrow I will also test he http method as well
As far as I know, the command parser has some limits on the number of characters on a single argument.
The "Low memory" message is also an indication some plugins may need some attention or it is simply using too many memory hungry plugins.
Raw recognized or Raw transmit work fine with 20190121. And with no memory crash plugin
So it must have been this pull request: https://github.com/letscontrolit/ESPEasy/pull/2232
I've just done a ctrl-F on malloc and this is the first hit: https://github.com/letscontrolit/ESPEasy/blob/fce9acdba30746f8e243a8abbeaac7ca559e47ba/src/_P035_IRTX.ino#L636-L651
I notice there is no check for the value of count
, so this one can get out of bounds without noticing and that will cause a crash.
And that's just the first call to malloc.
20190202 is the version I use on all my IR ( nodes, and the one I tested the raw commands posted above. Something else is going on. @TD-er the code that you mention is about Pronto devices, it is not called in this circumstances.
Well, even if it isn't the cause of these issues, it still is a potential crash. And like I said, it was the first item I looked for.
Also when using large buffers, it is possible a malloc may fail and there should be a check for it (it will return a nullptr then). Do you have any idea where in the code I should start looking? I don't know the code of the IR plugins and library.
@TD-er in case of error buf is not deleted
buf is created at lines 128-131 https://github.com/letscontrolit/ESPEasy/blob/fce9acdba30746f8e243a8abbeaac7ca559e47ba/src/_P035_IRTX.ino#L126-L131
buf is deleted at lines 244 245 https://github.com/letscontrolit/ESPEasy/blob/fce9acdba30746f8e243a8abbeaac7ca559e47ba/src/_P035_IRTX.ino#L243-L245
the only check not done is for variable idx (created at line 126). It represents the pulses count and we have 250 as the limit (the size of buf)
Edit TD-er: added permalinks
@jimmys01 No, it is not deleted in 219 and 223 idx is checked in 218 and 222
Edit TD-er: added permalink
Hmm OK I got it. So I assume this has to be addressed. Also there is another issue, that @dyter can't pass long commands through http. But I will test this tomorrow
Can both of you give some link also when discussing the code? If you paste 'permalinks' to this repository here, it will be placed inline in the post. That will make it much easier to read what you're talking about.
@TD-er #2357 is ready ;)
@uzi18 idx is not checked in case the encoding is Raw it is only checked in case is RAW2. But since RAW2 works for 90+% of remotes not many will be using RAW1
@jimmys01 but we talking about problem with RAW2 ;)
now with 20190226 no crash, but not work:
HTTP: IRSEND,RAW2,^18BJB9BJB9BJD99*59BJBJB9B9^BD^19AJBBBHAABJB9BAA9B9AAA9BJBJAAA9,38,60,60 140739: Invalid RAW2 B32 encoding!
and TSOP4838 not reponding, need a reboot
@dyter please provide more log and what you receive in browser when you click on this link: http://192.168.0.15/control?cmd=IRSEND,RAW2,^18BJB9BJB9BJD99*59BJBJB9B9^BD^19AJBBBHAABJB9BAA9B9AAA9BJBJAAA9,38,60,60
Browser say:
Base32Hex RAW Code: ^18BJB9BJB9BJD99*59BJBJB9B9^BD^19AJBBBHAABJB9BAA9B9AAA9BJBJAAA9 kHz: 38 Pulse Len: 60 Blank Len: 60
So it is not truncated string. Ok thanks
1 | ✔ | Environment - DHT11/12/22 SONOFF2301/7021 | DHT | | ❶(671) | GPIO-13 | Temperature:25.50Humidity:28.40 Edit | 2 | ✔ | Communication - IR Transmit | IR_Transmit | | | GPIO-5 | Edit | 3 | ✔ | Communication - TSOP4838 | IR_Receive | | | GPIO-4 | IR:1809958797 Edit | 4 | ✔ | Output - NeoPixel (Basic) | Leds | | | GPIO-12 | Edit | 5 | ✔ | Gases - CO2 MH-Z19 | Co2 | | | GPIO-14GPIO-2 | PPM:986.00Temperature:24.00U:0.00 Edit | 6 | ✔ | Analog input - internal | Battery | | | ADC (TOUT) | Volts:4.16 Edit | 7 | ✔ | Switch input - Switch | Button | | ❶(50) | GPIO-0 | Portillon:0 Edit | 8 | ✔ | Generic - Dummy Device | Power | | | | Low:0:0.00:0.00:0.00 Edit | 9 | ✔ | Generic - System Info | Sysinfo | | | | FreeStack:3344FreeRAM:8376CPULoad:47Wifi:-71