I owned an Asus RT-AC86U and I use it as a printer server. Starting from firmware version 3.0.0.4.386, I started having issue where clients are unable to print after the printer was powered off for a certain duration. Once this happens, I have to restart the printer server via the WebUI. I reached out to Asus but the issue is never fixed and the technical support seems to be unable to replicate it on their side.
This is a workaround to automate the printer server restart whenever a printer is connected (or powered on) to the router by hooking into the events in hotplug2
.
- Performs a md5 check on
/rom/etc/hotplug2.rules
using/jffs/custom/hotplug2.rules.md5
. - If failed or
/jffs/custom/hotplug2.rules.md5
is missing,- A copy of
/rom/etc/hotplug2.rules
as/jffs/custom/hotplug2.rules
is made and/jffs/custom/hotplug2.rules.md5
is generated. - A line is added to execute
restart_printer
.
- A copy of
- Check if
/etc/hotplug2.rules
is symbolic linked to/jffs/custom/hotplug2.rules
. - If not, replace the the symbolic link and restart
hotplug2
.
- Copy the scripts in
/jffs/scripts
into the same path in your router. - Register
init_start
to be executed onusbmount
by executing the following command:nvram set script_usbmount=/jffs/scripts/init-start nvram commit
- Reboot the router.
- You may need to perform step 2 again whenever you upgrade the firmware.
Note: Since we're using script_usbmount
to initiate the script, you will need to permanently have a usb drive plugged into one of the USB port of the router.
- Browse to your router WebUI.
- Go to
System Log
. - Turn on (or off) your printer.
- You should see the following events in the log.
[timestamp] rc_service: service xxxx:notify_rc restart_lpd [timestamp] rc_service: service xxxx:notify_rc restart_u2ec