Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_map_objects? #191

Open
jangeja opened this issue Aug 7, 2016 · 34 comments
Open

get_map_objects? #191

jangeja opened this issue Aug 7, 2016 · 34 comments

Comments

@jangeja
Copy link

jangeja commented Aug 7, 2016

I just ran the spiral search demo and I didn't find any pokemon or pokestops and I know there were some in the area. I'm only seeing these two fields in the JSON response.

'current_timestamp_ms': 1470569750623,
's2_cell_id': 9290065149094264832

@mviniciusleal
Copy link

The same here...any solution?

@crispmark
Copy link

Having the same problem as well. All I want is the location of gyms and pokestops.

@Vigerus
Copy link

Vigerus commented Aug 7, 2016

The default radius was the issue in my code, i used radius = 5 in get_cell_ids before instead of the default radius = 10 to get smaller group of pokestops. Unsure what was the old parameter unit but now it seems to be expressed in meters and values 300 - 1000 are getting the similar amount of pokestops as 5-10 before.

Commit hash: 35221ff

EDIT: I meant the one in utilities.py, spiral_poi_search.py uses its own method. Maybe it's better to reattach it to utilities.py

@ProLoDs
Copy link

ProLoDs commented Aug 7, 2016

the unkown6 fix has not been merged yet, see the pull requests

@jangeja
Copy link
Author

jangeja commented Aug 7, 2016

Anyone figure this out? Modified spiral_poi_search.py so that it uses the utilities.py get_cell_ids, but im still running into the same issue

@dnsBlah
Copy link

dnsBlah commented Aug 7, 2016

@ProLoDs It might be just me, but even if I merge these files, the cells are still empty :(
Can anyone shine a light here ?

@jangeja
Copy link
Author

jangeja commented Aug 7, 2016

I've been banging my head on a wall with this problem. Am I missing something?

@ProLoDs
Copy link

ProLoDs commented Aug 7, 2016

@jangeja
Copy link
Author

jangeja commented Aug 7, 2016

I'd like to use the pgoapi to build my own application. I will be doing a little more than just a pokemonGo Map. Why am I only getting empty cells?

@dnsBlah
Copy link

dnsBlah commented Aug 7, 2016

@ProLoDs indeed the ahaaaaa map is working again :) thats a great relief, but my debug engineering aint that level yet to see what I need to change exactly.

Just receiving empty cells, thought mayba a ban, but thats not the case, just guessing that somehow we need to implement the u6 proto together with all the requests i.e. get_mapobjects
But thats already in the requests proto (i think) combining the get_mapobjects in the original call, and even after 10 seconds or whatever does not give any results on mapobjects

@jangeja
Copy link
Author

jangeja commented Aug 7, 2016

@dnsBlah

  1. Download http://pastebin.com/raw/fCSw0Fz4 as encrypt.c
  2. Compile to .so (gcc -shared -o encrypt.so -fPIC encrypt.c)
  3. Edit ~/pgoapi-master/pgoapi/pygoapi.py
    insert this line in the init method of PGoApi:
    self.__signature_lib = "encrypt.so"
  4. Copy encrypt.so into same directory as the python program you are running OR include it in path
  5. DONE!!! IT WORKS!

@dnsBlah
Copy link

dnsBlah commented Aug 7, 2016

@jmangeja1
Been there, done that, still no results :(
o wait, step 4... ? moment :)

@jangeja
Copy link
Author

jangeja commented Aug 7, 2016

@dnsBlah
self.__signature_lib = "encrypt.so"
Is the most important step.

if you don't do step 4, you will get an error saying it cant find encrypt.so so thats easy to track down
However it took a while to figure out setting the signature lib

@jangeja
Copy link
Author

jangeja commented Aug 7, 2016

@dnsBlah
Also I forgot to mention....

These should be run after 4 in my previous comment
5. uninstall pygoapi (pip uninstall pygoapi)
6. reinstall python setup.py install

@dnsBlah
Copy link

dnsBlah commented Aug 7, 2016

Actually I used the dll file

life saver!

@Trolldemorted
Copy link

@jmangeja1 thanks a lot! On my debian however putting encrypt.so into a directory in $PATH did not work, i had to use an absolute path instead.

@BigChase
Copy link

I am using https://github.com/keyphact repository as of evening of August 10th with encrypt.dll compiled on a mac and am not getting any objects returned in GET_MAP_OBJECTS calls. What is the fix?

