esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

ESP8266: can't set up multiple RF sockets #22

Closed herrwusel closed 5 years ago

herrwusel commented 5 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.):

pip install of home assistant

ESP (ESP32/ESP8266/Board/Sonoff):

ESP8266

Affected component:

https://esphomelib.com/esphomeyaml/components/remote_transmitter.html https://esphomelib.com/esphomeyaml/components/remote_receiver.html RF sockets

Description of problem: I wanted to switch from openmqttgateway to esphome. So I started to receive my remote codes. Although I have typical typ a sockets (openmqtt did show according codes) esphome doesn't recognize these in my case - only the raw codes were received. So I started to add remote switches. One switch does work but when I add another one, every time I press the remote control esp seems to reboot or at least hangs. Moreover it is hard to find additional raw codes because I get the message Message skipped because it was too big to fit in TCP buffer - This is only cosmetic(pressing the same button on the remote results in a different lenght of raw code each time).

Problem-relevant YAML-configuration entries:

esphomeyaml:
  name: control
  platform: ESP8266
  board: nodemcuv2
wifi:
  ssid: 'FRITZ!Box 7590 UG'
  password: 'secret'
  power_save_mode: light
  manual_ip:
    static_ip: 192.168.178.41
    gateway: 192.168.178.1
    subnet: 255.255.255.0
logger:
  level: DEBUG
api:
  password: 'xx'
ota:
  password: 'xx'
remote_receiver:
  pin: D5
  # dump all signals we find
  dump: all
remote_transmitter:
  pin: D1
  carrier_duty_percent: 100%
