cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble Sending Raw Image Data over UART to ESP32 with AT Commands

Aldrin
Associate II

Hi everyone,

I'm working on an embedded project involving an STM32G0B0 MCU and an ESP32-WROOM module (using AT firmware v3.4.0.0). My goal is to send a 100x100 RGB565 image (20,000 bytes) from the STM32 to another ESP32 device connected to another stm32 via TCP using AT commands.

Setup:
STM32G0B0VET6 → ESP32 (UART4 @ 115200 baud)

ESP32 connected to Wi-Fi and using TCP mode

Using AT+CIPSEND=<id>,<len>

But I'm not able to transfer the image, while searching the internet i couldn't find any refence of someone doing this, 
so i just need to know if this is even possible and if so how to do it.
Thanks.

6 REPLIES 6
TDK
Guru

Certainly there are no issues with the STM32G0 sending UART data. The content is whatever you want it to be. Whether or not someone has done this particular application seems immaterial.

Documentation suggests AT+CIPSEND cannot send more than 8192 bytes.

TDK_0-1746803564508.png

 

If you feel a post has answered your question, please click "Accept as Solution".

>>But I'm not able to transfer the image, while searching the internet i couldn't find any refence of someone doing this, so i just need to know if this is even possible and if so how to do it.

Pretend it's not an image, and that it's just arbitrary binary data? Look for more general examples, perhaps GNSS NMEA data stream, or files.

Look at what AT+CIPSENDL permits in longer form, or perhaps come up with a protocol where you split the 20KB into smaller pieces that you reassemble at your Socket Listener

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

@Aldrin wrote:

I'm working on an embedded project involving an STM32G0B0 MCU and an ESP32-WROOM module (using AT firmware v3.4.0.0). My goal is to send a 100x100 RGB565 image (20,000 bytes) from the STM32 to another ESP32 device connected to another stm32 via TCP using AT commands..


You have far too many unknowns there!

  1. Your sending STM32
  2. Your ESP32-WROOM module 
  3. Your receiving ESP32-WROOM module 
  4. Your receiving STM32

Any error in any or all them will cause the whole system to fail!

So start simple.

Take one step at a time.

Have you confirmed that you can send & receive UART data at all on your STM32s ?

Can you send & receive basic AT commands between your STM32s & the ESP32s ?

There must, surely, be examples of using this AT+CIPSEND command - start with them...

 

PS:

AT Commands usually don't accept raw, binary data - so are you sure you have this covered ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

AT commands typically don't handle raw binary data well — have you accounted for this? I realize now that I hadn't fully considered that limitation.

 

Since the UART baud rate is limited, I was hoping to switch to SPI for better speed. I originally preferred UART because of the available AT firmware, but now that I'm moving to SPI, it looks like I'll need to develop custom firmware for the ESP32. Do you have any suggestions will i get desired speed over spi?


@Aldrin wrote:

I'll need to develop custom firmware for the ESP32. Do you have any suggestions 


So you'll need to ask on an ESP32 forum for that - it's not an ST product!

https://esp32.com/ 

https://www.espressif.com/en/support/services#self-service-resource

 


@Aldrin wrote:

will i get desired speed over spi?


Depends what speed you desire!

 

PS:


@Aldrin wrote:

AT commands typically don't handle raw binary data well — have you accounted for this?

I realize now that I hadn't fully considered that limitation.


Note that I said "typically" - the ESP32 might be atypical ...

You really need to study the ESP32 documentation, examples, etc to fully understand this before you can code it in an STM32 - or anything else, for that matter.

https://docs.espressif.com/projects/esp-at/en/latest/esp32/AT_Command_Set/TCP-IP_AT_Commands.html#cmd-send

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Ok.

Thanks for you help.