TypeError: __init__() got an unexpected keyword argument 'timeout'

629 views
Skip to first unread message

Robert Atkin

unread,
Oct 14, 2016, 8:19:44 AM10/14/16
to pywws
Hello Jim and all

I've been using pywws on my Raspberry Pi with a Maplin N96FY since September 2013. On Tuesday I was notified by Weather Underground that my station had stopped reporting. I was getting IOError: pywws.device_cython_hidapi.USBDevice.write_data failed errors.

Since then I've updated the software and firmware. Reset the weather station control box batteries. Tried powered USB hub. Installed the latest pywws. Installed pyusb(?).

I now get: 

12:46:29:pywws.Logger:pywws version 16.08.0, build 1361 (ca4543e)

12:46:29:pywws.Logger:Python version 2.7.3 (default, Jun 22 2016, 03:14:32) 

[GCC 4.6.3]

12:46:29:pywws.WeatherStation.CUSBDrive:using pywws.device_pyusb

12:46:33:pywws.DataLogger:Synchronising to weather station

12:46:33:pywws.weather_station:read period 1

12:46:33:pywws.weather_station:delay 0, pause 13.1883

12:46:47:pywws.weather_station:delay 0, pause 0.5

12:46:47:pywws.weather_station:avoid 5.7889008522

12:46:53:pywws.weather_station:avoid 5.13664507866

12:46:59:pywws.weather_station:live_data new data

12:46:59:pywws.DataLogger:Reading time 11:46:50

12:46:59:pywws.DataLogger:log time 11:45:56

12:46:59:pywws.DataLogger:Fetching data

12:47:00:pywws.weather_station:_read_block changing 000080

12:47:00:pywws.weather_station:_read_block changing 000080

12:47:00:pywws.Process:Generating summary data

12:47:00:pywws.Calib:Using default calibration

12:47:01:pywws.Process:unexpected data interval 2016-10-14 04:11:56 0:03:00

12:47:01:pywws.Process:unexpected data interval 2016-10-14 11:36:15 1:04:19

12:47:01:pywws.Process:daily: 2016-10-13 09:00:00

12:47:01:pywws.Process:daily: 2016-10-14 09:00:00

12:47:01:pywws.Process:monthly: 2016-10-01 09:00:00

12:47:01:pywws.Tasks.RegularTasks:Deprecated twitter entry in [hourly]

12:47:02:pywws.ToTwitter:Using python-twitter library

Traceback (most recent call last):

  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main

    "__main__", fname, loader, pkg_name)

  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code

    exec code in run_globals

  File "/usr/local/lib/python2.7/dist-packages/pywws/Hourly.py", line 111, in <module>

    sys.exit(main())

  File "/usr/local/lib/python2.7/dist-packages/pywws/Hourly.py", line 108, in main

    return Hourly(args[0])

  File "/usr/local/lib/python2.7/dist-packages/pywws/Hourly.py", line 79, in Hourly

    hourly_data, daily_data, monthly_data).do_tasks():

  File "/usr/local/lib/python2.7/dist-packages/pywws/Tasks.py", line 340, in do_tasks

    self._do_common(sections)

  File "/usr/local/lib/python2.7/dist-packages/pywws/Tasks.py", line 226, in _do_common

    self.do_twitter(template)

  File "/usr/local/lib/python2.7/dist-packages/pywws/Tasks.py", line 388, in do_twitter

    self.twitter = ToTwitter.ToTwitter(self.params)

  File "/usr/local/lib/python2.7/dist-packages/pywws/ToTwitter.py", line 141, in __init__

    key, secret, latitude, longitude, timeout)

  File "/usr/local/lib/python2.7/dist-packages/pywws/ToTwitter.py", line 96, in __init__

    timeout=timeout)

TypeError: __init__() got an unexpected keyword argument 'timeout'


I've also upgraded python-twitter.

I've tried the SD card in a different Raspberry Pi. I've tried the Weather Station plugged into a Macbook and it reported fine into a different app.


Any help please for what to try next.


Thanks


Robert

http://www.cheltenhamweather.net/


Jim Easterbrook

unread,
Oct 14, 2016, 8:31:06 AM10/14/16
to py...@googlegroups.com
On 14/10/16 13:01, Robert Atkin wrote:
>
> I now get:
> 12:46:29:pywws.Logger:pywws version 16.08.0, build 1361 (ca4543e)
> 12:46:29:pywws.Logger:Python version 2.7.3 (default, Jun 22 2016, 03:14:32)
> [GCC 4.6.3]
> 12:46:29:pywws.WeatherStation.CUSBDrive:using pywws.device_pyusb

Good, it's using pyusb.

> 12:47:01:pywws.Tasks.RegularTasks:Deprecated twitter entry in [hourly]

You should edit weather.ini and change the twitter configuration. See
http://pywws.readthedocs.io/en/latest/guides/twitter.html#add-twitter-updates-to-your-hourly-tasks

> 12:47:02:pywws.ToTwitter:Using python-twitter library
> Traceback (most recent call last):
[snip]
> File "/usr/local/lib/python2.7/dist-packages/pywws/Tasks.py", line
> 388, in do_twitter
> self.twitter = ToTwitter.ToTwitter(self.params)
> File "/usr/local/lib/python2.7/dist-packages/pywws/ToTwitter.py", line
> 141, in __init__
> key, secret, latitude, longitude, timeout)
> File "/usr/local/lib/python2.7/dist-packages/pywws/ToTwitter.py", line
> 96, in __init__
> timeout=timeout)
> TypeError: __init__() got an unexpected keyword argument 'timeout'
>
> I've also upgraded python-twitter.

What version have you upgraded to? It needs to be at least version 2.1.
Use 'pip list' to see what you've got installed.
--
Jim Easterbrook <http://www.jim-easterbrook.me.uk/>
Message has been deleted

Robert Atkin

unread,
Oct 14, 2016, 4:09:59 PM10/14/16
to pywws
Thanks Jim

I've amended the twitter configuration inn weather.ini
I also found I had to change a lot of templates from Wind: #wind_dir "%s, " "" "wind_dir_text[x]"# to Wind: #wind_dir "%s, " "" "winddir_text(x)"#
I missed the change of [] to () initially.
I had python-twitter 1.3.1
I upgraded using sudo pip install python-twitter==2.2 
Incidentally pip list didn't work, but pip freeze did.
I found a few more templates to amend.

But then... success!!

It's lost two days of data because of taking the batteries out. But in three years of recording that's not bad.

Thanks for your help.

Robert
Reply all
Reply to author
Forward
0 new messages