Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Loop stopping data collection issue persists. #16

Closed
HMPoweredMan opened this issue Jul 22, 2016 · 17 comments
Closed

Loop stopping data collection issue persists. #16

HMPoweredMan opened this issue Jul 22, 2016 · 17 comments

Comments

@HMPoweredMan
Copy link

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Python 2.7):
  • Operating System and version (desktop or mobile):
@padenshorey
Copy link

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

@renzy
Copy link

renzy commented Jul 22, 2016

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
Copy link

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
#16 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKi2EQz8zyjy5sL4JRGMldj6B1f_NT4Cks5qYFzpgaJpZM4JSZoh
.

@renzy
Copy link

renzy commented Jul 22, 2016

jk i dont think that worked.

@renzy
Copy link

renzy commented Jul 22, 2016

@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
Copy link
Author

HMPoweredMan commented Jul 22, 2016

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
Copy link

renzy commented Jul 22, 2016

@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
Copy link
Author

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

@reactortrip
Copy link

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

@renzy
Copy link

renzy commented Jul 22, 2016

@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
Copy link

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

@renzy
Copy link

renzy commented Jul 22, 2016

@endeavor7 ahhh, thank you. that makes sense

@jxmorris12
Copy link
Owner

Merged new AHAAAAAAAA updates

@renzy
Copy link

renzy commented Jul 22, 2016

@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
Copy link

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

@HMPoweredMan
Copy link
Author

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

@paperc07
Copy link

yeah it still stops after about 30 mins

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

No branches or pull requests

8 participants