`print-router-label.sh` script available

Make it your own :wink:

print_router_label() {
	DOMAIN=$(uci get dhcp.@dnsmasq[0].domain)
	HOSTNAME=$(uci get system.@system[0].hostname)
	DEVICE=$(cat /tmp/sysinfo/model)
	echo -n "Print login user: ";read USER
	echo -n "Print login pass: ";read -s PASS
cat <<EOF

Print the following label and tape it to the router...

======= Printed with: print-router-label.sh =======
     Device: $DEVICE
    OpenWrt: $(. /etc/openwrt_release; echo $DISTRIB_DESCRIPTION)
 Connect to: http://$HOSTNAME.$DOMAIN
         or: ssh $USER@$HOSTNAME.$DOMAIN
        LAN: $(uci get network.lan.ipaddr)
       User: $USER
       Pass: $PASS
EOF
	uci show wireless | awk -F= '/wifi-iface$/{print $1}' \
	| while read iface;do
		[ "$(uci get $iface.disabled)" = "1" ] && continue
cat <<EOF
  Wifi SSID: $(uci get $iface.ssid)
  Wifi  KEY: $(uci get $iface.key)
EOF
	done
cat <<EOF
 Configured: $(date +"%Y-%b-%d")
=== See github.com/richb-hanover/OpenWrtScripts ==="

Label for Power Brick: $DEVICE"

EOF
}

Yes. And it'd be sweet if OpenWrt could print such a label/QR code right from a LuCI page.

Anyone know how to do this? (That is, add a new tab to the Interface section of a wireless page? That way, the QR Code would be printable for any wireless interface, but you could choose only to print your Guest wifi credentials...)

We're also slowly seeing devices (xiaomi ax3000t) with NFC capabilities, which can use that to transport the wifi access credentials, XINFC - Tools the NFC reader on the Xiaomi routers.

1 Like

I think to start one could just do the QR code in text with 'qrencode'.

it has a utf-8 etc mode output FYI.

qrencode "WIFI:T:WPA;S:THISISNETWORK;P:ThisPasswordMustBeChanged;;" -t utf8
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–„β–„β–„ β–ˆβ–€β–€β–„ β–€β–€β–ˆ β–ˆβ–„β–€β–ˆβ–„β–ˆ β–„β–„β–„β–„β–„ β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆ β–ˆ   β–ˆ β–ˆβ–„β–ˆβ–„ β–ˆβ–ˆβ–€β–„β–ˆβ–„β–„β–€β–„β–ˆ β–ˆ   β–ˆ β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–„β–„β–„β–ˆ β–ˆ β–„β–„β–„β–€ β–„   β–ˆ β–ˆβ–ˆ β–ˆβ–„β–„β–„β–ˆ β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–„β–„β–„β–„β–„β–ˆ β–€β–„β–ˆ β–ˆβ–„β–ˆβ–„β–€ β–ˆ β–ˆβ–„β–„β–„β–„β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–„ β–€β–„β–€β–€β–„β–„β–ˆβ–„ β–„ β–ˆβ–„β–ˆβ–€ β–€ β–€β–€β–„  β–ˆβ–„β–„β–€β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–€β–„ β–„β–ˆ β–„β–„β–ˆ β–€β–€  β–ˆβ–ˆβ–„β–ˆβ–„ β–€β–€ β–„β–„β–„β–€β–„ β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–€β–„β–„β–„β–„β–€β–„β–„β–ˆβ–ˆ β–„ β–„β–€β–ˆβ–ˆβ–„ β–€β–ˆβ–„ β–„  β–€β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–€β–€β–€β–„β–ˆ β–„β–€β–€β–€  β–ˆβ–€ β–ˆβ–ˆβ–€β–„β–ˆ  β–„β–ˆβ–ˆβ–ˆ β–„β–„β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆβ–„ β–„β–€β–ˆβ–€β–„β–€ β–€β–ˆβ–ˆ β–ˆβ–€β–„ β–„β–„β–ˆβ–„β–„β–€ β–€β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–„β–ˆ    β–„β–„β–€β–€β–„β–€β–„β–„ β–€β–€β–€β–ˆβ–„β–ˆβ–ˆ β–€β–ˆβ–€β–„β–ˆβ–„β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–„β–ˆβ–ˆβ–„β–„β–ˆβ–„β–ˆ β–„ β–ˆ   β–ˆ β–ˆβ–ˆβ–„ β–„β–„β–„ β–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–„β–„β–„ β–ˆβ–„  β–€β–ˆ β–€β–€β–ˆβ–ˆβ–„  β–ˆβ–„β–ˆ β–ˆβ–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆ β–ˆ   β–ˆ β–ˆβ–€β–ˆβ–ˆβ–€ β–ˆβ–ˆβ–€β–ˆβ–„β–ˆβ–ˆβ–„ β–„β–„ β–ˆβ–„  β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–„β–„β–„β–ˆ β–ˆβ–€β–„β–€ β–€ β–ˆβ–ˆβ–ˆ  β–„β–€  β–„β–€β–€β–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–„β–„β–„β–„β–„β–ˆβ–„β–ˆβ–„β–ˆβ–„β–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–„β–„β–ˆβ–„β–ˆβ–„β–ˆβ–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ

My mentor always said, "If you can't think of three ways to misuse a tool, you don't really understand it."

You really understand qrencode :slight_smile:

1 Like

It took a little documentation reading. But most of it is stack exchange hahahaha =)

edit:
But yeah there's enough redundancy for damage to QR codes that it can work whilst doing all kinds of stuff yeah =)

You could use this thread: Poor man's virtual hosts

for some ideas on how to have your own printlabel.lan host that pulls up a customized output that displays the displayable info......