not working: IOTP printer (raspberry pi) version and twitter

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
lichtschilder
 
Posts: 36
Joined: Fri Jan 03, 2014 8:11 am

not working: IOTP printer (raspberry pi) version and twitter

Post by lichtschilder »

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

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: not working: IOTP printer (raspberry pi) version and twi

Post by adafruit_support_mike »

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.

User avatar
lichtschilder
 
Posts: 36
Joined: Fri Jan 03, 2014 8:11 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by lichtschilder »

Hello Mike,

Thanks, we would like tot make thuis one work!

Anything i can do to help and solve this issue ?

User avatar
lichtschilder
 
Posts: 36
Joined: Fri Jan 03, 2014 8:11 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by lichtschilder »

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.
Hi Mike,

What's the way to move now?
Forward and than?

M

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by pburgess »

Try running The twitter script alone from the command line, e.g.:

Code: Select all

python twitter.py
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.

User avatar
lichtschilder
 
Posts: 36
Joined: Fri Jan 03, 2014 8:11 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by lichtschilder »

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

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by pburgess »

lichtschilder wrote:The issue i see now that the script repeats to print already printed tweets
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).

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...

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by pburgess »

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).

User avatar
lichtschilder
 
Posts: 36
Joined: Fri Jan 03, 2014 8:11 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by lichtschilder »

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

User avatar
lichtschilder
 
Posts: 36
Joined: Fri Jan 03, 2014 8:11 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by lichtschilder »

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.. :)

User avatar
lichtschilder
 
Posts: 36
Joined: Fri Jan 03, 2014 8:11 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by lichtschilder »

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?

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by pburgess »

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?

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by pburgess »

Please see this other thread for a possible fix:
http://forums.adafruit.com/viewtopic.ph ... 45#p243748

User avatar
lichtschilder
 
Posts: 36
Joined: Fri Jan 03, 2014 8:11 am

Re: not working: IOTP printer (raspberry pi) version and twi

Post by lichtschilder »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”