{"id":79239,"date":"2024-10-06T02:57:35","date_gmt":"2024-10-05T23:27:35","guid":{"rendered":"https:\/\/nabfollower.com\/blog\/rasp-pi-network-id-tool-5hcm\/"},"modified":"2024-10-06T02:57:35","modified_gmt":"2024-10-05T23:27:35","slug":"rasp-pi-network-id-tool-5hcm","status":"publish","type":"post","link":"https:\/\/nabfollower.com\/blog\/rasp-pi-network-id-tool-5hcm\/","title":{"rendered":"\u0627\u0628\u0632\u0627\u0631 \u0634\u0646\u0627\u0633\u0647 \u0634\u0628\u06a9\u0647 Rasp-Pi &#8211; \u0627\u0646\u062c\u0645\u0646 DEV"},"content":{"rendered":"<p>Summarize this content to 400 words in Persian Lang<br \/>\n            \u0645\u0646 \u0628\u0647 \u0627\u0628\u0632\u0627\u0631\u06cc \u0646\u06cc\u0627\u0632 \u062f\u0627\u0634\u062a\u0645 \u06a9\u0647 \u0628\u062a\u0648\u0627\u0646\u062f \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0634\u0628\u06a9\u0647 \u0631\u0627 \u062f\u0631 \u0633\u0631\u06cc\u0639 \u062a\u0631\u06cc\u0646 \u0632\u0645\u0627\u0646 \u0645\u0645\u06a9\u0646 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f. \u0645\u062c\u0647\u0632 \u0628\u0647 Raspberry Pi 3 B+\u060c 2.13 \u0627\u06cc\u0646\u0686 \u06a9\u0627\u063a\u0630 \u0627\u0644\u06a9\u062a\u0631\u0648\u0646\u06cc\u06a9\u06cc Waveshare HAT V2\u060c \u0648 \u06a9\u0646\u062c\u06a9\u0627\u0648\u06cc \u0628\u0631\u0627\u06cc \u06a9\u0634\u0641 \u067e\u062a\u0627\u0646\u0633\u06cc\u0644 \u0622\u0646\u060c \u062a\u0635\u0645\u06cc\u0645 \u06af\u0631\u0641\u062a\u0645 \u0627\u0628\u0632\u0627\u0631\u06cc \u0631\u0627 \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u0645 \u06a9\u0647 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u0634\u0628\u06a9\u0647 \u0631\u0627 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f. \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0645\u0646 VLAN \u0647\u0627 \u0631\u0627 \u062f\u0631 PfSense \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u06cc \u06a9\u0631\u062f\u0645\u060c \u0628\u0647 \u062f\u0644\u06cc\u0644 \u0636\u0631\u0648\u0631\u062a \u0628\u0647 \u0648\u062c\u0648\u062f \u0622\u0645\u062f. \u0645\u0646 \u0627\u0632 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 &#8220;ipconfig \/release&#8221; \u0648 &#8220;ipconfig \/renew&#8221; \u062f\u0631 \u0647\u0646\u06af\u0627\u0645 \u0622\u0632\u0645\u0627\u06cc\u0634 \u0642\u0648\u0627\u0646\u06cc\u0646 \u062c\u062f\u0627\u0633\u0627\u0632\u06cc \u0634\u0628\u06a9\u0647 \u0648 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 \u062e\u0633\u062a\u0647 \u0634\u062f\u0645. \u0645\u0646 \u0622\u0646 \u067e\u0631\u0648\u0698\u0647 \u0631\u0627 \u062f\u0631 \u06cc\u06a9 \u067e\u0633\u062a \u0627\u0636\u0627\u0641\u06cc \u0628\u0647 \u0627\u0634\u062a\u0631\u0627\u06a9 \u062e\u0648\u0627\u0647\u0645 \u06af\u0630\u0627\u0634\u062a. <\/p>\n<p>\u0645\u0646 \u0642\u0635\u062f \u062f\u0627\u0631\u0645 \u0627\u06cc\u0646 \u067e\u0633\u062a \u0631\u0627 \u062a\u0627 \u062d\u062f \u0627\u0645\u06a9\u0627\u0646 \u062e\u0644\u0627\u0635\u0647 \u06a9\u0646\u0645. \u062f\u0631 \u0637\u0648\u0644 \u062a\u062d\u0642\u06cc\u0642\u0627\u062a\u0645 \u0628\u0631\u0627\u06cc \u062a\u062d\u0642\u0642 \u0628\u062e\u0634\u06cc\u062f\u0646 \u0628\u0647 \u0627\u06cc\u0646 \u067e\u0631\u0648\u0698\u0647\u060c \u0628\u0631\u0627\u06cc \u06cc\u0627\u0641\u062a\u0646 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0648\u0631\u062f \u0646\u06cc\u0627\u0632 \u062e\u0648\u062f\u060c \u067e\u0631\u0632\u0647\u0627\u06cc \u0632\u06cc\u0627\u062f\u06cc \u0631\u0627 \u062d\u0641\u0631 \u06a9\u0631\u062f\u0645. <\/p>\n<p>\u0645\u0646 \u0641\u0631\u0636 \u0645\u06cc \u06a9\u0646\u0645 \u0634\u0645\u0627 \u0645\u06cc \u062f\u0627\u0646\u06cc\u062f \u06a9\u0647 \u0686\u06af\u0648\u0646\u0647 \u0633\u06cc\u0633\u062a\u0645 \u0639\u0627\u0645\u0644 \u0631\u0627 \u0631\u0648\u06cc PI \u0641\u0644\u0634 \u06a9\u0646\u06cc\u062f. \u0645\u0627 \u067e\u0633\u062a Pi imager \u0631\u0627 \u0634\u0631\u0648\u0639 \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f. \u0645\u0646 \u0627\u0632 \u06cc\u06a9 \u06a9\u0627\u0631\u062a SD \u062c\u062f\u06cc\u062f 64 \u06af\u06cc\u06af\u0627\u0628\u0627\u06cc\u062a\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f\u0645. \u0647\u0645\u0686\u0646\u06cc\u0646\u060c \u0645\u062a\u0648\u062c\u0647 \u0634\u062f\u0645 \u06a9\u0647 \u06a9\u0627\u0631\u062a SD 128 \u06af\u06cc\u06af\u0627\u0628\u0627\u06cc\u062a\u06cc \u06a9\u0647 \u062f\u0631 \u0627\u0628\u062a\u062f\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f\u0647 \u0628\u0648\u062f\u0645\u060c \u0628\u0647 \u062f\u0631\u0633\u062a\u06cc \u0628\u0648\u062a \u0646\u0645\u06cc \u0634\u0648\u062f. \u0628\u0631\u0627\u06cc \u062a\u0639\u06cc\u06cc\u0646 \u0627\u06cc\u0646\u06a9\u0647 \u0622\u06cc\u0627 \u0627\u0646\u062f\u0627\u0632\u0647 \u06a9\u0627\u0631\u062a SD \u0627\u0633\u062a \u06cc\u0627 \u0628\u0631\u062e\u06cc \u0627\u0632 \u062e\u0637\u0627\u0647\u0627\u06cc \u0627\u067e\u0631\u0627\u062a\u0648\u0631\u060c \u0628\u06cc\u0634\u062a\u0631 \u0628\u0647 \u06a9\u0627\u0648\u0634 \u067e\u0631\u062f\u0627\u062e\u062a\u0645. \u0645\u0639\u0645\u0648\u0644\u0627 \u062f\u0648\u0645\u06cc.. <\/p>\n<p>pi@NetworkID:~ $ sudo apt update<br \/>\npi@NetworkID:~ $ sudo apt upgrade<\/p>\n<p>#install required packages<br \/>\npi@NetworkID:~ $ sudo apt-get install python3-rpi.gpio python3-spidev python3-pil python3-pip<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u0633\u067e\u0633 \u0631\u0627\u0628\u0637 SPI \u0631\u0627 \u0641\u0639\u0627\u0644 \u0645\u06cc \u06a9\u0646\u06cc\u0645. \u0645\u0627 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0627\u0632 \u0631\u0627\u0628\u0637 raspi-config \u0627\u0646\u062c\u0627\u0645 \u062e\u0648\u0627\u0647\u06cc\u0645 \u062f\u0627\u062f.<\/p>\n<p>pi@NetworkID:~ $ sudo raspi-config<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u06af\u0632\u06cc\u0646\u0647 3 &#8211; \u06af\u0632\u06cc\u0646\u0647 \u0647\u0627\u06cc \u0631\u0627\u0628\u0637 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f<\/p>\n<p>\u0628\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06af\u0632\u06cc\u0646\u0647\u060c \u0631\u0627\u0628\u0637 SPI \u0631\u0627 \u0641\u0639\u0627\u0644 \u06a9\u0646\u06cc\u062f. \u0633\u067e\u0633 \u0648\u0642\u062a\u06cc \u0635\u0641\u062d\u0647 \u0627\u0635\u0644\u06cc \u062f\u0648\u0628\u0627\u0631\u0647 \u0638\u0627\u0647\u0631 \u0634\u062f\u060c finish \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f. <\/p>\n<p>pi@NetworkID:~ $ git clone https:\/\/github.com\/waveshare\/e-Paper.git<br \/>\nCloning into &#8216;e-Paper&#8217;&#8230;<br \/>\nremote: Enumerating objects: 8711, done.<br \/>\nremote: Counting objects: 100% (1961\/1961), done.<br \/>\nremote: Compressing objects: 100% (264\/264), done.<br \/>\nremote: Total 8711 (delta 1745), reused 1778 (delta 1694), pack-reused 6750 (from 1)<br \/>\nReceiving objects: 100% (8711\/8711), 42.23 MiB | 307.00 KiB\/s, done.<br \/>\nResolving deltas: 100% (6242\/6242), done.<br \/>\nUpdating files: 100% (3002\/3002), done.<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u0686\u0646\u062f \u062b\u0627\u0646\u06cc\u0647 \u0628\u0647 \u0622\u0646 \u0641\u0631\u0635\u062a \u062f\u0647\u06cc\u062f \u062a\u0627 \u0645\u062e\u0632\u0646 \u0631\u0627 \u0634\u0628\u06cc\u0647 \u0633\u0627\u0632\u06cc \u06a9\u0646\u062f. \u0648\u0642\u062a\u06cc \u06a9\u0627\u0631 \u062a\u0645\u0627\u0645 \u0634\u062f\u060c \u0628\u0647 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc e-paper \u06a9\u0647 \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647 \u0627\u0633\u062a \u0628\u0631\u0648\u06cc\u062f \u0648 setup.py \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f<\/p>\n<p>pi@NetworkID:~ $ cd e-Paper\/RaspberryPi_JetsonNano\/python\/<\/p>\n<p>pi@NetworkID:~\/e-Paper\/RaspberryPi_JetsonNano\/python $ sudo python3 setup.py install<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u0627\u06cc\u0646\u062c\u0627\u0633\u062a \u06a9\u0647 \u0645\u0646 \u0627\u0634\u062a\u0628\u0627\u0647 \u06a9\u0631\u062f\u0645. \u0645\u0646 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0646\u0635\u0628 Python3 Setup Tools \u0648 netifaces \u062f\u0627\u0634\u062a\u0645. \u0627\u06cc\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627 \u0628\u0631\u0627\u06cc \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u0646\u0627\u0633\u0628 \u0648 \u067e\u0631\u0633 \u0648 \u062c\u0648\u0647\u0627\u06cc \u0631\u0627\u0628\u0637 \u0634\u0628\u06a9\u0647 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0628\u0633\u06cc\u0627\u0631 \u0645\u0647\u0645 \u0647\u0633\u062a\u0646\u062f.<\/p>\n<p>pi@NetworkID:~\/e-Paper\/RaspberryPi_JetsonNano\/python $ sudo apt install python3-setuptools<br \/>\nReading package lists&#8230; Done<br \/>\nBuilding dependency tree&#8230; Done<br \/>\nReading state information&#8230; Done<br \/>\npython3-setuptools is already the newest version (66.1.1-1).<br \/>\npython3-setuptools set to manually installed.<br \/>\n0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.<\/p>\n<p>pi@NetworkID:~\/e-Paper\/RaspberryPi_JetsonNano\/python $ sudo apt install python3-netifaces<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u0627\u06a9\u0646\u0648\u0646 \u0627\u062c\u0627\u0632\u0647 \u062f\u0647\u06cc\u062f \u062f\u0648\u0628\u0627\u0631\u0647 Setup.py \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u0645. \u062d\u0627\u0644\u0627 \u0628\u0639\u062f \u0627\u0632 \u0627\u06cc\u0646\u06a9\u0647 \u062a\u0645\u0627\u0645 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627 \u0648 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u062f\u0631\u0633\u062a \u0634\u062f\u060c \u0628\u06cc\u0627\u06cc\u06cc\u062f \u06a9\u062f\u06cc \u0628\u0646\u0648\u06cc\u0633\u06cc\u0645!<\/p>\n<p>import subprocess<br \/>\nimport netifaces<br \/>\nfrom waveshare_epd import epd2in13_V2<br \/>\nfrom PIL import Image, ImageDraw, ImageFont<br \/>\nfrom datetime import datetime<\/p>\n<p># Initialize e-Paper display<br \/>\n# Specifically for 2.13&#8243; V2<br \/>\nepd = epd2in13_V2.EPD()<\/p>\n<p># Define fonts<br \/>\nfont = ImageFont.truetype(&#8216;\/usr\/share\/fonts\/truetype\/dejavu\/DejaVuSans-Bold.ttf&#8217;, 12)<br \/>\nfont_small = ImageFont.truetype(&#8216;\/usr\/share\/fonts\/truetype\/dejavu\/DejaVuSans-Bold.ttf&#8217;, 10)<\/p>\n<p>def get_network_info(interface):<br \/>\n    try:<br \/>\n        # Get network information for the specified interface<br \/>\n        if interface in netifaces.interfaces():<br \/>\n            addresses = netifaces.ifaddresses(interface)<br \/>\n            ip_address = addresses[netifaces.AF_INET][0][&#8216;addr&#8217;]\n            netmask = addresses[netifaces.AF_INET][0][&#8216;netmask&#8217;]\n            gateway = netifaces.gateways()[&#8216;default&#8217;][netifaces.AF_INET][0]\n            mac_address = addresses[netifaces.AF_LINK][0][&#8216;addr&#8217;]\n            return ip_address, netmask, gateway, mac_address<br \/>\n        else:<br \/>\n            print(f&#8221;Interface {interface} not found.&#8221;)<br \/>\n            return None, None, None, None<br \/>\n    except Exception as e:<br \/>\n        print(f&#8221;Error retrieving network information: {e}&#8221;)<br \/>\n        return None, None, None, None<\/p>\n<p>def get_ssid(interface):<br \/>\n    try:<br \/>\n        # Execute the iwgetid command to get the SSID of the specified interface<br \/>\n        result = subprocess.run([&#8216;iwgetid&#8217;, interface, &#8216;&#8211;raw&#8217;], capture_output=True, text=True)<br \/>\n        if result.returncode == 0:<br \/>\n            return result.stdout.strip()<br \/>\n        else:<br \/>\n            return &#8220;SSID not found&#8221;<br \/>\n    except Exception as e:<br \/>\n        print(f&#8221;Error retrieving SSID: {e}&#8221;)<br \/>\n        return &#8220;SSID error&#8221;<\/p>\n<p>def display_network_info(ip_address, netmask, gateway, mac_address, ssid=None):<br \/>\n    # Create new image with white background (landscape orientation)<br \/>\n    image = Image.new(&#8216;1&#8217;, (epd.height, epd.width), 255)<br \/>\n    draw = ImageDraw.Draw(image)<\/p>\n<p>    # Clear display<br \/>\n    epd.init(epd.FULL_UPDATE)<br \/>\n    epd.displayPartBaseImage(epd.getbuffer(image))<\/p>\n<p>    # Draw network information on the display<br \/>\n    draw.text((10, 10), f&#8221;IP Address: {ip_address}&#8221;, font=font, fill=0)<br \/>\n    draw.text((10, 30), f&#8221;Subnet Mask: {netmask}&#8221;, font=font, fill=0)<br \/>\n    draw.text((10, 50), f&#8221;Default Gateway: {gateway}&#8221;, font=font, fill=0)<\/p>\n<p>    # Add timestamp<br \/>\n    current_time = datetime.now().strftime(&#8216;%Y-%m-%d %H:%M:%S&#8217;)<br \/>\n    draw.text((10, 70), f&#8221;Timestamp: {current_time}&#8221;, font=font, fill=0)<\/p>\n<p>    # If SSID is available, display it<br \/>\n    if ssid:<br \/>\n        draw.text((10, 90), f&#8221;SSID: {ssid}&#8221;, font=font, fill=0)<\/p>\n<p>    # Display MAC address<br \/>\n    draw.text((10, 110), f&#8221;MAC Address: {mac_address}&#8221;, font=font, fill=0)<\/p>\n<p>    # Rotate the image 90 degrees clockwise<br \/>\n    image = image.rotate(90, expand=True)<\/p>\n<p>    # Display rotated image on the e-Paper display<br \/>\n    epd.init(epd.FULL_UPDATE)<br \/>\n    epd.display(epd.getbuffer(image))<\/p>\n<p>    # Sleep to conserve power<br \/>\n    epd.sleep()<\/p>\n<p>def main():<br \/>\n    # Check for wireless connection first<br \/>\n    # Wirelss connection need to be configured before hand<\/p>\n<p>    if &#8216;wlan0&#8217; in netifaces.interfaces():<br \/>\n        interface=&#8221;wlan0&#8243;<br \/>\n        ip_address, netmask, gateway, mac_address = get_network_info(interface)<br \/>\n        ssid = get_ssid(interface)<br \/>\n        if ip_address:<br \/>\n            display_network_info(ip_address, netmask, gateway, mac_address, ssid)<br \/>\n    # If no wireless connection, check for wired connection<br \/>\n    # Make sure the name of the interface here matches what is running on your device<br \/>\n    elif &#8216;eth0&#8217; in netifaces.interfaces():<br \/>\n        interface=&#8221;eth0&#8243;<br \/>\n        ip_address, netmask, gateway, mac_address = get_network_info(interface)<br \/>\n        if ip_address:<br \/>\n            display_network_info(ip_address, netmask, gateway, mac_address)<br \/>\n    else:<br \/>\n        print(&#8220;No network interface found.&#8221;)<\/p>\n<p>if __name__ == &#8216;__main__&#8217;:<br \/>\n    main()<\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<p>\u0645\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 crontab \u0631\u0627 \u0628\u0631\u0627\u06cc \u0627\u062c\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u062f\u0631 \u0647\u0646\u06af\u0627\u0645 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u062c\u062f\u062f \u0627\u0646\u062a\u062e\u0627\u0628 \u0645\u06cc \u06a9\u0646\u0645. <\/p>\n<p>pi@NetworkID:~ $ contab -e <\/p>\n<p># Use option one, or whichever editor you&#8217;d like.<br \/>\n# At the end of the file add this line.<\/p>\n<p>@reboot \/usr\/bin\/python3 \/home\/pi\/network_monitor.py<\/p>\n<p># This will run the script at each reboot. <\/p>\n<p>    \u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/p>\n<p>    \u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<div data-article-id=\"1964058\" id=\"article-body\">\n<p>\u0645\u0646 \u0628\u0647 \u0627\u0628\u0632\u0627\u0631\u06cc \u0646\u06cc\u0627\u0632 \u062f\u0627\u0634\u062a\u0645 \u06a9\u0647 \u0628\u062a\u0648\u0627\u0646\u062f \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0634\u0628\u06a9\u0647 \u0631\u0627 \u062f\u0631 \u0633\u0631\u06cc\u0639 \u062a\u0631\u06cc\u0646 \u0632\u0645\u0627\u0646 \u0645\u0645\u06a9\u0646 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f. \u0645\u062c\u0647\u0632 \u0628\u0647 Raspberry Pi 3 B+\u060c 2.13 \u0627\u06cc\u0646\u0686 \u06a9\u0627\u063a\u0630 \u0627\u0644\u06a9\u062a\u0631\u0648\u0646\u06cc\u06a9\u06cc Waveshare HAT V2\u060c \u0648 \u06a9\u0646\u062c\u06a9\u0627\u0648\u06cc \u0628\u0631\u0627\u06cc \u06a9\u0634\u0641 \u067e\u062a\u0627\u0646\u0633\u06cc\u0644 \u0622\u0646\u060c \u062a\u0635\u0645\u06cc\u0645 \u06af\u0631\u0641\u062a\u0645 \u0627\u0628\u0632\u0627\u0631\u06cc \u0631\u0627 \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u0645 \u06a9\u0647 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u0634\u0628\u06a9\u0647 \u0631\u0627 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f. \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0645\u0646 VLAN \u0647\u0627 \u0631\u0627 \u062f\u0631 PfSense \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u06cc \u06a9\u0631\u062f\u0645\u060c \u0628\u0647 \u062f\u0644\u06cc\u0644 \u0636\u0631\u0648\u0631\u062a \u0628\u0647 \u0648\u062c\u0648\u062f \u0622\u0645\u062f. \u0645\u0646 \u0627\u0632 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 &#8220;ipconfig \/release&#8221; \u0648 &#8220;ipconfig \/renew&#8221; \u062f\u0631 \u0647\u0646\u06af\u0627\u0645 \u0622\u0632\u0645\u0627\u06cc\u0634 \u0642\u0648\u0627\u0646\u06cc\u0646 \u062c\u062f\u0627\u0633\u0627\u0632\u06cc \u0634\u0628\u06a9\u0647 \u0648 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 \u062e\u0633\u062a\u0647 \u0634\u062f\u0645. \u0645\u0646 \u0622\u0646 \u067e\u0631\u0648\u0698\u0647 \u0631\u0627 \u062f\u0631 \u06cc\u06a9 \u067e\u0633\u062a \u0627\u0636\u0627\u0641\u06cc \u0628\u0647 \u0627\u0634\u062a\u0631\u0627\u06a9 \u062e\u0648\u0627\u0647\u0645 \u06af\u0630\u0627\u0634\u062a. <\/p>\n<p>\u0645\u0646 \u0642\u0635\u062f \u062f\u0627\u0631\u0645 \u0627\u06cc\u0646 \u067e\u0633\u062a \u0631\u0627 \u062a\u0627 \u062d\u062f \u0627\u0645\u06a9\u0627\u0646 \u062e\u0644\u0627\u0635\u0647 \u06a9\u0646\u0645. \u062f\u0631 \u0637\u0648\u0644 \u062a\u062d\u0642\u06cc\u0642\u0627\u062a\u0645 \u0628\u0631\u0627\u06cc \u062a\u062d\u0642\u0642 \u0628\u062e\u0634\u06cc\u062f\u0646 \u0628\u0647 \u0627\u06cc\u0646 \u067e\u0631\u0648\u0698\u0647\u060c \u0628\u0631\u0627\u06cc \u06cc\u0627\u0641\u062a\u0646 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0648\u0631\u062f \u0646\u06cc\u0627\u0632 \u062e\u0648\u062f\u060c \u067e\u0631\u0632\u0647\u0627\u06cc \u0632\u06cc\u0627\u062f\u06cc \u0631\u0627 \u062d\u0641\u0631 \u06a9\u0631\u062f\u0645. <\/p>\n<p>\u0645\u0646 \u0641\u0631\u0636 \u0645\u06cc \u06a9\u0646\u0645 \u0634\u0645\u0627 \u0645\u06cc \u062f\u0627\u0646\u06cc\u062f \u06a9\u0647 \u0686\u06af\u0648\u0646\u0647 \u0633\u06cc\u0633\u062a\u0645 \u0639\u0627\u0645\u0644 \u0631\u0627 \u0631\u0648\u06cc PI \u0641\u0644\u0634 \u06a9\u0646\u06cc\u062f. \u0645\u0627 \u067e\u0633\u062a Pi imager \u0631\u0627 \u0634\u0631\u0648\u0639 \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f. \u0645\u0646 \u0627\u0632 \u06cc\u06a9 \u06a9\u0627\u0631\u062a SD \u062c\u062f\u06cc\u062f 64 \u06af\u06cc\u06af\u0627\u0628\u0627\u06cc\u062a\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f\u0645. \u0647\u0645\u0686\u0646\u06cc\u0646\u060c \u0645\u062a\u0648\u062c\u0647 \u0634\u062f\u0645 \u06a9\u0647 \u06a9\u0627\u0631\u062a SD 128 \u06af\u06cc\u06af\u0627\u0628\u0627\u06cc\u062a\u06cc \u06a9\u0647 \u062f\u0631 \u0627\u0628\u062a\u062f\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f\u0647 \u0628\u0648\u062f\u0645\u060c \u0628\u0647 \u062f\u0631\u0633\u062a\u06cc \u0628\u0648\u062a \u0646\u0645\u06cc \u0634\u0648\u062f. \u0628\u0631\u0627\u06cc \u062a\u0639\u06cc\u06cc\u0646 \u0627\u06cc\u0646\u06a9\u0647 \u0622\u06cc\u0627 \u0627\u0646\u062f\u0627\u0632\u0647 \u06a9\u0627\u0631\u062a SD \u0627\u0633\u062a \u06cc\u0627 \u0628\u0631\u062e\u06cc \u0627\u0632 \u062e\u0637\u0627\u0647\u0627\u06cc \u0627\u067e\u0631\u0627\u062a\u0648\u0631\u060c \u0628\u06cc\u0634\u062a\u0631 \u0628\u0647 \u06a9\u0627\u0648\u0634 \u067e\u0631\u062f\u0627\u062e\u062a\u0645. \u0645\u0639\u0645\u0648\u0644\u0627 \u062f\u0648\u0645\u06cc.. <\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>\n\npi@NetworkID:~ $ sudo apt update\npi@NetworkID:~ $ sudo apt upgrade\n\n#install required packages\npi@NetworkID:~ $ sudo apt-get install python3-rpi.gpio python3-spidev python3-pil python3-pip\n\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u0633\u067e\u0633 \u0631\u0627\u0628\u0637 SPI \u0631\u0627 \u0641\u0639\u0627\u0644 \u0645\u06cc \u06a9\u0646\u06cc\u0645. \u0645\u0627 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0627\u0632 \u0631\u0627\u0628\u0637 raspi-config \u0627\u0646\u062c\u0627\u0645 \u062e\u0648\u0627\u0647\u06cc\u0645 \u062f\u0627\u062f.<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>\n\npi@NetworkID:~ $ sudo raspi-config\n\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u06af\u0632\u06cc\u0646\u0647 3 &#8211; \u06af\u0632\u06cc\u0646\u0647 \u0647\u0627\u06cc \u0631\u0627\u0628\u0637 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f<\/p>\n<p><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/media.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftaoyvszn7mmp1ksh8n9y.png\" alt=\"SPI \u0631\u0627 \u0641\u0639\u0627\u0644 \u06a9\u0646\u06cc\u062f\" loading=\"lazy\" width=\"800\" height=\"452\" title=\"\"><\/p>\n<p>\u0628\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06af\u0632\u06cc\u0646\u0647\u060c \u0631\u0627\u0628\u0637 SPI \u0631\u0627 \u0641\u0639\u0627\u0644 \u06a9\u0646\u06cc\u062f. \u0633\u067e\u0633 \u0648\u0642\u062a\u06cc \u0635\u0641\u062d\u0647 \u0627\u0635\u0644\u06cc \u062f\u0648\u0628\u0627\u0631\u0647 \u0638\u0627\u0647\u0631 \u0634\u062f\u060c finish \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f. <\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>\n\npi@NetworkID:~ $ git clone https:\/\/github.com\/waveshare\/e-Paper.git\nCloning into 'e-Paper'...\nremote: Enumerating objects: 8711, done.\nremote: Counting objects: 100% (1961\/1961), done.\nremote: Compressing objects: 100% (264\/264), done.\nremote: Total 8711 (delta 1745), reused 1778 (delta 1694), pack-reused 6750 (from 1)\nReceiving objects: 100% (8711\/8711), 42.23 MiB | 307.00 KiB\/s, done.\nResolving deltas: 100% (6242\/6242), done.\nUpdating files: 100% (3002\/3002), done.\n\n\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u0686\u0646\u062f \u062b\u0627\u0646\u06cc\u0647 \u0628\u0647 \u0622\u0646 \u0641\u0631\u0635\u062a \u062f\u0647\u06cc\u062f \u062a\u0627 \u0645\u062e\u0632\u0646 \u0631\u0627 \u0634\u0628\u06cc\u0647 \u0633\u0627\u0632\u06cc \u06a9\u0646\u062f. \u0648\u0642\u062a\u06cc \u06a9\u0627\u0631 \u062a\u0645\u0627\u0645 \u0634\u062f\u060c \u0628\u0647 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc e-paper \u06a9\u0647 \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647 \u0627\u0633\u062a \u0628\u0631\u0648\u06cc\u062f \u0648 setup.py \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>\n\npi@NetworkID:~ $ cd e-Paper\/RaspberryPi_JetsonNano\/python\/\n\npi@NetworkID:~\/e-Paper\/RaspberryPi_JetsonNano\/python $ sudo python3 setup.py install\n\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u0627\u06cc\u0646\u062c\u0627\u0633\u062a \u06a9\u0647 \u0645\u0646 \u0627\u0634\u062a\u0628\u0627\u0647 \u06a9\u0631\u062f\u0645. \u0645\u0646 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0646\u0635\u0628 Python3 Setup Tools \u0648 netifaces \u062f\u0627\u0634\u062a\u0645. \u0627\u06cc\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627 \u0628\u0631\u0627\u06cc \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u0646\u0627\u0633\u0628 \u0648 \u067e\u0631\u0633 \u0648 \u062c\u0648\u0647\u0627\u06cc \u0631\u0627\u0628\u0637 \u0634\u0628\u06a9\u0647 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0628\u0633\u06cc\u0627\u0631 \u0645\u0647\u0645 \u0647\u0633\u062a\u0646\u062f.<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>\n\npi@NetworkID:~\/e-Paper\/RaspberryPi_JetsonNano\/python $ sudo apt install python3-setuptools\nReading package lists... Done\nBuilding dependency tree... Done\nReading state information... Done\npython3-setuptools is already the newest version (66.1.1-1).\npython3-setuptools set to manually installed.\n0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n\npi@NetworkID:~\/e-Paper\/RaspberryPi_JetsonNano\/python $ sudo apt install python3-netifaces\n\n\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u0627\u06a9\u0646\u0648\u0646 \u0627\u062c\u0627\u0632\u0647 \u062f\u0647\u06cc\u062f \u062f\u0648\u0628\u0627\u0631\u0647 Setup.py \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u0645. <br \/>\u062d\u0627\u0644\u0627 \u0628\u0639\u062f \u0627\u0632 \u0627\u06cc\u0646\u06a9\u0647 \u062a\u0645\u0627\u0645 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627 \u0648 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u062f\u0631\u0633\u062a \u0634\u062f\u060c \u0628\u06cc\u0627\u06cc\u06cc\u062f \u06a9\u062f\u06cc \u0628\u0646\u0648\u06cc\u0633\u06cc\u0645!<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>\n\nimport subprocess\nimport netifaces\nfrom waveshare_epd import epd2in13_V2\nfrom PIL import Image, ImageDraw, ImageFont\nfrom datetime import datetime\n\n# Initialize e-Paper display\n# Specifically for 2.13\" V2 \nepd = epd2in13_V2.EPD()\n\n# Define fonts\nfont = ImageFont.truetype('\/usr\/share\/fonts\/truetype\/dejavu\/DejaVuSans-Bold.ttf', 12)\nfont_small = ImageFont.truetype('\/usr\/share\/fonts\/truetype\/dejavu\/DejaVuSans-Bold.ttf', 10)\n\ndef get_network_info(interface):\n    try:\n        # Get network information for the specified interface\n        if interface in netifaces.interfaces():\n            addresses = netifaces.ifaddresses(interface)\n            ip_address = addresses[netifaces.AF_INET][0]['addr']\n            netmask = addresses[netifaces.AF_INET][0]['netmask']\n            gateway = netifaces.gateways()['default'][netifaces.AF_INET][0]\n            mac_address = addresses[netifaces.AF_LINK][0]['addr']\n            return ip_address, netmask, gateway, mac_address\n        else:\n            print(f\"Interface {interface} not found.\")\n            return None, None, None, None\n    except Exception as e:\n        print(f\"Error retrieving network information: {e}\")\n        return None, None, None, None\n\ndef get_ssid(interface):\n    try:\n        # Execute the iwgetid command to get the SSID of the specified interface\n        result = subprocess.run(['iwgetid', interface, '--raw'], capture_output=True, text=True)\n        if result.returncode == 0:\n            return result.stdout.strip()\n        else:\n            return \"SSID not found\"\n    except Exception as e:\n        print(f\"Error retrieving SSID: {e}\")\n        return \"SSID error\"\n\ndef display_network_info(ip_address, netmask, gateway, mac_address, ssid=None):\n    # Create new image with white background (landscape orientation)\n    image = Image.new('1', (epd.height, epd.width), 255)\n    draw = ImageDraw.Draw(image)\n\n    # Clear display\n    epd.init(epd.FULL_UPDATE)\n    epd.displayPartBaseImage(epd.getbuffer(image))\n\n    # Draw network information on the display\n    draw.text((10, 10), f\"IP Address: {ip_address}\", font=font, fill=0)\n    draw.text((10, 30), f\"Subnet Mask: {netmask}\", font=font, fill=0)\n    draw.text((10, 50), f\"Default Gateway: {gateway}\", font=font, fill=0)\n\n    # Add timestamp\n    current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')\n    draw.text((10, 70), f\"Timestamp: {current_time}\", font=font, fill=0)\n\n    # If SSID is available, display it\n    if ssid:\n        draw.text((10, 90), f\"SSID: {ssid}\", font=font, fill=0)\n\n    # Display MAC address\n    draw.text((10, 110), f\"MAC Address: {mac_address}\", font=font, fill=0)\n\n    # Rotate the image 90 degrees clockwise\n    image = image.rotate(90, expand=True)\n\n    # Display rotated image on the e-Paper display\n    epd.init(epd.FULL_UPDATE)\n    epd.display(epd.getbuffer(image))\n\n    # Sleep to conserve power\n    epd.sleep()\n\ndef main():\n    # Check for wireless connection first\n    # Wirelss connection need to be configured before hand\n\n    if 'wlan0' in netifaces.interfaces():\n        interface=\"wlan0\"\n        ip_address, netmask, gateway, mac_address = get_network_info(interface)\n        ssid = get_ssid(interface)\n        if ip_address:\n            display_network_info(ip_address, netmask, gateway, mac_address, ssid)\n    # If no wireless connection, check for wired connection\n    # Make sure the name of the interface here matches what is running on your device\n    elif 'eth0' in netifaces.interfaces():\n        interface=\"eth0\"\n        ip_address, netmask, gateway, mac_address = get_network_info(interface)\n        if ip_address:\n            display_network_info(ip_address, netmask, gateway, mac_address)\n    else:\n        print(\"No network interface found.\")\n\nif __name__ == '__main__':\n    main()\n\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u0645\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 crontab \u0631\u0627 \u0628\u0631\u0627\u06cc \u0627\u062c\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u062f\u0631 \u0647\u0646\u06af\u0627\u0645 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u062c\u062f\u062f \u0627\u0646\u062a\u062e\u0627\u0628 \u0645\u06cc \u06a9\u0646\u0645. <\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>\n\npi@NetworkID:~ $ contab -e \n\n# Use option one, or whichever editor you'd like.\n# At the end of the file add this line.\n\n@reboot \/usr\/bin\/python3 \/home\/pi\/network_monitor.py\n\n# This will run the script at each reboot. \n\n\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summarize this content to 400 words in Persian Lang \u0645\u0646 \u0628\u0647 \u0627\u0628\u0632\u0627\u0631\u06cc \u0646\u06cc\u0627\u0632 \u062f\u0627\u0634\u062a\u0645 \u06a9\u0647 \u0628\u062a\u0648\u0627\u0646\u062f \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0634\u0628\u06a9\u0647 \u0631\u0627 \u062f\u0631 \u0633\u0631\u06cc\u0639 \u062a\u0631\u06cc\u0646 \u0632\u0645\u0627\u0646 \u0645\u0645\u06a9\u0646 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f. \u0645\u062c\u0647\u0632 \u0628\u0647 Raspberry Pi 3 B+\u060c 2.13 \u0627\u06cc\u0646\u0686 \u06a9\u0627\u063a\u0630 \u0627\u0644\u06a9\u062a\u0631\u0648\u0646\u06cc\u06a9\u06cc Waveshare HAT V2\u060c \u0648 \u06a9\u0646\u062c\u06a9\u0627\u0648\u06cc \u0628\u0631\u0627\u06cc \u06a9\u0634\u0641 \u067e\u062a\u0627\u0646\u0633\u06cc\u0644 \u0622\u0646\u060c \u062a\u0635\u0645\u06cc\u0645 \u06af\u0631\u0641\u062a\u0645 \u0627\u0628\u0632\u0627\u0631\u06cc \u0631\u0627 \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u0645 \u06a9\u0647 \u0645\u06cc &hellip;<\/p>\n","protected":false},"author":2,"featured_media":79240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[339],"tags":[],"class_list":["post-79239","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/79239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/comments?post=79239"}],"version-history":[{"count":0,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/79239\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media\/79240"}],"wp:attachment":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media?parent=79239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/categories?post=79239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/tags?post=79239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}