Sie sind auf Seite 1von 9

ARDUINO WIFI RASPBERRY PI NETWORK

NODE MCU UDP LISTENER SUBSCRIBE HERE


Subscribe For Live Updates
MOBILE PHONE SENSOR Name
DATA
Email *

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

Node MCU UDP


Listener Mobile
Phone Sensor Data

Arduino MKR
WAN1300 with LORA
Connectivity

Mind Controlled Robot


using MindFlex and
Arduino

WiFi Antennas
Explained Types of
WiFi Antennas

Heavy Duty Power


Source for Raspberry
Pi
By doing so, you can easily start and stop the network whenever you
want. Make sure that you keep the listener with in the range of WiFi
network. ASK ROOTSAID
COMMUNITY
Play now

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

Node MCU UDP Listener Mobile Phone Sensor D

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).

const char* ssid = rootsaid;


const char* password = testpassword;

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.

SENDING UDP PACKETS


There are various Apps available in play store that can be used to send
UDP data to other devices from your phone. Here, I will be using

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

IP Address Monitor WiFi Antenna

Network Monitor Beef


Here enter the IP address of the Listener and Port number. Type
something in the text to send and click send.
If everything is done correctly, you will see the text you send in the
Serial Monitor.

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

KISMET KRACK TEST MOBILE PHONE WIFI


IN KALI LINUX CONTROLLED RASPBERRY PI
ROBOT

2 COMMENTS

Rohit October 27, 2017 Reply

hi nice work, is it possible to receive telephonic call on


nodemcu for android device, so whenever there will be
a incoming call, nodemcu will acts as a device which
will be consist of speakers and mic, instead of using
mobile we will talk on nodemcuif it is possible then
please tell me how, i am new into this field
thank-you

Jithin October 29, 2017 Reply

you mean like a bluetooth receiver? sending


the mobile phones speaker and mic signals
are possible.but i am not sure about the
output sound quality. to confirm that, we
will have to make one. I will google it and
revert back.

ADD A COMMENT

Your email address will not be published. Required fields are


marked *

Comment:*

Name:*

Email Address:*

Website:
ADD COMMENT

"

COPYRIGHT 2017 ROOT SAID.

TERMS OF USAGE PRIVACY POLICY DISCLAIMER POLICY CONTACT US ABOUT US

Das könnte Ihnen auch gefallen