Code Monkey home page Code Monkey logo

luci-app-internet-detector's Introduction

Internet detector for OpenWrt.

Internet-detector is an application for checking the availability of the Internet. Performs periodic connections to a known public host and determines the actual Internet availability.

Features:

  • It can run continuously as a system service or only in an open web interface.
  • Checking the availability of a host using ping or by connecting via TCP to a specified port.
  • LED indication of Internet availability.
  • Performing actions when connecting and disconnecting the Internet: rebooting device, restarting network or modem (internet-detector-mod-modem-restart), executing custom shell scripts.
  • Sending email notification when Internet access is restored (internet-detector-mod-email).
  • The daemon is written entirely in Lua using the luaposix library.

Dependences: lua, luaposix, libuci-lua.

Installation notes (OpenWrt >= 21.02)

opkg update
wget --no-check-certificate -O /tmp/internet-detector_1.3-0_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector_1.3-0_all.ipk
opkg install /tmp/internet-detector_1.3-0_all.ipk
rm /tmp/internet-detector_1.3-0_all.ipk
/etc/init.d/internet-detector start
/etc/init.d/internet-detector enable

wget --no-check-certificate -O /tmp/luci-app-internet-detector_1.3-0_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-internet-detector_1.3-0_all.ipk
opkg install /tmp/luci-app-internet-detector_1.3-0_all.ipk
rm /tmp/luci-app-internet-detector_1.3-0_all.ipk
/etc/init.d/rpcd restart

i18n-ru:

wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_1.3-0_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-i18n-internet-detector-ru_1.3-0_all.ipk
opkg install /tmp/luci-i18n-internet-detector-ru_1.3-0_all.ipk
rm /tmp/luci-i18n-internet-detector-ru_1.3-0_all.ipk

Screenshots:

Modem restart module (internet-detector-mod-modem-restart):

Dependences: modemmanager.

wget --no-check-certificate -O /tmp/internet-detector-mod-modem-restart_1.3-0_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-modem-restart_1.3-0_all.ipk
opkg install /tmp/internet-detector-mod-modem-restart_1.3-0_all.ipk
rm /tmp/internet-detector-mod-modem-restart_1.3-0_all.ipk
/etc/init.d/internet-detector restart

Email notification module (internet-detector-mod-email):

Dependences: mailsend.

wget --no-check-certificate -O /tmp/internet-detector-mod-email_1.3-0_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-email_1.3-0_all.ipk
opkg install /tmp/internet-detector-mod-email_1.3-0_all.ipk
rm /tmp/internet-detector-mod-email_1.3-0_all.ipk
/etc/init.d/internet-detector restart

luci-app-internet-detector's People

Contributors

gspotx2f avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

luci-app-internet-detector's Issues

Скорее вопрос, поскольку внятного ответа найти не могу

Есть платформа APU2C4 (OpenWrt 22.03.3) на ней установлены светодиоды, подгружаемые ядром (ими можно управлять из LuCI) и на ней-же есть NCT5104D и ей приходится управлять строками типа:
echo 0 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio0/direction
echo "1" > /sys/class/gpio/gpio0/value

Подскажите пожалуйста возможно ли добавить управление диодами в вэб интерфейс или это слишком сложно и требуется что-то делать с ядром системы? Заранее спасибо и спасибо за ваши труды: мониторинг дисков, сети и процессора то, чего мне действительно не хватало!

Inclusion in the official OpenWRT repository.

This is a great application. I use it to autorun fast reverse proxy (frpc) and write to a log file when there is an internet outage. Why is this application not in the official OpenWRT repository? I didn't find any similar analogues, and by the way it is a very handy application in cases when the internet is not stable and some programs are turned off.
I have a request to the developer to send a request to include your development in the official OpenWRT repository.

UI Provide images & icons for state changes and LAN connected...

This is a feature / enhancement request inspired by some router pages which show change in network states using:

  1. Images, Lines, Icons & colours to show the disconnect - for example with line from OpenWRT device icon to WAN in the dashboard that's red when not connected or green when connected.

  2. Text with WAN IP's using dig or some other tool if the OpenWRT is not WAN DHCP and with a Public IP - then lookup IP to show the WAN IP when everything is connected next to the OpenWRT device logo on the dashboard; the Public IP and how that was looked up - ie direct or via dig could also be highlighted with the text using an @ logo for example vs no logo if WAN DHCP. When no connection or valid state then 0.0.0.0 or 0::0 could be shown as opposed to the IPv6 / IPv4 addresses.

  3. LAN icon / states showing when connected devices are available (green line to icon or some other customisation).

