Flash ESP32 programmatically using Java/Android

macieljr
Posts: 5
Joined: Mon Jan 13, 2020 7:31 pm

Flash ESP32 programmatically using Java/Android

Postby macieljr » Mon Jan 13, 2020 8:22 pm

Hi guys!

I’m developing an Android app that is directly connected via USB to consume data from an ESP32 with sensors attached. I’m using https://github.com/felHR85/UsbSerial to manage the connection. Since the app will be running on an internet connected tablet, I think it’s obvious to update ESP32 code, if needed, through the app, giving the user an option do download it (.bin) and then upload it to ESP32.

But I have no idea how...

Tried searching for and Android/Java lib, but I wonder it can be done by the same lib I’m using to establish the serial communication already.

So, If you have done such thing or know how to do and/or can point some direction, please share it with me.

Kind regards,

Vicente Maciel Jr

User avatar
gunar.kroeger
Posts: 143
Joined: Fri Jul 27, 2018 6:48 pm

Re: Flash ESP32 programmatically using Java/Android

Postby gunar.kroeger » Fri Jan 17, 2020 6:55 pm

To upload the .bin to the esp you would need to control the reset and the boot pins as well. Then you can transfer the .bin through uart0 using the SLIP interface. There is the python program that does this called esptool.py that comes with esp-idf.

The second, easier option, is to use the OTA example and change it to use uart instead of http. This way you can update the esp, but the first time you will have to flash it with a PC.
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

macieljr
Posts: 5
Joined: Mon Jan 13, 2020 7:31 pm

Re: Flash ESP32 programmatically using Java/Android

Postby macieljr » Sat Jan 18, 2020 3:08 am

First, thank you so much for the reply!

I’ll look for some references regarding the tips you mentioned and try them.

I’ll post the results here. Or the questions, if I have. Thank you again!

Kind regards,

Vicente Maciel Jr

drradao
Posts: 1
Joined: Fri Jun 12, 2020 8:13 pm

Re: Flash ESP32 programmatically using Java/Android

Postby drradao » Fri Jun 12, 2020 8:18 pm

Hi!

Did you have any success?

I've tried to flash it with python via chaquopy but got stuck at a permission denied.
I'm going to try to request it from python.

Thanks!

Who is online

Users browsing this forum: Bing [Bot] and 29 guests