IOTP printer (raspberry pi) version and twitter.py
Anyone here who has built the current release of the IOTP raspberry pi printer and was able to make the twitter-script work properly?
printer instructions: http://learn.adafruit.com/pi-thermal-printer?view=all
as i am new to the python and not sure how to debug this properly i am looking for some experience here.
i have started a topic here and no official adafruit responses yet.
therefore i am wondering if there are users on this forum which have managed to make this printer work with the provided scripts? https://github.com/adafruit/Python-Thermal-Printer for the offical sources
not working: IOTP printer (raspberry pi) version and twitter
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- lichtschilder
- Posts: 36
- Joined: Fri Jan 03, 2014 8:11 am
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: not working: IOTP printer (raspberry pi) version and twi
The Twitter script is a bit of a problem child.. when it works it's great, but it's known to generate obscure problems.
Let me forward this to our IOTP guru.
Let me forward this to our IOTP guru.
- lichtschilder
- Posts: 36
- Joined: Fri Jan 03, 2014 8:11 am
Re: not working: IOTP printer (raspberry pi) version and twi
Hello Mike,
Thanks, we would like tot make thuis one work!
Anything i can do to help and solve this issue ?
Thanks, we would like tot make thuis one work!
Anything i can do to help and solve this issue ?
- lichtschilder
- Posts: 36
- Joined: Fri Jan 03, 2014 8:11 am
Re: not working: IOTP printer (raspberry pi) version and twi
Hi Mike,adafruit_support_mike wrote:The Twitter script is a bit of a problem child.. when it works it's great, but it's known to generate obscure problems.
Let me forward this to our IOTP guru.
What's the way to move now?
Forward and than?
M
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: not working: IOTP printer (raspberry pi) version and twi
Try running The twitter script alone from the command line, e.g.:
See if it crashes and burns. If so, please copy-and-paste the error traceback, that should give some indication of the source of the trouble.
99% of the time it'll be the consumer key and secret. If at all humanly possible, access the Pi via ssh, copy and paste the exact strings from the Twitter developer page rather than trying to type them manually. Lots of fiddly case-sensitive stuff.
Code: Select all
python twitter.py
99% of the time it'll be the consumer key and secret. If at all humanly possible, access the Pi via ssh, copy and paste the exact strings from the Twitter developer page rather than trying to type them manually. Lots of fiddly case-sensitive stuff.
- lichtschilder
- Posts: 36
- Joined: Fri Jan 03, 2014 8:11 am
Re: not working: IOTP printer (raspberry pi) version and twi
Hello,
I have rebuild a complete image, this made the system worm, including a manual run of the Twitter.
The issue i see now that the script repeats to print already printed tweets (the last three get repeated) in 8 hours this wastes a lot of paper any suggestions tot fix this?
M
I have rebuild a complete image, this made the system worm, including a manual run of the Twitter.
The issue i see now that the script repeats to print already printed tweets (the last three get repeated) in 8 hours this wastes a lot of paper any suggestions tot fix this?
M
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: not working: IOTP printer (raspberry pi) version and twi
Ah crud. This was a problem that also plagued the Arduino version. Turns out it's a coin toss whether the Twitter server returns the max tweet ID # along with the results...usually does, but not always (THANKS, TWITTER).lichtschilder wrote:The issue i see now that the script repeats to print already printed tweets
Anyway, the fix will require picking through each tweet and comparing the ID #, keeping track of the max that way. Thought this was already done in this code, but apparently not...I'll work on it...
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: not working: IOTP printer (raspberry pi) version and twi
Updated twitter script on Github:
https://github.com/adafruit/Python-Ther ... twitter.py
Other files haven't changed; you should only need that one. Don't forget to copy & paste your consumer key & secret from your prior copy of the script. Let me know if that clears it up (and if it still prints new tweets).
https://github.com/adafruit/Python-Ther ... twitter.py
Other files haven't changed; you should only need that one. Don't forget to copy & paste your consumer key & secret from your prior copy of the script. Let me know if that clears it up (and if it still prints new tweets).
- lichtschilder
- Posts: 36
- Joined: Fri Jan 03, 2014 8:11 am
Re: not working: IOTP printer (raspberry pi) version and twi
Thanks for the new version, have installed this version now, will test this today and let you know!
there is another issue with the timetemp.py which i cannot find a way to solve:
i do live in europe, and therefore would like to change the temperature to Celcius, i fixed this in the forecast.py by changeing (adding) a parameter to the api-call for the weather:
# Fetch forecast data from Yahoo!, parse resulting XML
dom = parseString(urllib.urlopen(
'http://weather.yahooapis.com/forecastrss?u=c&w=' + WOEID).read())
however when i repeat this in the timetemp.py, the scrip hickups because the wind-speed changes from 7 to 11.34 and this last value isn't supported in the script, do you have any suggestions for this issue?
the temperature seems ok, but as the other options are being parsed the press of the button doesn't work anymore.
M
there is another issue with the timetemp.py which i cannot find a way to solve:
i do live in europe, and therefore would like to change the temperature to Celcius, i fixed this in the forecast.py by changeing (adding) a parameter to the api-call for the weather:
# Fetch forecast data from Yahoo!, parse resulting XML
dom = parseString(urllib.urlopen(
'http://weather.yahooapis.com/forecastrss?u=c&w=' + WOEID).read())
however when i repeat this in the timetemp.py, the scrip hickups because the wind-speed changes from 7 to 11.34 and this last value isn't supported in the script, do you have any suggestions for this issue?
the temperature seems ok, but as the other options are being parsed the press of the button doesn't work anymore.
M
- lichtschilder
- Posts: 36
- Joined: Fri Jan 03, 2014 8:11 am
Re: not working: IOTP printer (raspberry pi) version and twi
oops:
second question for the twitter.py, how can i add the textwrap-feature while printing? the words now get cut-off not too nice..
second question for the twitter.py, how can i add the textwrap-feature while printing? the words now get cut-off not too nice..
- lichtschilder
- Posts: 36
- Joined: Fri Jan 03, 2014 8:11 am
Re: not working: IOTP printer (raspberry pi) version and twi
I am Sorry to write this but my printer has been reprinting the last received tweets about 10 times in the last 10 hours
Anything I can do here to help debug this?
Anything I can do here to help debug this?
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: not working: IOTP printer (raspberry pi) version and twi
This is with the most recently-posted code, with the supposed fix?
Shoot, I'm stumped at the moment. Let me dig through the code a little and see if I can spot any dubious goings-on.
It's not a complete reset (with the greeting cloud image and everything), right? Just the tweets?
Shoot, I'm stumped at the moment. Let me dig through the code a little and see if I can spot any dubious goings-on.
It's not a complete reset (with the greeting cloud image and everything), right? Just the tweets?
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: not working: IOTP printer (raspberry pi) version and twi
Please see this other thread for a possible fix:
http://forums.adafruit.com/viewtopic.ph ... 45#p243748
http://forums.adafruit.com/viewtopic.ph ... 45#p243748
- lichtschilder
- Posts: 36
- Joined: Fri Jan 03, 2014 8:11 am
Re: not working: IOTP printer (raspberry pi) version and twi
indeed it's only reprinting already printed tweets, for the last day about 4 times, have just patched the code with the commenting and adding some code as mentioned in the other topic.
againg sorry about the time diffence, makes responding properly a bit more difficult!
M
againg sorry about the time diffence, makes responding properly a bit more difficult!
M
Please be positive and constructive with your questions and comments.