Serial data from arduino uno to espeasy

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
jupiter8
Normal user
Posts: 10
Joined: 05 Feb 2019, 21:39

Serial data from arduino uno to espeasy

#1 Post by jupiter8 » 10 Jul 2019, 20:33

Hi, i've searched and tried for 2 days to make a serial connexion from an Arduino Uno to a wemos di mini with Espeasy with Ser2net and also tried the dummy device plugin with no results.

does anybody have a tutorial how to do this?

What i tried;

arduino pin 2 (Softserial) ---> Voltage divider-----> wemos Rx
arduino pin 3---->wemos Tx
Also arduino Tx------> voltage divider-----> wemos Rx
arduido ground----> wemos ground

dummy device, single, Dummy

serial speed 9600

Arduino sketch:

Code: Select all

#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
 mySerial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
 
 Serial.println("TaskValueSet,1,1,70");
 mySerial.println("TaskValueSet,1,1,70");

 
  delay(5000);        // delay in between reads for stability
}

i can see in the arduino serial monitor

Code: Select all

TaskValueSet,1,1,70
But nothing in the esp log.

also tried:

Ser2net serial server with

arduino Tx------> voltage divider-----> wemos Rx
arduino ground----> wemos ground
Also arduino pin 2 (Softserial) ---> Voltage divider-----> wemos Rx
arduino pin 3---->wemos Tx

in arduino: serial.print(whatever)

nothing in log, tried 2 different wemos, the arduino can communicate with anothe one, so serial works.

Anybody is doing this?

jupiter8
Normal user
Posts: 10
Joined: 05 Feb 2019, 21:39

Re: Serial data from arduino uno to espeasy

#2 Post by jupiter8 » 10 Jul 2019, 22:41

All wright. for some reasons i hooked up a node mcu the same way, same config and i succeeded. Looks like my wemos have a problem with serial pins.

this is the arduino code that works, simple sketch that reads anlog 0 beware that this is on a mega with serial1:

Code: Select all

void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(115200);
  Serial1.begin(115200);
  
} 


// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int  eventvalue = analogRead(A0);

  // print out the value you read:

   Serial1.print("TaskValueSet,1,1,"); Serial1.println(eventvalue); 
   Serial.print("TaskValueSet,1,1,"); Serial.println(eventvalue);
  //Serial1.write('\r');  
   
 
  delay(5000);        // delay in between reads for stability
}]
Node mcu configured with a generic dummy device.
Last edited by jupiter8 on 11 Jul 2019, 13:25, edited 1 time in total.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Serial data from arduino uno to espeasy

#3 Post by ThomasB » 10 Jul 2019, 23:07

Check the revision on your Wemos D1 mini. If it is a V3.x series I suspect that there will be a conflict with the onboard USB/Serial chip.

I suggest lifting the TXD pin (PIN-2) on the CH340C. This will prevent attenuating the externally transmitted data signal level that is going to the Wemos's "RX" I/O Pad. But don't damage anything since you'll want to occasionally reconnect the pin to allow future ESP firmware updates.

Lift Pin 2 on CH340.
Lift Pin 2 on CH340.
wemos_rx_mode.jpg (98.71 KiB) Viewed 9878 times

From the details seen on the schematic versions, there's no need to do this on a V2.x Wemos board. But the attenuating resistors on the Arduino serial port must be lower than usual values. Some details to this are here: https://github.com/arkypita/LaserGRBL/issues/216
An alternative is to use a logic level convertor board between Arduino and Wemos D1 mini.

- Thomas

jupiter8
Normal user
Posts: 10
Joined: 05 Feb 2019, 21:39

Re: Serial data from arduino uno to espeasy

#4 Post by jupiter8 » 11 Jul 2019, 15:37

REPORT:

Tanks for pointing that. In fact i was using those cheap wemos D1 Mini knock off.
They seem to be V.2.xx. The serial port doesn't work on theses, even when connected with a level shifter and powered by a power shield and the pin cut from the board.

Tried with Wemos Di Mini Pro and it works. Also with Node Mcu.

And it's very true that a level shifter of 220 ohms for r1 and 470 ohms for r2 is needed as with my regular 1k, 2k it didn't work.

The first pic is the node mcu and the second the wemos v.2xx (but nothing is written on it)
Attachments
nodemcu.JPG
nodemcu.JPG (43.34 KiB) Viewed 9822 times
wemosv2.JPG
wemosv2.JPG (71.3 KiB) Viewed 9822 times

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Serial data from arduino uno to espeasy

#5 Post by ThomasB » 11 Jul 2019, 16:52

You are able to flash firmware to the Wemos D1 V2.x knockoff so the ESP8266's serial port is alive. Maybe the cloner made a mistake in the board layout on the RX and TX I/O pins. Or perhaps the two "470 ohm" resistors on the CH340G (at pins TXD & RXD) were stuffed with the incorrect value.

So if you are determined to make the knockoff clone work then check the board's serial pin circuitry for mistakes. But good to know you have a workaround so you can avoid this extra work.

- Thomas

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: Serial data from arduino uno to espeasy

#6 Post by kimot » 11 Jul 2019, 20:30

You do not need Ser2net for sending data from Arduino to ESPeasy.
Simply send command via serial line.

Third line in tab here:
https://www.letscontrolit.com/wiki/inde ... _Reference

Search this forum - I remember it was solved here somewhere.

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: Serial data from arduino uno to espeasy

#7 Post by kimot » 11 Jul 2019, 20:35


jupiter8
Normal user
Posts: 10
Joined: 05 Feb 2019, 21:39

Re: Serial data from arduino uno to espeasy

#8 Post by jupiter8 » 12 Jul 2019, 07:53

Yes indeed, that's what i'm doing as explained in post #2 only dummy device.

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests