arduino-uno


Receiving data automatically in wifi(ESP8266) Even though connected my mobile with ESP8266


Hello friends,
I'm new to arduino. So please help me to solve this issue.
I'm doing android mobile (IR less) control arduino UNO and WIFI (ESP8266) based TV control. I connected my mobile phone wifi with ESP8266 and I'm sending data to ESP8266 to control TV.
But it receives random values and did not receive values whatever I'm sending through my mobile phone wifi (But both wifi has in connection). But before I did controlled. Now I couldn't control I don't know why. And also how to stop this random value reception.
I'm attaching my code here
#include<IRremote.h>
IRsend ir;
char serialA;
void setup()
{
pinMode(3, OUTPUT);
// Serial communication
Serial.begin(115200);
// Wifi commands
Serial.println("AT");
delay(1000);
Serial.println("AT+CIPMUX=1\r\n");
delay(1000);
Serial.println("AT+CIPSERVER=1,80\r\n");
delay(1000);
Serial.end();
}
void loop()
{
delay(800);
Serial.begin(115200);
if (Serial.available() > 0 )
{
serialA = Serial.read();
Serial.println(serialA);
IRREMOTE();
}
}
void IRREMOTE()
{
switch (serialA)
{
case 'A': //Power
ir.sendNEC(0x2FD48B7, 32);
delay(500);
break;
case 'B': // AV/TV
ir.sendNEC(0x2FD28D7, 32);
delay(500);
break;
case 'C': // Mute
ir.sendNEC(0x2FD08F7, 32);
delay(500);
break;
case 'D': // CH+
ir.sendNEC(0x2FDD827, 32);
delay(500);
break;
case 'E': // CH-
ir.sendNEC(0x2FDF807, 32);
delay(500);
break;
case 'F': // Vol+
ir.sendNEC(0x2FD58A7, 32);
delay(500);
break;
case 'G': // Vol-
ir.sendNEC(0x2FD7887, 32);
delay(500);
break;
case 'H':
// Menu
ir.sendNEC(0x2FD30CF, 32);
delay(500);
break;
case 'I':
// Alt
ir.sendNEC(0x2FD708F, 32);
delay(500);
break;
case 'J':
// Scan
ir.sendNEC(0x2FDDA25, 32);
delay(500);
break;
}
}
Thank you
I'm not an expert but you sent
Serial.println("AT");
instead of Serial.println("AT\r\n");.
To initialize the ESP8266 you normally start with a reset so maybe you should add
Serial.println("AT+RST\r\n");
delay(500);
above your AT command.
Furthermore, you start your communication in the setup() and you repeat it in the loop(). The line in the loop() shouldn't be necessary!
Would be nice to see the random values which you received! Maybe I can find the problem (could be something wrong depending on the ASCII table)
try adding Serial.Flush() after every Serial data sent to the ESP

Related Links

stepper motor nema 17 controlled by l298n driver
Why is it so slow to process Strings on Arduino?
Baud rate arduino
upload a programme to Arduino-uno gives error “could not find any usb device”
Arduino UNO(9600) with Wizfi250 cannot send data to Ubidots
How to wire a 12V double solenoid to an Arduino?
Receiving data automatically in wifi(ESP8266) Even though connected my mobile with ESP8266
How to copy string (char*) from Flash to RAM with strcpy_P
LED's won't light up with Arduino
Every function executes on Arduino reset
What is the output of this arduino code?
Shield L6474 and motor equiped with a reducer
NRF24L01+PA+LNA (Transciever) not communicating between two arduinos
Can't program Arduino 328P after first time use of ICSP Sparkfun AVR Pocket Programmer
Arduino uploading issue: “avrdude: no programmer has been specified on the command line or the config file”
Code is showing multiple object declaration error during multiple file compilation

Categories

HOME
sendgrid
arduino-uno
log4j
pdf
gitlab
hook
push-notification
office365api
relay
jsp-tags
jira
sharepoint-designer
survey
ezpublish
azure-storage-tables
portia
offline
etl
php-7.1
serverless-framework
django-admin
sms-gateway
beyondcompare
lldb
predix
jasonette
mps
cultureinfo
claims-based-identity
one-to-many
vlsi
javacv
centos6.5
kannel
user-interaction
social-media
dbclient
microsoft-chart-controls
karaf
protovis
git-merge
bitbucket-pipelines
vapor
uft-api
impersonation
splice
trim
avro4s
quadratic-programming
elmah
heightmap
flashair
wso2carbon
apache-fop
atomicity
pango
boost-preprocessor
time-and-attendance
jquery-filter
disque
yaws
bluegiga
ipconfig
security-testing
kcachegrind
sysinternals
myo
ami
umbraco6
camanjs
winddk
device-manager
responsive-slides
poller
undefined-reference
cloud-connect
jmapviewer
soundtouch
quartz-graphics
jquery-mobile-dialog
type-equivalence
jelly
referrer
tridion-worldserver
osql
spring-portlet-mvc
qt-jambi
subgurim-maps
celltable
imac
yslow
asp.net-mvc-areas
sproutcore-2
forums
ti-dsp
avatar
sector
procedural-music
port-number

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App