Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. NODEmcu K-Type Temp-Fühler in IObroker !? [gelöst]

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    NODEmcu K-Type Temp-Fühler in IObroker !? [gelöst]

    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      Qax1 @Qax1 last edited by

      @MCU

      Ich weiß nicht ob s was zu sagen hat,
      aber ich habe in IObroker im MQTT-Adapter
      keinen Namen / Passwort vergeben.

      M 1 Reply Last reply Reply Quote 0
      • M
        MCU @Qax1 last edited by MCU

        @mcu Eins nachdem anderen:

        1. String MCUName = "SensorMax"; einfügen nach #define client_name
        2. werteCount = 0; Zeile komplett löschen
        3. bei client.subscribe(client_name : client_name durch MCUName ersetzen
        4. und bei allen client.publish(client_name : client_name durch MCUName ersetzen
        5. beim client.connect"MQTTUser","MQTTPassword" -> "",""
        Q 1 Reply Last reply Reply Quote 0
        • Q
          Qax1 @MCU last edited by

          @mcu

          👍
          Komplieren läuft jetzt komplett durch...

          1 Reply Last reply Reply Quote 0
          • M
            MCU last edited by

            @qax1 Dann schick mir mal das komplette Script.

            Q 1 Reply Last reply Reply Quote 0
            • Q
              Qax1 @MCU last edited by Qax1

              @mcu ```
              #include <Wire.h>
              #include <SPI.h>
              #include "Adafruit_MAX31855.h"
              #include <ESP8266WiFi.h>

              #include <MQTT.h>

              #define CLK 14 //connect CLK to GPIO14
              #define CS 5 //connect CS to GPIO5
              #define DO 12 //connect DO to GPIO12

              #define client_name "SensorMAX"
              String MCUName = "SensorMax";

              const char ssid[] = "xyz";
              const char pass[] = "xxxxxxxxxxxxxxxxx";
              String Nachricht_MQTT = "";
              String Topic_MQTT = "";

              Adafruit_MAX31855 thermocouple(CLK,CS,DO);

              WiFiClient net;
              MQTTClient client;

              void connect() {
              Serial.print("\nchecking wifi...");
              while (WiFi.status() != WL_CONNECTED) {
              Serial.print(".");
              delay(1000);
              }
              Serial.print("\nconnecting...");
              while (!client.connect(client_name,"MQTTUser","MQTTPassword")) {
              Serial.print(".");
              delay(1000);
              }
              Serial.print("\nconnected!");

              client.subscribe(MCUName + "/+");
              client.publish(MCUName + "/alive","true");

              }

              void messageReceived(String &topic, String &payload) {
              Serial.println("MQTT incoming: " + topic + " - " + payload);
              Topic_MQTT = topic;
              Nachricht_MQTT = payload;

              topic = "";
              payload = "";
              }

              void setup() {
              Serial.begin(9600);
              Serial.println("MAX31855 testing");
              delay(500);
              WiFi.begin(ssid, pass);
              client.begin("192.168.178.30",1883,net); //192.168.178.45
              connect(); //alive wird gesendet
              client.onMessage(messageReceived);

              }

              void loop() {
              Serial.print("Internal Temp = ");
              Serial.println(thermocouple.readInternal());
              delay(100);
              double c = thermocouple.readCelsius();
              if (isnan(c)) {
              Serial.println("Something wrong with thermocouple!");
              } else {
              Serial.print("C = ");
              Serial.println(c);
              client.publish(MCUName + "/InternalTemp",String(c));
              }
              client.loop();
              if (!client.connected()) {
              Serial.println("Neustart!");
              delay(200);
              WiFi.begin(ssid, pass);
              client.begin("http://192.168.178.30",1883,net);
              connect(); //alive wird gesendet
              client.onMessage(messageReceived);
              client.publish(MCUName + "/connectProblem","Verbindungsproblem gehabt");
              }
              delay(1000);
              }

              M 1 Reply Last reply Reply Quote 0
              • M
                MCU @Qax1 last edited by MCU

                @qax1 sagte in NODEmcu K-Type Temp-Fühler in IObroker !?:

                Serial.print("\nconnecting...");
                while (!client.connect(client_name,"MQTTUser","MQTTPassword")) {

                Serial.print("\nconnecting...");
                while (!client.connect(client_name,"MQTTUser","MQTTPassword")) {
                

                noch ändern -> "",""

                Code-tags - erste Zeile frei lassen , sonst versteht er das nicht.

                client.begin("http://192.168.178.30",1883,net); ->client.begin("192.168.178.30",1883,net);
                das http:// entfernen

                Q 1 Reply Last reply Reply Quote 0
                • Q
                  Qax1 @MCU last edited by

                  @mcu
                  Ok... erledigt

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    MCU @Qax1 last edited by

                    @qax1 Dann zeig nochmal, aber erste Zeile frei lassen-> Return und dann erst Code-Tag (</>).

                    Q 1 Reply Last reply Reply Quote 0
                    • Q
                      Qax1 @MCU last edited by

                      @mcu

                      #include <Wire.h>
                      #include <SPI.h>
                      #include "Adafruit_MAX31855.h"
                      #include <ESP8266WiFi.h>
                      
                      #include <MQTT.h>
                      
                      
                      #define CLK 14          //connect CLK to GPIO14
                      #define CS 5             //connect CS to GPIO5
                      #define DO 12           //connect DO to GPIO12
                      
                      #define client_name "SensorMAX"
                      String MCUName = "SensorMax";
                      
                      const char ssid[] = "xyz";
                      const char pass[] = "xxxxxxxxxxxxxxxxxxx";
                      String Nachricht_MQTT = "";
                      String Topic_MQTT = "";
                      
                      
                      
                      Adafruit_MAX31855 thermocouple(CLK,CS,DO);
                      
                      WiFiClient net;
                      MQTTClient client;
                      
                      void connect() {
                         Serial.print("\nchecking wifi...");
                         while (WiFi.status() != WL_CONNECTED) {
                           Serial.print(".");
                           delay(1000);
                         }
                         
                         Serial.print("\nconnecting...");
                         while (!client.connect(client_name,"MQTTUser","MQTTPassword")) {
                           Serial.print(".");
                           delay(1000);
                         }
                         
                         Serial.print("\nconnected!");
                          
                         client.subscribe(MCUName + "/+");
                         client.publish(MCUName + "/alive","true");
                         
                      }
                      
                      void messageReceived(String &topic, String &payload) {
                       Serial.println("MQTT incoming: " + topic + " - " + payload);
                       Topic_MQTT = topic;
                       Nachricht_MQTT = payload;
                       
                       topic = "";
                       payload = "";
                      }
                      
                      void setup() {
                       Serial.begin(9600); 
                       Serial.println("MAX31855 testing");
                       delay(500);
                       WiFi.begin(ssid, pass);
                       client.begin("192.168.178.30",1883,net); //192.168.178.45
                       connect(); //alive wird gesendet
                       client.onMessage(messageReceived);
                      
                      }
                      
                      void loop() {
                        Serial.print("Internal Temp = ");
                        Serial.println(thermocouple.readInternal());
                        delay(100);
                        double c = thermocouple.readCelsius();
                        if (isnan(c)) {
                          Serial.println("Something wrong with thermocouple!");
                        } else {
                          Serial.print("C = ");
                          Serial.println(c);
                          client.publish(MCUName + "/InternalTemp",String(c));
                        }
                        client.loop();
                        if (!client.connected()) {
                           Serial.println("Neustart!");
                           delay(200);
                           WiFi.begin(ssid, pass);
                           client.begin("192.168.178.30",1883,net);
                           connect(); //alive wird gesendet
                           client.onMessage(messageReceived);
                           client.publish(MCUName + "/connectProblem","Verbindungsproblem gehabt");
                        }
                        delay(1000);
                      }
                      
                      M 1 Reply Last reply Reply Quote 0
                      • M
                        MCU @Qax1 last edited by

                        @qax1 sagte in NODEmcu K-Type Temp-Fühler in IObroker !?:

                        while (!client.connect(client_name,"MQTTUser","MQTTPassword"))

                        Immer noch nicht geändert:
                        while (!client.connect(client_name,"MQTTUser","MQTTPassword")) -> while (!client.connect(client_name,"",""))

                        Q 1 Reply Last reply Reply Quote 0
                        • Q
                          Qax1 @MCU last edited by

                          @mcu sagte in NODEmcu K-Type Temp-Fühler in IObroker !?:

                          while (!client.connect(client_name,"",""))

                           
                             Serial.print("\nconnecting...");
                             while (!client.connect(MCUName,"","")) {
                               Serial.print(".");
                               delay(1000);
                          

                          so ?

                          M 1 Reply Last reply Reply Quote 1
                          • M
                            MCU @Qax1 last edited by MCU

                            @qax1
                            while (!client.connect(MCUName,"","")) {
                            dort nicht den client_name ersetzen!

                            while (!client.connect(client_name,"",""))

                            Q 1 Reply Last reply Reply Quote 0
                            • Q
                              Qax1 @MCU last edited by

                              @mcu

                                 
                                 Serial.print("\nconnecting...");
                                while (!client.connect(client_name,"","")) {
                                   Serial.print(".");
                                   delay(1000);
                              

                              ok

                              M 1 Reply Last reply Reply Quote 0
                              • M
                                MCU @Qax1 last edited by MCU

                                @qax1 Dann lass mal laufen. Kommt im ioBroker MQTT was an?
                                Sonst zeige die Einstellungen zum MQTT-Adapter.
                                Meine sind:
                                d6831ac2-3a87-4f07-94e5-58a7d0387d2a-image.png

                                Q 1 Reply Last reply Reply Quote 0
                                • Q
                                  Qax1 @MCU last edited by

                                  @mcu

                                  Sau Geil es läuft....

                                  22-03-_2021_22-14-32.jpg

                                  Ich kann dir gar nicht genug Danken....
                                  Das hätte ich alleine wohl nie hinbekommen 🍻 🍻 🍻

                                  M 1 Reply Last reply Reply Quote 0
                                  • M
                                    MCU @Qax1 last edited by MCU

                                    @qax1
                                    218644d8-d58c-42c3-b950-a704c9e55aed-image.png

                                    Und dann bitte im ersten Post die Überschrift anpassen [gelöst] NODEmcu....

                                    Q 1 Reply Last reply Reply Quote 1
                                    • Q
                                      Qax1 @MCU last edited by

                                      @mcu

                                      Nochmal vielen Dank @mcu für deine Hilfe...

                                      Hier ein Bild vom gestrigen Probeheitzen,
                                      bin echt überrascht, mit über 600 °C hätte ich nicht gerechnet.
                                      Muss24-03-_2021_20-32-53.jpg die Tage mal gegenmessen.

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

                                      Support us

                                      ioBroker
                                      Community Adapters
                                      Donate
                                      FAQ Cloud / IOT
                                      HowTo: Node.js-Update
                                      HowTo: Backup/Restore
                                      Downloads
                                      BLOG

                                      545
                                      Online

                                      31.7k
                                      Users

                                      79.7k
                                      Topics

                                      1.3m
                                      Posts

                                      nodemcu max38155 mqtt
                                      2
                                      39
                                      1629
                                      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