Implanted with a wretched corpo browser, huh?
You might as well be shackled to the Megacorps!
The system's built to oppress, suppress, and compress your soul!
Come back when you don't have a corpo-chip in you anymore.
⏿ NetWatch is watchin' you, choomba.
In the binary woods, secrets hide in plain sight,
Seek the end where bytes embers ignite.
A sly fox, guardian of the code,
Through encrypted paths, its wisdom bestowed.
When I was building weird things with my Banana Pi Zero 2 I noticed that it often loses the Wi-Fi connection.
After endless back and forth in the network settings I found somewhere on the net a way to solve it differently. Which was not quite optimal, so I had to find another solution.
It's a brutal solution and definitely not a real solution either, but it works.
A cronjob checks every minute if the Wi-Fi is still active, if it is not active, it is turned on again. Of course, this is not done by the cronjob alone, you have to create a small script.
And this is how you can prevent your Banana Pi from sleeping, at least you can prevent the Wi-Fi from sleeping.
Create a new file under
vi /usr/local/bin/nosleep.sh on your Banana Pi.
ping -c4 184.108.40.206 > /dev/null if [ $? != 0 ] then /sbin/ifdown 'wlan0' sleep 1 /sbin/ifup --force 'wlan0' fi
Replace the IP
220.127.116.11 with the IP from your modem/router.
To allow the script to do something we need to create the permissions.
sudo chmod 775 /usr/local/bin/nosleep.sh
Now we are almost done, now we create a cronjob which checks every minute if the wi-fi has gone out, we can solve this with the following command:
*/1 * * * * /usr/bin/sudo -H /usr/local/bin/nosleep.sh >> /dev/null 2>&1
The check now runs every minute, if this is too much you can replace the
1 with e.g. a
5 for every 5 minutes.
By the way, the script works not only on a Banana Pi but on almost everything that has a Wi-Fi chip.