NEWS
MQTT mit Visuino Einstellungen
-
Hallo zusammen ich bitte euch um Hilfe.
Ich komme nicht weiter hab schon alles ausprobiert, selber bin ich kein Programmierer und wen ich Visuino gefunden habe war ich so glücklich das grafisch alles geht.
Um zu alles Ekleren habe ich Video auf YouTube geladen. Über Visuino gibst keine Infos hier und ich finde das Programm ist geil für Anfänge wie ich.
Für eure Hilfe bin ich Dankbar.
//---------------------------------------------- // // Sketch Generated by Visuino // www.visuino.com // Version 7.8.2.261 // //------------------ Source -------------------- // // Uno_MQTT.visuino // //---------------------------------------------- #define VISUINO_ARDUINO_UNO #include <openwire.h> #include <mitov.h> #include <mitov_formattedserial.h> #include <mitov_ethernetshield.h> #include <spi.h> #include <ethernet.h> #include <dns.h> #include <mitov_mqtt.h> #include <mitov_button.h> // Arduino Board Declarations namespace BoardDeclarations { Mitov::ArduinoDigitalOutputChannel<8> ArduinoDigitalChannel_8( false, false ); } // BoardDeclarations // Declarations namespace Declarations { Mitov::EthernetShield<1> TArduinoEthernetShield1( Mitov::TMACAddress( 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED ), false, IPAddress( 192, 168, 178, 28 ) ); Mitov::TCPClientSocket<mitov::ethernetshield<1>, Declarations::TArduinoEthernetShield1, EthernetClient> TArduinoEthernetTCPClientSocket1( 0, IPAddress( 192, 168, 178, 25 ) ); Mitov::EthernetSocketBinaryInput<mitov::tcpclientsocket<mitov::ethernetshield<1>, Declarations::TArduinoEthernetShield1, EthernetClient>, Declarations::TArduinoEthernetTCPClientSocket1> TArduinoEthernetTCPClientSocket1_SerialInputByte_1; Mitov::MitovMQTTClient MQTTClient1 = Mitov::MitovMQTTClient( false, "40D3FBD2C32DEC5692BB717C23690287" ); Mitov::ArduinoMQTTClientTextReadTopic <declarations::mqttclient1>TArduinoMQTTTextTopic1( Declarations::MQTTClient1 ); Mitov::Button Button1; } // Declarations // Type Converters namespace TypeConverters { Mitov::Convert_DigitalToText Converter0; } // TypeConverters // Pin Call Declarations namespace PinCalls { void PinCallerReceive1( void *_Data ); void PinCallerReceive2( void *_Data ); void PinCallerReceive3( void *_Data ); void PinCallerReceive4( void *_Data ); void PinCallerReceive5( void *_Data ); void PinCallerReceive6( void *_Data ); void PinCallerReceive7( void *_Data ); } // PinCalls // Pin Call Implementations namespace PinCalls { void PinCallerReceive1( void *_Data ) { Declarations::Button1.InputPin_o_Receive( _Data ); } void PinCallerReceive2( void *_Data ) { Declarations::MQTTClient1.ConnectedInputPin_o_Receive( _Data ); } void PinCallerReceive3( void *_Data ) { Declarations::MQTTClient1.InputPin_o_Receive( _Data ); } void PinCallerReceive4( void *_Data ) { Declarations::TArduinoEthernetTCPClientSocket1.DisconnectInputPin_o_Receive( _Data ); } void PinCallerReceive5( void *_Data ) { Declarations::TArduinoEthernetTCPClientSocket1_SerialInputByte_1.InputPin_o_Receive( _Data ); } void PinCallerReceive7( void *_Data ) { TypeConverters::Converter0.Convert( _Data, PinCallerReceive6 ); } void PinCallerReceive6( void *_Data ) { Declarations::TArduinoMQTTTextTopic1.InputPin_o_Receive( _Data ); } } // PinCalls namespace ComponentsHardware { void SystemUpdateHardware() { } } // ComponentsHardware //The setup function is called once at startup of the sketch void setup() { BoardDeclarations::ArduinoDigitalChannel_8.OutputPin().SetCallback( PinCalls::PinCallerReceive1 ); Declarations::TArduinoEthernetTCPClientSocket1.ConnectedOutputPin().SetCallback( PinCalls::PinCallerReceive2 ); Declarations::TArduinoEthernetTCPClientSocket1.Port = 1883; Declarations::TArduinoEthernetTCPClientSocket1.OutputPin().SetCallback( PinCalls::PinCallerReceive3 ); Declarations::MQTTClient1.DisconnectOutputPin().SetCallback( PinCalls::PinCallerReceive4 ); Declarations::MQTTClient1.OutputPin().SetCallback( PinCalls::PinCallerReceive5 ); Declarations::TArduinoMQTTTextTopic1.Topic = "Test1"; Declarations::Button1.OutputPin().SetCallback( PinCalls::PinCallerReceive7 ); BoardDeclarations::ArduinoDigitalChannel_8.SystemInit(); Declarations::TArduinoEthernetShield1.SystemInit(); Declarations::TArduinoEthernetTCPClientSocket1.SystemInit(); BoardDeclarations::ArduinoDigitalChannel_8.SystemStart(); Declarations::Button1.SystemStart(); } // The loop function is called in an endless loop void loop() { unsigned long A_Current_Microseconds = micros(); BoardDeclarations::ArduinoDigitalChannel_8.SystemLoopBegin( A_Current_Microseconds ); Declarations::TArduinoEthernetTCPClientSocket1.SystemLoopBegin( A_Current_Microseconds ); Declarations::MQTTClient1.SystemLoopBegin( A_Current_Microseconds ); Declarations::Button1.SystemLoopBegin( A_Current_Microseconds ); }</declarations::mqttclient1></mitov::tcpclientsocket<mitov::ethernetshield<1></mitov::ethernetshield<1></mitov_button.h></mitov_mqtt.h></dns.h></ethernet.h></spi.h></mitov_ethernetshield.h></mitov_formattedserial.h></mitov.h></openwire.h>