![](https://private-user-images.githubusercontent.com/138901665/280454419-390c440f-8e48-4cad-9735-f42e349a2169.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MTQ3OTQsIm5iZiI6MTcyNDcxNDQ5NCwicGF0aCI6Ii8xMzg5MDE2NjUvMjgwNDU0NDE5LTM5MGM0NDBmLThlNDgtNGNhZC05NzM1LWY0MmUzNDlhMjE2OS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNlQyMzIxMzRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zNWEzNzM4YjNlMmJhZmJkNTBiM2RhNzI5MmE5MWM4NGE4OWQxZDg5YmRjYWY4MjdhZTJmNmU0NmZiZTdmOTAyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Fa1AXRFTHnxzsR8ZQr0UpvxHiZzDZPKcAne72YwasUA)
Macagotchi for the Raspberry Pi is a tamagotchi-like pet (macOS / Windows codebases are also available). It interacts with the user by displaying a virtual pet on the screen while it scans for nearby Wi-Fi networks, and it will become happy when it’s found new SSIDs. Your Macagotchi will also track how many days in a row you’ve been able to keep it happy. While the code is very different, the idea is based on the excellent pwnagotchi project. The difference here is that Macagotchi doesn’t do anything sinister which might get you arrested or annoy people sitting around you. But seriously, check it out.
As pwnagotchi's less sinister cousin it only collects SSIDs to keep score, which it keeps locally in a log. It doesn’t export data, and doesn’t contain any marketing or tracking code. By design, if you want to share how many SSIDs you’ve collected and/or how happy your Macagotchi is, take a photo.
-
Python 3.x
-
A Waveshare 2.13inch touch E-Paper HAT
-
Raspbian
-
Pi Zero 2 W
-
Wi-Fi Network Scanning
- Scan for nearby Wi-Fi networks using the 'iwlist' command.
- Parse the scan results and extract network information.
-
Wi-Fi Network Tracking
- Store scanned network SSIDs and dates in a log file.
- Calculate the number of unique networks found today.
- Make your Macagotchi happy or sad depending on how many unique ssids it has found today.
-
Display Update
- Create an image for the E-Paper display.
- Draw user information, streak, network data, and your Macagotchi's face on the screen.
- Update the E-Paper display with the image.
-
Shutdown Functionality
- Press and hold the off icon in the bottem left hand corner for 2 seconds and let go to power off. Only unplug from power once the green light on the pi has switched off
- To power on again, unplug and plugin the pi.
- The program displays a tamagotchi-like pet face, which changes based on user interaction and network scanning results.
- User data, such as the username and network count, is displayed on the E-Paper screen.
- Loyalty streak information is tracked and displayed.
- Network scanning results, including the number of unique networks found today, are displayed.
- External libraries for the E-Paper display and touch functionality.
- Touch-enabled E-Paper display hardware.
- Python 3.x
- This program is designed for a Raspberry Pi Zero 2 W using that includes a Waveshare 2.13inch touch E-Paper HAT. macOS and Windows codebases are also available.
- Unlike the macOS and Windows versions, Macagotchi for pi does not support wardriving mode. Instead, Macagotchi scans every 30 seconds, and then after 6 scans (3 minutes) the screen updates. This is because of the limitations of E-Paper screens.
- Unlike macOS and Windows versions, your Macagotchi's expressions and commentary are based on data from that day, not from sessions, as, as you'll probably discover, you can leave your Macagotchi on for a long time on a power bank before it runs out of power.
Note that you will need adminstrator priveleges on the raspberry pi that you are using.
- Install the 2 in 13 touch E-Paper HAT.
- Follow this tutorial until it the "Download the Demo" stage begins. Since macagotchi comes pre-installed with the waveshare drivers, you will not need to complete this step.
- Run
git clone https://github.com/SpaceMonkeyAlfa/macagotchi-pi macagotchi
in your home/[your username here] directory. - Run
sudo crontab -e
and select the nano text editor - At the end of the document, type
@reboot sudo python3 /home/[your username here]/macagotchi/scripts/macagotchi.py
with [your username here] replaced with, you guessed it, your username. - Press ^S and ^X to save and exit crontab.
- Run
sudo reboot
Once the pi reboots, the screen should update to show your Macagotchi's face after about 20 seconds. Congratulations! You are now the proud owner of a Macagotchi.
By default, your Macagotchi's name is set to the current username. To change the name, simply:
- Run
cd macagotchi/scripts
to enter the scripts and save files directory - Run
nano name.txt
- Type in the new name for your Macagotchi.
- Press ^S ^X to save and exit.
- The next time the screen refreshes, you should see the new name. If not, you may need to reboot your pi. You can do that by pressing and holding on the power button for 2 seconds, then releasing, then waiting for the green light from your pi to go off, unplugging it and plugging it in again.