@jangeja
Copy link
Author

jangeja commented Aug 11, 2016

@BigChase if youre using a Mac, you need encrypt.so and you need to compile it yourself. Follow my instructions posted earlier

@BigChase
Copy link

BigChase commented Aug 11, 2016

@jmangeja1 I've done so.  Compiled both into encrypt.dll in /usr/local/lib and as encrypt.so in same directory as pgoapi.py.

How can I debut encrypt.dll in order to determine if it's functioning correctly? (There were a large number of warnings during compilation to encrypt.so, but just repeats of "warning: '&' within '|' [-Wbitwise-op-parentheses]".)

(On a Mac.)

@jangeja
Copy link
Author

jangeja commented Aug 11, 2016

warnings are fine. Did you change the line about signature lib in pgoapi.py?

@BigChase
Copy link

BigChase commented Aug 11, 2016

Yes, changed that line though I am using keyphact's repository which was updated yesterday and again today which I believe deals with signature issues in slightly different way. With the folllowing line in pokecli.py:

api.activate_signature("/usr/local/lib/encrypt.dll")

plus i added encrypt.dll to global path.

@jangeja
Copy link
Author

jangeja commented Aug 11, 2016

try app.activate_signature("encrypt.so")
and put encrypt.so in the same directory as pokecli.py

@BigChase
Copy link

Great idea! And guess what? Worked like a charm! Love you man. Was working on this non-stop for 24 hours straight trying every combination of repository, user account, etc.

Until I followed your advice, I was using the compilation instructions and file placement on the following URL: #181 (comment). Wonder why it didn't work and your approach did?

The next issue I am having is that I have to run pokecli.py twice everytime. The first time always yields: "pgoapi.exceptions.ServerSideRequestThrottlingException: Request throttled by server... slow down man". And then immediately rerunning script works to completion. Any ideas?

Thanks again. Huge help!

@jangeja
Copy link
Author

jangeja commented Aug 11, 2016

Yea, You need to put time.sleep(x) delays after get_map_objects i recommend 10 seconds

@BigChase
Copy link

There is only one get_map_objects in pokecli.py, yet I still experience the described "slow doan man" failure on the first script execution. Can't figure out why?

@jangeja
Copy link
Author

jangeja commented Aug 11, 2016

put a time.sleep(1) after any api call made in pokecli.py

@BigChase
Copy link

Thanks again. Now to start understanding the get_map_objects responses.... (size of a cell, how to reference the spawn times and exact locations of nearby pokemon, etc.)...

@EasonPai
Copy link

@dnsBlah
can you share your .dll? I have no idea how to build it on windows, thanks~

@dnsBlah
Copy link

dnsBlah commented Aug 11, 2016

I'm using a Unix machine, sorry. My dll would be useless.
Try this one instead: #181 it's in a comment of Scotty

@jangeja
Copy link
Author

jangeja commented Aug 11, 2016

@dnsBlah how are you using a proxy? When I use a proxy it doesn't return and forts or Pokemon

@EasonPai
Copy link

EasonPai commented Aug 11, 2016

@dnsBlah
I found it here,
its working and i am getting a lot data of get_map_objects now, thanks bro

@dnsBlah
Copy link

dnsBlah commented Aug 11, 2016

ow nice!

@Jacopo1891
Copy link

Jacopo1891 commented Oct 3, 2016

On Ubuntu 16.04, with last update.
I still have this problem. Following #191 (comment) i do not solved.
Trying with app.activate_signature("encrypt.so") still not work:

Traceback (most recent call last):
File "spiral_poi_search.py", line 235, in
main()
File "spiral_poi_search.py", line 147, in main
api.activate_signature("/usr/local/lib/encrypt.dll")
File "/usr/local/lib/python2.7/dist-packages/pgoapi-1.1.6-py2.7.egg/pgoapi/pgoapi.py", line 90, in getattr
raise AttributeError
AttributeError

Any solution?

@ajvish91
Copy link

I am getting empty cells as well. Even after different combinations of radius, GPS coords and delay. Here is roughly how the output looks like:
[{'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211176005566464L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211154530729984L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211156678213632L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211167415631872L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211169563115520L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211171710599168L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211173858082816L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211158825697280L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211160973180928L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211163120664576L}, {'current_timestamp_ms': 1478832280274L, 's2_cell_id': 3592211165268148224L}]
`

Why am I not able to get a single wild pokemon??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests