GPIO from 0 to 1 GL-MT300N-V2 Alarm E-Mail

is it possible: if gpio from 0 to 1.

then send me a email with the subject Mac address (xx: xx: xx: xx: xx: xx) and GPIO number of device?

The device have 4 GPIO.

Its for a alarm😉

Thanks

If you can write a script to poll the gpio then you can use the package msmtp to send an email.
I have done similar, not with gpio but on wifi connection for example, but the principle is the same.

Hello can Show me a example script?

Sorry for my bad english😉

how modifid the script in the link to send only one e-Mail by change the GPIO from 0 to 1?

https://forum.openwrt.org/viewtopic.php?id=55330

You would need to find out how to access the gpio. I have not needed to do so on this device.
@alzhao is there some documentation available? Would be very useful for other models too :smiley:

I found only that can i use the Gpio4, Gpio5, Gpio45 and Gpio46 on this device.

See link

https://www.gl-inet.com/wordpress/wp-content/uploads/2017/06/GL-MT300N-V2-PINOUT.pdf

First you need to tell which GPIO you want to use.

Then write a script to read the status. I don’t have the device at hand. To read the status you need to read from /sys/class/gpio/debug or something.

Hello,
I am not see the Button GPIO4, GPIO5, GPIO45 and GPIO46

Can you help me?
I would start a script with the GPIO45 and GPIO46?

best regards
root@GL-MT300N-V2:~# cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/10000600.gpio, 10000600.gpio:
gpio-0 ( |BTN_0 ) in hi
gpio-3 ( |BTN_1 ) in lo
gpio-11 ( |usbpow ) out hi

GPIOs 32-63, platform/10000600.gpio, 10000600.gpio:
gpio-38 ( |reset ) in hi
gpio-42 ( |? ) out lo
gpio-43 ( |? ) out hi
gpio-44 ( |? ) out hi

Can you try to export these first?

Check the docs
https://wiki.openwrt.org/doc/hardware/port.gpio