Homepage

Mostrando las entradas con la etiqueta iot. Mostrar todas las entradas
Mostrando las entradas con la etiqueta iot. Mostrar todas las entradas

sábado, 12 de noviembre de 2016

Tutorial ESP8266 Control Servo Node-RED MQTT (Mosquitto) IoT #2



This time the integration of ESP8266 and the Node-RED platform has been made integrating an actuator in this case a servo controlled by PWM with rotation from 0 to 180 degrees.
From an HMI or SCADA Web creator on Node-Red-Dashboard using as base the MQTT Protocol and pubsubclient library converting the ESP8266 into MQTT Client.



Note: To successfully complete this tutorial you must perform the following tutorials.
Previous tutorials Recommended
icstation.com
Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation node red platform
Tutorial 3: Installation Node Red Dashboard
Tutorial 4: Installation Modbus TCP IP in Node Red
Tutorial 5: Installation of Mosquitto Broker MQTT in Lubuntu
Tutorial 6: Program ESP8266 con Arduino IDE
Tutorial 7: ESP8266 and Node-RED MQTT GPIO  # 1


Arduino IDE
The ESP8266 module has been configured as an MQTT client, as subscriber of the "servo" topic, the ESP8266 will receive a value from 0 to 100% and will convert it from 0 to 180 degrees for servo control via PWM by GPIO 02.


Mosquitto MQTT Broker
Previously it has been installed in a computer with lubuntu (Ubuntu) Linux, the server Broker MQTT which performs the management of messages in the network, Mosquitto has been used in this case.

Node-Red
A sequence of nodes has been created to send data from the Dashboard.


                                                          Node-RED-Dashboard

                                                            View Tablet




                            Video Tutorial ESP8266 Control Servo  MQTT Node-Red  IoT #4 
  

Materials 
1 ESP8266 01 
1 Regulator LDV33CV  5 a 3.3V
1 Chip FTDI Serial
1 Servo  Mystery control PWM

Connections

Where to buy?
icstation.com 
ESP8266 01 (ESP 01)

Downloads:
Github  Arduino IDE code ESP8266 MQTT
Github pubsubclient  Library 
Node Red  import code example

References
icstation.com
Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation node red platform
Tutorial 3: Installation Node Red Dashboard
Tutorial 4: Installation Modbus TCP IP in Node Red
Tutorial 5: Installation of Mosquitto Broker MQTT in Lubuntu
Tutorial 6: Program ESP8266 con Arduino IDE
Tutorial 7: ESP8266 and Node-RED MQTT GPIO  # 1

node-red-dashboard
Nodered.org
github.com/node-red
Nodejs.org

More Information:

Youtube Channel:

miércoles, 9 de noviembre de 2016

Tutorial ESP8266 and Node-RED MQTT GPIO (Mosquitto) # 1

To integrate the module ESP8266 with node-red IoT platform has been used MQTT protocol, there are client libraries for esp8266 as MQTT in this case I decided to use the library pubsubclient.

This example will receive Node Red that receives data from the ESP8266 and allow control a LED connected to GPIO 02 from a dashboard created in Node Red Dashboard .




Arduino IDE add the pubsubclient library using the search engine libraries or manually by downloading the library and storing it in their respective folder for libraries.

Note: To successfully complete this tutorial you must perform the following tutorials.
Previous tutorials Recommended
icstation.com
Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation node red platform
Tutorial 3: Installation Node Red Dashboard
Tutorial 4: Installation Modbus TCP IP in Node Red
Tutorial 5: Installation of Mosquitto Broker MQTT in Lubuntu
Tutorial 6: Program ESP8266 con Arduino IDE


Arduino IDE code
Arduino IDE code performs several steps but definire major, Broker connection with MQTT, function post (send messages) even specific topic and subscribe function (receive messages) even specific topic.
Note: At the bottom of the post code Full IDE arduino

