PokemonGoF / PokemonGo-Bot

The Pokemon Go Bot, baking with community.
MIT License
3.87k stars 1.54k forks source link

Could not fetch data from PokemonGo-Map instance using Sniper #5558

Closed ghost closed 8 years ago

ghost commented 8 years ago

Expected Behavior

The bot fetches data from a local PokemonGo-Map instance and snipes Pokémon accordingly.

Actual Behavior

The bot displays an error message and doesn't snipe Pokémon.

Your FULL config.json (remove your username, password, gmapkey and any other private info)

chemnitz.json

Output when issue occurred

[2016-09-20 07:45:52] [ Sniper] [INFO] Could not fetch data from 'http://localhost:5000/raw_data'. Details: 'ascii' codec can't encode character u'\u2640' in position 7: ordinal not in range(128). Skipping...

Steps to Reproduce

  1. Run PokemonGo-Map
  2. Run PokemonGo-Bot

    Other Information

OS: macOS 10.12 Branch: dev Git Commit: d1e983f45f4687580c2a305591dd9178477be444 Python Version: Python 2.7.12 Any other relevant files/configs (eg: path files) path1.gpx

calvinbui commented 8 years ago

Same error on Ubuntu 16.04.

I believe it is to do with the Female/Male symbols on Nidoran

crvfts commented 8 years ago

I received this error as well when I first started running Sniper but it went away after awhile. I also added and enabled debug to Sniper task and was able to see 'Nidoran F' properly listed as a skipped pmon (not on list, iv too low, pmon sucks etc). Perhaps the ascii symbols were old data that needed to be cycled out? Anyway, it appears pokemon.min is where names come from in pogom, if issue persists we could just edit that until fixed.

ghost commented 8 years ago

It most definitely stems from Nidoran\u2642 and Nidoran\u2640.

YvesHenri commented 8 years ago

@acurioustale I'm probably fixing this soon, but in the meanwhile, remove the "name" mapping from the PokemonGo-Map mappings and it should work:

"id": { "param": "pokemon_id" }, "latitude": { "param": "latitude" }, "longitude": { "param": "longitude" }, "expiration": { "param": "disappear_time", "format": "milliseconds" }

warlikeofchaos commented 8 years ago

Could you be more specific about what file inside PokemonGo-Map I must modify to fix and test this?

YvesHenri commented 8 years ago
{
        "type": "Sniper",
        "config": {
            "enabled": true,
            "mode": "url",
            "bullets": 3,
            "homing_shots": false,
            "special_iv": 100,
            "order": ["iv", "priority", "missing"],
            "sources": [
                {
                    "enabled": true,
                    "url": "http://localhost:5000/raw_data",
                    "key": "pokemons",
                    "mappings": {
                        "id": { "param": "pokemon_id" },
                        "latitude": { "param": "latitude" },
                        "longitude": { "param": "longitude" },
                        "expiration": { "param": "disappear_time", "format": "milliseconds" }
                    }
                }
            ],
            "catch": {
                YOUR CATCH LIST HERE
            }
        }
      }
warlikeofchaos commented 8 years ago

[2016-09-21 20:18:48] [MoveToMapPokemon] [INFO] Failure! JSON format is not valid [2016-09-21 20:18:48] [ Sniper] [INFO] Teleporting to meet Pidgey (-3.12384286839; -60.0175006321)... [2016-09-21 20:18:52] [ Sniper] [INFO] Yay! There really is a wild Pidgey nearby! [2016-09-21 20:18:52] [ Sniper] [INFO] Teleporting back to the old position (-3.12615678742; -60.0266239676)... [2016-09-21 20:18:55] [PokemonCatchWorker] [INFO] A wild Pidgey appeared! (CP: 151) (NCP: 0.22) (Potential 0.6) (A/D/S 5/15/7)

[2016-09-21 20:21:02] [ Sniper] [INFO] Could not fetch data from 'http://localhost:5000/raw_data'. Details: 'ascii' codec can't encode character u'\u2640' in position 7: ordinal not in range(128). Skipping...

Problem still there, nidoran related? I modified the config file like above post.

YvesHenri commented 8 years ago

@warlikeofchaos You shouldnt be using both snipers. Either use MoveToMapPokemon or Sniper.

warlikeofchaos commented 8 years ago

I must be doing something wrong, can you help?

2016-09-21 20:29:48,183 [ cli] [INFO] commit: cf123836

[2016-09-21 20:31:05] [ Sniper] [INFO] Validating sources: http://localhost:5000/raw_data...

[2016-09-21 20:31:05] [ Sniper] [INFO] Source 'http://localhost:5000/raw_data' is good!

[2016-09-21 20:31:59] [ Sniper] [INFO] Could not fetch data from 'http://localhost:5000/raw_data'. Details: 'ascii' codec can't encode character u'\u2640' in position 7: ordinal not in range(128). Skipping...

config.json.zip

YvesHenri commented 8 years ago

@warlikeofchaos Please use the slack help channel instead. Thank you.

Gobberwart commented 8 years ago

As per comment from @YvesHenri, remove the name mapping from that source:

                {
                    "url": "http://localhost:5000/raw_data",
                    "enabled": false,
                    "key": "pokemons",
                    "mappings": {
                        "id": { "param": "pokemon_id" },
                        "latitude": { "param": "latitude" },
                        "longitude": { "param": "longitude" },
                        "expiration": { "param": "disappear_time", "format": "milliseconds" }
                    }
                },