hi everyone i am new here and i hoped that you can help me with my struggle , i want to activate a relay using esp01 , and i want to send the command using my mobile and an application i downloaded from play store,i searched a lot and i couldn't benefit from anything i read, can you help me please?
yazan666:
i couldn't benefit from anything i read
Are you expecting someone to do the entire project for you?
no , of course not , and even if they do i wont accept ,but i need some reference or a book or something like that
yazan666:
no , of course not , and even if they do i wont accept ,but i need some reference or a book or something like that
But you wrote that you didn't understand anything of what you read.
How is a book going to be different?
can you program the esp-01? uploading a Blink sketch to it?
yes i blinked an external led and the built in led
ok. and can you wire and program the relay?
i can wire the relay , but am not sure about the programming i am trying to use the udp library , but i am really confused , i keep getting connection failed on my phone : this is what i came up with so far
#include <ESP8266WiFi.h>
#include <ESP8266WiFiAP.h>
#include <ESP8266WiFiGeneric.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266WiFiScan.h>
#include <ESP8266WiFiSTA.h>
#include <ESP8266WiFiType.h>
#include <WiFiClient.h>
#include <WiFiClientSecure.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>
char nena[2] ;
WiFiUDP
void setup() {
// put your setup code here, to run once:
WiFi.begin();
WiFiUDP.begin(9995);
pinMode(2,OUTPUT);
digitalWrite(2,LOW);
}
void loop() {
// put your main code here, to run repeatedly:
WiFiUDP.read(nena,2);
digitalWrite(2,LOW);
if(nena == ‘a’)
{
digitalWrite(2,HIGH);
}
}
you could use Blynk
can you please give me the steps of operation
i am more experienced with pic micro controller libraries , so this is all new to me, thank you for your patience
THANK YOU MY FRIEND IT WORKED.....but it needs a router i was hoping that i could use the esp01 as the router it self any way to accomplish that
yazan666:
but it needs a router i was hoping that i could use the esp01 as the router it self any way to accomplish that
Blynk is a cloud service. you can switch the relay from anywhere.
you want to access it only from LAN?
the simplest would be running a webserver in esp8266 and access it from browser from phone or computer.
or running plain telnet server and writing your own android application which would communicate over socket.
so if i want to use an android application i should also download its library ? , the one i downloaded named wifi mcu if you could check it i will be greatful , but really i wont to avoid using esp01 as a web server, my idea is to use the application i mentioned above to send a command to esp01 , the esp01 reads the command and decides to turn the gpio2 on or off , my problem is that i didnt understand which library i should use(server,client or udp) i tried to use them but i couldnt make a connection , so i came here for help.
I do no see a link to an application in your posts
it is something outdated, without docs. May be it requires a corresponding firmware.
hi
well...i have been working with the esp 01 for the past few days , and now i am able to use it with blynk and web servers , honestly i followed the tutorials online and it worked , i couldnt write my own code and i was hoping to use the esp8266 without the presence of an external network , any advices for me?
sorry no. I do not know any ready android application and corresponding esp8266 library.
on the esp side a simple telnet server could receive the command from java from a simple android application.
no i meant that if there is a way to use esp8266 without an external wifi network , like if i want to use it for a garage door