1 .Parameters Network 
Set parameters network  PASSWORD  and SSID is required to have previously installed a MQTT Broker server which performs the function server broker, in this case I use Mosquitto MQTT.

const char* ssid = "##############";
const char* password = "###############";
const char* mqtt_server = "192.168.0.19";

2. Function publish ("topic" message)
 client.publish("event", "hello world");

3. subscribe Function ("topic")
the subscribe function makes a call to the callback function for data reception
  client.subscribe("event");

4. callback function
This function enter 3 personal parameters of the library pubsubclient.h topic, payload (load) and size, performs printing  of the topic and the message, to turn on the LED diode sweeps payload in a specific position to determine the state 1 or 0.

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print(topic);
  Serial.print("] ");
  for (int i = 0; i < length; i++) {
    Serial.print((char)payload[i]);
  }
  Serial.println();

  // Switch on the LED if an 1 was received as first character
  if ((char)payload[0] == '0') {
     Serial.println("LOW");
    digitalWrite(2, LOW);   // Turn the LED on (Note that LOW is the voltage level
    // but actually the LED is on; this is because
    // it is acive low on the ESP-01)
  } 

 if ((char)payload[0] == '1') {
    Serial.println("HIGH");
    digitalWrite(2, HIGH);  // Turn the LED off by making the voltage HIGH
  }

}

Node Red
1 Node client receiving messages MQTT (subscribe) from ESP8266 through the topic "event" node debugging and debug.
2 Building 2 button "On" "Off" for sending node values MQTT (publish) to ESP8266 topic "event"
3 Node text text output to display status LED diode.
Note: At the bottom of the post code on Github Import Nodes



Design Node Red Dashboard 
Organization Tabbed Widgets and Groups



Visualization Node red Dashboard 






Conections ESP8266


Where to buy?
icstation.com 
ESP8266 01 (ESP 01)

Downloads:
Github  Arduino IDE code ESP8266 MQTT
Github pubsubclient  Library 
Node Red  import code example

References
icstation.com
Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation node red platform
Tutorial 3: Installation Node Red Dashboard
Tutorial 4: Installation Modbus TCP IP in Node Red
Tutorial 5: Installation of Mosquitto Broker MQTT in Lubuntu
Tutorial 6: Program ESP8266 con Arduino IDE


node-red-dashboard
Nodered.org
github.com/node-red
Nodejs.org

More Information:

Youtube Channel:











sábado, 5 de noviembre de 2016

Installation Mosquitto Broker MQTT in lubuntu (Ubuntu) Linux




That is MQTT ?
In short MQTT is a TCP / IP protocol lightweight messaging, the model is publication - subscriber requires a message broker  which is responsible for directing recipients through a topic  in common.
It is considered to Andrew James Stanford-Clark as the author of this protocol.
More information MQTT Wikipedia.
Official Website: mqtt.org


Application
I believe that this protocol is very practical and is currently implemented in IoT and M2M "machine-to-machine" applications, field application in this case would be sending monitoring and control data between servers, sensors and actuators.

Previous tutorials Recommended
Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation node red platform
Tutorial  3 : Installation Node Red Dashboard
Tutorial  4:  Installation Modbus TCP IP in Node Red



Architecture MQTT Protocol 

Broker Mosquitto MQTT
Eclipse mosquitto ™ It is open source, it is a message broker this intermediary MQTT allows the connection of devices.
Official Website: mosquitto.org



Installation of Mosquitto Broker MQTT in lubuntu (Ubuntu) Linux

MQTT to connect devices with Node-red I use mosquitto as Broker, this is an extra complement Node red in the next tutorial installation.

Enter the terminal lubuntu command as root.
Add mosquitto repositories dev
sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa 

Update repositories linux
sudo apt-get update

Install broker mosquitto
sudo apt-get install mosquitto

Install development libraries
sudo apt-get install libmosquitto-dev

