Gratis sin TLS
- Broker: mqtt.rosariot.com
- Puerto: 1800
- Persistencia: NO
- Backups: NO
Gratis con TLS
- Broker: mqtt.rosariot.com
- Puerto: 8880
- Certificado: Descargar
- Persistencia: NO
- Backups: NO
Node-RED
Broker MQTT Free TLS
MQTT.fx
Broker MQTT Free
Broker MQTT Free TLS
MQTTX
Broker MQTT Free
Broker MQTT Free TLS
Broker MQTT Free TLS
Arduino IDE + TLS
#include <ESP8266Wifi.h>
#include <PubSubClient.h>
const char *ssid = "ssid-wifi";
const char *pass = "password-wifi";
WiFiClientSecure wifi_client;
const char* mqtt_server = "mqtt.rosariot.com";
const int mqtt_port = 8880;
const char* mqtt_fingerprint = "42:EF:11:A3:D2:3F:9C:43:8C:03:FC:B2:A1:21:13:73:AC:B1:77:26:1F:34:96:7D:DD:2A:CF:5B:A5:0E:86:F8";
//const char* mqtt_pass = "mqtt-user";
//const char* mqtt_user = "mqtt-pass";
PubSubClient mqtt_client(mqtt_server, mqtt_port, wifi_client);
void setup()
{
Serial.begin(115200);
delay(100);
Serial.println("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
wifi_client.setFingerprint(mqtt_fingerprint);
}
void loop()
{
wifi_client.connect(mqtt_server,mqtt_port); //CONNETION TCP/IP TO SERVER
if(wifi_client.verify(mqtt_server,mqtt_fingerprint)) { //VERIFICATION TLS
Serial.println("SECURE TLS OK");
wifi_client.stop();
if(mqtt_client.connect(“mqtt_id”)) { //CONNETION TO MQTT BROKER
Serial.println("MQTTS OK");
//-----------------------YOUR CODE------------------------------//
} else {
wifi_client.stop();
Serial.print(" --> ERROR WHEN TRYING CONNECT TO BROKER MQTT, "); Serial.print("rc= "); Serial.println(mqtt_client.state());
}
} else {
wifi_client.stop();
Serial.println(" --> ERROR SECURE TLS");
}
delay(5000);
}
Arduino IDE
#include <ESP8266Wifi.h>
#include <PubSubClient.h>
const char *ssid = "ssid-wifi";
const char *pass = "password-wifi";
WiFiClient wifi_client;
const char* mqtt_server = "mqtt.rosariot.com";
const int mqtt_port = 1880;
//const char* mqtt_pass = "mqtt-user";
//const char* mqtt_user = "mqtt-pass";
PubSubClient mqtt_client(mqtt_server, mqtt_port, wifi_client);
void setup()
{
Serial.begin(115200);
delay(100);
Serial.println("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass); //WOKWI WIFI SIMULATION --> WiFi.begin("Wokwi-GUEST","",6);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
}
void loop()
{
mqtt_client.connect(“mqtt_id”); //CONNETION TCP/IP TO SERVER
if(mqtt_client.connected()) { //CONNETION TO MQTT BROKER
Serial.println("MQTTS OK");
//-----------------------YOUR CODE------------------------------//
} else {
wifi_client.stop();
Serial.print(" --> ERROR WHEN TRYING CONNECT TO BROKER MQTT, ");
Serial.print("rc= "); Serial.println(mqtt_client.state());
}
delay(5000);
}