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

Syno OK Docker OK Rpi KO ??? #3

Closed
l0ghan opened this issue Jan 27, 2019 · 9 comments
Closed

Syno OK Docker OK Rpi KO ??? #3

l0ghan opened this issue Jan 27, 2019 · 9 comments

Comments

@l0ghan
Copy link

l0ghan commented Jan 27, 2019

Bonjour,

J'ai installé le programme python sur le synology -> parfait
J'ai dockerisé le programme -> parfait

Je viens de l'installer sur Raspberry pi et j'ai cette erreur :

2019-01-27 22:31:14,355 logging in InfluxDB Server Host 192.168.0.253...
2019-01-27 22:31:14,361 logged in InfluxDB Server Host 192.168.0.253 succesfully
2019-01-27 22:31:14,362 logging in Enedis URI https://espace-client-particuliers.enedis.fr/group/espace-particuliers...
2019-01-27 22:31:14,934 logged in successfully!
Traceback (most recent call last):
File "linkynflux.py", line 93, in
firstTS = _getStartTS(args.days)
File "linkynflux.py", line 48, in _getStartTS
return date.astimezone(tz.tzutc()).timestamp()
ValueError: astimezone() cannot be applied to a naive datetime

Du coup je ne comprend pas pkoi j'ai un comportement different sachant que j'ai fait les memes installations...une idée ?

Merci encore pour le boulot accompli :)
ju

@beufanet
Copy link
Owner

Python2 ? ou Python3 ?

@l0ghan
Copy link
Author

l0ghan commented Jan 28, 2019

pi@raspberrypi:~ $ python3 --version
Python 3.5.3

@djerfy
Copy link

djerfy commented Jan 29, 2019

@l0ghan ça te donne quoi si tu retourne la commande date simplement ?

J'avais eu quelques soucis similaires sur un autre projet, un lien qui peut être utile https://techblog.thescore.com/2015/11/03/timezones-in-python/

@beufanet
Copy link
Owner

beufanet commented Feb 7, 2019

bug trouvé ou pas ?

@l0ghan
Copy link
Author

l0ghan commented Feb 9, 2019

non j'ai essayé de modifier le code mais tjs la meme erreur je me demande si il n,y a pas un soucis avec les "variables d'environnement" par defaut de l'image rasbian sachant que j'ai fait une reinstall ..

@djerfy
Copy link

djerfy commented Feb 9, 2019

J'ai un doute sur le fait que ça vienne d'une simple variable d'environnement. Je pense soit à la version de Python, soit au timezone utilisé. Un truc assez rapide à tester si tu veux (à faire en root) :

mv /etc/localtime /etc/localtime.old
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime

@l0ghan
Copy link
Author

l0ghan commented Feb 10, 2019

Apres les modifs que tu as suggéré @djerfy :
(pour info j'avais regénéré le timezone avec le "raspi-config" aussi ca n'avait pas marché :

root@raspberrypi:/home/pi/linkyndle# python3 linkynflux.py --days=16
2019-02-10 13:36:02,956 logging in InfluxDB Server Host 192.168.0.253...
2019-02-10 13:36:02,962 logged in InfluxDB Server Host 192.168.0.253 succesfully
2019-02-10 13:36:02,963 logging in Enedis URI https://espace-client-particuliers.enedis.fr/group/espace-particuliers...
2019-02-10 13:36:03,020 Starting new HTTPS connection (1): espace-client-connexion.enedis.fr
2019-02-10 13:36:03,448 https://espace-client-connexion.enedis.fr:443 "POST /auth/UI/Login HTTP/1.1" 302 0
2019-02-10 13:36:03,469 logged in successfully!
Traceback (most recent call last):
File "linkynflux.py", line 93, in
firstTS = _getStartTS(args.days)
File "linkynflux.py", line 48, in _getStartTS
return date.astimezone(tz.tzutc()).timestamp()
ValueError: astimezone() cannot be applied to a naive datetime

@beufanet
Copy link
Owner

beufanet commented Apr 3, 2019

Est ce que tu as trouvé une solution ?

@l0ghan
Copy link
Author

l0ghan commented Apr 18, 2019

non je suis parti sur une autre façon de faire du coup.
merci

@l0ghan l0ghan closed this as completed Apr 18, 2019
beufanet pushed a commit that referenced this issue Jul 6, 2019
add posibility to last the script via --last
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

3 participants