sending data serial from arduino to esp8266 nodemcu | ESP8266 Wi-Fi Module | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
sending data serial from arduino to esp8266 nodemcu
No permission to create posts
March 9, 2018
7:49 pm
Avatar
zidan
New Member
Members
Forum Posts: 1
Member Since:
March 9, 2018
sp_UserOfflineSmall Offline

hey guys ,
1) i'm trying to send data from my arduino uno to the nodemcu 8266 through serial but i receive nothing , but when i send any data from the node mcu to the arduino things go smoothly
2) so i to access the esp8266 module on the nodemcu esp8266 and made all the wirings so i can access the wifi from the arduino directly then i'll have the benefit of uploading the arduino data through the esp8266 without programing the nodemcu controller , but i failed when i enter any AT command nothing happens

---------------------------------------------------------------------------------------------Arduino code :

#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3); // RX | TX
char c = ' ';
void setup()
{

Serial.begin(9600);

BTserial.begin(115200);

pinMode(13,OUTPUT);
}

void loop()
{
if (BTserial.available())
{
BTserial.write('a');
digitalWrite(13,1);
delay(1000);
BTserial.write('b');
digitalWrite(13,0);
delay(1000);
}
}

--------------------------------------------------------------------------------------NodeMcu esp8266 code :

#include <SoftwareSerial.h>
SoftwareSerial BTserial(13, 15); // RX | TX
char c = ' ';
void setup()
{

Serial.begin(9600);
BTserial.begin(115200);

pinMode(LED_BUILTIN,OUTPUT);
}
void loop()
{
if (BTserial.available())
{ digitalWrite(LED_BUILTIN,HIGH);
c=Serial.read();
Serial.print(c);
}
}

March 13, 2018
9:57 pm
Avatar
rw950431

Top
Members
Forum Posts: 269
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

Which serial ports are being used to connect between the arduino and the NodeMCU?  Is it Serial or BTserial?

I do see a problem in that in the Arduino code you are waiting for some character to be received before you send anything. Perhaps remove the if (BTserial.available()) lines and see if that works.

You might also try a lower speed on the BTserial ports to see if that helps.

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

dollyip18, toddbt2, SatrapB, Ronalpsync, wandaim69, GregoryGof

Administrators: Hans: 387, lee: 457