switch: 
  - platform: remote_transmitter
    id: lichterkette_balkon_on
    raw: [6952, -282, 1169, -387, 1139, -390, 1133, -404, 359, -1158, 1129, -410, 356, -1167, 360, -1166, 347, -1174, 353, -1169, 359, -1168, 356, -1167, 364, -1156, 367, -1165, 1117, -414, 1110, -418, 1108, -425, 343, -1190, 336, -1181, 1106, -431, 337, -1196, 1080, -453, 320, -2339, 326, -1191, 335, -1186, 1098, -444, 1079, -444, 1083, -450, 1077, -458, 309, -1214, 1073, -459, 307, -1218, 310, -1213, 310, -1214, 313, -1207, 318, -1209, 318, -1208, 318, -1204, 324, -1203, 1079, -455, 1072, -458, 1069, -461, 306, -1221, 305, -1226, 1061, -461, 305, -1245, 1027, -507, 266, -2381, 283, -1245, 282, -1241, 1048, -545, 961, -551, 978, -546, 984, -552, 216, -1303, 987, -544, 223, -1288, 242, -1276, 252, -1271, 258, -1266, 262, -1254, 274, -1243, 286, -1232, 296, -1225, 1063, -480, 1049, -480, 1049, -482, 286, -1231, 297, -1223, 1066, -468, 300, -1220, 1069, -467, 306, -2344, 323, -1202, 326, -1218, 1070, -443, 1085, -452, 1075, -450, 1078, -455, 313, -1215, 1074, -456, 312, -1212, 316, -1206, 322, -1200, 328, -1202, 326, -1198, 329, -1195, 333, -1182, 345, -1179, 1107, -439, 1089, -432, 1094, -442, 325, -1194, 334, -1198, 1089, -438, 329, -1193, 1095, -449, 2995, -7199, 482, -1062, 469, -1051, 989, -548, 982, -550, 981, -558, 975, -558, 462, -1072, 971, -562, 459, -1071, 461, -1072, 461, -1071, 461, -1069, 463, -1059, 473, -1067, 465, -1058, 473, -1072, 967, -566, 965, -563, 969, -564, 459, -1072, 460, -1066, 975, -560, 462, -1068, 974, -568, 3003, -7200, 480, -1052, 479, -1049, 991, -543, 986, -554, 978, -558, 973, -567, 458, -1065, 974, -566, 457, -1071, 461, -1069, 464, -1065, 466, -1065, 468, -1062, 469, -1066, 467, -1061, 470, -1053, 987, -548, 983, -560, 971, -566, 460, -1070, 459, -1074, 967, -568, 456, -1068, 972, -571, 3001, -7201, 480, -1060, 471, -1050, 989, -546, 984, -558, 974, -558, 973, -560, 463, -1067, 974, -563, 460, -1068, 465, -1077, 455, -1066, 466, -1069, 463, -1069, 463, -1057, 474, -1058, 474, -1056, 984, -557, 974, -557, 975, -563, 461, -1069, 461, -1075, 967, -575, 448, -1074, 966, -570, 3003, -7202, 478, -1055, 477, -1047, 991, -550, 981, -553, 978, -562, 970, -564, 459, -1069, 976, -561, 458, -1073, 460, -1073, 460, -1065, 466, -1067, 466, -1071, 461, -1058, 474, -1055, 476, -1052, 989, -555, 975, -565, 967, -561, 462, -1070, 463, -1071, 970, -563, 460, -1070, 971]
  - platform: remote_transmitter 
    id: lichterkette_balkon_off
    raw: [7074, -332, 1165, -417, 1131, -412, 362, -1163, 1128, -415, 1115, -418, 349, -1171, 361, -1177, 336, -1182, 1109, -431, 1103, -430, 337, -1202, 336, -1204, 1099, -450, 1089, -456, 1088, -463, 311, -1234, 311, -1213, 323, -1209, 1088, -451, 318, -1214, 1087, -467, 310, -2359, 322, -1214, 317, -1215, 1089, -458, 1079, -466, 1071, -464, 302, -1224, 1070, -469, 1070, -482, 291, -1240, 305, -1247, 290, -1239, 1074, -487, 1057, -478, 292, -1240, 293, -1231, 1066, -482, 1057, -486, 1058, -489, 283, -1263, 277, -1246, 292, -1255, 1058, -514, 242, -1293, 1018, -536, 240, -2421, 263, -1278, 262, -1270, 1019, -601, 945, -595, 946, -579, 194, -1329, 970, -574, 972, -563, 207, -1332, 211, -1312, 230, -1296, 1019, -530, 1014, -531, 242, -1284, 259, -1275, 1036, -514, 1032, -519, 1023, -516, 258, -1286, 260, -1261, 279, -1263, 1043, -489, 282, -1245, 1060, -488, 288, -2382, 304, -1226, 308, -1212, 1082, -460, 1074, -457, 1071, -464, 303, -1223, 1076, -466, 1068, -470, 302, -1220, 308, -1217, 314, -1210, 1082, -454, 1074, -458, 309, -1213, 316, -1211, 1076, -452, 1077, -457, 1074, -460, 303, -1216, 312, -1211, 318, -1212, 1077, -447, 321, -1201, 1089, -458, 2988, -7204, 476, -1059, 473, -1059, 981, -568, 964, -558, 974, -577, 449, -1079, 964, 976, -558, 974, -568, 458, -1066, 974, -569, 967, -572, 451, -1077, 457, -1081, 452, -1072, 969, -563, 971, -573, 451, -1079, 455, -1080, 962, -570, 964, -578, 956, -587, 437, -1085, 449, -1089, 444, -1085, 960, -569, 453, -1079, 964, -582, 2994, -7205, 474, -1055, 477, -1064, 979, -560, 985, -571, 979, -578, 460, -1079, 979, -575, 973, -583, 449, -1093, 460, -1095, 458, -1081, 975, -576, 970, -587, 446, -1093, 459, -1094, 970, -581, 968, -586, 964, -591, 444, -1094, 452, -1095, 453, -1092, 974, -583, 456, -1106, 958, -591, 3021, -7281, 475, -1069, 470, -1072, 986, -560, 979, -557, 981, -567, 465, -1078, 980, -567, 965, -573, 455, -1083, 457, -1080, 460, -1082, 972, -573, 968, -573, 455, -1083, 455, -1086, 973, -571, 974, -584, 956, -598, 436, -1090, 451, -1086, 461, -1085, 970, -572, 458, -1093, 967]
  - platform: remote_transmitter
    id: lichterkette_schlafzimmer_on
    raw: [5051, -80, 503, -789, 1010, -292, 347, -932, 991, -292, 349, -939, 981, -310, 336, -941, 981, -307, 338, -945, 962, -330, 313, -975, 949, -333, 312, -968, 316, -975, 310, -962, 962, -331, 310, -969, 313, -974, 309, -975, 948, -333, 312, -9932, 341, -939, 344, -935, 351, -933, 987, -306, 330, -953, 975, -307, 330, -959, 966, -322, 320, -962, 962, -322, 321, -961, 958, -333, 309, -978, 947, -337, 305, -984, 942, -341, 301, -979, 308, -974, 307, -978, 943, -346, 297, -990, 294, -983, 301, -985, 940, -344, 298, -9958, 308, -966, 319, -960, 309, -989, 933, -357, 285, -994, 933, -357, 286, -992, 935, -354, 287, -992, 936, -360, 282, -993, 934, -355, 287, -990, 937, -351, 291, -994, 934, -350, 291, -994, 292, -986, 300, -982, 948, -340, 299, -987, 298, -983, 302, -973, 953, -337, 305, -9941, 343, -930, 352, -933, 350, -931, 991, -301, 340, -943, 980, -304, 336, -948, 976, -312, 329, -956, 969, -319, 322, -959, 966, -325, 316, -963, 963, -330, 312, -971, 955, -336, 305, -976, 310, -968, 316, -969, 957, -327, 314, -968, 317, -966, 320, -961, 963, -342, 300, -9922, 361, -923, 360, -921, 361, -922, 997, -294, 348, -938, 983, -311, 331, -957, 966, -312, 329, -951, 977, -318, 320, -961, 963, -320, 321, -962, 963, -326, 317, -963, 961, -332, 310, -969, 956, -335, 307, -969, 957, -334, 948, -341, 942, -343, 941, -348, 935, -356, 286, -9942, 341, -937, 346, -946, 337, -938, 983, -303, 338, -943, 979, -310, 331, -951, 972, -320, 321, -966, 959, -321, 320, -963, 961, -328, 314, -966, 965, -322, 313, -971, 953, -332, 310, -973, 952, -343, 299, -973, 952, -338, 944, -343, 941, -346, 936, -356, 928, -359, 284, -9937, 345, -941, 341, -938, 345, -936, 986, -306, 334, -949, 974, -313, 328, -955, 973, -319, 318, -958, 966, -324, 318, -964, 961, -325, 315, -965, 959, -329, 313, -969, 956, -332, 310, -971, 954, -335, 306, -973, 953, -338, 952, -335, 940, -347, 936, -353, 931, -356, 286, -9947, 336, -940, 342, -939, 345, -944, 977, -309, 332, -946, 977, -313, 327, -956, 969, -323, 317, -958, 967, -320, 320, -962, 963, -326, 316, -968, 956, -331, 311, -973, 955, -329, 310, -971, 953, -338, 304, -978, 948, -336, 946, -341, 942, -348, 935, -353, 931, -356, 286]
  - platform: template
    name: Lichterkette Schlafzimmer
    optimistic: True
    turn_on_action:
      - switch.turn_on: lichterkette_schlafzimmer_on
    turn_off_action:
      - switch.turn_on: lichterkette_schlafzimmer_off
