Hello, I want to build a piece of hard- and software, that could flash a target fully automated by running a bash script.
Currently I am working with the Xiaomi Mi Router 4A, but later on it should be some kind of universal flashing tool. So that the user does not need to know much about how to flash a target with OpenWrt.
It takes 3 Steps for getting OpenWrt running on the Xiaomi.
Unlock bootloader by changing the "bootmenu-show-delay-time" from '0' to n seconds. This part is working.
Listen to the UART communication, wait for the bootmenu to appear and choose the tftp-bootoption.
This is the part where I am struggling on...
When tftp boot is done, just do a sysupgrade.
That part is also done.
I am trying to capture the ttyUSB / UART input with stty + exec and send commands when the bootmenu is showing. Im able to "detect" the bootmenu-string.
But the weird thing is, that the xiaomi does not care about my input-commands. It also does not wait until the bootmenu-show-delay-time is over. It just runs through with the standard boot option.
But when using minicom, it does count down the bootmenu-show-delay-time and I am able to input data.
Does anyone know, what I´m doing wrong? I suppose that it has something to do with stty but I have no clue, maybe a special option is missing?