Wemos D1 mini Serial reading with scanner.

Good Day!
I am new in programming controller and i am trying to connect a barcode scanner and read data using wemos d1 mini.
I tried following this guide.
http://forum.arduino.cc/index.php?topic=288234.0
and was able to make the barcode scanner work with arduino uno by using this code.

const byte numChars = 32;
char receivedChars[numChars]; // an array to store the received data

boolean newData = false;

void setup() {
 Serial.begin(9600);
 Serial.println("<Arduino is ready>");
}

void loop() {
 recvWithEndMarker();
 showNewData();
}

void recvWithEndMarker() {
 static byte ndx = 0;
 char endMarker = '\n';
 char rc;
 
 // if (Serial.available() > 0) {
           while (Serial.available() > 0 && newData == false) {
 rc = Serial.read();

 if (rc != endMarker) {
 receivedChars[ndx] = rc;
 ndx++;
 if (ndx >= numChars) {
 ndx = numChars - 1;
 }
 }
 else {
 receivedChars[ndx] = '\0'; // terminate the string
 ndx = 0;
 newData = true;
 }
 }
}

void showNewData() {
 if (newData == true) {
 //Serial.print("This just in ... ");
 Serial.println(receivedChars);
 newData = false;
 }
}

I then tried to apply the same logic for my wemos and connected the barcode scanner's pins to tx and rx as shown in my attachment below. I am very confused on how i will be able to read the data using wemos mini d1 since it shows nothing on my serial monitor. i have tried changing the baud rate to 115200 and read some more similar posts but failed to understand which should i fix the breadboard connections or the code. Please help me make this work. Thank you so much for taking time in reading this post.

Your image

Try to think or learn about what Rx and Tx are connected to (here is something to read or that reference too)

@Aeoxia,

What is the thing in the orange plastic bag?

A photo of a connection diagram drawn in pencil will be much easier to understand.

...R
Simple Image Guide

Robin2:
What is the thing in the orange plastic bag?

Probably the serial scanner he wants to read?

And the "orange plastic bag" looks like Kapton tape to me.

Whandall:
Probably the serial scanner he wants to read?

I was trying to make the point to the OP that s/he needs to provide a lot more information.

...R

Robin2:
@Aeoxia,

What is the thing in the orange plastic bag?

A photo of a connection diagram drawn in pencil will be much easier to understand.

...R
Simple Image Guide

The one in kapton tape is the barcode scanner

(Wemos)TX->RX (Barcode)

(Wemos)RX->TX (Barcode)

J-M-L:
Your image

Try to think or learn about what Rx and Tx are connected to (here is something to read or that reference too)

I have read the links you have given and have learned that serial monitor cannot be used once UART0 was used to communicate with another hardware. I am limited into using UART0 since i need to receive data and since i cannot use the serial monitor i have tried my own way of checking the processes.

for every condition or function want to test i set an assigned pin to HIGH to know which ones are working but unfortunately neither of the functions im using was working.

void loop() { // run over and over
  recvWithEndMarker();
 showNewData();
}

void recvWithEndMarker() {
 static byte ndx = 0;
 char endMarker = '\n';
 char rc;

 // if (Serial.available() > 0) {
           while (Serial.available() > 0 && newData == false) {

digitalWrite(D5, HIGH);
delay(500);
digitalWrite(D5, LOW);
 rc = Serial.read();

 if (rc != endMarker) {
 receivedChars[ndx] = rc;
 ndx++;
 if (ndx >= numChars) {
 ndx = numChars - 1;
 }
 }
 else {
 receivedChars[ndx] = '\0'; // terminate the string
 ndx = 0;
 newData = true;
 }
 }else{
 digitalWrite(D6, HIGH);
delay(500);
digitalWrite(D6, LOW);
}
}
void showNewData() {
digitalWrite(D2, HIGH);
delay(500);
digitalWrite(D2, LOW);

 if (newData == true) {
digitalWrite(D3, HIGH);
delay(500);
digitalWrite(D3, LOW);
 Serial.println(receivedChars);
 newData = false;
 }
}

This puts me in a bind of being unable to determine whether the code im using is working, or maybe the scannerSerial->wemosSerial is wrong?

(Wemos)TX->RX (Barcode)

(Wemos)RX->TX (Barcode)

or maybe wemos really cannot handle this serial connection and i am misusing wemos?? i have searched a lot of examples and i have not seen any wemos used alone it is always paired to arduino to read the serial data. I always have wanted to use wemos d1 mini+scanner alone since since ill be able to achieve a smaller form factor.

Aeoxia:
The one in kapton tape is the barcode scanner

(Wemos)TX->RX (Barcode)

(Wemos)RX->TX (Barcode)

That suggests that you are missing an essential GND connection.

Draw a diagram with pencil showing all the connections as I asked for in Reply #2 - then we will have all the necessary information in a neat package with no confusion.

...R