If you are updating from
async please create a backup of your current working MAD setup. Backup of database, backup of files, backup of nginx/apache2 settings - etc. Have a backup, backup is important, full backup - the more the better. Backup, yes. Backup.
If you running more than 15 (your mileage may vary) devices you probably need to run some extra MITM Receivers. If you are not near this number you can skip reading this point here - as you will just use single
start.py and everything will be easier.
MAD is now split into 4 parts:
start_core.pythis is main part of MAD that handles websockets/login flow/routes/MADmin etc.
start_mitmreceiver.pythis is part of MAD that process data received from PD and puts that in MySQL/database. This is the heaviest (CPU usage) part of MAD as it runs 24/7 and do a lot.
start_mitmapper.pythis is helper part
start_statshandler.pythis is just stats part
start.py that starts everything above in one single process, but that also means it’s limited to 1 vCPU/core so if you throw too many devices at that it will struggle to keep up.
There will be some examples how to run Multiply MITM RECEIVERS.
There are some outdated settings like
madmin_password that need to be deleted. There is new setting called
apk_storage_interface that need to be set to
config.ini. You can read the description in
config.ini.example. Also please set
mitmmapper_type: redis. Remember that commented out lines (
# first in that line) are commented out and it will not use those.
python3.9 - most modern systems have that in repository (apt install python3.9 for example) or for older one you can most likely install it from external repositories like deadsnakes. Before going to install anything check what is your current python version installed - it could be already there - try running
python3.9 --version and
python3 --version. Remember to install
python3[.9]-dev python3[.9]-venv python3[.9]-opencv packages.
redis-server installed (
apt install redis) - it’s required now, this does not any configuration by default, just install.
venv, python-venv, virtualenv - use venv, not local packages, not global packages, use venv, really, it makes life easier for everyone. TODO_LINK_HERE_TO_MANUAL_INSTALL_MAD_DOCS_VENV
MariaDB/MySQL is still there and if you are just updating you should have all of this.
list of packages needed for Debian 11 clean install - do NOT blindly-copy paste this - this is just for reference
python3-dev python3-venv mariadb-server redis mariadb-client build-essential git default-libmysqlclient-dev python3-opencv tesseract-ocr pkg-config
There are some (a lot!) of changes between versions and migrations are sometimes funky - please take a look at Common problems if you hit any error/problem. All the ports and endpoints (ws:// http://) stays the same.
Step 1: Create Backup. Backup - first point in this Quick FAQ.
Step 2: There are breaking PogoAuth changes so before running migration make sure there is only one (currently logged in on device) account mapped to single device in MADmin Pogo Auth section.
Step 3: Stop current legacy/master MAD.
Step 4: You don’t want to waste 30 minutes on MAD/MySQL changing the
pokemon_display tables because you have 17851758 / 6 months of mons history there! Clear those up:
DELETE FROM if you don’t do it already automagically.
Step 5: Remove
update_log.json file from MAD master/legacy main directory.
Step 6: Run
git checkout async from MAD master/legacy main directory.
Step 7: Run
git status from MAD master/legacy main directory, it should show:
On branch async
Your branch is up to date with 'origin/async'.
Step 8: Adjust config.ini (config.ini changes)
Step 9: Install new requirmements in python3.9 (virtualenv)
Step 10: Start
start.py via python3.9 venv manually (not crontab, systemd, supervisor or any type of script) - just for first time to see if there are any errors/problems and to make sure you will see everything.
Step 11: If everything working go to Pogo Auth in MADmin and edit level of your accounts to real level (so 30+)
Step 12: Password protect MADmin if not running via VPN/LAN MADmin password/login
Step 13: Update PD and RGC on all devices -
async have dedicated version of those programs. You can do it via Wizzard/MADmin Packages (if ATV), Jobs, manually - whatever you like more. Links to apks
Step 14: Make sure
screendetection is set to
True in every Devices settings in MADmin (and in Shared settings/settings pools if using). Crucial for PTC/Google login process.
If you run more than 15 devices you probably need this. In
master/legacy you started more instances - in
async you start more mitm receivers that process data within the same instance.
Few examples how this works: https://github.com/Map-A-Droid/MAD/blob/async/asyncio_readme.md or https://github.com/spammer23/MAD/blob/async_quest_layers/async_SimpleSetup.md
This part is little more tricky as you need to start muliply mitm receivers and distribute data to those. In a nutshell you should put load balancer/proxy and make that connect to your mitm receivers. Links above should show you how to handle most common setups (apache2/nginx), but feel free to ask on Discord if you having any problems/questions regarding this.
Due to latest N behavior changes (BSOD / maintenance screen) and limiting number of mon encounters per account within some <time period> there is now a need for changing accounts on devices. MAD can fully handle PTC accounts and semi-handle Google accounts.
PogoAuth section is now a list/repository of all accounts you have. MAD uses this list to automagically select valid (non banned/non maintenance/non cooldown) accounts. You need to have proper account levels there - if you are just migrating it was imported with levels 0/1 and MAD won’t login into those accounts when running mon_mitm/iv_mitm/raids_mitm - those need higher (30/8) levels. Please adjust those levels manually via MADmin or SQL query (
UPDATE settings_pogoauth SET level = 30).
If you running PTC only then you make sure levels in Pogo Auth settings are set to 30+. You also need to remember about PTC login limits so (beta-testing)
config.ini could be an option or running bunch of proxies to have different IPs there.
MAD (atm) does not handle directly login into Google Accounts so you either had them logged in earlier via autoconfig or you did it manually. It’s like that mostly because Google is picky with security and there is a lot of different things that can go wrong if you decided to login multply account within short period of time - some extra checks, temp bans etc. Because of those limitations MAD now need to know which account is on which device so on top of having your accounts listed in Pogo Auth (with correct level!) you also need to tell MAD how to map does - go to MADmin Settings -> Devices and fill the
ggl_login_mail with correct accounts. You don’t do it via Pogo Auth section, you do it via
ggl_login_mail in specific Device settings. Yes, you can have multiply accounts in
ggl_login_mail, but those need to be already logged in on device. Remember about setting correct levels on those accounts.
If you don’t remember your Google password then just type anything in password box - PogoAuth does not support login via those passwords and MAD picks accountns by username - only autoconfig need valid Google Account password.
MAD will first try to use Google accounts mapped via
ggl_login_mail and then use PTC accounts if those Google one are on maintenance. Please read both bullet points above :-)
All accounts in Pogo Auth section need to have correct level set up. MAD need accounts level 30+ for Quests/Mons so it won’t even try to login into lower level accounts. Remember to set level manually if you migrated or set it correctly when adding new accounts. MAD will log into lower levels account if it’s running Levelup Quest Mode and update/increase levels.
Accounts hit by BSOD / maintenance screen have current timestamp saved into database and they are deemed not valid to use for next 24 hours - this is for how long (most of the times, Niantic) accounts are not usuable at all. There are some icons you can hover/click in Pogo Auth section to give you an idea when it happen/what is the status.
Old system using
madmin_login is gone - you should remove those entries from
config.ini. You can now password-protect MADmin via built-in auth levels or externally via nginx/apache2.
Both systems have pros and cons, so you should decide on one, there is no “better” system, but personally because I don’t share my MADMin or don’t have a public quest page I prefer the nginx/apache2 proxy.
Using MAD built-in auth system:
If you decided to use built-in MAD system you need to add new user via MADMin Settings -> Auth with
MADMIN_ADMIN permissions and enable/uncomment
config.ini. Restart MAD and it’s all done.
Using nginx/apache2 proxy:
You need to use standard Basic Authentication for nginx/apache2. Example config for nginx is included in https://github.com/Map-A-Droid/MAD/blob/async/configs/examples/nginx/foo.conf#L56
# Please to use basic auth...
For apache2 it’s very similar:
Allow from all
Authname "Password Required"
To create .htpasswd_mad file you use
htpasswd program (from
apache2-utils system repository package) via
[sudo] htpasswd -c /etc/apache2/.htpasswd_mad USERNAME_HERE
[sudo] htpasswd -c /etc/nginx/.htpasswd_mad USERNAME_HERE
it will ask for password twice and then create a file for you.
Remember to restart nginx/apache2 after changes.
config.ini.example to see everything it’s there and then copy-paste specific section/settings to
git pull cannot overwrite yours config.ini because it would be a total mess and you would need to restore that file every update.
init mode settings? - init mode have a dedicated type now - just create new area using Init scanner ``init`` mode.
You can specify what type you are interested -
forts will jump every ~500 meters and add all pokestops/gyms to database and hardly any spawnpoints as those are visibly only within ~50 meters.
mons will jump every ~50 meters and add a lot of more spawnpoints, but it will have a lot of more jumps/stops/position on route.
unrecognized argument when starting MAD
start.py: error: unrecognized arguments: --madmin_user= --weather it means that this arguments (
weather) is need to be deleted from new
config.ini as it is not supported anymore.
ortools ortools speedup route calculation but it’s not
requierments.txt by default so you just need to install it in your venv
If you get [W] Unable to save/upload apk: (pymysql.err.InterfaceError) (0, ‘Not connected’) in logs while trying to Wizzard PD/POGO you most likely need to update MySQL/MariaDB settings in /etc/mysql/mariadb.conf.d/50-server.conf for max_allowed_packet to something like 256M, restart MySQL/MariaDB after that.