Additional MCU to ESP modul

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
velja
Normal user
Posts: 27
Joined: 08 Feb 2017, 08:07

Additional MCU to ESP modul

#1 Post by velja » 12 Feb 2017, 14:30

How to connect ESP modul with other MCU (AVR 90S2313)? What settings for ESPEasy to use?

My idea is that AVR MCU work some counting and calculation (wind speed, rain, wind direction) and in interval of 10 minutes ESP, which do some other measurements, call AVR and send all data to remote receiver.

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

Re: Additional MCU to ESP modul

#2 Post by toffel969 » 12 Feb 2017, 16:08

velja wrote:How to connect ESP modul with other MCU (AVR 90S2313)? What settings for ESPEasy to use?

My idea is that AVR MCU work some counting and calculation (wind speed, rain, wind direction) and in interval of 10 minutes ESP, which do some other measurements, call AVR and send all data to remote receiver.
idea 1
check out the promini extender plugin. it uses I2C to communicate between an avmega 328, but provides io extension only. this would need to be adapted to your idea.
idea 2
use dummy device on esp easy, connect serial between avr and esp, then use taskvalueSet function via serial ( not sure if this is possible)to write the data from avr to dummy device. dummy device should be able to send data to the controller
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

velja
Normal user
Posts: 27
Joined: 08 Feb 2017, 08:07

Re: Additional MCU to ESP modul

#3 Post by velja » 13 Feb 2017, 08:34

Hi,
I just create dummy device and can vrite from rules values on it but I don't know how make to write data from serial port (I use terminal program in this phase). How to connect serial port?



There are rules:
__________________________________________________________
on System#Boot do //delay 5 seconds to get the time
timerSet,1,5
endon

on Rules#Timer=1 do
TaskValueSet 4, 1, 11
TaskValueSet 4, 2, 22
TaskValueSet 4, 3, 33
TaskValueSet 4, 4, 44
endon
___________________________________________________________
Devices.jpg
Devices.jpg (87.66 KiB) Viewed 3174 times

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

Re: Additional MCU to ESP modul

#4 Post by toffel969 » 13 Feb 2017, 17:12

velja wrote:Hi,
I just create dummy device and can vrite from rules values on it but I don't know how make to write data from serial port (I use terminal program in this phase). How to connect serial port?



There are rules:
__________________________________________________________
on System#Boot do //delay 5 seconds to get the time
timerSet,1,5
endon

on Rules#Timer=1 do
TaskValueSet 4, 1, 11
TaskValueSet 4, 2, 22
TaskValueSet 4, 3, 33
TaskValueSet 4, 4, 44
endon
___________________________________________________________
Devices.jpg
Check out http://www.letscontrolit.com/wiki/index ... _Reference According to this you can just send the command TaskvalueSet via Serial (meaning on AVR you say something like Serial.Print(TaskValueSet.....), so you should be able to use serial monitor of Arduino IDE to simulate this with a USB/TTL adapter (either a built on adapter like on NodeMCU/Wemos). Just type the command in the serial monitor and hit enter. Settings is 115200 bps

For the connection, ESP Easy uses GPIO 1&3 for Serial communication. Connect these to your AVR serial pins( often labeled UART). For in case you use an 5V AVR, its probably necessary to use a level shifter
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

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

Re: Additional MCU to ESP modul

#5 Post by toffel969 » 13 Feb 2017, 17:26

velja wrote:How to connect ESP modul with other MCU (AVR 90S2313)? What settings for ESPEasy to use?

My idea is that AVR MCU work some counting and calculation (wind speed, rain, wind direction) and in interval of 10 minutes ESP, which do some other measurements, call AVR and send all data to remote receiver.
By the way, why not use an ArduinoNano(clone), they cost about 3 € instead of AVR90S2313 and should be able to do the same?
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

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

Re: Additional MCU to ESP modul

#6 Post by toffel969 » 13 Feb 2017, 17:30

toffel969 wrote:
velja wrote:Hi,
I just create dummy device and can vrite from rules values on it but I don't know how make to write data from serial port (I use terminal program in this phase). How to connect serial port?



There are rules:
__________________________________________________________
on System#Boot do //delay 5 seconds to get the time
timerSet,1,5
endon

on Rules#Timer=1 do
TaskValueSet 4, 1, 11
TaskValueSet 4, 2, 22
TaskValueSet 4, 3, 33
TaskValueSet 4, 4, 44
endon
___________________________________________________________
Devices.jpg
Check out http://www.letscontrolit.com/wiki/index ... _Reference According to this you can just send the command TaskvalueSet via Serial (meaning on AVR you say something like Serial.Print(TaskValueSet.....), so you should be able to use serial monitor of Arduino IDE to simulate this with a USB/TTL adapter (either a built in adapter like on NodeMCU/Wemos). Just type the command in the serial monitor and hit enter. Settings is 115200 bps

