sibalzer / impfbot

Benachrichtigungs-Bot für das niedersächische Impfportal / Notification bot for the lower saxony vaccination portal https://impfportal-niedersachsen.de
GNU General Public License v3.0
36 stars 8 forks source link

Running on android (termux) #71

Closed ronizzel closed 3 years ago

ronizzel commented 3 years ago

It's just a hint, that might be added to README: it's surprisingly easy to run the bot on android smartphones.

All you need is termux (https://termux.com/), install python and maybe openssh to copy files and test everything from pc. Works for me without trouble, but maybe energy saving will make some in the future, I will see.

sibalzer commented 3 years ago

Keep me updated!

If it works well I'll put a tutorial in the readme. I'm just afraid ads the energy saving profiles of different manufacturers can be problematic. (https://dontkillmyapp.com/)

ronizzel commented 3 years ago

I am running it since yesterday and it was killed only one time. After applying the options (https://dontkillmyapp.com/) is suggesting for my smartphone (xiaomi) it wasn't killed again since last evening. (It even found one free slot while riding my bike, but when I stopped and tried to book, it was already to late).

I would simply make a list of commands to set it up as a short tutorial. However, I did it quick and dirty by installing and setting up sshd and then copying the files with scp from my already setup directory on the pc, etc, which worked fine. I guess, for a tutorial I should list the commands to download the source code, unpack, etc? The disadvantage would be, that you have to do all the configuration on the phone (editing the config file as well).

Also I wonder, wether one can trigger a push message from within termux. For me so far, sending mails to three of my permanently checked accounts and one telegram gives me enough of alarm. (edit: with "Termux:API" this would be possible, perhaps even with opening the website on hitting that notification; within impfbot either a shell command needs to be called, or: https://pypi.org/project/termux-api/)

sibalzer commented 3 years ago

A list of Commands would be fine. But i think we should make seperate files for more tutorials e.g. docs/SETUP_ANDROID.md. Can you make a PR?

Maybe termux accepts dbus? That would be the simplest solution.

ronizzel commented 3 years ago

So I just posted a PR (actually my first anywhere). Hope I followed all important rules and didn't mess anything up.

The problem I'm describing in the tutorial, what happens, when Internet connection is lost, might be a bug repairable by checking, wether another public IP is accessible?

Dbus does'nt seem to be compatible with android or termux. It would be a new function to implement push notification via termux, but I'm not sure wether it's really necessary.

sibalzer commented 3 years ago

Thank you!

With #41 it should detect if there is an connection error, needs to be tested on termux.

If there is a demand we can implement the termux api but it's already a very specific use case, so I would make it completely optional to not increase the config unnecessarily.

closed with #87 🚀