ESP8266 & Public Broker MQTT mosca.io & Node-RED

The MQTT protocol has taken great strength in recent years since it is simple, safe, practical and lightweight perfect for IoT and M2M applications.

Thanks to the contribution of developers and developers of MQTT applications, there are public MQTT Broker for tests, are available to connect from any MQTT client in this case will use Mosca.io, which has dashboard to view MQTT connections and web sockets, given Which is public should have some considerations that we will see below.

Source: Public MQTT Brokers

We have found very little information about the public broker and we have assumed that it is part of the project mosca.io created by mcollina, this broker MQTT downloadable based on nodejs

Oficial Website: mosca.io

Dashboard MQTT: We assume that apparently has not.

MQTT Broker Configurations

Broker: test.mosca.io
TCP Port: 1883





Tests

Acontinuacion will perform 2 detailed tests:

  1. Connection with Broker MQTT mosca.io from Node-RED.
  2. Connection Broker MQTT mosca.io with ESP8266 & Node-RED.

 

Connection with Broker MQTT Mosca.io from Node-RED

Using Node-RED previously installed on a local server in my network, we will make the MQTT connection with Mosca.io to validate the connection from any MQTT client.

 

Connection Broker MQTT Mosca.io with ESP8266 & Node-RED

In this case the module ESP8266 12E NodeMCU configured as client MQTT read a temperature sensor DS18B20 Protocol (Onewire) sends the temperature via MQTT to the Broker Mosca.io and Node-RED installed in the local network requests the temperature value And graph in Node-RED Dashboard.





Arduino IDE Code

The ESP8266 module is configured as an MQTT client and periodically reads the temperature of the DS18B20 sensor, connected to the D4 pin (Gpio 02), fed at 5v, with its respective recommended resistance in the maxim datasheet.

Requires libraries:

  • PubSubClient.h
  • OneWire.h
  • DallasTemperature.h

Materials and where to buy

Conclusions y recommendations

We consider that although technically the broker is public we do not realize applications that are constantly connected to this broker, and since it is free public we do not know the legal aspects of use.

We only do fast tests and since it has no dashboard we do not know specific details about the broker, we assume that it belongs to the mosca.io project. I thank you in advance for the collaboration to the community.

 

References

 





 

 

You may also like...

Leave a Reply