Up until now, you could only use the WLAN Pi display to see its IP address and other IP details. If you are on the same subnet you could do ping wlanpi.local
. Alternatively, your DHCP server log or show ip arp
on the access switch could tell you.
Telegram Bot for the WLAN Pi automates the whole process and it sends you the IP details of your WLAN Pi whenever the Pi comes online. You can then easily and remotely skim through the details, check its IP address, public IP address, current mode, uptime, switch and port details the WLAN Pi is connected to, or double-check that its Ethernet adapter successfully negotiated 1 Gbps Full Duplex.
And you can do all this from you wrist, phone, tablet or laptop.
How to enable Telegram Bot
- Download WLAN Pi image 2.0.1 or newer. Flash it onto an SD card. Boot up from this SD card.
- Create a new Telegram account if you do not have one already. Start the Telegram app.
- Let’s create a new Telegram bot. Find a person called
Botfather
and send them a message saying/newbot
. - Follow the instructions to create a new bot.
- After the new bot is created, copy the API key to a text editor.
- Start a new chat with the newly created bot and say
Hey
,Hi
or something like that and welcome them to the blue planet. This is mandatory and you can send more than one message. - Now SSH to the WLAN Pi and run this command with root privileges
sudo telegrambot
- It will complain about missing API key and tell you where to paste it.
- Edit the configuration file, uncomment the second line and paste your own API key from step 5 using
sudo nano /etc/networkinfo/telegrambot.conf
. - Save the file using
CTRL+o
(letter o) and exit the editor usingCTRL+x
. - Make sure you sent a Telegram message in step 6 to your new bot.
- Connect your WLAN Pi to the internet.
- Finally, reboot by
sudo reboot
Multiple Pi’s can use the same API key and send their IP configurations to the same chat or you can have 1 chat per WLAN Pi (my preferred option). It is completely up to you.
How often are Telegram messages sent?
Every time the WLAN Pi reboots and has internet access, it will send a new message to you.
If internet connection goes down (for example when you disconnect the Ethernet cable, DNS server stops responding or something breaks at your ISP while eth0 still remains up) for more than 10 seconds, the WLAN Pi will send you a new message with its fresh details after the internet connection goes up again.
Send a new message manually
Assuming you have completed the setup using the above instructions, you can SSH to the WLAN Pi at any time and send a new Telegram message manually using sudo telegrambot
.
How to troubleshoot
If you are not receiving any message from the WLAN Pi, send another message to the Telegram bot using the Telegram app and reboot the Pi.
You can also check the logs and grep for telegrambot
:sudo cat /var/log/messages | grep telegrambot