tx rx serial plugin

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
dangu
Normal user
Posts: 11
Joined: 14 Jan 2018, 18:09

tx rx serial plugin

#1 Post by dangu » 21 Feb 2018, 18:16

Hello
there is very much of plugin on the communication serie in easy esp. :(
after several tests, with a basic plug-in style p-020 Ser2Net and modification, I do not communicate with anything. :oops:
what wants to do is receive 2 bytes sent by an arduino to 19200 bauds, integrate them into 2 TaskDeviceValueNames [0] and [1], then return a byte to the arduino, or put a pin to 1 on esp to confirm the reception.
if you know how to use the serial port under easy esp, I'm at your listening,
because I dry a little to write my plugin, and the use under easy esp ets quite different from that of arduino.
Thank you for all your advice..... ;)

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: tx rx serial plugin

#2 Post by toffel969 » 22 Feb 2018, 11:17

Hi

I think you can achieve desired functionality by using rules and serial commands to ESPEasy from Arduino


Connect Arduino Serial to ESP serial
Create a dummy device on ESP Easy (lets say on Task No1)

On the arduino :

Code: Select all

Serial.print(TaskValueSet,1,1,[value 1 from Arduino])
Serial.print(TaskValueSet,1,2,[value 2 from Arduino])
Now you have the values from the Arduino stored in the Dummy device of ESP.

you should be able to send back via rules using the serialsend command (that needs confirmation)
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

dangu
Normal user
Posts: 11
Joined: 14 Jan 2018, 18:09

Re: tx rx serial plugin

#3 Post by dangu » 22 Feb 2018, 20:12

Hello
thank you for your help, in fact thanks to your help, the operation is super simple. :idea:
I created a Dummy Device, then sent the value TaskValueSet, 1,4,1893.33 with usb serial interface 3.3v, and valeue received task1 value 4 = 1893.33.
Perfect, that's exactly what I wanted to do, I understood the sending mechanism. ;)
thank you.

Meek
Normal user
Posts: 59
Joined: 31 Oct 2017, 15:50
Contact:

Re: tx rx serial plugin

#4 Post by Meek » 25 Feb 2018, 22:42

I’m very curious on how your code on the Arduino looks like.

In the past, I have tried to exchange data via the serial interface (TxD & RxD) between ESP and Arduino core.
But in my experiences with serial code exchange between the Arduino and ESP modules, this gave a lot of overhead on the ESP module that became unresponsive.

Perhaps in the last months, the implementation might have evolved thanks to the community and especially by the coders.

Would you like to share the Arduino code with us ?

dangu
Normal user
Posts: 11
Joined: 14 Jan 2018, 18:09

Re: tx rx serial plugin

#5 Post by dangu » 26 Feb 2018, 01:12

Hello
  I work with the firmware "EASYESP" version 2.3.0 build 147 with ESP8266-12

IF I UNDERSTAND WELL, you are sending data from esp to arduino, which strongly slows down the ESP according to you.
In my case, I send data from ARDUINO to ESP via serial interface.
sending is done with this command: Serial.print ("TaskValueSet, 1,1, [value 1 from Arduino]"), simply (5 times this every 2m30sec)
in fact this montage serves me with arduino to decode the data of a weather station type ks300 in 868mhz, which sends the data to esp which sends a domoticz.
my concern now, "easyesp" send the data according to the time determined by (delay), and not at the reception.
I would like to send the received data just after, and the next sending will be done after receiving the other data, no sending if no data reception.
I dig how to do? ? ? :?:

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: tx rx serial plugin

#6 Post by toffel969 » 26 Feb 2018, 11:26

Meek wrote: 25 Feb 2018, 22:42 I’m very curious on how your code on the Arduino looks like.

In the past, I have tried to exchange data via the serial interface (TxD & RxD) between ESP and Arduino core.
But in my experiences with serial code exchange between the Arduino and ESP modules, this gave a lot of overhead on the ESP module that became unresponsive.

Perhaps in the last months, the implementation might have evolved thanks to the community and especially by the coders.

Would you like to share the Arduino code with us ?
Hi

Depending on the update rate, Serial commands shouldnt increase load substantially (like every 2,5 min from TO) or am I mistaken?
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

tango156157
Normal user
Posts: 11
Joined: 27 Feb 2018, 15:30

Re: tx rx serial plugin

#7 Post by tango156157 » 27 Feb 2018, 17:06

dangu wrote: 26 Feb 2018, 01:12 Hello
  I work with the firmware "EASYESP" version 2.3.0 build 147 with ESP8266-12

IF I UNDERSTAND WELL, you are sending data from esp to arduino, which strongly slows down the ESP according to you.
In my case, I send data from ARDUINO to ESP via serial interface.
sending is done with this command: Serial.print ("TaskValueSet, 1,1, [value 1 from Arduino]"), simply (5 times this every 2m30sec)
in fact this montage serves me with arduino to decode the data of a weather station type ks300 in 868mhz, which sends the data to esp which sends a domoticz.
my concern now, "easyesp" send the data according to the time determined by (delay), and not at the reception.
I would like to send the received data just after, and the next sending will be done after receiving the other data, no sending if no data reception.
I dig how to do? ? ? :?:


Hi Dangu, I am also trying to achieve something similar. Please can you share your Arduino code?
Many Thanks

dangu
Normal user
Posts: 11
Joined: 14 Jan 2018, 18:09

Re: tx rx serial plugin

#8 Post by dangu » 28 Feb 2018, 14:26

Hello Tango

do you want to do a montage similar to what I do?
what code do you want, the code that just sends 2 datas to esp for testing,
or the code that receives the datas from the weather station in esp8266 under interrupt, but without using arduino!

tango156157
Normal user
Posts: 11
Joined: 27 Feb 2018, 15:30

Re: tx rx serial plugin

#9 Post by tango156157 » 02 Mar 2018, 14:53

Hi Dangu,

Thanks for replying back. Actually I am looking for your Arduino side code (completed code which sends data to ESP over Serial).
Many thanks if you can share that.

Regards
T

dangu
Normal user
Posts: 11
Joined: 14 Jan 2018, 18:09

Re: tx rx serial plugin

#10 Post by dangu » 04 Mar 2018, 19:07

hello Tango
I was blocked by the SendToHTTP function, but now that it works, I will be able to advance in the arduino code.
be careful I do not communicate with AT commands, I send values to it by the TaskValueSet command with serial port.
when my program is over, I'll give it to you.

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests