0x0D and 0x0A on UART with ESP8266 and more

Use this section to discuss your embedded Flowcode projects.
User avatar
Nico595
Posts: 100
http://meble-kuchenne.info.pl
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 20 times
Been thanked: 5 times

Flowcode v10 0x0D and 0x0A on UART with ESP8266 and more

Post by Nico595 »

Hello,

I write the ESP setup with the UART1 but I need send h0D and h0A at the end of string.

How to do to add CR LF at the end of the SendString function of UART ?

Thank you.
Last edited by Nico595 on Mon Jun 02, 2025 2:31 pm, edited 1 time in total.

mnfisher
Valued Contributor
Posts: 1579
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 140 times
Been thanked: 744 times

Re: hex 0D and hex 0A on UART

Post by mnfisher »

The usual is :

SendString("\r\n")

Which sends a return and newline..

Martin

User avatar
Nico595
Posts: 100
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 20 times
Been thanked: 5 times

Re: hex 0D and hex 0A on UART

Post by Nico595 »

Hi Martin,

Thank you so much :)

Yes, it's perfect.
I tried with "/r/n", of course it's not correct.

Yesterday, I added the ESP8266 Component in my project, send AT cmd are ok but I can't receive the return or RX data.
If I remember good, I updated the PCIO mapping of the RX pin in the cal file of the UART because PC5 RX UART Pin is PC7 and PC7 is PC5.

I searched how to do to update this pin in the ESP8266 Component file but without success.

So I will try design ESP8266 Component with the UART.

chipfryer27
Valued Contributor
Posts: 1639
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 362 times
Been thanked: 575 times

Re: hex 0D and hex 0A on UART

Post by chipfryer27 »

Hi

Not all targets allow mapping of pins but assuming yours does, then the best way to capture the receive characters is to use the RxInt interrupt and immediately put the received character into a Circular Buffer.

You can process the buffer whenever and there are many examples of this both in the forum and Wiki.

Regards

User avatar
Nico595
Posts: 100
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 20 times
Been thanked: 5 times

Re: hex 0D and hex 0A on UART

Post by Nico595 »

Hi Chipfryer,

Thank you for this information, I think use the same method with the USB Component: Int on UARTRX and a FiFo buffer.

I have a new problem with " in the SendString UART Function to send AT Command AT+CIPSAP="SSID","0123456789",5,2
Flowcode don't write " in the SendString function because it's the sign to define text.

EDIT: I just found with \" :)

User avatar
Nico595
Posts: 100
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 20 times
Been thanked: 5 times

Re: hex 0D and hex 0A on UART

Post by Nico595 »

I use the ESP8266_TCP_Server.fcfx example file from the Wiki Component to design the Access Point with ESP03.
Init of the Server is ok and after CIFSR I obtain the IP and Mac address of my ESP.

Archos tablet is connected on the SSID, however, when I place the IP of ESP in the web browser I have no html page.
I can see the ESP send information about the Archos tablet: +IPD 443 GET HTTP/1.1 ...

May be I must write the code of WLAN_ESP8266::CheckForPageRequest function, because like other functions of this component, I have no data.

Ideas for me ?

Thank you so much :)

chipfryer27
Valued Contributor
Posts: 1639
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 362 times
Been thanked: 575 times

Re: 0x0D and 0x0A on UART with ESP8266 and more

Post by chipfryer27 »

Hi

Whilst I have no direct experience of the ESP03 I'm assuming the AT command set is the same as the ESP8266. When I use the 8266's the first thing I do is to ensure the firmware is up to date including the AT commands. I've bought new modules that had firmware about a decade old.... If you don't know your AT version then you may find the AT commands you are issuing are not compatible.

As for what is going wrong within your chart, you would need to post. However the Webserver WiKi is a good start. ESP8266 / ESP32 and Raspberry Pi targets can all simulate comms, so you can test your code without hardware. A very handy feature. Create your webpage and point your browser to it (127.0.0.1 if using same computer or whatever your PC address is if using something else).

Regards

User avatar
Nico595
Posts: 100
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 20 times
Been thanked: 5 times

Re: 0x0D and 0x0A on UART with ESP8266 and more

Post by Nico595 »

Thank you for this information.


You have right, AT commands are the same of the ESP8266 because ESP03 is ESP8266 family.
I use UART to send init AT commands because I can't receive data with the ESP8266 component. So ESP8266 functions wait some seconds with 0 return.

I don't know if this problem come from the RX pin or from the circular buffer used in the ESP8266 component.
The circular buffer don't work with my project. May be the data from the ESP8266 component are lost in the Circular Buffer.

I can see ESP TX and RX data with Logic Analyser. ESP module work fine but I will update the firmware of the ESP03.

I placed a small code in the html widows of the ESP8266 component "page1" -> html.
But the best method is probably use Flash of the ESP card (SPIFFS) to provide the html code.

I bought the ESP32 option with FC10, regrettably, ESP8266 not exist as target. I must use Arduino to write the code in the ESP03.

But also, I ask me if I can use the ESP Flash to provide the html code and drive the device with the UART without FC10 Webserver Component.
Problem with the Webserver Component is the occupation of the html page in the Flash memory of the UC.
.
EDIT: I downloaded Arduino ESP Board, I investigate to find the best method with the SPIFFS for html page.

chipfryer27
Valued Contributor
Posts: 1639
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 362 times
Been thanked: 575 times

Re: 0x0D and 0x0A on UART with ESP8266 and more

Post by chipfryer27 »

Hi

Are you attempting to program the ESP03 directly? By that I mean use it as the microcontroller? If so I have no experience of that and really cannot assist. If however you are only using it as a means to access the internet, with it connected to say a PIC or such like, then I do have experience with that.

Regards

User avatar
Nico595
Posts: 100
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 20 times
Been thanked: 5 times

Re: 0x0D and 0x0A on UART with ESP8266 and more

Post by Nico595 »

I want use internal memory flash of the ESP to provide the html page, like this I save the memory space of the MCU.
In a first time, the ESP is configured as Server in Access Point only.

I want control my device with the ESP Wifi access via the UART comms. If I can't find how to use ESP8266 Component of FC10, I must isolate some RX data from the output of ESP (UART TX) to control the device with the ?var=X. After that, I must send string to the ESP to update value in the html page with JSON.

Post Reply