Hi, I am somewhat new to OpenWRT and Embedded Linux. Background: I am working with a MediaTek MT7628-based IoT Gateway hardware sourced from a partner vendor that is running a custom OpenWRT image (customized according to this vendor's own devicetree). The application logic is relatively simple from the POV of the MediaTek:
- Read data over USB (that's actually coming from another chip over a CP210x USB-to-UART bridge) periodically.
- Upload it to a backend (HTTP for now, but might switch to MQTT later). - That's it basically!
- Also there's some GPIO stuff for toggling LEDs and voltage regulators.
After some R&D I've managed to do these things separately:
(1) using stty
(to set the baudrate) and cat
to read from the /dev/ttyUSBx
serial port device, (2) using curl
(which I had to download with opkg
) to make HTTP requests and (3) using the gpiod-tools
package (also downloaded with opkg
).
Since all these are "shell-level" programs, my intuition is to code up the application in an ash script and install it using the procd
initi system so it runs every time on bootup. As I understand it, this would be a mostly user-space approach, correct?
Instead of relying on these external "shell-level" dependencies, another approach would be to use libraries like libusb
, libcurl
and libgpiod
and write an OpenWRT package in C, compile it to a .ipk
file and install it as a kernel module which would run in kernel-space. Of course this option would take more development effort but would there by any benefits (in terms of stability or flexibility) in the long term that could make this worthwhile? This is my first Embedded Linux project, so any insight is welcome. Thanks.