There's another immediate style of theme that comes to mind similar to the image which you have on the README.md which could be LED themed for various states or as per the image example device below. I'm not sure how much user customisation may be possible but it would be great if custom PNG / SVG could be set for particular events or colours according to the LED theme plus the image below for example:
image
image

Problem with compiling new internet-detector

Hi, could you please tell me what I'm doing wrong that the package is not compiling (I'm building with MASTER).

make[3]: Entering directory '/home/rafal/Documents/openwrt/package/internet-detector'
rm -f /home/rafal/Documents/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/internet-detector/.built
touch /home/rafal/Documents/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/internet-detector/.built_check
CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -fmacro-prefix-map=/home/rafal/Documents/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/internet-detector=internet-detector -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/home/rafal/Documents/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-11.2.0_musl_eabi/usr/include -I/home/rafal/Documents/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-11.2.0_musl_eabi/include/fortify -I/home/rafal/Documents/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-11.2.0_musl_eabi/include " CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -fmacro-prefix-map=/home/rafal/Documents/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/internet-detector=internet-detector -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/home/rafal/Documents/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-11.2.0_musl_eabi/usr/include -I/home/rafal/Documents/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-11.2.0_musl_eabi/include/fortify -I/home/rafal/Documents/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-11.2.0_musl_eabi/include " LDFLAGS="-L/home/rafal/Documents/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-11.2.0_musl_eabi/usr/lib -L/home/rafal/Documents/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-11.2.0_musl_eabi/lib -znow -zrelro " make -j1 -C /home/rafal/Documents/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/internet-detector/. AR="arm-openwrt-linux-muslgnueabi-gcc-ar" AS="arm-openwrt-linux-muslgnueabi-gcc -c -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -fmacro-prefix-map=/home/rafal/Documents/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/internet-detector=internet-detector -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=arm-openwrt-linux-muslgnueabi-ld NM="arm-openwrt-linux-muslgnueabi-gcc-nm" CC="arm-openwrt-linux-muslgnueabi-gcc" GCC="arm-openwrt-linux-muslgnueabi-gcc" CXX="arm-openwrt-linux-muslgnueabi-g++" RANLIB="arm-openwrt-linux-muslgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-muslgnueabi-strip OBJCOPY=arm-openwrt-linux-muslgnueabi-objcopy OBJDUMP=arm-openwrt-linux-muslgnueabi-objdump SIZE=arm-openwrt-linux-muslgnueabi-size CROSS="arm-openwrt-linux-muslgnueabi-" ARCH="arm" ;
make[4]: Entering directory '/home/rafal/Documents/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/internet-detector'
make[4]: *** No targets specified and no makefile found.  Stop.
make[4]: Leaving directory '/home/rafal/Documents/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/internet-detector'
make[3]: *** [Makefile:57: /home/rafal/Documents/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/internet-detector/.built] Error 2
make[3]: Leaving directory '/home/rafal/Documents/openwrt/package/internet-detector'
time: package/internet-detector/compile#1.02#0.15#1.18
    ERROR: package/internet-detector failed to build.

Отправка сообщения на Телеграм

Хороший получился пакет у вас, а есть возможность скриптом отправлять в Телеграм сообщения внешнего ip, при перезагрузки роутера?
Можете поделиться как это сделать,?Спасибо

Incorrectly displayed form.

Hi :), I don't know if it's just for me, but the controls are shifted, as if they did not fit.

I still have a question. Can I add my own AT command to reset the modem in the application?
@gSpotx2f And a little bit of privacy .. would you look at the code of my application? because I don't know how to work around a certain thing in LuCI JS.
Internet detector
.

Feature request: Current data rate display

Hi @gSpotx2f

first of all I would like to thank you for this excellent addon for OpenWrt!

I have been using it for quite a while and highly appreciate it.

I would love to see the "current data rate" displayed besides the green symbols for "connection" and "vpn" on the start page of OpenWrt similar to what is available in Padavan.

grafik

What are the advantages?

  • Sometimes there is internet connect but the data rate is extremely slow. By this it would become instantly visible
  • You do not need to change the view in LuCi to "Realtime Graph" for checking the network speed. By this all important information is visible centrally on the first page.

Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.