Weewx and twitter

91 views
Skip to first unread message

Andrey Mihaylov

unread,
Apr 1, 2022, 8:19:22 AM4/1/22
to weewx-user
Hello Guys, 

all day im trying to make my weather station to report data to twitter but without success. Something is wrong with the credentials and really don't know what.  I created APP at developer.twitter.com, OAuth 1.0a is set with permissions Read and write, callback uri is http://localhost, access token and Secret are added into weewx.conf, but still same error in the log . 

 ERROR weewx.restx: Twitter: Failed to publish record 2022-04-01 14:55:00 EEST (1648814100): Authorization failed: Twitter API returned a 401 (Unauthorized), Invalid or expired token.

[[Twitter]]

        oauth_token_secret = Access Secret

        oauth_token = Access Token

        app_key_secret = API Key

        app_key = API Secret 

 
what can be wrong ? 

Thanks, 

A, 

Twitter Developers.png


Andrey Mihaylov

unread,
Apr 4, 2022, 5:47:56 AM4/4/22
to weewx...@googlegroups.com
 I have made some progress, but  now Ascii encoding issue appears. 

how this could be fixed?

thanks, 


Apr  4 12:35:41 neo-rp1 weewx[7933] ERROR weewx.restx: Twitter: Unexpected exception of type <type 'exceptions.UnicodeEncodeError'>
Apr  4 12:35:42 neo-rp1 weewx[7933] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras', 'weewx.cheetahgenerator.JSONHelpers', u'user.forecast.ForecastVariables']
Apr  4 12:35:42 neo-rp1 weewx[7933] ERROR weewx.restx: *** Traceback (most recent call last):
Apr  4 12:35:42 neo-rp1 weewx[7933] ERROR weewx.restx: ***   File "/usr/share/weewx/weewx/restx.py", line 381, in run_loop
Apr  4 12:35:42 neo-rp1 weewx[7933] ERROR weewx.restx: ***     self.process_record(_record, dbmanager)
Apr  4 12:35:42 neo-rp1 weewx[7933] ERROR weewx.restx: ***   File "/usr/share/weewx/user/twitter.py", line 322, in process_record
Apr  4 12:35:42 neo-rp1 weewx[7933] ERROR weewx.restx: ***     (ntries, self.max_tries, e))
Apr  4 12:35:42 neo-rp1 weewx[7933] ERROR weewx.restx: *** UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 172: ordinal not in range(128)
Apr  4 12:35:42 neo-rp1 weewx[7933] CRITICAL weewx.restx: Twitter: Thread terminating. Reason: 'ascii' codec can't encode character u'\u2019' in position 172: ordinal not in range(128)


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/00340311-9214-44e2-b58d-fb7cee0b8675n%40googlegroups.com.

Tom Keffer

unread,
Apr 4, 2022, 8:28:40 AM4/4/22
to weewx-user
Hello,

A couple questions:

What version of the twitter uploader are you using? You want v0.15.

What version of Python are you using?


Andrey Mihaylov

unread,
Apr 4, 2022, 9:11:54 AM4/4/22
to weewx...@googlegroups.com
Hello, 

Twitter uploader is twython==3.7.0
on Python 2.7.





Tom Keffer

unread,
Apr 4, 2022, 10:00:10 AM4/4/22
to weewx-user
Sorry. What we need is the version of the twitter uploader. Look in file bin/user/twitter.py for a line that looks something like

VERSION = "0.15"

If it's a lesser version, the first thing I'd try is upgrading to V0.15

-tk


Andrey Mihaylov

unread,
Apr 4, 2022, 1:13:14 PM4/4/22
to weewx...@googlegroups.com
yes,  the version is 0.15   


Reply all
Reply to author
Forward
0 new messages