Installing client MQTT
sudo apt-get install mosquitto-clients

Check that mosquitto is running
sudo service mosquitto status

Ready to have fun ...






Customer tests Mosquitto MQTT in lubuntu (Ubuntu) Linux
Subscriber
Our client is suscruibira the theme or topic  "Sensor_MQTT" meaning that all published messages associated with this topic will be received.

mosquitto_sub -h localhost -t "Sensor_MQTT" -v

Publisher
Our client publish the message "Error Sensor" through the topic "Alert_MQTT"

mosquitto_pub -h localhost -t "Alert_MQTT" -m "Error_Sensor"

Ready to have fun ...





References
Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation node red platform
Tutorial  3: Installation Node Red Dashboard
Tutorial  4: Installation Modbus TCP IP in Node Red

node-red-dashboard
Nodered.org
github.com/node-red
Nodejs.org

More Information:

Youtube Channel:









jueves, 27 de octubre de 2016

Installation Node Red dashboard




Node red Dashboard
Node red has dashboard to create and view dashboards to interact with the devices in the internet of things.
There was an earlier version call node-red-contrib-ui which was replaced by node-red-dashboard created by Dave Conway-Jones (dceejay) thanks for your great contribution.


In this case we will install this add to our Node-red, previously installed  Lubuntu (Ubuntu) in next tutorials integrate devices already used previously as Arduino and ESP8266.

Previous tutorials
Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation node red platform

Github
github.com/node-red/node-red-dashboard

Dashboard installation for developers

Enter a folder / node-red
 cd ~\.node-red\node_modules 

Copy from github repositories
git clone https://github.com/node-red/node-red-dashboard.git

Enter folder node-red-dashboard
cd node-red-dashboard

Build application
npm install

Back to Folder node-red
cd ..

Run node red
node red 




Dashboard widgets available


Example
Organization and Design Dashboards

The dashboard tab  to organize our dashboard by tabs  and groups since it does not have a tool own design, but consider this way very practical to design without worrying about compatibility design screens different resolutions on devices like smartphones tablets and  pc.


Visualization from PC

Visualization from Tablet  7"


Visualization from Smartphone 4"


Video Complete



Ready to have fun ...

References
Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation node red platform
node-red-dashboard
Nodered.org
github.com/node-red
Nodejs.org

More Information:

Youtube Channel:



miércoles, 26 de octubre de 2016

Installation node Modbus TCP Node Red

In the search for attachable communication protocols Node-Red I found thanks to the collaborative development a library or nodes for communication Modbus TCP IP, the following tutorial is indicated as installing the nodes in lubuntu (Ubuntu).

Previous tutorials Recommended
Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation node red platform
Tutorial  3 :  Installation Node Red Dashboard




This library   node-red-contrib-modbustcp  was created by  Jason D. Harper  was based on the jsmodbus library, this library allows our Node-Red server is configured as master Modbus TCP, it contains 2 nodes one reading and one writing .

 - your user linux -  /node-red/node_modules/
npm install node-red-contrib-modbustcp

Reading from Master (Node Red) to Slave

Writing from Master (Node Red) to Slave



Complete Video  Install Modbus TCP IP in Node Red


                                              Complete Video  Test Modbus TCP IP in Node Red


Ready to have fun ...


lunes, 17 de octubre de 2016

Installation Node red Platform


Installing Node-Red Platform

Longtime had wanted to try this platform called Node-red created by IBM, was developed in nodejs, Node red is developed by Nick O'Leary and Dave Conway-Jones thanks for their contributions.
But that is Node-red ?
It is an open source graphical tool based connection nodes containing API'S and / or services for communication and / or connecting devices to the Internet
of things, has a friendly web interface contains a variety of basic and complex functions IoT, there is also an online version of node red called IBM bluemix.
There are many tutorials to install Node-red on a local server, but these tutorials although very complete I did not work properly, I decided collect the steps to install Node-red in Linux, in this case Lubuntu (Ubuntu) I hope you will his liking this guide.
Applications
No need to be a great programmer to use Node-red, although his native language is javascript with a few tutorials will be very easy to make applications Arduino or ESP8266 or other platforms.
Currently installed Node red on Raspberry pi, excellent, although effected, since testing I decided to install it on Lubuntu (Linux) by hardware capacity.
Tutorial Install lubuntu