# until here one socket works fine. When I add the lines below, esp seems to have problems.
  - platform: remote_transmitter
    id: lichterkette_flur_on
    raw: [1732, -741, 500, -752, 465, -778, 460, -786, 455, -795, 433, -810, 426, -820, 367, -899, 347, -895, 351, -895, 971, -278, 346, -904, 340, -898, 349, -898, 967, -285, 330, -917, 951, -302, 321, -923, 945, -309, 315, -928, 319, -919, 328, -920, 948, -311, 299, -9634, 339, -906, 340, -904, 342, -904, 343, -900, 346, -902, 344, -900, 347, -896, 351, -897, 341, -904, 342, -902, 345, -900, 966, -285, 337, -908, 339, -909, 337, -905, 960, -291, 331, -913, 955, -299, 324, -919, 948, -305, 319, -925, 321, -925, 322, -918, 938, -324, 299, -9647, 316, -925, 322, -930, 317, -921, 325, -921, 326, -923, 324, -915, 331, -917, 329, -913, 334, -914, 332, -910, 336, -909, 957, -295, 327, -919, 328, -914, 333, -910, 957, -298, 324, -922, 946, -301, 322, -926, 942, -309, 314, -929, 318, -925, 322, -924, 944, -308, 315, -9620, 361, -885, 360, -885, 360, -887, 358, -888, 357, -887, 357, -892, 354, -890, 354, -891, 355, -896, 349, -891, 354, -890, 973, -280, 342, -910, 956, -289, 333, -912, 954, -299, 324, -917, 950, -300, 323, -920, 947, -305, 939, -315, 930, -320, 926, -327, 918, -329, 295]
  - platform: remote_transmitter
    id: lichterkette_flur_off
    raw: [1782, -698, 494, -758, 486, -757, 463, -783, 439, -813, 428, -816, 427, -819, 366, -897, 344, -902, 344, -902, 965, -284, 338, -907, 340, -905, 342, -906, 962, -286, 325, -930, 940, -305, 316, -929, 942, -309, 313, -930, 941, -307, 316, -930, 318, -936, 299, -9639, 337, -911, 336, -908, 338, -909, 339, -906, 341, -902, 344, -901, 346, -899, 348, -900, 339, -905, 342, -905, 341, -901, 966, -287, 336, -911, 336, -909, 338, -904, 961, -295, 328, -914, 954, -299, 324, -919, 949, -303, 320, -923, 946, -305, 318, -930, 306, -944, 304, -9648, 317, -926, 321, -927, 321, -922, 324, -921, 326, -917, 330, -918, 329, -922, 325, -911, 336, -913, 334, -910, 336, -911, 956, -293, 329, -915, 332, -917, 330, -912, 956, -298, 324, -918, 950, -302, 321, -925, 944, -308, 314, -929, 940, -311, 313, -930, 317, -932, 316, -9625, 359, -885, 360, -886, 359, -887, 359, -886, 359, -890, 356, -889, 356, -888, 358, -889, 356, -888, 358, -891, 354, -892, 973, -278, 343, -902, 344, -903, 344, -900, 966, -285, 337, -911, 956, -296, 327, -917, 951, -300, 323, -924, 944, -304, 319, -928, 319, -923, 325, -9622, 361, -880, 365, -880, 365, -882, 363, -886, 359, -887, 359, -889, 356, -886, 359, -885, 360, -894, 352, -889, 356, -887, 977, -276, 346, -898, 966, -288, 334, -911, 956, -293, 330, -915, 952, -299, 324, -924, 944, -303, 942, -312, 932, -317, 929, -319, 927, -326, 298, -9634, 351, -896, 350, -897, 349, -894, 352, -894, 351, -898, 348, -893, 352, -895, 351, -894, 352, -895, 351, -895, 350, -897, 968, -282, 340, -905, 961, -296, 327, -916, 951, -301, 322, -922, 946, -304, 319, -927, 941, -309, 936, -314, 931, -322, 924, -331, 914, -333, 291, -9642, 344, -900, 346, -901, 345, -901, 345, -898, 348, -897, 348, -902, 344, -900, 346, -903, 343, -898, 348, -897, 349, -896, 969, -284, 338, -906, 961, -292, 329, -918, 950, -299, 324, -920, 947, -309, 315, -924, 944, -311, 934, -318, 927, -320, 926, -326, 919, -331, 293, -9643, 343, -901, 346, -898, 348, -901, 344, -897, 350, -896, 349, -901, 345, -897, 349, -900, 346, -898, 348, -900, 345, -900, 965, -283, 339, -907, 960, -293, 329, -916, 952, -297, 326, -922, 945, -306, 317, -925, 944, -310, 935, -314, 931, -319, 927, -325, 921, -331, 292]
  - platform: template
    name: Lichterkette Flur
    optimistic: True
    turn_on_action:
      - switch.turn_on: lichterkette_flur_on
    turn_off_action:
      - switch.turn_on: lichterkette_flur_on

