ESP-WROOM-32 AT commands firmware

wind_energy
Posts: 28
Joined: Fri Feb 03, 2017 10:36 pm

Re: ESP-WROOM-32 AT commands firmware

Postby wind_energy » Fri Feb 10, 2017 10:34 pm

Hi again :)
May I ask you the another question? :)

I`m trying to make comunication between two modules of ESP ( ESP<->ESP ). Actually I need to make comunication between two AVR.

I need to get the data string through UARTs - Is it possibile ?

What trasmission mode should I set?

I need to use AT commands.


I`m trying to set ESP as a two servers and send data between them.

AT+CWMODE=3
AT+CWJAP="ESP_2CB220", // First ESP connect to another one
AT+CIPMODE=0 // both
AT+CIPMUX=1 // both
AT+CIPSERVER=1,80 // both set as a server
AT+CIPSEND=0,30 // sending data





Many thanks

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP-WROOM-32 AT commands firmware

Postby rudi ;-) » Fri Feb 10, 2017 11:22 pm

wind_energy wrote:Hi again :)
May I ask you the another question? :)

I`m trying to make comunication between two modules of ESP ( ESP<->ESP ). Actually I need to make comunication between two AVR.

I need to get the data string through UARTs - Is it possibile ?

What trasmission mode should I set?

I need to use AT commands.

Many thanks
hi

hope i have understand yours right,
please ask back if this is not the right answere you searched:

yes you can connect two devices over the uart,
if they 3.3V pin compatible there is no problem
if you use ESP and AVR - check AVR is this a 3.3 ( arduino mini pro 3.3V example ) or 5 V
if 5 V you need voltage devider that only 3.3V comes.

if you set in menuconfig the AT communication back to the orig code
then you have on UART1 example the AT terminal corespondence.
if so, then you can example use one µC as comander and the second ( ESP32 ) example as actor.

example sequence:
------------------------

send out over uart1 ( Tx ) pin -> to Rx pin at second µC example ESP32 as actor, use uart1 too example
response from the ESP32 as actor back to comander you receive on comander uart1 Rx pin <- the sending from ESP32 Tx pin
Tx -> Rx
Rx <- Tx

all AT Commands you send then from your "commander" over uart to the uart of "actor"
( same things like you use a terminal for your AT Commands )

example Return SDK Version Info
printf("AT+GMR\r\n");

Commander send then AT+GMR +CR+LF over UART on Tx pin to the Actor
the Actor receive the AT Command on Rx Pin and run this Command and send result on Tx to the Commander Rx Back
you must now pharse the things what comes and act.

hope this helps

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

wind_energy
Posts: 28
Joined: Fri Feb 03, 2017 10:36 pm

Re: ESP-WROOM-32 AT commands firmware

Postby wind_energy » Fri Feb 10, 2017 11:37 pm

Not in this point.

I have 2 AVRs and 2 ESPs :

1. AVR connected to ESP (AVR+ESP)
2. AVR connected to ESP (AVR+ESP)

I need to make comunnication between 1 and 2 bidirectional. (AVR + ESP) <-> (AVR + ESP).
Using AT commands I need to make communication between 2 AVRs.

:)

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP-WROOM-32 AT commands firmware

Postby rudi ;-) » Fri Feb 10, 2017 11:54 pm

wind_energy wrote:Not in this point.

I have 2 AVRs and 2 ESPs :

1. AVR connected to ESP (AVR+ESP)
2. AVR connected to ESP (AVR+ESP)

I need to make comunnication between 1 and 2 bidirectional. (AVR + ESP) <-> (AVR + ESP).
Using AT commands I need to make communication between 2 AVRs.

:)

;-)

ok.
i think you have connected AVR < - > ESP32 well.
so the thing is, how communicates the ESP32(1) to ESP32(2) by AT Commands

first:

connecting way one:
--------------------------
AVR(1)<-UART->ESP32(1) <-WIFI-> ESP32(2)<-UART->AVR(2)

connecting way two:
---------------------------
AVR(1)<-UART->ESP32(1) <-UARTS-> ESP32(2)<-UART->AVR(2)

which combine you want take :mrgreen:

.. in the meantime for your answere i write offline next post..

:mrgreen:
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

wind_energy
Posts: 28
Joined: Fri Feb 03, 2017 10:36 pm

Re: ESP-WROOM-32 AT commands firmware

Postby wind_energy » Fri Feb 10, 2017 11:57 pm

AVR(1)<-UART->ESP32(1) <-WIFI-> ESP32(2)<-UART->AVR(2)
:)

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP-WROOM-32 AT commands firmware

Postby rudi ;-) » Sat Feb 11, 2017 12:23 am

wind_energy wrote:AVR(1)<-UART->ESP32(1) <-WIFI-> ESP32(2)<-UART->AVR(2)
:)
this is the simplest way:
take a look to the AT Instruction document

You need on one side the SoftAP ( Accesspoint ) + Station Mode ( Client )
and on other side the Station Mode ( Client )
Your searchstring in docu is :
AT+CWMODE

you can set the SoftAP ( Accesspoint ) with
AT+CWSAP
you set "SSID" "Passwort" channel and encryption

the second ( Client ) "join" now to this SoftAP with
AT+CWJAP
you need SSID, Passwort for the conneting

if they are connected as network
you can start on one a "server" and connect with the other to it by client mode
You need first AT+CIPMUX
single connection or multi connection

server:
5.2.9
AT+CIPSERVER
create on port 909
AT+CIPSERVER=1,909
( now Server is listening on 909 )


client:
5.2.3
AT+CIPSTART
you need protokoll type (TCP, UDP )
you need remote (Server ) ip
you need remote (Server) port

now you are connected

you can send step by step data
or you can use transparent mode
AT+CIPMODE

After ( transparent mode example )
you start your data send by
AT+CIPSEND
and push data nonstop to the server

ending transparent mode is with "+++"
printf("+++");

study the AT Instruction
you must act on the feedback/response from the AT Commands
the AT Response is well described in the DOCU


for bidirectional
you can use UDP example
and you can push data in transparent mode bidirektional ( transparent bridge )


let me know how you get on in this
hope this short thing is helpfull

best wiishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

wind_energy
Posts: 28
Joined: Fri Feb 03, 2017 10:36 pm

Re: ESP-WROOM-32 AT commands firmware

Postby wind_energy » Sat Feb 11, 2017 12:29 am

rudi ;) many thanks - I appropriate your big help ! :D tomorrow evening I`ll check it :)
best regards :)

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP-WROOM-32 AT commands firmware

Postby rudi ;-) » Sat Feb 11, 2017 12:32 am

push:
the best way is, you test first the steps by using a terminal
better, you connect one ESP32 to a terminal and the second ESP32 to a terminal
then you can "play" the steps you need later on AVR and you can make a protokoll.
this protokoll then you write then later for the AVR / c code
the AVR then send "AT Commands" over UART to the married ESP32 for communicate with the other ESP32..AVR
best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP-WROOM-32 AT commands firmware

Postby rudi ;-) » Sat Feb 11, 2017 12:38 am

one thing:

if you end the transparent mode by send "+++"
there is no "OK" or other from the standard AT firmware

i helped me with this:
after i send "+++"

Code: Select all

printf("+++");
i check this in the other side too
and send a response "done"
so the commander knows now, it can send the next AT Command.

in the docu there is ment. that we have to wait for one second,
this is for me not good solution ( proposal )
i do this by manually send "done\r\n"

Code: Select all

printf("done\r\n");

and i know then ( pharse the response ) that next AT Command can be send ( or all is ok )

this is missing in the standard AT.

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP-WROOM-32 AT commands firmware

Postby rudi ;-) » Sat Feb 11, 2017 2:38 am

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Who is online

Users browsing this forum: No registered users and 116 guests