Build external apps for the Monstatek M1. Apps are relocatable ARM ELF
files (.m1app) loaded from the SD card and run as FreeRTOS tasks on the M1's
Cortex-M33, calling firmware functions resolved at load time via a symbol table.
Runs on app-loader firmware such as M1-firmware-connected.
include/m1app.h— the full app API: display (u8g2), input, timing, memory, audio, LEDs, GPIO/I2C/SPI, IR, NFC/RFID/Sub-GHz, crypto, file I/O, Flipper file parsers, and a new HTTP client (see below).include/m1app_conf.h— header-only SD config parser (m1conf_load/get/ get_n/split) so apps are configured from.conffiles, no recompile.examples/— hello world, game template, coin flip, flappy bird, etc.apps/— four homelab/device-integration apps (below).
Apps can call LAN/cloud device APIs over WiFi. The ESP32-C6 (ESP-AT firmware)
does the TCP/TLS; the firmware just formats AT+HTTPCLIENT.
int m1_http_get(const char *url, char *resp, int resp_size);
int m1_http_post_json(const char *url, const char *json_body, char *resp, int resp_size);
int m1_http_request(int method, int content_type, const char *url,
const char *headers /* e.g. "Authorization: Bearer …" */,
const char *body, char *resp, int resp_size);Returns response-body bytes (≥0) or a negative M1APP_HTTP_ERR_*. Requires the
device to be on WiFi (Main Menu → WiFi → Config).
| App | What it does | Config file |
|---|---|---|
| ha_remote | Toggle Home Assistant entities (authenticated) | ha.conf |
| fleet_status | Up/down reachability board for your LAN hosts | fleet.conf |
| webhook_buttons | Fire configurable GET/POST webhooks | hooks.conf |
| device_status | Poll authenticated JSON endpoints, show a value each | status.conf |
Each app ships a *.conf.example — copy it to 0:/apps/<name>.conf on the SD
card and edit it (URLs, tokens, entity IDs).
sudo apt install gcc-arm-none-eabi # or brew install arm-none-eabi-gcc
make APP=apps/ha_remote # -> apps/ha_remote/ha_remote.m1app
make APP=examples/hello_world # build an example- Flash app-loader firmware (M1-firmware-connected) + ESP-AT (with HTTP support) to the ESP32-C6; connect WiFi on the device.
- Copy
*.m1appand the edited*.confto0:/apps/on the SD card. - On the M1: Main Menu → Apps → pick your app.
Pre-built .m1app files for the four apps are attached to the
Releases.
#include "m1app.h"
M1_APP_MANIFEST("My App", 512); /* name, stack in 32-bit words */
int32_t app_main(void *context) {
u8g2_t *u8g2 = m1app_get_u8g2();
while (1) {
m1app_display_begin();
do { u8g2_SetFont(u8g2, u8g2_font_6x10_tr);
u8g2_DrawStr(u8g2, 10, 30, "Hello!"); } while (m1app_display_flush());
if (game_poll_button(100) == M1APP_BTN_BACK) break;
}
return 0;
}See include/m1app.h for the complete API and the list of available fonts.