Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Русский
    3. ioBroker
    4. ioBroker драйвера
    5. Драйвер Mqtt + Arduino

    NEWS

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    • Save The Date: ioBroker@Smart Living Forum Solingen, 14.06.

    Драйвер Mqtt + Arduino

    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      instalator last edited by

      @revenkopa:

      я имею ввиду что до версии драйвера MQTT Adapter 2.15 паблики исходящих сообщений имели вид

      "myhome/Mother/DomofonOpen"

      и это меня устраивало и с точки зрения чистоты кода, и с точки зрения применяемости полученного конечного устройства (параллельно смотрю мажордомо)

      после версии драйвера MQTT Adapter 2.15 паблики исходящих сообщений стали

      "mqtt/0/myhome/Mother/DomofonOpen"

      и это меня не устраивает а отключить не нашел как

      обходные пути я вижу но они меня не устраивают

      поэтому вопросы :

      • это глюк при переходе ?

      • есть возможность отключить ?

      ну и старые никем не отвеченные :

      • Можно ли организовать работу с одной переменной (без IN и OUT) ?

      • У меня контролер ловит свои же сообщения и отрабатывает …. это глюк или все как положено?

      • как в iobroker организовать работу когда лампочка в vis отображает значение пришедшее в OUT а управляющий надо посылать в IN ? `
        Выложи код с ардуины, подозреваю что то ты намудрил. Не пойму про IN и OUT, зачем они тебе?
        4447_adapterneustart-und-volume_gesetzt.log

      1 Reply Last reply Reply Quote 0
      • R
        revenkopa last edited by

        Вот код :

        ! #include <dht.h>#include <esp8266wifi.h>#include <pubsubclient.h>#define DHTPIN 5
        ! //#define DHTTYPE DHT11 // DHT 11
        ! #define DHTTYPE DHT22 // DHT 22 (AM2302)
        ! //#define DHTTYPE DHT21 // DHT 21 (AM2301)
        ! float dht_h ; // Reading temperature or humidity takes about 250 milliseconds!
        ! float dht_t ; // Read temperature as Celsius (the default)
        ! DHT dht(DHTPIN, DHTTYPE);
        ! #define Rel1pin 12
        ! #define Rel2pin 13
        ! #define But1pin 4
        ! #define But2pin 6
        ! // Update these with values suitable for your network.
        ! const char* ssid = "kv7";
        ! const char* password = "*****";
        ! //const char
        mqtt_server = "broker.mqtt-dashboard.com";
        ! IPAddress MQTTserver(192, 168, 1, 120);
        ! String MQTT_CN = "kv7/Kitchen/1";
        ! IPAddress IPAdrr (192, 168, 1, 201);
        ! IPAddress IPGW (192, 168, 1, 1);
        ! IPAddress Mask (255, 255, 255, 0);
        ! unsigned long TimerSendTH = 0;
        ! unsigned long TimerSendTHOFF = 2000;
        ! unsigned long TimerRel1 = 0;
        ! unsigned long TimerRel1OFF = 5000;
        ! unsigned long TimerRel2 = 0;
        ! unsigned long TimerRel2OFF = 6000;
        ! WiFiClient espClient;
        ! PubSubClient client(espClient);
        ! long lastMsg = 0;
        ! char msg[50];
        ! int value = 0;
        ! void setup() {
        ! pinMode(BUILTIN_LED, OUTPUT); // Initialize the BUILTIN_LED pin as an output
        ! pinMode(12, OUTPUT);
        ! pinMode(13, OUTPUT);
        ! pinMode( 4, INPUT);
        ! dht.begin();
        ! Serial.begin(115200);
        ! WiFi.begin(ssid, password);
        ! WiFi.config(IPAdrr, IPGW, Mask ); //Comment for DHCP
        ! setup_wifi();
        ! client.setServer(MQTTserver, 1883);
        ! client.setCallback(callback);
        ! }
        ! void setup_wifi() {
        ! delay(10);
        ! // We start by connecting to a WiFi network
        ! Serial.println();
        ! Serial.print("Connecting to ");
        ! Serial.println(ssid);
        ! // WiFi.begin(ssid, password);
        ! while (WiFi.status() != WL_CONNECTED) {
        ! delay(500);
        ! Serial.print(".");
        ! }
        ! Serial.println("");
        ! Serial.println("WiFi connected");
        ! Serial.println("IP address: ");
        ! Serial.println(WiFi.localIP());
        ! }
        ! void callback(char
        topic, byte
        payload, unsigned int length) {
        ! payload[length] = '\0';
        ! String strTopic = String(topic);
        ! strTopic.replace(MQTT_CN,"");
        ! String strPayload = String((char
        )payload);
        ! Serial.print("Message arrived [");
        ! Serial.print(strTopic+" | ");
        ! Serial.print(strPayload);
        ! Serial.print("]");
        ! Serial.println("");
        ! if (strTopic == "/Rel1") {
        ! if (strPayload == "0") digitalWrite(Rel1pin, !LOW);
        ! else if (strPayload == "1") digitalWrite(Rel1pin, !HIGH);
        ! }
        ! else if (strTopic == "/Rel2") {
        ! if (strPayload == "0") digitalWrite(Rel2pin, !LOW);
        ! else if (strPayload == "1") digitalWrite(Rel2pin, !HIGH);
        ! }
        ! }
        ! boolean reconnect() {
        ! Serial.print("Attempting MQTT connection…");
        ! // if (client.connect(("Controller "+MQTT_CN).c_str() ))
        ! if (client.connect("Controller 1"))
        ! {
        ! // Once connected, publish an announcement...
        ! client.publish(MQTT_CN.c_str() ," online");
        ! // ... and resubscribe
        ! Serial.print("Subscribe...ok "+MQTT_CN);
        ! client.subscribe((MQTT_CN+"/#").c_str() );
        ! }
        ! else Serial.print("Fail...");
        ! return client.connected();
        ! }
        ! boolean measurements() {
        ! Serial.print("measurements... ");
        ! dht_h = dht.readHumidity();
        ! dht_t = dht.readTemperature();
        ! if (isnan(dht_h) || isnan(dht_t) || isnan(dht.readTemperature(true))) return false;
        ! return true;
        ! }
        ! void loop() {
        ! if (!client.connected()) reconnect();
        ! client.loop();
        ! // digitalWrite(12, !digitalRead(4) );
        ! // digitalWrite(13, !digitalRead(4) );
        ! // TimerSendTH = 0;
        ! //TimerSendTHOFF = 2000;
        ! // TimerRel1 = 0;
        ! // TimerRel1OFF = 5000;
        ! // TimerRel2 = 0;
        ! // TimerRel2OFF = 6000;
        ! //measurements();
        ! //snprintf (msg, 75, "%2d", DHT.humidity);
        ! dtostrf (dht_h,0,2,msg );
        ! // client.publish((MQTT_CN+ "/humidity").c_str(), msg);
        ! // Serial.println(dht_h);
        ! dtostrf ( dht_t,0,2,msg );
        ! // client.publish((MQTT_CN+"/temperature").c_str(), msg);
        ! // Serial.println(dht_t);
        ! client.publish((MQTT_CN+"/Rel1").c_str(),String( !digitalRead(12)).c_str());
        ! Serial.println((MQTT_CN+"/Rel1"+String( !digitalRead(12))).c_str() );
        ! delay(500);
        ! client.publish((MQTT_CN+"/Rel2").c_str(),String( !digitalRead(13)).c_str());
        ! Serial.println((MQTT_CN+"/Rel2"+String( !digitalRead(13))).c_str() );
        ! delay(500);
        ! }</pubsubclient.h></esp8266wifi.h></dht.h>

        1 Reply Last reply Reply Quote 0
        • R
          revenkopa last edited by

          Вот точно такая же фигня была :

          Раньше такая строка отправлялась от брокера: myhome/Bedroom/Servo

          Сейчас: mqtt/0/myhome/Bedroom/Servo

          только не помогает ранее найденое лекарство - строка префикса и так пустая

          1 Reply Last reply Reply Quote 0
          • I
            instalator last edited by

            Я просто оставлю свой код, который реально работает у меня в данный момент.
            266_kitchen_mqtt.rar

            Я так и не пойму какая разница ` > Раньше такая строка отправлялась от брокера: myhome/Bedroom/Servo

            Сейчас: mqtt/0/myhome/Bedroom/Servo `
            Что это меняет?

            1 Reply Last reply Reply Quote 0
            • H
              Haus last edited by

              "Я просто оставлю свой код, который реально работает у меня в данный момент."

              Спасибо за примеры опробовал работает.

              Вопрос, в твоём коде заменил библиотеку для ENC28J60 и адрес DS18BB20.

              Не мог скомпелировать всё ругался на callbac и указывал на строчку, так как в коде не понимаю стёр callbac и всё сработало.

              Температуры показывает , переменные создались. Не связано ли это с ENC28J60 ?

              ! EthernetClient ethClient;
              ! //PubSubClient client(server, 1883, callback, ethClient);
              ! PubSubClient client(server, 1883, ethClient);
              ! #define id_connect "myhome-kitchen"
              ! #define Prefix_subscribe "myhome/Kitchen/"

              1 Reply Last reply Reply Quote 0
              • E
                electric69 last edited by

                @Haus:

                "Я просто оставлю свой код, который реально работает у меня в данный момент."

                Спасибо за примеры опробовал работает.

                Вопрос, в твоём коде заменил библиотеку для ENC28J60 и адрес DS18BB20.

                Не мог скомпелировать всё ругался на callbac и указывал на строчку, так как в коде не понимаю стёр callbac и всё сработало.

                Температуры показывает , переменные создались. Не связано ли это с ENC28J60 ?

                ! EthernetClient ethClient;
                ! //PubSubClient client(server, 1883, callback, ethClient);
                ! PubSubClient client(server, 1883, ethClient);
                ! #define id_connect "myhome-kitchen"
                ! #define Prefix_subscribe "myhome/Kitchen/" `
                Ардуина отправляет (публикует) данные в ioBroker.

                А как обстоят дела с подпиской? Данные от ioBroker передаются в ардуину?

                1 Reply Last reply Reply Quote 0
                • I
                  instalator last edited by

                  @Haus:

                  "Я просто оставлю свой код, который реально работает у меня в данный момент."

                  Спасибо за примеры опробовал работает.

                  Вопрос, в твоём коде заменил библиотеку для ENC28J60 и адрес DS18BB20.

                  Не мог скомпелировать всё ругался на callbac и указывал на строчку, так как в коде не понимаю стёр callbac и всё сработало.

                  Температуры показывает , переменные создались. Не связано ли это с ENC28J60 ?

                  ! EthernetClient ethClient;
                  ! //PubSubClient client(server, 1883, callback, ethClient);
                  ! PubSubClient client(server, 1883, ethClient);
                  ! #define id_connect "myhome-kitchen"
                  ! #define Prefix_subscribe "myhome/Kitchen/" `
                  а сама функция то далее по коду есть?

                  ////////////////////////////////////////////////////////////////////////////
                  void callback(char* topic, byte* payload, unsigned int length) {
                      payload[length] = '\0';
                     // Serial.print(topic);
                     // Serial.print("=");
                      String strTopic = String(topic);
                      String strPayload = String((char*)payload);
                     // Serial.println(strPayload);
                      callback_iobroker(strTopic, strPayload);
                  }
                  
                  1 Reply Last reply Reply Quote 0
                  • H
                    Haus last edited by

                    Я же написал "в твоём коде заменил библиотеку для ENC28J60 (#include <uipethernet.h>) и адрес DS18BB20", а он всё callbac ну я и стёр эту функцию в PubSubClient client(server, 1883, callback, ethClient) получилось вот так PubSubClient client(server, 1883, ethClient) .Понимаю что это неправильно, про бывал другие примеры ситуация похожая. Так как спросить больше не у кого, прошу помощи у вас. В чём может быть проблема? Вот этот код компилируется нормально.

                    ! #include <spi.h>#include <uipethernet.h>// UIP Ethernet Library to support ENC28J60 ethernet module.
                    ! #include <pubsubclient.h>// MQTT publisher/subscriber client library
                    ! #include <wire.h>#include <liquidcrystal_i2c.h>// i2C bus converter compatible library for LCD
                    ! LiquidCrystal_I2C lcd(0x27,16,2);
                    ! byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED }; // Set the mac address for the arduino nano mcu
                    ! byte server[] = { 192, 168, 1, 16 }; // Set MQTT broker server IP address
                    ! //char server[] = "xxx.xxxxxxx.xxx"; // Set MQTT broker server domain address
                    ! byte ip[] = { 192, 168, 1, 11 }; // Set the IP address for the arduino nano mcu
                    ! int LED = 6; // Initialize digital pin 6 to LED variable
                    ! String msgString; // Initialize msgString variable
                    ! void callback(char* topic, byte* payload, unsigned int length) {
                    ! // Handle message arrived upon a publish from a MQTT client
                    ! char message_buff[100];
                    ! int i;
                    ! for(i=0; i <length; i++)/{<br="">message_buff = payload;
                    ! }
                    ! message_buff = '\0';
                    ! msgString = String(message_buff);
                    ! Serial.println("message arrived: " + msgString); // Serial output of received callback payload
                    ! if(msgString == "0")
                    ! {
                    ! digitalWrite(LED, LOW); // If message payload received is 0, LED is turned off
                    ! lcd.clear(); // Clear previously printed values in the LCD
                    ! lcd.print("D6 : OFF"); // Print The Message on LCD
                    ! lcd.setCursor(0,1); // Set top cursor position on 16x2 LCD module
                    ! }
                    ! else if (msgString == "1")
                    ! {
                    ! digitalWrite(LED, HIGH); // If message payload received is 1, LED is turned on
                    ! lcd.clear(); // Clear previously printed values in the LCD
                    ! lcd.print("D6 : ON"); // Print The Message on LCD
                    ! lcd.setCursor(0,1); // Set top cursor position on 16x2 LCD module
                    ! } else {
                    ! lcd.clear(); // Clear previously printed values in the LCD
                    ! lcd.print("Device Status"); // Print Device Status message on LCD
                    ! lcd.setCursor(0,1); // Set top cursor position on 16x2 LCD module
                    ! lcd.print(msgString); // Print The message payload on LCD
                    ! lcd.setCursor(1,1); // Set top cursor position on 16x2 LCD module
                    ! }
                    ! }
                    ! EthernetClient ethClient;
                    ! PubSubClient client(server, 1883, callback, ethClient); // Initialize a MQTT client instance
                    ! void setup()
                    ! {
                    ! Serial.begin(9600); // Set the Serial Buad rate to 9600
                    ! pinMode(LED, OUTPUT); // Set LED connected pin to OUTPUT mode
                    ! lcd.init(); // Initialize the 16X2 LCD
                    ! lcd.backlight();
                    ! Ethernet.begin(mac, ip);
                    ! if (client.connect("arduinoClient")) { // Check the MQTT broker connectivity
                    ! client.publish("topic","connected"); // Publish ethernet connected status to MQTT topic
                    ! client.subscribe("topic"); // Subscribe to a MQTT topic
                    ! }
                    ! }
                    ! void loop()
                    ! {
                    ! client.loop();
                    ! }
                    ____</length;></liquidcrystal_i2c.h></wire.h></pubsubclient.h></uipethernet.h></spi.h></uipethernet.h>

                    1 Reply Last reply Reply Quote 0
                    • H
                      Haus last edited by

                      Чего хочу сделать:

                      Есть 2 аккумулятивных бака, раньше в них стояли простые термометры и показывали температуру. Сейчас вместо них всунуты DS18B20 и на экране компьютера, телефона всё прекрасно отображается. Но когда хочешь докинуть дров чтобы до грузить баки, под рукой может неокозатца телефона чтобы прикинуть сколько дров подбросить. Хочу поставить рядом с котлом LCD монитор чтобы видеть температуру баков 4х2=8 датчиков переданную с сервера. Также можно было бы и снимать температуру с датчиков отображать на дисплей и отправлять серверу.

                      1 Reply Last reply Reply Quote 0
                      • I
                        instalator last edited by

                        @Haus:

                        Я же написал "в твоём коде заменил библиотеку для ENC28J60 (#include <uipethernet.h>) и адрес DS18BB20", а он всё callbac ну я и стёр эту функцию в PubSubClient client(server, 1883, callback, ethClient) получилось вот так PubSubClient client(server, 1883, ethClient) .Понимаю что это неправильно, про бывал другие примеры ситуация похожая. Так как спросить больше не у кого, прошу помощи у вас. В чём может быть проблема? Вот этот код компилируется нормально.

                        ! #include <spi.h>#include <uipethernet.h>// UIP Ethernet Library to support ENC28J60 ethernet module.
                        ! #include <pubsubclient.h>// MQTT publisher/subscriber client library
                        ! #include <wire.h>#include <liquidcrystal_i2c.h>// i2C bus converter compatible library for LCD
                        ! LiquidCrystal_I2C lcd(0x27,16,2);
                        ! byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED }; // Set the mac address for the arduino nano mcu
                        ! byte server[] = { 192, 168, 1, 16 }; // Set MQTT broker server IP address
                        ! //char server[] = "xxx.xxxxxxx.xxx"; // Set MQTT broker server domain address
                        ! byte ip[] = { 192, 168, 1, 11 }; // Set the IP address for the arduino nano mcu
                        ! int LED = 6; // Initialize digital pin 6 to LED variable
                        ! String msgString; // Initialize msgString variable
                        ! void callback(char* topic, byte* payload, unsigned int length) {
                        ! // Handle message arrived upon a publish from a MQTT client
                        ! char message_buff[100];
                        ! int i;
                        ! for(i=0; i <length; i++)/{<br="">message_buff = payload;
                        ! }
                        ! message_buff = '\0';
                        ! msgString = String(message_buff);
                        ! Serial.println("message arrived: " + msgString); // Serial output of received callback payload
                        ! if(msgString == "0")
                        ! {
                        ! digitalWrite(LED, LOW); // If message payload received is 0, LED is turned off
                        ! lcd.clear(); // Clear previously printed values in the LCD
                        ! lcd.print("D6 : OFF"); // Print The Message on LCD
                        ! lcd.setCursor(0,1); // Set top cursor position on 16x2 LCD module
                        ! }
                        ! else if (msgString == "1")
                        ! {
                        ! digitalWrite(LED, HIGH); // If message payload received is 1, LED is turned on
                        ! lcd.clear(); // Clear previously printed values in the LCD
                        ! lcd.print("D6 : ON"); // Print The Message on LCD
                        ! lcd.setCursor(0,1); // Set top cursor position on 16x2 LCD module
                        ! } else {
                        ! lcd.clear(); // Clear previously printed values in the LCD
                        ! lcd.print("Device Status"); // Print Device Status message on LCD
                        ! lcd.setCursor(0,1); // Set top cursor position on 16x2 LCD module
                        ! lcd.print(msgString); // Print The message payload on LCD
                        ! lcd.setCursor(1,1); // Set top cursor position on 16x2 LCD module
                        ! }
                        ! }
                        ! EthernetClient ethClient;
                        ! PubSubClient client(server, 1883, callback, ethClient); // Initialize a MQTT client instance
                        ! void setup()
                        ! {
                        ! Serial.begin(9600); // Set the Serial Buad rate to 9600
                        ! pinMode(LED, OUTPUT); // Set LED connected pin to OUTPUT mode
                        ! lcd.init(); // Initialize the 16X2 LCD
                        ! lcd.backlight();
                        ! Ethernet.begin(mac, ip);
                        ! if (client.connect("arduinoClient")) { // Check the MQTT broker connectivity
                        ! client.publish("topic","connected"); // Publish ethernet connected status to MQTT topic
                        ! client.subscribe("topic"); // Subscribe to a MQTT topic
                        ! }
                        ! }
                        ! void loop()
                        ! {
                        ! client.loop();
                        ! }
                        ____</length;></liquidcrystal_i2c.h></wire.h></pubsubclient.h></uipethernet.h></spi.h> ______Что за ошибку дает при компиляции? у меня нету твоих библиотек, проверить не могу.

                        Какую кстати версию библиотеки PubSubClient.h юзаете?

                        Добавил которая стоит у меня, вроде 1.9 версия.

                        Обновил у себя до версии 2.4 все нормально компилится. Мой код который я выкладывал компилится у вас? или ошибки только когда добавляете свеоего кода?___
                        266_pubsubclient.zip___</uipethernet.h> `

                        1 Reply Last reply Reply Quote 0
                        • H
                          Haus last edited by

                          Твой код без изменений, PubSubClient.h 2.4, ошибка Kitchen_Mqtt:16: error: 'callback' was not declared in this scope.

                          Если в коде две строчки переставить в другое место всё компилится

                          ! ////////////////////////////////////////////////////////////////////////////
                          ! void callback(char* topic, byte* payload, unsigned int length) {
                          ! payload[length] = '\0';
                          ! // Serial.print(topic);
                          ! // Serial.print("=");
                          ! String strTopic = String(topic);
                          ! String strPayload = String((char*)payload);
                          ! // Serial.println(strPayload);
                          ! callback_iobroker(strTopic, strPayload);
                          ! }
                          ! EthernetClient ethClient;
                          ! PubSubClient client(server, 1883, callback, ethClient);

                          ! ////////////////////////////////////////////////////////////////////////////
                          ! void setup() {
                          ! //Serial.begin(57600);
                          ! // Serial.println("start");

                          1 Reply Last reply Reply Quote 0
                          • I
                            instalator last edited by

                            Там проект состоит из двух файлов они должны быть в одном каталоге, если в среде ардуино не появляется вторая вкладка то добавь в проект файл с функциями.

                            1 Reply Last reply Reply Quote 0
                            • H
                              Haus last edited by

                              Два файла есть, когда две строчки как писал переставляю в другое место то проект компилируется и работает. Правильно ли это?

                              1 Reply Last reply Reply Quote 0
                              • I
                                instalator last edited by

                                @Haus:

                                Два файла есть, когда две строчки как писал переставляю в другое место то проект компилируется и работает. Правильно ли это? `
                                Выложить свои библиотеки

                                1 Reply Last reply Reply Quote 0
                                • H
                                  Haus last edited by

                                  @instalator:

                                  @Haus:

                                  Два файла есть, когда две строчки как писал переставляю в другое место то проект компилируется и работает. Правильно ли это? Выложить свои библиотеки

                                  #include <spi.h>1.0.0

                                  #include <ethernet.h>1.1.1

                                  #include <pubsubclient.h>2.4.0

                                  #include <servo.h>1.1.1

                                  #include <dht.h>DHTlib

                                  #include <onewire.h>2.3.1

                                  #include <dallastemperature.h>3.7.5

                                  Arduino 1.6.6

                                  Проблема в чём то другом…..</dallastemperature.h></onewire.h></dht.h></servo.h></pubsubclient.h></ethernet.h></spi.h>

                                  1 Reply Last reply Reply Quote 0
                                  • I
                                    instalator last edited by

                                    @Haus:

                                    @instalator:

                                    @Haus:

                                    Два файла есть, когда две строчки как писал переставляю в другое место то проект компилируется и работает. Правильно ли это? Выложить свои библиотеки

                                    #include <spi.h>1.0.0

                                    #include <ethernet.h>1.1.1

                                    #include <pubsubclient.h>2.4.0

                                    #include <servo.h>1.1.1

                                    #include <dht.h>DHTlib

                                    #include <onewire.h>2.3.1

                                    #include <dallastemperature.h>3.7.5

                                    Arduino 1.6.6

                                    Проблема в чём то другом…..</dallastemperature.h></onewire.h></dht.h></servo.h></pubsubclient.h></ethernet.h></spi.h> `
                                    Я имел ввиду именно твои библиотеки от твоего проекта.

                                    у меня Arduino 1.6.4

                                    А ты выкинул колбэк из кода у тебя при изменении переменной в iob ардуина реагирует?

                                    1 Reply Last reply Reply Quote 0
                                    • E
                                      electric69 last edited by

                                      @instalator:

                                      А ты выкинул колбэк из кода у тебя при изменении переменной в iob ардуина реагирует? `
                                      Я несколько сообщений назад уже спрашивал, ответа не получил))
                                      @electric69:

                                      @Haus:

                                      "Я просто оставлю свой код, который реально работает у меня в данный момент."

                                      Спасибо за примеры опробовал работает.

                                      Вопрос, в твоём коде заменил библиотеку для ENC28J60 и адрес DS18BB20.

                                      Не мог скомпелировать всё ругался на callbac и указывал на строчку, так как в коде не понимаю стёр callbac и всё сработало.

                                      Температуры показывает , переменные создались. Не связано ли это с ENC28J60 ?

                                      ! EthernetClient ethClient;
                                      ! //PubSubClient client(server, 1883, callback, ethClient);
                                      ! PubSubClient client(server, 1883, ethClient);
                                      ! #define id_connect "myhome-kitchen"
                                      ! #define Prefix_subscribe "myhome/Kitchen/" `
                                      Ардуина отправляет (публикует) данные в ioBroker.

                                      А как обстоят дела с подпиской? Данные от ioBroker передаются в ардуину? `

                                      1 Reply Last reply Reply Quote 0
                                      • H
                                        Haus last edited by

                                        Чего то мы не разберёмся. Вот это твой проект который у меня не компилируется. Я в нём сделал изменение в строке 15, 16 (закомментировал) и добавил строку 72, 73(перенёс сюда строку 15, 16) при таком положение всё компилируется. Если тебя не затруднит проверить этот код и ответить на один вопрос, имеет ли какое то значение где расположены по коду эти две строчки? Я в коде дуб :oops:

                                        443_kitchen_mqtt_haus.zip

                                        1 Reply Last reply Reply Quote 0
                                        • H
                                          Haus last edited by

                                          @electric69:

                                          @instalator:

                                          А ты выкинул колбэк из кода у тебя при изменении переменной в iob ардуина реагирует? `
                                          Я несколько сообщений назад уже спрашивал, ответа не получил))
                                          @electric69:

                                          @Haus:

                                          "Я просто оставлю свой код, который реально работает у меня в данный момент."

                                          Спасибо за примеры опробовал работает.

                                          Вопрос, в твоём коде заменил библиотеку для ENC28J60 и адрес DS18BB20.

                                          Не мог скомпелировать всё ругался на callbac и указывал на строчку, так как в коде не понимаю стёр callbac и всё сработало.

                                          Температуры показывает , переменные создались. Не связано ли это с ENC28J60 ?

                                          ! EthernetClient ethClient;
                                          ! //PubSubClient client(server, 1883, callback, ethClient);
                                          ! PubSubClient client(server, 1883, ethClient);
                                          ! #define id_connect "myhome-kitchen"
                                          ! #define Prefix_subscribe "myhome/Kitchen/" `
                                          Ардуина отправляет (публикует) данные в ioBroker.

                                          А как обстоят дела с подпиской? Данные от ioBroker передаются в ардуину?

                                          Извини что пропустил вопрос, просто тема про выкинутое слово callbak из строчки сам понял что дурак. :roll:

                                          Сейчас большая проблема с ENC28J60 точней с библиотекой <uipethernet.h>в arduino nano сжирает всю память.</uipethernet.h>

                                          1 Reply Last reply Reply Quote 0
                                          • I
                                            instalator last edited by

                                            @Haus:

                                            Чего то мы не разберёмся. Вот это твой проект который у меня не компилируется. Я в нём сделал изменение в строке 15, 16 (закомментировал) и добавил строку 72, 73(перенёс сюда строку 15, 16) при таком положение всё компилируется. Если тебя не затруднит проверить этот код и ответить на один вопрос, имеет ли какое то значение где расположены по коду эти две строчки? Я в коде дуб :oops:

                                            filename="Kitchen_Mqtt_HAUS.zip" index="0">~~ `
                                            У меня компилится и так и так, вообще не пойму что за ошибка у тебя может быть.

                                            А вообще должно все работать так как ты перенес, может в что в новой версии ардуиновкой среды намутили, ща обновлю проверю

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            783
                                            Online

                                            31.6k
                                            Users

                                            79.4k
                                            Topics

                                            1.3m
                                            Posts

                                            18
                                            244
                                            63161
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo