Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pgaskin/lua-sagemcom-openwrt
OpenWRT Lua library for controlling Sagemcom routers.
https://github.com/pgaskin/lua-sagemcom-openwrt
bell home-hub lua lua51 openwrt sagemcom
Last synced: 28 days ago
JSON representation
OpenWRT Lua library for controlling Sagemcom routers.
- Host: GitHub
- URL: https://github.com/pgaskin/lua-sagemcom-openwrt
- Owner: pgaskin
- License: mit
- Created: 2024-05-03T17:51:31.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-05-03T18:53:44.000Z (7 months ago)
- Last Synced: 2024-05-03T19:40:41.033Z (7 months ago)
- Topics: bell, home-hub, lua, lua51, openwrt, sagemcom
- Language: Lua
- Homepage:
- Size: 44.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lua-sagemcom-openwrt
OpenWRT Lua library for controlling Sagemcom routers.
Tested against the Bell Giga Hub 4000 (F@ST 5689E) firmware 1.19.6 (gui 7.3.28, guiapi 1.106).
Has basic error handling, but expects responses to be well-formed in general.
#### How to automatically disable radios on wan connection
- Copy [`sagemcom.lua`](./sagemcom.lua) and [`sha2.lua`](./sha2.lua) to `/usr/lib/lua`.
- Copy [`set_sagemcom_radios.lua`](./set_sagemcom_radios.lua) to `/usr/bin/set_sagemcom_radios`.
- `opkg update && opkg install luci-lib-base luci-lib-httpclient and luci-lib-json`.
- Create `/etc/hotplug.d/iface/90-sagemcom-radios` (replace wan/admin/password with your values):
```shell
#!/bin/sh
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
{ set_sagemcom_radios 192.168.2.1 admin password off 2>&1 || echo exit status $? ; } | while read x
do
echo "(set_sagemcom_radios) $x" > /dev/kmsg
echo "$x" | logger -t set_sagemcom_radios
done
}
exit 0
```
- `chmod +x /usr/bin/set_sagemcom_radios /etc/hotplug.d/iface/90-sagemcom-radios`
- `printf '%s\n' '' /usr/lib/lua/sagemcom.lua /usr/lib/lua/sha2.lua /usr/bin/set_sagemcom_radios /etc/hotplug.d/iface/90-sagemcom-radios >> /etc/sysupgrade.conf`