Wolf_Yout
@Wolf_Yout

Arduino IDE при компиляций возвращает ошибку компиляций, хотя ошибок нет, что делать?

Код(Главный файл):
//-------------Настройки-------------
const char* ssid = "DIR-620"; //                 SSID вайфая
const char* password = "irina5540114"; //        Пароль вайфая
const char* mqtt_server = "broker.hivemq.com"; //Сервер MQTT
int mqtt_port = 1883; //                         Порт MQTT
#define LED_PIN 4 //                          Пин ленты
#define LED_NUM 50 //                         Кол-во свет-ов

//--------------Импорты--------------
#include <FastLED.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>

//-------------Переменные------------
byte bright = 255; // Яркость(По умолчанию)
CRGB leds[LED_NUM]; //Цвета ленты
WiFiClient espClient;
PubSubClient client(espClient);

void setup() {
  // put your setup code here, to run once:
  FastLED.addLeds< WS2812, LED_PIN, GRB>(leds, LED_NUM);
  Serial.begin(115200);
  setup_wifi();
  client.setServer(mqtt_server, mqtt_port);
  client.setCallback(call_function);
  
}

void loop() {
  // put your main code here, to run repeatedly:
  if (!client.connected()) {
    reconnect();
  }
  client.loop();
  for (int i = 0; i < LED_NUM; i++) {
    leds[i].setHue(i * 255 / LED_NUM);
  }
  FastLED.show();
}

functions_call.ino:
void call_function(char* topic, byte* payload, unsigned int length) {
  Serial.print("MQTT console: ["); //         Выводим начало
  Serial.print(topic); //                     Выводим топик
  Serial.print("] "); //                      Выводим закрытие квадратной скобки
  char* full_text; //                        Переменная для полного текста
  for (int i = 0; i < length; i++) {
    full_text += (char)payload[i]; // Сгребаем байты в текст
  }

  Serial.print(full_text); //                 Выводим всё
  Serial.println();
  //                                          Вкл/выкл
  if ((char)payload[0] == '1') {
    FastLED.setBrightness(bright);
  } else if((char)payload[0] == '0') {
    FastLED.setBrightness(0);
  } else {
    bright = int(full_text);
    FastLED.setBrightness(bright);
  }
}

mqtt.ino:
// Update these with values suitable for your network.
const char* mqtt_login="Tjmaa"; //логин
const char* mqtt_pass="пароль"; //пароль

unsigned long lastMsg = 0;
#define MSG_BUFFER_SIZE (50)
char msg[MSG_BUFFER_SIZE];
int value = 0;

void setup_wifi() {

 delay(10);
 // We start by connecting to a WiFi network
 Serial.println();
 Serial.print("Connecting to ");
 Serial.println(ssid);

 WiFi.mode(WIFI_STA);
 WiFi.begin(ssid, password);

 while (WiFi.status() != WL_CONNECTED) {
 delay(500);
 Serial.print(".");
 }

 randomSeed(micros());

 Serial.println("");
 Serial.println("WiFi connected");
 Serial.println("IP address: ");
 Serial.println(WiFi.localIP());
}

//void callback(char* topic, byte* payload, unsigned int length) {
// Serial.print("Message arrived [");
// Serial.print(topic);
// Serial.print("] ");
// String full_text;
// for (int i = 0; i < length; i++) {
// // Serial.print((char)payload[i]);
// full_text += (char)payload[i];
// }
// Serial.print(full_text);
// Serial.println();
//
// // Switch on the LED if an 1 was received as first character
// if ((char)payload[0] == '1') {
// digitalWrite(D4, HIGH); // Turn the LED on (Note that LOW is the voltage level
// // but actually the LED is on; this is because
// // it is active low on the ESP-01)
// } else {
// digitalWrite(D4, LOW); // Turn the LED off by making the voltage HIGH
// }
//
//}

void reconnect() {
 // Loop until we're reconnected
 while (!client.connected()) {
 Serial.print("Attempting MQTT connection...");
 // Create a random client ID
 String clientId = "ESP8266Client-";
 clientId += String(random(0xffff), HEX);
 // Attempt to connect
 if (client.connect(clientId.c_str(),mqtt_login,mqtt_pass)) {
 Serial.println("connected");
 // Once connected, publish an announcement...
 client.publish("outTopic", "hello world");
 // ... and resubscribe
 client.subscribe("WTechs");
 } else {
 Serial.print("failed, rc=");
 Serial.print(client.state());
 Serial.println(" try again in 5 seconds");
 // Wait 5 seconds before retrying
 delay(5000);
 }
 }
}


Но при компиляций возвращает ошибку:
Arduino: 1.8.19 (Windows 10), Плата:"LOLIN(WEMOS) D1 mini (clone), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, DOUT (compatible), 40MHz, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"


Ошибка компиляции для платы LOLIN(WEMOS) D1 mini (clone).



Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
"Показать подробный вывод во время компиляции"

Ничего не урезано, прям вот так и вывелось без каких либо ошибок. Что делать?
  • Вопрос задан
  • 132 просмотра
Пригласить эксперта
Ответы на вопрос 2
@lonelymyp
Хочу вылезти из минуса по карме.
Для начала сделать то что предлагается в тексте, включить подробный вывод.
Ответ написан
Комментировать
@Kantat
hobby
Я обычно переписываю модуль(место). Быстрее чем разбираться. НЕ ЗАБЫВАЙ в ARDUINO есть свои ошибки.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы