Connect ESP8266 with MCU using UART

ESP_Alen

Connect ESP8266 with MCU using UART

Postby ESP_Alen » Wed May 25, 2016 1:07 pm

Problem we are facing are:

1.
When we flash esp with mesh demo bin files. Then when we connect serial monitor to esp we can see that esp is sending some date over UART. I suppose that is for debugging purpose. When I send packet from server to esp I wanna send that packet also over UART to mcu. So I must disable already existing debugging information and only send packet over UART.

For example I will send from server some data like "1111111111" and I wanna only this information to be send over UART. Where do we change this ?

2.
We are still unable to locate file where we have to put this two command line:
uart_div_modify(0, UART_CLK_FREQ / 9600);
uart_div_modify(1, UART_CLK_FREQ / 9600);

ESP_Alen

Re: Connect ESP8266 with MCU using UART

Postby ESP_Alen » Wed May 25, 2016 1:10 pm

Alen wrote:Problem we are facing are:

1.
When we flash esp with mesh demo bin files. Then when we connect serial monitor to esp we can see that esp is sending some date over UART. I suppose that is for debugging purpose. When I send packet from server to esp I wanna send that packet also over UART to mcu. So I must disable already existing debugging information and only send packet over UART.

For example I will send from server some data like "1111111111" and I wanna only this information to be send over UART. Where do we change this ?

2.
We are still unable to locate file where we have to put this two command line:
uart_div_modify(0, UART_CLK_FREQ / 9600);
uart_div_modify(1, UART_CLK_FREQ / 9600);


1. Firstly, you need to porting UART driver between MCU and ESP8266.
When you receive packet from mesh, you use the API espconn_mesh_get_usr_data to get data in mesh packet, and then use UART to send the data to MCU.
2. Please pay attention to line 355-356 in mesh_demo.c
The first two lines of function user_init is the code.

CipiCips
Posts: 13
Joined: Sun Apr 24, 2016 10:26 pm

Re: Connect ESP8266 with MCU using UART

Postby CipiCips » Thu May 26, 2016 1:53 am

Dear Alen,

Thank you for your help,


1. Firstly, you need to porting UART driver between MCU and ESP8266.
When you receive packet from mesh, you use the API espconn_mesh_get_usr_data to get data in mesh packet, and then use UART to send the data to MCU.
2. Please pay attention to line 355-356 in mesh_demo.c
The first two lines of function user_init is the code.


1. Can you provide us with little bit more detail about porting UART driver between MCU and ESP8266.

2. Thank you for this baud ration we have manage to set it to our needs.

Regards
Ivan

ESP_Alen

Re: Connect ESP8266 with MCU using UART

Postby ESP_Alen » Fri May 27, 2016 11:28 am

CipiCips wrote:Dear Alen,

Thank you for your help,


1. Firstly, you need to porting UART driver between MCU and ESP8266.
When you receive packet from mesh, you use the API espconn_mesh_get_usr_data to get data in mesh packet, and then use UART to send the data to MCU.
2. Please pay attention to line 355-356 in mesh_demo.c
The first two lines of function user_init is the code.


1. Can you provide us with little bit more detail about porting UART driver between MCU and ESP8266.

2. Thank you for this baud ration we have manage to set it to our needs.

Regards
Ivan


1. Now, os_printf is send data using UART, I think don't need to porting UART driver, it works now.
You just need to connect pins of VCC/GND/TX/RX to MCU's COM.

2. Yes, uart_div_modify is used to set serial baud ratio.

Who is online

Users browsing this forum: No registered users and 13 guests