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

python 3 versus 2 #2

Open
kyussinchains opened this issue Jan 31, 2020 · 2 comments
Open

python 3 versus 2 #2

kyussinchains opened this issue Jan 31, 2020 · 2 comments

Comments

@kyussinchains
Copy link

Hello Daniel,

Your work has been a godsend! I'm trying to replicate what you've done almost exactly, however I'm having the issue that the start.py code throws up an error when run in python 2, but runs happily in python 3, however when I set GPS mode, the GPS code only runs in python 2.....

any suggestions?

@JarvisSan22
Copy link
Owner

Hi kyussinchains

Thanks for your message.
I checked over the code for the GPS and there was few python 2 formatted prints I have updated, but also think the issue may come from the "run" functions in GPS2.py

def run(self):
global gpsd
while gpsp.running:
gpsd.next() #this will continue to loop and grab EACH set of gpsd info to clear the buffer

After a quick check, the issue may by the .next() command not working in python3 the same was as python2
https://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html

Sadly I currently don't have an RPI3 at hand to test the code. Could you please test if its this is the cause?

kind regards
Daniel Jarvis

@kyussinchains
Copy link
Author

kyussinchains commented Feb 4, 2020

Hi Daniel,

I tried the new version and I am running up against the same error, the issue seems to be that there is no gps header to import under python 3, so the main start.py code runs under python 3 (I get various struct.unpack errors under python 2) but the GPS code runs under python 2, it seems both will run independently, but not together.... have you managed to get the code running in GPS mode during your testing?

best regards
Simon

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

2 participants