Hey all,
I find myself in a position where I need a bare minimum firmware that I can use to fix a device that is soft-bricked in the field.
I’m having an issue where my device firmware is quite large (1.4mb) and it takes approximately 10 minutes for an OTA to flash, but my in-field device is rebooting every 5 minutes.
I’m trying to create a bare minimum firmware but am having trouble:
- Creating a FW that is approx 700-800kb (I tested with a stopwatch, so smaller the better)
- FW that gets applied after upload (struggling with this for some reason)
- Can still be OTA’d once updated
Would appreciate any suggestions on library-efficient ways to get my FW small as possible, or knowledge on what libs are MUST.
So far I’ve got:
- origin: https://github.com/mongoose-os-libs/dash
- origin: https://github.com/mongoose-os-libs/ca-bundle
- origin: https://github.com/mongoose-os-libs/http-server
- origin: https://github.com/mongoose-os-libs/ota-shadow
- origin: https://github.com/mongoose-os-libs/ota-http-client
- origin: https://github.com/mongoose-os-libs/ota-http-server
- origin: https://github.com/mongoose-os-libs/rpc-common
- origin: https://github.com/mongoose-os-libs/rpc-loopback
- origin: https://github.com/mongoose-os-libs/rpc-service-config
version: latest
- origin: https://github.com/mongoose-os-libs/rpc-service-fs
- origin: https://github.com/mongoose-os-libs/rpc-service-ota
- origin: https://github.com/mongoose-os-libs/rpc-service-wifi
- origin: https://github.com/mongoose-os-libs/rpc-ws
#include "mg_rpc_channel_loopback.h"
#include "mgos.h"
#include "mgos_rpc.h"
enum mgos_app_init_result mgos_app_init(void) {
struct mg_rpc_call_opts opts = {.dst = mg_mk_str(MGOS_RPC_LOOPBACK_ADDR)};
mg_rpc_callf(mgos_rpc_get_global(), mg_mk_str("OTA.Commit"), NULL, NULL,
&opts, NULL);
return MGOS_APP_INIT_SUCCESS;
}
The above compiles but is not being applied on reboot for some reason.
Thanks.