For testing I have previously installed a virtual machine with lubuntu, through the SSH client PuTTY equivalent to a command terminal.

Let's start with the nodejs and Node-red installation

Repository Update
sudo apt-get update

Install nodejs.
sudo apt-get install node.js -y
sudo apt-get install nodejs-legacy

Install git
sudo apt-get install git -y

Clone repository with source code on github Node-red
git clone https://github.com/node-red/node-red.git

Enter node red  folder
cd node-red

Install npm
sudo apt-get install npm -y

Install dependencies Node-red
npm install

Top folder
cd ..

Install grunt-cli globally
sudo npm install -g grunt-cli

Enter node red  folder
cd node-red

build and run Node-red application
grunt build 
 node red 


Ready to have fun .....

Video Complete

jueves, 7 de julio de 2016

Turn led ESP8266 with Thinger.io


This time a test is carried out with the Thinger.io platform, using a 01 ESP8266 be conducted remotely control a diode led directly from the web platform.
As shown by a LED diode will control but the application can be with relay actuators and others.

Requirements:

Turn led ESP8266 with Thinger.io

Api control device

 Arduino IDE Code


Test



Materials

1  - 1 ESP8266 - 01
2  - 2 Converter FTDI  Serial -Usb ttl
3  - 3 Regulator 5 a 3.3v
4  - 1 diode led
5  - 1 resistor de 220 Ohm

Connections






Downloads 


More Info:

Youtube Channel
PDAControl

miércoles, 6 de julio de 2016

Introduction Plataform IoT Thinger.io



This time I bring this IoT platform called Thinger.io, in this tutorial as NOTED create an account to register our devices either Arduino, Raspberry Pi or other data collection platform in my case tests effected, with the ESP8266 01.

This platform allows monitoring and control of variables without any complications.
page Oficcial : https://thinger.io/


You want to try thinger.io? The following video will show you step by step



Preview


Report data transmission


Number of Devices
Register for free allows 3 devices with a limit of sending requests monthly 100mb


Geolocation
It has geolocation of connected devices.



Testing - Video tutorial






More Info:

Youtube Channel
PDAControl

Test ESP8266 + DS18B20 Onewire + Google Speadsheets (Google Docs)


If we want a simple solution to monitor temperature, for complicate applications?
if we have Google Docs, This test perform temperature measurement using a probe DS18B20 and transmit directly to  Google spreadsheets using as Google app script bridge.
For this test approximately every 10 seconds temperature data was sent.

Requirements
Arduino IDE
Programming ESP8266
Google Docs account



Connection ESP8266 and Google spreadsheet (Google Docs) Direct
I tested the bookstore Library HTTPSRedirect created by Sujay hadke (electronicsguy) thanks for their contribution to the ESP community, in your example creates a kind of chat between Google Docs and ESP8266, below a tutorial video where settings are explained and Connection.




Important note:
To perform this test is required to see the previous tutorial, settings for Google script and Google spreadsheets, Below are the sofware related to this project.

probe DS18B20




Google Spreadsheets Sheet

This sheet has the following characteristics:

1. Historical Record
2. Graph Historical
3. Dial for Current Status


Video Tutorial
Materials

1  - 1 ESP8266 - 01
2  - 2 Converter FTDI  Serial -Usb ttl
3  - 3 Regulator 5 a 3.3v
4  - 1 Sensor DS18B20



Downloads  Github  Project

Related

More Info:

Youtube Channel
PDAControl