For the connection, ESP Easy uses GPIO 1&3 for Serial communication. Connect these to your AVR serial pins( often labeled UART). For in case you use an 5V AVR, its probably necessary to use a level shifter
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

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

Re: Additional MCU to ESP modul

#7 Post by toffel969 » 13 Feb 2017, 17:31

toffel969 wrote:
toffel969 wrote:
velja wrote:Hi,
I just create dummy device and can vrite from rules values on it but I don't know how make to write data from serial port (I use terminal program in this phase). How to connect serial port?



There are rules:
__________________________________________________________
on System#Boot do //delay 5 seconds to get the time
timerSet,1,5
endon

on Rules#Timer=1 do
TaskValueSet 4, 1, 11
TaskValueSet 4, 2, 22
TaskValueSet 4, 3, 33
TaskValueSet 4, 4, 44
endon
___________________________________________________________
Devices.jpg
Check out http://www.letscontrolit.com/wiki/index ... _Reference According to this you can just send the command TaskvalueSet via Serial (meaning on AVR you say something like Serial.Print(TaskValueSet.....), so you should be able to use serial monitor of Arduino IDE to simulate this with a USB/TTL adapter (either a built in adapter like on NodeMCU/Wemos, os seperate USB to TTL adapter like Sonoff). Just type the command in the serial monitor and hit enter. Settings is 115200 bps

For the connection, ESP Easy uses GPIO 1&3 for Serial communication. Connect these to your AVR serial pins( often labeled UART). For in case you use an 5V AVR, its probably necessary to use a level shifter
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

velja
Normal user
Posts: 27
Joined: 08 Feb 2017, 08:07

Re: Additional MCU to ESP modul

#8 Post by velja » 13 Feb 2017, 17:53

toffel969 wrote:
toffel969 wrote:
toffel969 wrote:
Check out http://www.letscontrolit.com/wiki/index ... _Reference According to this you can just send the command TaskvalueSet via Serial (meaning on AVR you say something like Serial.Print(TaskValueSet.....),
So this is a point: How to populate values? I send characters through terminal, (via TTL adapter) but values stay untuched. How to write value for Sensor1 (Sensor2, Sensor3...) from serial device? When I use ser2net this characters went out to Putty terminal but Sensor1 value stay unchanged.
toffel969 wrote: so you should be able to use serial monitor of Arduino IDE to simulate this with a USB/TTL adapter (either a built in adapter like on NodeMCU/Wemos, os seperate USB to TTL adapter like Sonoff). Just type the command in the serial monitor and hit enter. Settings is 115200 bps

For the connection, ESP Easy uses GPIO 1&3 for Serial communication. Connect these to your AVR serial pins( often labeled UART). For in case you use an 5V AVR, its probably necessary to use a level shifter

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

Re: Additional MCU to ESP modul

#9 Post by toffel969 » 13 Feb 2017, 18:00

Ser2Net is definitly not what you a looking for, as it routes an Serial connection to an TCP connection (Telnet) and not at all what you are trying to do. Try the serial monitor from Arduino IDE, type

Code: Select all

TaskValueSet,4,1,11
then hit enter. Will try this at home later (if I find time)
Last edited by toffel969 on 13 Feb 2017, 20:26, edited 1 time in total.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

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

Re: Additional MCU to ESP modul

#10 Post by toffel969 » 13 Feb 2017, 19:33

toffel969 wrote:Ser2Net is definitly not what you a looking for, as it routes an Serial connection to an TCP connection (Telnet) and not at all what you are trying to do. Try the serial monitor from Arduino IDE, type

Code: Select all

TaskValueSet,4,1,11
then hit enter. Will try this at home later (if I find time)
i can confirm this works(with arduino serial moitor), i can write values via serial into dummy device. however strange enough, i had to first put serial log level to 4, before it worked. now after switching back to level 2, still works fine. you can also use this to let avr control outputs,
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

velja
Normal user
Posts: 27
Joined: 08 Feb 2017, 08:07

Re: Additional MCU to ESP modul

#11 Post by velja » 13 Feb 2017, 20:16

I'll try tomorow morning.
Thank you

velja
Normal user
Posts: 27
Joined: 08 Feb 2017, 08:07

Re: Additional MCU to ESP modul

#12 Post by velja » 14 Feb 2017, 07:37

Yes, it work! Now there is no problem with some interface that is not support by ESPEasy.

38domo
Normal user
Posts: 12
Joined: 18 Feb 2017, 11:43

Re: Additional MCU to ESP modul

#13 Post by 38domo » 18 Feb 2017, 11:48

hello,
could you explain how to create the dummy device, I don't have in the list of possibles devices ?
I use ESP Easy R108
I would like to use the ESP module to send data from Wifi to a big display connected to the ESP via serial.
regards

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

Re: Additional MCU to ESP modul

#14 Post by toffel969 » 18 Feb 2017, 18:33

