In this opportunity we will useNode-RED to control and Arduino MEGA 2560 R3, thanks to the collaboration of a colleague Absolutely Automation I indicated this method that allows to easily control an Arduino if complications.
Also in one of the comments does anyone consult if there is a more practical way to control from Arduino and Node-RED?
I've decided to do a tutorial to take this solution into account.
In my case I have installed Node-REDon my pc with lubuntu, in other applications can be installed on a Raspberry pi, although you must take into account the speed and performance in case of very complex applications.
More Info: PDAControl
English version: Controlling Arduino from Node-RED with Firmware Firmata http://pdacontrolen.com/controlling-arduino-from-...
Version en Español:Controlar Arduino desde Node-RED con Firmware Firmata http://pdacontroles.com/controlar-arduino-desde-n...
Step 1: Materials
Step 2: I Recommend a Linux Operating System.... Lubuntu
I recommend a linux operating system in my case Lubuntu, light and fast
below a solution if they are Windows users.
Create a virtual machine with Virtualbox in Windows and in a few steps mount a Linux system
Install lubuntu (Ubuntu) from Scratch on Virtualbox
Step 3: Permanent Installation
You can also install lubuntu permanently, in my case leave windows, good is an option ..
Full Migration to Lubuntu Operating System
Step 4: Install Node-RED
For a long time I had wanted to try this platform called Node-red created by IBM, it was developed in nodejs, Node network is developed by Nick O’Leary and Dave Conway-Jones thanks for your contributions.
Tutorial Recomended: Install Node-RED
But what is Node-Red?
It is an open source graphic tool based on connection of nodes that contain API’S and / or services for the communication and / or connection of devices for the Internet
Step 5: Install Nodes for Arduino
Install Nodes for Arduino
From Node-RED from the node palette we can directly install the Arduino nodes, and in the example we will copy the basic blink example in the arduino GPIO 13.
information package npm:node-red-node-arduino
Step 6: Upload Firmware Firmware From Arduino IDE
Upload Firmware Firmware from Arduino IDE
This code technically is a very fast protocol that directs the control of GPIO, ADC, PWM and handling of Strings through the serial port, there are several versions of the firmware but we will use StandardFirmata included in the sample libraries.
Step 7: Conclusions and Considerations
Conclusions and Considerations
A timely solution for simple applications that allow the blade to be connected directly to the PC. The great disadvantage in general of the controls made from an external platform, without executing code properly on the board, is the safety or autonomy in case of disconnection in this case, disconnection of Node-RED
but guaranteeing a robust hardware should not be feared.
More Info: PDAControl
Controlling Arduino from Node-RED with Firmware Firmata
Version en Español
Controlar Arduino desde Node-RED con Firmware Firmata