Way to send data from UART

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Xbiotec
Posts: 217
http://meble-kuchenne.info.pl
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Way to send data from UART

Post by Xbiotec »

Hi Ben,
I just made a sample program to send data from UART to a Sensor.
Could tell me if this is the good way to send data a the good baud rate or do you have a better way even without LUT, with a string or EEPROM etc...
send to UART.fcfx
(10.8 KiB) Downloaded 408 times
Seb

BenR
Matrix Staff
Posts: 1956
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 511 times
Been thanked: 700 times

Re: Way to send data from UART

Post by BenR »

Hello,

That looks good to me. It really depends on if you need to be able to send different things.

As the data is fairly small you could send as a string using the following fixed string parameter. Sending as a string won't allow you to pass the value 0x00.

"\x64\x69\x03\x5E\x4E"

Or you could pop the values into a byte array and send the array. This will allow you to send the value 0x00.

data[0] = 0x64
data[1] = 0x69
etc

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: Way to send data from UART

Post by Xbiotec »

hi Ben,
I did different test
Console.jpg
Console.jpg (118.69 KiB) Viewed 4175 times
1- SendString like you proposed to me:
Data are well send in simulation but can not compile program , Failed attached log file
2- I don't know if data are sent to UART and there is no data in console, is it normal ?
3- Data sent and can be compiled

Could you check point 1 and 2 please

Another point without link with this
C:/esp-idf/components/esp_event/include/esp_event_loop.h:2:2: warning: #warning "esp_event_loop.h is deprecated, please include esp_event.h instead" [-Wcpp]
#warning "esp_event_loop.h is deprecated, please include esp_event.h instead"


thx
Attachments
send to UARTV01.fcfx
(10.78 KiB) Downloaded 365 times
send to UARTV01.msg.txt
(16.3 KiB) Downloaded 444 times
Seb

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: Way to send data from UART

Post by Xbiotec »

There is also many error message during compilation of my project
see the file
WifiV3.2.msg.txt
(61.41 KiB) Downloaded 423 times
Seb

LeighM
Valued Contributor
Posts: 490
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 84 times
Been thanked: 265 times

Re: Way to send data from UART

Post by LeighM »

re your first post - you need to remove the final \ character in send string
re second post - I don't see any errors, the compile and flash to device looks like it all worked ok
There are quite a few warnings, but these are normal (for now) and can be ignored.

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: Way to send data from UART

Post by Xbiotec »

LeighM wrote:
Thu Dec 02, 2021 3:32 pm
re your first post - you need to remove the final \ character in send string
Yes you are right !
LeighM wrote:
Thu Dec 02, 2021 3:32 pm
re second post - I don't see any errors, the compile and flash to device looks like it all worked ok
There are quite a few warnings, but these are normal (for now) and can be ignored.
Yes without final \ character in send string, no error.

Thx
Seb

Post Reply