A Tuya IoT daemon for Teltonika RUTX routers running RutOS (OpenWRT-based), packaged as two separate OpenWRT
.ipkpackages.
RutOS Daemon is a C-based daemon that runs on Teltonika RUTX routers and reports device data to the Tuya IoT cloud. It is built against the RutOS SDK (OpenWRT) and cross-compiled for ARM Cortex-A7.
The project ships as two independent packages:
| Package | Description |
|---|---|
tuyad |
The daemon — communicates with the Tuya IoT cloud and sends router data (e.g. RAM usage) via ubus |
libtuyad |
The Tuya IoT C SDK, packaged as a shared library — auto-downloaded from upstream during build |
- Teltonika RUTX router running RutOS
- RutOS SDK installed at:
~/Documents/RUTX_R_GPL_00.07.13.1/rutos-ipq40xx-rutx-sdk - SSH access to the router (default:
root@192.168.1.1) - Tuya IoT Platform credentials (Device ID, Device Secret, Product ID)
Run the following from inside the RutOS SDK folder:
# Clean and compile both packages
make package/tuyad/clean
make package/tuyad/compileMake sure you've cloned this repo and copied
libtuyad/andtuyad/into the SDK's package folder before building.
From inside the SDK folder on your dev PC ([$]):
# Copy packages to the router
scp bin/packages/arm_cortex-a7_neon-vfpv4/base/libtuyad_1.0.1-1_arm_cortex-a7_neon-vfpv4.ipk root@192.168.1.1:~
scp bin/packages/arm_cortex-a7_neon-vfpv4/base/tuyad_1.0.0-1_arm_cortex-a7_neon-vfpv4.ipk root@192.168.1.1:~SSH into the router ([#]) and confirm the files are present:
ssh root@192.168.1.1
ls ~Then install both packages in order:
opkg install libtuyad_1.0.1-1_arm_cortex-a7_neon-vfpv4.ipk
opkg install tuyad_1.0.0-1_arm_cortex-a7_neon-vfpv4.ipkOn first run, the daemon will prompt you to enter your Device ID, Device Secret, and Product ID from the Tuya IoT platform.
# Restart the daemon
/etc/init.d/tuyad restart
# Stop the daemon
/etc/init.d/tuyad stop
# View daemon logs
logreadIf you entered incorrect credentials, fix them with uci or simply restart the daemon to re-enter them.
On the router ([#]), from [root@RUTX08:~#]:
# Remove packages
opkg remove tuyad
opkg remove libtuyad
# Remove package files
rm -f libtuyad_1.0.1-1_arm_cortex-a7_neon-vfpv4.ipk
rm -f tuyad_1.0.0-1_arm_cortex-a7_neon-vfpv4.ipkMake sure you are in the home directory (
~) when removing files, otherwise thermcommands will fail.
- The Tuya SDK source is auto-downloaded from the upstream remote during build — it is not bundled in this repository
- The daemon uses ubus to query live router data (e.g. RAM usage) and forwards it to the Tuya cloud
- No global variables are used for passing data between functions
- All daemon activity is written to the system log, viewable via
logread
Contributions are welcome! If you'd like to improve the project or add new features, please submit a pull request.
This project is maintained by Tadas. Feel free to reach out with any questions or feedback.