Beruflich Dokumente
Kultur Dokumente
Subscribe
As I mentioned in the previous posts, Node MCU is a tiny little board is
based on ESP8266 WiFi module which is specifically designed for
working with or without micro controllers which is specifically
Search the site !
designed for IOT projects. Today I will how you how you can live
stream and process Android Mobile Phones Sensor Data to node MCU
using UDP. SUBSCRIBE OUR
YOUTUBE CHANNEL
UDP FOR TUTORIALS
Root Said
The Transport layer in the OSI model manages data flow in an IP
Ads
Google
by
YouTube
network. TCP and UDP are the two protocols working in this layer.
Each has its own advantages and disadvantages as mentioned here.
Ads by Google
JOIN US ON
Firewall Test WiFi Monitor
!"#$
How to Network IP Address Monitor
There is a trade off between speed and reliability. Since reliability is
Robotics and Home
not an issue here, in this project we will be using UDP rather than TCP.
Automation Using WiFi
SETTING UP NODE MCU IN ARDUINO IDE Command Center
The easiest way to program Node MCU is through Arduino IDE. Setting Top 5 Best Anti Virus
up Node MCU in arduino is very simple. You can find step by step Free Downloads for
instruction to set up Node MCU in Arduino IDE here. Once you have 2018
setup everything, please proceed to the the next step. Brushless Motor
Setting up the Network Wireless Control Using
Arduino
We will need a WiFi network to connect the listener (Node MCU) and
the transmitter (Android Phone) to the same network. Best thing to do DIY RC Plane
is set up a hot spot in your android phone. Transmitter Receiver
Using Arduino Part 1
of 2
Portable Mini
Computer Using
Raspberry Pi
Arduino MKR
WAN1300 with LORA
Connectivity
WiFi Antennas
Explained Types of
WiFi Antennas
a 3D virtual world where users can create, connect, and chat with others
Ad secondlife.com
You can also use your home network to connect both devices. All that
matters is that both the devices should be in the same network.
VIDEO TUTORIAL
THE CODE
This is a simple arduino code that can be compiled and uploaded to
Node MCU using Arduino IDE.
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
const char* ssid = rootsaid;
const char* password = testpassword;
WiFiUDP Udp;
unsigned int port = 5514;
char packet[255];
void setup()
{
Serial.begin(9600);
Serial.println();
Serial.printf(Connecting to %s , ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(.);
}
Serial.println(Connection Successful);
Udp.begin(port);
Serial.printf(Listener started at IP %s, at port
%d\n, WiFi.localIP().toString().c_str(), port);
}
void loop()
{
int packetSize = Udp.parsePacket();
if (packetSize)
{
Serial.printf(Received %d bytes from %s, port
%d\n, packetSize, Udp.remoteIP().toString().c_str(),
Udp.remotePort());
int len = Udp.read(packet, 255);
if (len > 0)
{
packet[len] = 0;
}
Serial.printf(UDP packet contents: %s\n, packet);
}
}
When this code is uploaded, the Node MCU will automatically connect
to the WiFi network, obtains and IP address and starts an UDP
Listener in the above mentioned port (5514).
Change the ssid to the WiFi name and password to WiFi network
password.Now start the serial monitor.
Here you will see the status of Node MCU. Take a note of the IP
address and Port.
Ads
Google
by
Sensor UDP for this purpose. This application enables us to send real
time sensor data to a remote device.
Ads by Google
Here you can also choose the sensor values that can be sent using
Sensor UDP. This will be streamed and can be viewed in the Serial
monitor.
These data can be used for various other projects like controlling a
robot, making a wireless mouse etc.
RELATED POSTS
BRUSHLESS MOTOR MINDFLEX DATA
WIRELESS CONTROL USING EXTRACTION USING ARDUINO
ARDUINO
2 COMMENTS
ADD A COMMENT
Comment:*
Name:*
Email Address:*
Website:
ADD COMMENT
"