jxmorris12 / PokemonGo-Finder

Live visualization of all the pokemon in your area... and more!
GNU General Public License v3.0
171 stars 43 forks source link

Loop stopping data collection issue persists. #16

Closed HMPoweredMan closed 7 years ago

HMPoweredMan commented 7 years ago

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Your Environment

padenshorey commented 7 years ago

Yep I just tested again and after about 20 minutes, Pokemon were no longer being received from the server.

renzy commented 7 years ago

try changing the get_token function in main.py from....

if global_token is None:
    if service == 'ptc':
        global_token = login_ptc(username, password)
    else:
        global_token = login_google(username, password)
    return global_token
else:
    return global_token

to just...

if service == 'ptc':
    global_token = login_ptc(username, password)
else:
    global_token = login_google(username, password)
return global_token

been running for about a half hour although there is probably a better solution

xcheneric commented 7 years ago

Just to be sure I'd say if you're good after an hour or two then it's fixed. What's your step distance at?

On Thu, Jul 21, 2016, 11:02 PM Aaron Renzelmann notifications@github.com wrote:

try changing the get_token function in main.py from....

if global_token is None: if service == 'ptc': global_token = login_ptc(username, password) else: global_token = login_google(username, password) return global_token else: return global_token

to just...

if service == 'ptc': global_token = login_ptc(username, password) else: global_token = login_google(username, password) return global_token

been running for about a half hour although there is probably a better solution

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jxmorris12/PokemonGo-Finder/issues/16#issuecomment-234461584, or mute the thread https://github.com/notifications/unsubscribe-auth/AKi2EQz8zyjy5sL4JRGMldj6B1f_NT4Cks5qYFzpgaJpZM4JSZoh .

renzy commented 7 years ago

jk i dont think that worked.

renzy commented 7 years ago

@xcheneric i have it at 5. it looks like in the process_step function its hitting the except AttributeError and breaking. someone more skilled in python might be able to figure this out a lot quicker than me hah. but thats what ive got so far

HMPoweredMan commented 7 years ago

Personally, there's no point in having notifications if this can't run longer than 30 minutes. renzy appears to be correct that it is hitting that attribute error. I replaced the

    except AttributeError:
        break

with

        except AttributeError:
            pass

and it seems to be working. I'll check back after lunch.

Nevermind: I'm done. The parent repo seems to be way different at this point.

renzy commented 7 years ago

@HMPoweredMan nice! i actually just grabbed the example.py source from https://github.com/AHAAAAAAA/PokemonGo-Map and copied the get_args function from this repo and have it running now, can check back in if it works.

on that other repo, the last commit to the example.py file was "fix script failing after 30 min or so problem" so whatever the diffs are between that file and the main.py in this repo are would clear things up too.

HMPoweredMan commented 7 years ago

@renzy That works, but you'll have to figure out how to re-add the notification bit to your updated main.py

reactortrip commented 7 years ago

There was some changes to the fullmap_template.html from that fix, not sure if it impacts this though.

renzy commented 7 years ago

@HMPoweredMan yeah i just imported notifier & added after pokemons[poke.SpawnPointId] in the for loop...

if hasattr(pokemons, poke.SpawnPointId)==False:
    notifier.pokemon_found(pokemons[poke.SpawnPointId]) 
endeavor7 commented 7 years ago

if you comment out @memoize from main.py, it starts a new login every time it loops, which seems to solve the problem.

renzy commented 7 years ago

@endeavor7 ahhh, thank you. that makes sense

jxmorris12 commented 7 years ago

Merged new AHAAAAAAAA updates

renzy commented 7 years ago

@jxmorris12 good man, thank you!

friend of mine is running this too on a windows box, i think he was having encoding issues within notifier.py. im not sure if this made any difference but right after the reload(sys) should sys.setdefaultencoding('utf8') be sys.setdefaultencoding('utf-8') ..? running fine on my ubuntu boxes, so idk i dont really have a way to test.

reactortrip commented 7 years ago

I have the new version working, still stops functioning after 30 minutes.

HMPoweredMan commented 7 years ago

It's allegedly fixed in the develope branch of the parent. Something to do with API token expirinf

paperc07 commented 7 years ago

yeah it still stops after about 30 mins