38domo wrote:hello,
could you explain how to create the dummy device, I don't have in the list of possibles devices ?
I use ESP Easy R108
I would like to use the ESP module to send data from Wifi to a big display connected to the ESP via serial.
regards
under devices tab, just add a new device and chose dummy from the dropdown list
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

38domo
Normal user
Posts: 12
Joined: 18 Feb 2017, 11:43

Re: Additional MCU to ESP modul

#15 Post by 38domo » 18 Feb 2017, 19:20

I don't have dummy in the dropdown list.
May be it is due to my version of espeasy. I use R108 for the moment.

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

Re: Additional MCU to ESP modul

#16 Post by toffel969 » 18 Feb 2017, 21:31

38domo wrote:I don't have dummy in the dropdown list.
May be it is due to my version of espeasy. I use R108 for the moment.
True, you have to update
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

38domo
Normal user
Posts: 12
Joined: 18 Feb 2017, 11:43

Re: Additional MCU to ESP modul

#17 Post by 38domo » 19 Feb 2017, 18:39

hello,
I have tried to update esp easy to V120 but obtain one error during compil:


error:
C:\Users\gegel\Documents\Arduino\ESPEasy\ESPEasy.ino:221:25: fatal error: ArduinoJson.h: No such file or directory

#include <ArduinoJson.h>

I have used espeasy sources v120 from github and replaced source and libraries to arduino lib and ArduinoJson.h is present in arduino\libraries\ArduinoJson
arduino ide : 1.81
esp8266 version 2.3.0
esp 12E selected

velja
Normal user
Posts: 27
Joined: 08 Feb 2017, 08:07

Re: Additional MCU to ESP modul

#18 Post by velja » 19 Feb 2017, 19:59

Use firmware from
http://www.letscontrolit.com/wiki/index.php/ESPEasy

v120 (stable). Download and unzip. Then connect to to your device through serial communication or 192.168.4.1, option OTA upgrade. There is manual how to do that on ESPEasy wiki

38domo
Normal user
Posts: 12
Joined: 18 Feb 2017, 11:43

Re: Additional MCU to ESP modul

#19 Post by 38domo » 20 Feb 2017, 20:38

hello, I have updated the version using flash.cmd included in the zip. Update OK. After reboot I can see now the dummy device in devices list.
I have now to understand how to send datas from mqqt to esp and to the serial port
regards

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

Re: Additional MCU to ESP modul

#20 Post by toffel969 » 21 Feb 2017, 07:08

38domo wrote:hello, I have updated the version using flash.cmd included in the zip. Update OK. After reboot I can see now the dummy device in devices list.
I have now to understand how to send datas from mqqt to esp and to the serial port
regards
afaik taskvalueset command does not work via mqtt
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Additional MCU to ESP modul

#21 Post by paxi » 21 Feb 2017, 10:06

You are right toeffel. But one can "wrap" that command in a rule and trigger this new event via mttq.

@38dome:
I haven't used it yet but from the description ser2net should be capable of what you're trying to to (send data to serial port) but you'll have to use telnet instead of mttq.

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

Re: Additional MCU to ESP modul

#22 Post by toffel969 » 21 Feb 2017, 13:09

paxi wrote:You are right toeffel. But one can "wrap" that command in a rule and trigger this new event via mttq.

@38dome:
I haven't used it yet but from the description ser2net should be capable of what you're trying to to (send data to serial port) but you'll have to use telnet instead of mttq.
:idea: true, but how do you get the values to set?
They also Come via mqtt, or am i getting it wrong. Ahhh but the event value could work...just checked. Wrapping event in conjuction with %eventvalue% should work.

http://www.letscontrolit.com/wiki/index ... _Variables
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Additional MCU to ESP modul

#23 Post by paxi » 21 Feb 2017, 13:45

Yes, this should work for @velja.

Be carefull, @38domo kind of hijacked this thread ;) and we're actually discussing two different topics here (desired direction of data flow over the serial interface). :P

akulla
Normal user
Posts: 1
Joined: 13 Oct 2018, 23:23

Re: Additional MCU to ESP modul

#24 Post by akulla » 13 Oct 2018, 23:35

Hello,

I am working on a home project with a arduino to get and process some analog values. I thought of using espeasy to get the data from the arduino via serial. First thing i try was to create a serial server device in espeasy and connect the arduino tothe esp via serial. Then with node-red i successfuly connect to the serial server tcp port and send data that i was able to see in the serial monitor(arduino serial monitor). But the problem is that i can not do the other way (send data from the serial monitor to node-red), there seems to exist some problem...
Then i come across this thread and saw the idea of set the task value of a dummy device via serial, beautiful!!! I set the dummy device and start receiving device value via MQTT that is a good solution too for me. The problem is that the command TaskValueSet,x,x,x does not work... So my question is anybody have done this with success? If yes i apreciate your help.

Thank very much.

RB

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests