Hello,
Im using Wemos NodeMCU V3 32mb wifi module with a level converter and arduino mega.
I connected the converter as in this tutorial, under label "Using the BD-LLC for Serial" (I dont really understand this part: " Although you won't be taking advantage of the BD-LCC's bi-directional abilities, it's perfectly fine to use the board to shift serial communication"):
https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide
I used exact same level converter and tried to send data from arduino using many different ways. The code for sender(arduino) looks like this:
#include <SoftwareSerial.h>
SoftwareSerial espSerial(19, 18);
String str;
void setup(){
Serial.begin(9600);
Serial1.begin(9600);
espSerial.begin(9600);
delay(2000);
}
void loop()
{
Serial.print("H: ");
Serial.print("% ");
Serial.print(" T: ");
Serial.println("C");
Serial1.print("H: ");
Serial1.print("% ");
Serial1.print(" T: ");
Serial1.println("C");
espSerial.write("H: ");
espSerial.write("% ");
espSerial.write(" T: ");
espSerial.write("C");
espSerial.print("H: ");
espSerial.print("% ");
espSerial.print(" T: ");
espSerial.print("C");
delay(1000);
}
and code for reciever(Wemos wifi) looks like that:
#include <SoftwareSerial.h>
SoftwareSerial espSerial = SoftwareSerial(5, 4);
void setup() {
pinMode(5, INPUT);
pinMode(4, OUTPUT);
espSerial.begin(9600);
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
Serial.print(espSerial.read());
}
delay(10);
}
I programmed what i wanted the arduino to do in a different program and now i just want to test sending and recieving data. The problems are:
- after some edits/rewireing serial on Wemos shows nothing, i suppose because Serial.available() is not true
- Serial from Wemos shows only blank squares .
Of course i connected RX to TX and so on, so thats should not be the problem.
The final project is supposed to collect data from sensors(on arduino), and send them to a web server. A part with collecting data is ready and working well, and same for the one sending data to server. I just cant transfer the sensor data from mega to wemos.
any advice would be awesome, as im not experienced, in fact im completly new to recieve/send projects.
Thanks in advance