Traceback (if applicable):

Additional information:

OttoWinter commented 5 years ago

Probably due to runtime memory, please enable debug component to see how much RAM is available.

Please also post what configuration you used for OpenMQTTGateway (interested in codes, so I can find out why it's not detected)

brandond commented 5 years ago

@OttoWinter do those IR and RF code arrays (and other such blobs like images for LCDs) go into DRAM or are they kept in IRAM? I thought I saw that you'd been trying to split more of the strings and other such stuff out with attributes. Not sure if that would help with RAM or not, but perhaps could help with image size on more complicated configs.

OttoWinter commented 5 years ago

@brandond They're stored in the static data section (so runtime memory). Seeing as the codes here are 400 uint32_t * 5 = 8kb the RAM is definitely the limiting factor here.

I guess the raw data codes could also be stored in flash memory directly (a bit like images are stored right now).

For @herrwusel: It looks like your codes contain repeated data. At least the 8000us long pulses indicate that a new transmission is started, can you try removing all data in the raw code after a pulse with length 8000us?

herrwusel commented 5 years ago

Please also post what configuration you used for OpenMQTTGateway (interested in codes, so I can find out why it's not detected)

I didn't change OpenMQTTGateway at all. Just flashed it to the ESP so I don't know what part you want to see. In mqtt I can see this when using the rf remote:

home/OpenMQTTGateway/433toMQTT/protocol 5
home/OpenMQTTGateway/433toMQTT/bits 24
home/OpenMQTTGateway/433toMQTT/length 513
home/OpenMQTTGateway/433toMQTT 3354476
home/OpenMQTTGateway/commands/MQTTto433 3354476

Probably due to runtime memory, please enable debug component to see how much RAM is available.

I will try this and report back. Right now I got some gosund sp111 and use them.

OttoWinter commented 5 years ago

This has been addressed