From 4aadd022b3eedbc612889bc5f355d5031060d3de Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Sun, 15 Sep 2013 09:40:18 +0100 Subject: [PATCH 01/40] Updated for local weather --- forecast.py | 2 +- timetemp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/forecast.py b/forecast.py index d985497..6d8489b 100755 --- a/forecast.py +++ b/forecast.py @@ -23,7 +23,7 @@ # by 'manually' visiting http://weather.yahoo.com, entering a location # and requesting a forecast, then copy the number from the end of the # current URL string and paste it here. -WOEID = '2459115' +WOEID = '34918' # Dumps one forecast line to the printer def forecast(idx): diff --git a/timetemp.py b/timetemp.py index 2835782..8a16989 100755 --- a/timetemp.py +++ b/timetemp.py @@ -23,7 +23,7 @@ # by 'manually' visiting http://weather.yahoo.com, entering a location # and requesting a forecast, then copy the number from the end of the # current URL string and paste it here. -WOEID = '2459115' +WOEID = '34918' # Fetch weather data from Yahoo!, parse resulting XML dom = parseString(urllib.urlopen( From 1a7fe1fe42f6904e8c7ef4d7ea8f8c99d29b1b32 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Sun, 15 Sep 2013 09:46:54 +0100 Subject: [PATCH 02/40] Reduced heat time to stop jamming --- Adafruit_Thermal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adafruit_Thermal.py b/Adafruit_Thermal.py index f5e5162..c9b7bcc 100644 --- a/Adafruit_Thermal.py +++ b/Adafruit_Thermal.py @@ -50,7 +50,7 @@ class Adafruit_Thermal(Serial): lineSpacing = 8 barcodeHeight = 50 printMode = 0 - defaultHeatTime = 60 + defaultHeatTime = 45 def __init__(self, *args, **kwargs): # If no parameters given, use default port & baud rate. From 04aeeb433329be03c95eddbb3ab05a5001ea87e6 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Mon, 16 Sep 2013 09:05:42 +0100 Subject: [PATCH 03/40] More heat changes --- Adafruit_Thermal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Adafruit_Thermal.py b/Adafruit_Thermal.py index c9b7bcc..dc43ed3 100644 --- a/Adafruit_Thermal.py +++ b/Adafruit_Thermal.py @@ -103,7 +103,7 @@ def __init__(self, *args, **kwargs): 55, # 7 (print settings) 20, # Heat dots (20 = balance darkness w/no jams) heatTime, # Lib default = 45 - 250) # Heat interval (500 uS = slower but darker) + 500) # Heat interval (500 uS = slower but darker) # Description of print density from page 23 of the manual: # DC2 # n Set printing density @@ -214,7 +214,7 @@ def begin(self, heatTime=defaultHeatTime): 55, # 7 (print settings) 20, # Heat dots (20 = balance darkness w/no jams) heatTime, # Lib default = 45 - 250) # Heat interval (500 uS = slower but darker) + 500) # Heat interval (500 uS = slower but darker) def reset(self): From d3d935a31e0d28c71d865b93697c59520c48c51b Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Mon, 16 Sep 2013 12:06:45 +0100 Subject: [PATCH 04/40] Added printertest2.py, includes darker graphic print --- printertest2.py | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 printertest2.py diff --git a/printertest2.py b/printertest2.py new file mode 100644 index 0000000..a8c1cfc --- /dev/null +++ b/printertest2.py @@ -0,0 +1,88 @@ +#!/usr/bin/python + +from __future__ import print_function +from Adafruit_Thermal import * +import Image + +printer = Adafruit_Thermal("/dev/ttyAMA0", 19200, timeout=5) + +# Because the hello/goodbye images are overall fairly light, we can +# get away with using a darker heat time for these, then reset to the +# default afterward. +ht = printer.defaultHeatTime * 2 +if(ht > 255): ht = 255 + +printer.begin(ht) # Set temporary dark heat time +img = Image.open('gfx/hello.png') +printer.printImage(img, True) +printer.feed(3) +printer.begin() # Reset default heat time + +# Test inverse on & off +printer.inverseOn() +printer.println("Inverse ON") +printer.inverseOff() + +# Test character double-height on & off +printer.doubleHeightOn() +printer.println("Double Height ON") +printer.doubleHeightOff() + +# Set justification (right, center, left) -- accepts 'L', 'C', 'R' +printer.justify('R') +printer.println("Right justified") +printer.justify('C') +printer.println("Center justified") +printer.justify('L') +printer.println("Left justified") + +# Test more styles +printer.boldOn() +printer.println("Bold text") +printer.boldOff() + +printer.underlineOn() +printer.println("Underlined text") +printer.underlineOff() + +printer.setSize('L') # Set type size, accepts 'S', 'M', 'L' +printer.println("Large") +printer.setSize('M') +printer.println("Medium") +printer.setSize('S') +printer.println("Small") + +printer.justify('C') +printer.println("normal\nline\nspacing") +printer.setLineHeight(50) +printer.println("Taller\nline\nspacing") +printer.setLineHeight() # Reset to default +printer.justify('L') + +# Barcode examples +printer.feed(1) +# CODE39 is the most common alphanumeric barcode +printer.printBarcode("ADAFRUT", printer.CODE39) +printer.setBarcodeHeight(100) +# Print UPC line on product barcodes +printer.printBarcode("123456789123", printer.UPC_A) + +# Print the 75x75 pixel logo in adalogo.py +import gfx.adalogo as adalogo +printer.printBitmap(adalogo.width, adalogo.height, adalogo.data) + +# Print the 135x135 pixel QR code in adaqrcode.py +import gfx.adaqrcode as adaqrcode +printer.printBitmap(adaqrcode.width, adaqrcode.height, adaqrcode.data) +printer.println("Adafruit!") +printer.feed(1) + +printer.begin(ht) # Set temporary dark heat time +img = Image.open('gfx/goodbye.png') +printer.printImage(img, True) +printer.feed(3) +printer.begin() # Reset default heat time + +printer.sleep() # Tell printer to sleep +printer.wake() # Call wake() before printing again, even if reset +printer.setDefault() # Restore printer to defaults From 2b54d44eafca00ae0cbd5d4a324abc9d39756a74 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Mon, 16 Sep 2013 13:30:15 +0100 Subject: [PATCH 05/40] Changed heat settings, added x to printertest2.py --- Adafruit_Thermal.py | 4 ++-- printertest2.py | 0 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 printertest2.py diff --git a/Adafruit_Thermal.py b/Adafruit_Thermal.py index dc43ed3..c9b7bcc 100644 --- a/Adafruit_Thermal.py +++ b/Adafruit_Thermal.py @@ -103,7 +103,7 @@ def __init__(self, *args, **kwargs): 55, # 7 (print settings) 20, # Heat dots (20 = balance darkness w/no jams) heatTime, # Lib default = 45 - 500) # Heat interval (500 uS = slower but darker) + 250) # Heat interval (500 uS = slower but darker) # Description of print density from page 23 of the manual: # DC2 # n Set printing density @@ -214,7 +214,7 @@ def begin(self, heatTime=defaultHeatTime): 55, # 7 (print settings) 20, # Heat dots (20 = balance darkness w/no jams) heatTime, # Lib default = 45 - 500) # Heat interval (500 uS = slower but darker) + 250) # Heat interval (500 uS = slower but darker) def reset(self): diff --git a/printertest2.py b/printertest2.py old mode 100644 new mode 100755 From 6e8c61b94a9ead0cc6a7c77453d32cca14cebf57 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Mon, 16 Sep 2013 14:02:48 +0100 Subject: [PATCH 06/40] Added increased image heat settings --- main.py | 12 ++++++++++++ sudoku-gfx.py | 4 ++++ timetemp.py | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/main.py b/main.py index 4af3456..ffe513a 100755 --- a/main.py +++ b/main.py @@ -39,8 +39,12 @@ def tap(): # Called when button is held down. Prints image, invokes shutdown process. def hold(): GPIO.output(ledPin, GPIO.HIGH) + ht = printer.defaultHeatTime * 2 + if(ht > 255): ht = 255 + printer.begin(ht) # Set temporary dark heat time printer.printImage(Image.open('gfx/goodbye.png'), True) printer.feed(3) + printer.begin() # Reset default heat time subprocess.call("sync") subprocess.call(["shutdown", "-h", "now"]) GPIO.output(ledPin, GPIO.LOW) @@ -97,8 +101,16 @@ def daily(): exit(0) # Print greeting image +# Because the hello/goodbye images are overall fairly light, we can +# get away with using a darker heat time for these, then reset to the +# default afterward. +ht = printer.defaultHeatTime * 2 +if(ht > 255): ht = 255 + +printer.begin(ht) # Set temporary dark heat time printer.printImage(Image.open('gfx/hello.png'), True) printer.feed(3) +printer.begin() # Reset default heat time GPIO.output(ledPin, GPIO.LOW) # Poll initial button state and time diff --git a/sudoku-gfx.py b/sudoku-gfx.py index 91b5204..65cdf4d 100755 --- a/sudoku-gfx.py +++ b/sudoku-gfx.py @@ -43,6 +43,9 @@ def main(): puzzles = [makepuzzle(solution([None] * 81))] for puzzle in puzzles: printboard(puzzle) # Doesn't print, just modifies 'bg' image + ht = printer.defaultHeatTime * 2 + if(ht > 255): ht = 255 + printer.begin(ht) # Set temporary dark heat time printer.printImage(bg, True) # This does the printing printer.println("RATING:", ratepuzzle(puzzle, 4)) if len(args) > 0: @@ -52,6 +55,7 @@ def main(): if answer is None: printer.println("NO SOLUTION") else: printer.print(printboard(answer)) printer.feed(3) + printer.begin() # Reset default heat time def makepuzzle(board): puzzle = []; deduced = [None] * 81 diff --git a/timetemp.py b/timetemp.py index 8a16989..4902f6b 100755 --- a/timetemp.py +++ b/timetemp.py @@ -163,5 +163,9 @@ def numWidth(str, list): # Open connection to printer and print image printer = Adafruit_Thermal("/dev/ttyAMA0", 19200, timeout=5) +ht = printer.defaultHeatTime * 2 +if(ht > 255): ht = 255 +printer.begin(ht) # Set temporary dark heat time printer.printImage(img, True) printer.feed(3) +printer.begin() # Reset default heat time From d1d5e0cae228a4d0f69a8457e90fea838cdafc10 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Mon, 16 Sep 2013 14:08:55 +0100 Subject: [PATCH 07/40] Set sudoku to heattime of 60 --- sudoku-gfx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-gfx.py b/sudoku-gfx.py index 65cdf4d..5763e26 100755 --- a/sudoku-gfx.py +++ b/sudoku-gfx.py @@ -43,7 +43,7 @@ def main(): puzzles = [makepuzzle(solution([None] * 81))] for puzzle in puzzles: printboard(puzzle) # Doesn't print, just modifies 'bg' image - ht = printer.defaultHeatTime * 2 + ht = 60 if(ht > 255): ht = 255 printer.begin(ht) # Set temporary dark heat time printer.printImage(bg, True) # This does the printing From 91ea335fd70535f2cd3df9ecb4b56c0a26ef686a Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Mon, 16 Sep 2013 17:19:23 +0100 Subject: [PATCH 08/40] Modification to heat time --- sudoku-gfx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-gfx.py b/sudoku-gfx.py index 5763e26..08ff805 100755 --- a/sudoku-gfx.py +++ b/sudoku-gfx.py @@ -43,7 +43,7 @@ def main(): puzzles = [makepuzzle(solution([None] * 81))] for puzzle in puzzles: printboard(puzzle) # Doesn't print, just modifies 'bg' image - ht = 60 + ht = printer.defaultHeatTime + 15 if(ht > 255): ht = 255 printer.begin(ht) # Set temporary dark heat time printer.printImage(bg, True) # This does the printing From f6d212dcaf2968a60e738f79bc5f5631e5cfd526 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Mon, 16 Sep 2013 18:33:52 +0100 Subject: [PATCH 09/40] Increased startup delay to fix print issue on IP address --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index ffe513a..b222bb5 100755 --- a/main.py +++ b/main.py @@ -83,7 +83,7 @@ def daily(): # Processor load is heavy at startup; wait a moment to avoid # stalling during greeting. -time.sleep(30) +time.sleep(60) # Show IP address (if network is available) try: From dc4a805231de3bab45c3c56a1b78f392b43396c9 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Tue, 17 Sep 2013 10:52:20 +0100 Subject: [PATCH 10/40] Added multi twitter query example --- twitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitter.py b/twitter.py index 4b579d7..b73ceda 100755 --- a/twitter.py +++ b/twitter.py @@ -42,7 +42,7 @@ # boolean operators. See http://dev.twitter.com/docs/using-search # for options and syntax. Funny characters do NOT need to be URL # encoded here -- urllib takes care of that. -queryString = 'from:Adafruit' +queryString = 'from:Adafruit OR from:gizmodo' # Other globals. You probably won't need to change these. ----------------- From d4dbf696a19bf101b426bf99d04563bea094867d Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Tue, 17 Sep 2013 16:32:30 +0100 Subject: [PATCH 11/40] Wrap tweets neatly at 32 chars --- twitter.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/twitter.py b/twitter.py index b73ceda..aa92e31 100755 --- a/twitter.py +++ b/twitter.py @@ -27,7 +27,7 @@ # with dummy strings. from __future__ import print_function -import base64, HTMLParser, httplib, json, sys, urllib, zlib +import base64, HTMLParser, httplib, json, sys, urllib, zlib, textwrap from unidecode import unidecode from Adafruit_Thermal import * @@ -113,9 +113,11 @@ def issueRequestAndDecodeResponse(method, url, body, headers): # Remove HTML escape sequences # and remap Unicode values to nearest ASCII equivalents - printer.print(unidecode( - HTMLParser.HTMLParser().unescape(tweet['text']))) - + # Use textwrap module to wrap neatly at 32 characters + tweettext=textwrap.wrap(unidecode( + HTMLParser.HTMLParser().unescape(tweet['text'])),32) + for line in tweettext: + printer.print(line + "\n") printer.feed(3) print(data['search_metadata']['max_id_str']) # Piped back to calling process From ba445b315a9b36d078df4f9b43bebde150102814 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Wed, 18 Sep 2013 12:13:05 +0100 Subject: [PATCH 12/40] Load twitter key & secret from external files not pushed to GitHub --- twitter.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/twitter.py b/twitter.py index aa92e31..a1e4f2b 100755 --- a/twitter.py +++ b/twitter.py @@ -35,8 +35,22 @@ # Configurable globals. Edit to your needs. ------------------------------- # Twitter application credentials -- see notes above -- DO NOT SHARE. -consumer_key = 'PUT_YOUR_CONSUMER_KEY_HERE' -consumer_secret = 'PUT_YOUR_CONSUMER_SECRET_HERE' +# Have both key and secret set to load from file, makes my life easier pushing to GitHub +# Doesn't require the twitter-key & twitter-secret file; if you're not planning to share this file, just enter those details below +try: + file_key = open('/home/pi/twitter-key') + consumer_key = file_key.readline() +except: + consumer_key = 'PUT_YOUR_CONSUMER_KEY_HERE' +else: + file_key.close() +try: + file_secret = open('/home/pi/twitter-secret') + consumer_secret = file_secret.readline() +except: + consumer_secret = 'PUT_YOUR_CONSUMER_SECRET_HERE' +else: + file_secret.close() # queryString can be any valid Twitter API search string, including # boolean operators. See http://dev.twitter.com/docs/using-search From a8e7dc88fe417ac7a84ef2007c25166d39f45bf3 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 19 Sep 2013 04:22:43 +0100 Subject: [PATCH 13/40] Changed additional twitter search to my home server feed --- twitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitter.py b/twitter.py index a1e4f2b..6253485 100755 --- a/twitter.py +++ b/twitter.py @@ -56,7 +56,7 @@ # boolean operators. See http://dev.twitter.com/docs/using-search # for options and syntax. Funny characters do NOT need to be URL # encoded here -- urllib takes care of that. -queryString = 'from:Adafruit OR from:gizmodo' +queryString = 'from:Adafruit OR from:smarttube' # Other globals. You probably won't need to change these. ----------------- From 088ba00d623d3558b9a64e118b47c687794f0049 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 19 Sep 2013 08:24:43 +0100 Subject: [PATCH 14/40] Corrected reading key and secret from file, removing newline char --- twitter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twitter.py b/twitter.py index 6253485..1c0e31b 100755 --- a/twitter.py +++ b/twitter.py @@ -39,14 +39,14 @@ # Doesn't require the twitter-key & twitter-secret file; if you're not planning to share this file, just enter those details below try: file_key = open('/home/pi/twitter-key') - consumer_key = file_key.readline() + consumer_key = file_key.readline().rstrip('\n') except: consumer_key = 'PUT_YOUR_CONSUMER_KEY_HERE' else: file_key.close() try: file_secret = open('/home/pi/twitter-secret') - consumer_secret = file_secret.readline() + consumer_secret = file_secret.readline().rstrip('\n') except: consumer_secret = 'PUT_YOUR_CONSUMER_SECRET_HERE' else: From 8aedacc27c27c579e25fa9396cc7ce8b61af35b3 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 19 Sep 2013 08:44:07 +0100 Subject: [PATCH 15/40] Tested my server output, doesn't work with protected tweets --- twitter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/twitter.py b/twitter.py index 1c0e31b..1c5cfad 100755 --- a/twitter.py +++ b/twitter.py @@ -56,8 +56,7 @@ # boolean operators. See http://dev.twitter.com/docs/using-search # for options and syntax. Funny characters do NOT need to be URL # encoded here -- urllib takes care of that. -queryString = 'from:Adafruit OR from:smarttube' - +queryString = 'from:Adafruit OR from:SmartTube' # Other globals. You probably won't need to change these. ----------------- From 9febe2b2a8f59207a79d34cf570818bd468ca1ef Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 19 Sep 2013 10:48:00 +0100 Subject: [PATCH 16/40] Changed twitter search string --- twitter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/twitter.py b/twitter.py index 1c5cfad..76b764c 100755 --- a/twitter.py +++ b/twitter.py @@ -56,7 +56,8 @@ # boolean operators. See http://dev.twitter.com/docs/using-search # for options and syntax. Funny characters do NOT need to be URL # encoded here -- urllib takes care of that. -queryString = 'from:Adafruit OR from:SmartTube' +#queryString = 'from:Adafruit OR from:SmartTube' +queryString = 'from:SmartTube' # Other globals. You probably won't need to change these. ----------------- From 976cbdca67bd31fedf2af7b9ab4cca638ab66f60 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 19 Sep 2013 13:53:04 +0100 Subject: [PATCH 17/40] Added file for resize testing --- gfx/graph.png | Bin 0 -> 1723 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 gfx/graph.png diff --git a/gfx/graph.png b/gfx/graph.png new file mode 100644 index 0000000000000000000000000000000000000000..744745bf69e4f1ae8525b06f6d72f33a78533c19 GIT binary patch literal 1723 zcmV;s21NOZP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00006P)t-s|Ns900033O(|!N| z00Cl4M??UK1szBL004A)R9JLUVRs;Ka&Km7Y-J#Hd2nSQWq4_3004N}WsKbkz%U4e z-<_f(_>&qlj*u3*LC0@W6I#f@ad`R($9?KhmLhL&L00mV^L_t(|+U?xWj^i{K z0C3y&(r*SNd|U|$KEw;~0IS6_+5<<99OpqQun>ni@(BAVm3Wbg(;kbsa2wLZP2AM^ zWBVK8M*gJP$)@&ioZ3ztyA5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TC1FNa4g(lgn8Fk$kvTot zzGG4zbpDhT^D!reB;sa3{aHj^kjRMQ}9E#_1;tAynWcKJDc+L=5Waf z)opbL_*uKPamE>s?bf&b>%E`3Z@1n!j8n!jM*A{&+cuXY%+AXkeS5e2Vdl}xfTw#2 ziNlQW))aWUreq0>azKnfs4lDOAC%Ml{(9$QpnHpdX}5m(Zl6^rDp8_Di4rAB+;aQ} z3T?bv%g#a{0000bbVXQnWMOn=I%9HWVRU5xGB7bSEigGPF*#H*G&(gfIxsOSFfuwY zFy{bHQUCw|C3HntbYx+4WjbwdWNBu305UK!Gc7PVEipM%F*G_gFgh?WD=;!TFfcGG R{aOG3002ovPDHLkV1f{T`;Y(t literal 0 HcmV?d00001 From 59605e90a645ec4143c7c3a40a01a6472b461d7d Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Fri, 20 Sep 2013 08:19:06 +0100 Subject: [PATCH 18/40] Added secondary twitter feed --- twitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitter.py b/twitter.py index 76b764c..b4d1146 100755 --- a/twitter.py +++ b/twitter.py @@ -57,7 +57,7 @@ # for options and syntax. Funny characters do NOT need to be URL # encoded here -- urllib takes care of that. #queryString = 'from:Adafruit OR from:SmartTube' -queryString = 'from:SmartTube' +queryString = 'from:SmartTube OR from:SmartSouthWales' # Other globals. You probably won't need to change these. ----------------- From d3efbaaa60d54954e1e733c1067b53fc66764a67 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Mon, 23 Sep 2013 00:05:25 +0100 Subject: [PATCH 19/40] List of files to be ignored --- .gitignore | 4 ++++ gfx/.gitignore | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 .gitignore create mode 100644 gfx/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b808db --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# +# generated files +# +*.pyc diff --git a/gfx/.gitignore b/gfx/.gitignore new file mode 100644 index 0000000..1b808db --- /dev/null +++ b/gfx/.gitignore @@ -0,0 +1,4 @@ +# +# generated files +# +*.pyc From c0bde332747fffc537550ef7269c36c04e75a9fb Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Tue, 24 Sep 2013 13:36:18 +0100 Subject: [PATCH 20/40] Formatting --- twitter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/twitter.py b/twitter.py index b4d1146..a552f16 100755 --- a/twitter.py +++ b/twitter.py @@ -1,3 +1,4 @@ + #!/usr/bin/python # This is a Python port of Adafruit's "Gutenbird" sketch for Arduino. @@ -35,8 +36,10 @@ # Configurable globals. Edit to your needs. ------------------------------- # Twitter application credentials -- see notes above -- DO NOT SHARE. -# Have both key and secret set to load from file, makes my life easier pushing to GitHub -# Doesn't require the twitter-key & twitter-secret file; if you're not planning to share this file, just enter those details below +# Have both key and secret set to load from file, makes my life easier +# pushing to GitHub +# Doesn't require the twitter-key & twitter-secret file; if you're not +# planning to share this file, just enter those details below try: file_key = open('/home/pi/twitter-key') consumer_key = file_key.readline().rstrip('\n') From 17d46541a3f2b671b4176d1e6a89090607adbdba Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Fri, 27 Sep 2013 22:05:24 +0100 Subject: [PATCH 21/40] Added scratchpad --- sudoku-gfx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-gfx.py b/sudoku-gfx.py index 08ff805..00a8fb1 100755 --- a/sudoku-gfx.py +++ b/sudoku-gfx.py @@ -47,7 +47,7 @@ def main(): if(ht > 255): ht = 255 printer.begin(ht) # Set temporary dark heat time printer.printImage(bg, True) # This does the printing - printer.println("RATING:", ratepuzzle(puzzle, 4)) + printer.println("RATING:", ratepuzzle(puzzle, 4), " 1 2 3 4 5 6 7 8 9") if len(args) > 0: printer.println() printer.println("SOLUTION:") From 45ffc7375ced6eea5ab15f01074ad31ef05c493d Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Sat, 28 Sep 2013 04:46:28 +0100 Subject: [PATCH 22/40] Temp switched off twitter to save paper. Adjusted sudoku scratchpad --- sudoku-gfx.py | 2 +- twitter.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sudoku-gfx.py b/sudoku-gfx.py index 00a8fb1..9dde860 100755 --- a/sudoku-gfx.py +++ b/sudoku-gfx.py @@ -47,7 +47,7 @@ def main(): if(ht > 255): ht = 255 printer.begin(ht) # Set temporary dark heat time printer.printImage(bg, True) # This does the printing - printer.println("RATING:", ratepuzzle(puzzle, 4), " 1 2 3 4 5 6 7 8 9") + printer.println("RATING:", ratepuzzle(puzzle, 4), " 1 2 3 4 5 6 7 8 9") if len(args) > 0: printer.println() printer.println("SOLUTION:") diff --git a/twitter.py b/twitter.py index a552f16..3c47a7d 100755 --- a/twitter.py +++ b/twitter.py @@ -60,7 +60,8 @@ # for options and syntax. Funny characters do NOT need to be URL # encoded here -- urllib takes care of that. #queryString = 'from:Adafruit OR from:SmartTube' -queryString = 'from:SmartTube OR from:SmartSouthWales' +#queryString = 'from:SmartTube OR from:SmartSouthWales' +queryString = 'from:SmartArduino' # Other globals. You probably won't need to change these. ----------------- From 0be27aecf1e78154a43f89ebc0bab86f4f001398 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Tue, 8 Oct 2013 23:36:00 +0100 Subject: [PATCH 23/40] Addeded ignore for backup files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 1b808db..3367d69 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ # generated files # *.pyc +# +# temp files +# +*~ From 3d29e45a4f47a613f5c3005fe15a08da781388d4 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Tue, 8 Oct 2013 23:36:39 +0100 Subject: [PATCH 24/40] Rearranged IP address printout --- main.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/main.py b/main.py index b222bb5..e2ab9a9 100755 --- a/main.py +++ b/main.py @@ -85,11 +85,25 @@ def daily(): # stalling during greeting. time.sleep(60) +# Print greeting image +# Because the hello/goodbye images are overall fairly light, we can +# get away with using a darker heat time for these, then reset to the +# default afterward. +ht = printer.defaultHeatTime * 2 +if(ht > 255): ht = 255 + +printer.begin(ht) # Set temporary dark heat time +printer.printImage(Image.open('gfx/hello.png'), True) +printer.feed(3) +printer.begin() # Reset default heat time + # Show IP address (if network is available) try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('8.8.8.8', 0)) + printer.justify('C') printer.print('My IP address is ' + s.getsockname()[0]) + printer.justify('L') printer.feed(3) except: printer.boldOn() @@ -100,17 +114,6 @@ def daily(): printer.feed(3) exit(0) -# Print greeting image -# Because the hello/goodbye images are overall fairly light, we can -# get away with using a darker heat time for these, then reset to the -# default afterward. -ht = printer.defaultHeatTime * 2 -if(ht > 255): ht = 255 - -printer.begin(ht) # Set temporary dark heat time -printer.printImage(Image.open('gfx/hello.png'), True) -printer.feed(3) -printer.begin() # Reset default heat time GPIO.output(ledPin, GPIO.LOW) # Poll initial button state and time From 9cfad37afc77d87e6b0ba4555edf386ef495ff67 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Wed, 9 Oct 2013 07:40:31 +0100 Subject: [PATCH 25/40] Scratchpad and space code now flexible --- sudoku-gfx.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sudoku-gfx.py b/sudoku-gfx.py index 9dde860..1f053b7 100755 --- a/sudoku-gfx.py +++ b/sudoku-gfx.py @@ -47,7 +47,11 @@ def main(): if(ht > 255): ht = 255 printer.begin(ht) # Set temporary dark heat time printer.printImage(bg, True) # This does the printing - printer.println("RATING:", ratepuzzle(puzzle, 4), " 1 2 3 4 5 6 7 8 9") + rating="RATING:" + ratepussle(puzzle, 4) + scratchpad="1 2 3 4 5 6 7 8 9" + spaces_req=" "*(32-(len(rating)+len(scratchpad))) + rating_scratchpad=rating + spaces_req + scratchpad + printer.println(rating_scratchpad) if len(args) > 0: printer.println() printer.println("SOLUTION:") From 5511097c1a4259d02899cd96f9dd0f21163442aa Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Wed, 9 Oct 2013 08:51:36 +0100 Subject: [PATCH 26/40] Debugging... --- sudoku-gfx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sudoku-gfx.py b/sudoku-gfx.py index 1f053b7..ff6e382 100755 --- a/sudoku-gfx.py +++ b/sudoku-gfx.py @@ -47,10 +47,10 @@ def main(): if(ht > 255): ht = 255 printer.begin(ht) # Set temporary dark heat time printer.printImage(bg, True) # This does the printing - rating="RATING:" + ratepussle(puzzle, 4) + rating_lvl="RATING:" + str(ratepussle(puzzle, 4)) scratchpad="1 2 3 4 5 6 7 8 9" - spaces_req=" "*(32-(len(rating)+len(scratchpad))) - rating_scratchpad=rating + spaces_req + scratchpad + spaces_req=" "*(32-(len(rating_lvl)+len(scratchpad))) + rating_scratchpad=rating_lvl + spaces_req + scratchpad printer.println(rating_scratchpad) if len(args) > 0: printer.println() From f8760aef491ebc1e786817971827bfcd46cf126b Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Tue, 15 Oct 2013 02:01:53 +0100 Subject: [PATCH 27/40] corrected spelling of function call --- sudoku-gfx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudoku-gfx.py b/sudoku-gfx.py index ff6e382..73194c1 100755 --- a/sudoku-gfx.py +++ b/sudoku-gfx.py @@ -47,7 +47,7 @@ def main(): if(ht > 255): ht = 255 printer.begin(ht) # Set temporary dark heat time printer.printImage(bg, True) # This does the printing - rating_lvl="RATING:" + str(ratepussle(puzzle, 4)) + rating_lvl="RATING:" + str(ratepuzzle(puzzle, 4)) scratchpad="1 2 3 4 5 6 7 8 9" spaces_req=" "*(32-(len(rating_lvl)+len(scratchpad))) rating_scratchpad=rating_lvl + spaces_req + scratchpad From bd9782775409cd4803b6a5b783ede7154da8d252 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Wed, 16 Oct 2013 03:54:04 +0100 Subject: [PATCH 28/40] test weather images --- gfx/logo_130x80.png | Bin 0 -> 15769 bytes gfx/partlycloudy.gif | Bin 0 -> 2061 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 gfx/logo_130x80.png create mode 100644 gfx/partlycloudy.gif diff --git a/gfx/logo_130x80.png b/gfx/logo_130x80.png new file mode 100644 index 0000000000000000000000000000000000000000..f30f8e24c1b82272c2bc7fc29120a2fe21ed15ec GIT binary patch literal 15769 zcmV;KJ!Zm*P)XQhwSj0Q66>N4lA$6BP7V$ox;XS7C>1I!6ro+k7CI)Ke;?G@f?S`mSWLKjv-n>#~)`Xe8Kyu@wyY(GdTio+3yR7}|gu*QbJ5cBy zdi3*Qe_vC5eGpnugT_wukd6jT$IOp3zWjLd8F!C$1j-BMZc1mh@jpioH z%0ftjB*|Gq-mn;HWnl*cPxnF5&p=Nf@-KTWYqrK~$Y(@4b~|IyZnv;<*7f0%h!70_ z({=v3G>-V_JTj-hQ9Y8v#Y9XM)+JHcXob)3D-UYxN1+RYjuvZS5m`KFO>zPbxGIndi(O z<{5LsEHkgU?K#emc?8p(1Ahe|o!osP3ZgLnow--6VAney35iFcl2BS9M72>6k5C92 zj|TAvC>1I_5m68kN(m7yHc=@RY$6e{*K5PFcXphay>^MxO}?DTnfuL|GxHnzFR^J_ zHG#zKt!%6+e_lRvvV0f}_0WaLNt610@T5Fq=?AHLeqm`*IggH^^i#SxK0DR_DGIO( zjpxsHZG98^>z^J~PBaP`kPsdd8ZHq&NA01mKzQq_LiROEIz?dY=6q72P4WoGf0RE>Ko*yE}EvkVnGVRN38 zpSE|8m_8p-JVJNLmK2ThB^47yR1r5cG5~nzF19#Mc-^eCCRml6>*3rij~iJltU1p0 zac-W+!7l+wt(K4~qA>i;eVlpez4<6CZ|2pAjBFD{K@XxRf)Gl=ifj?NY7?fbcD1sN zNESq^76lO&77AG_qlkzwvyimH2t$s9Y-n!YnL*T=0^4SdW$XU^lB|9t2FhQ+4r z4|O>kPK8>T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bq1en`#SE=CM53N;|rc3DRecqY1k(5>ipiN2k8fs z`8kLdt5}b4UsE6tI;eTgDMf1bndc|tWNgDc(-fD;?Zcwp-Q{h>CqTu=srNbDcSzkp zUAh*}9LY-K8s=vAMNp0>U>{aERDnpy^*q61KhC-VElIdWJ1!1qj<4TGF^{0EogHk; z?jzSyA(x9)KIZ5z`$&1mjz?hsY>0AS2IF_F`1wO#A9Wv-wzHz!kG)IH_`a3b+L0_e zZC38GJi{$UgglKEP+E&uu}JPED`Bg_-o{KdjCF-xJ|@(8{l1KKs~C&_t=>FVN+(sA zs9{}erT2_V0UXIvsT2F&OIGey{j1|~Npn@adcGggU=K6)a8S6aCig3MyiD-%mwf#% XAy;Ayu}9}Y00000NkvXXu0mjfz+@Vb literal 0 HcmV?d00001 diff --git a/gfx/partlycloudy.gif b/gfx/partlycloudy.gif new file mode 100644 index 0000000000000000000000000000000000000000..c8df0d0a8116e6f691763f001f405e982985ddf7 GIT binary patch literal 2061 zcmcIkX+RU#79NN!MWBFGC`B29T20Byo45Fbx)0WB0lSY<~;2#CB1E%yD;_wU^wGxyy2&Ud~u_q*5KlWJ?n zAOR#`j1I{1cJ|IKvYW)OmKWkX#?L$&39c8f)C-nN$$_{a(8IGNWr!D#1UR zkpWEW;l<6t1xD?|l^SShQQka0z1or4HaQbjQ{O!^ zU;OA<=cH729-NZND<7oIZu2k6*cZwkmy0Dm&IOTy^>6t3}DF2a?D}iTJs+ zeq^@n>B!v)X~dn5rMf+(y)%7%pGP&_kIKlz#toQ&bYPxdy5NL%XV3`DK0%%Rd z5iKljY;4Ry5`jp-6G(U>2}`sgTad^E0{GWJBh~mJp=2Kl^{-k;7OmI zd9P_X0^CMBI3|~k7czKwB95SFX%k4J{ck9n{TeNReW1VfzL8kq8^eR}K9GPL#b-hY z+)Po5M|R~y44BLJ<#Ho8|Dsno7v>7WxjfMIpcP1CFj*W$yn(0D$etVl%-}E~Pl^K? zVZgCiA!Mp6kw~#~qYx=BwnU;E!P&yqmO^!=xLH$)R!Fp&OW`u3*boQa%nkWF*X^yj z3M;UANM#DdXMGKYQ2AUoxY071^(HL@J6EEO3kl(~c(ay2b3@*)#r3UP@Q4_^Vq^bn zqc@ij_b8^XZHol2jSq1UxAPHOE3Lm;d%3zIUzRONUp!x2n4g=SnVxz!IWayqIwBbs z4-Nh?(Et0>Cw;w-A3c1~(|!NnUH`h*dAFmz?YGunTbi318}9s4UswC{?OQcBZ(RTB z+K*SST>jzG_tjMwD=W&&E|iv>KXHP2VPUYrgXJwwuNI&syT53viQer~9 z==eX6#eEYSBaHq!3KsCc;&D0b$cUq?@UT!Qgc;1B|Kmtd;Ne4G2Kf7Z;d{`>+w1cK zwEdrb>gnN5b)&etI6FCh;$Z(V+0NF++RD;`gd8ax*8C&PzP%sr*}cmQZ3>#~++qBI z(ffu5+uzgQrl+g(uC|uuR*iSm)l^lspp=yWz*N2kdC~!M#Ra6euK~4n5j`O>DLExI z?b{RS87DKdvU74z<$afb`buPyCDC|nAYMN`il@f6_Oc?%83ju5?6Gw=u_KPxZ)w-2K-3wqyo96!n4p81E*O zVQ6(lKFMRURXGVB@m5yOV~rJrS5{X76BXm#vB@H*@*?;#YusIxAX37`ElrM}7pY<< PN|Lr84L6MkfRFzJX5v*7 literal 0 HcmV?d00001 From 10b819ab822d950ac70b9bd58fe392142846040a Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Wed, 16 Oct 2013 09:09:28 +0100 Subject: [PATCH 29/40] test script to convert colour image to greyscale and b&w --- imgbw | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 imgbw diff --git a/imgbw b/imgbw new file mode 100644 index 0000000..69edbfb --- /dev/null +++ b/imgbw @@ -0,0 +1,7 @@ +from PIL import Image +image_file = Image.open("gfx/partlycloudy.gif") # open colour image +image_file = image_file.convert('L') # convert image to black and white +image_file.save('result.png') +image_file = Image.open("result.png") # open colour image +image_file = image_file.convert('1') # convert image to black and white +image_file.save('result.gif') \ No newline at end of file From a76826ea0cfaf0e378ccc87f122fdbbfce503592 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Wed, 16 Oct 2013 23:53:21 +0100 Subject: [PATCH 30/40] greyscale and b&w test images --- gfx/result.gif | Bin 0 -> 1647 bytes gfx/result.png | Bin 0 -> 678 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 gfx/result.gif create mode 100644 gfx/result.png diff --git a/gfx/result.gif b/gfx/result.gif new file mode 100644 index 0000000000000000000000000000000000000000..ee138993f80a2983bef63494b2e7329841fe9178 GIT binary patch literal 1647 zcmZ9LcRW@9AIHzV_MSu&}VQva+$Uv9q&taBy&PavnKygo}&o z=+UFx+}y{G9pmBQIez>&FE1}2A0IzIKMV#tapHu4fWXOCMG5>E-oPg$(=oW_T0I1=g*&)mzP&i zP*7AP39UUEA zU0ppry(?F)T)lc#UtizAz`)SZ(8$Q>+O=!O#>OTlCZ?vQW@cvBuU|JeH@C2`xN+mg z&6_tZEiJ9AtgNlAZES3A-MV%A_HA2RTRS^DdwY8a2M0$-$2)iKI5{~vJ3G6$xVXBy zy1BWzySsaMc-*~v*VEJU-o1NXUS8hb-uLg{fAHXekB`s8hYue;dgSZt>*we9`0->o&*F0Jbn5U4u>NUh`_+WXV0Dm1qD5S{yaE1I3y$_G&D3UEG#@cJR&0E#fuj& zU%q_x>ecJluiw0R6B!v96&3aN?c3<+=$M$8ckkZ4fB*i&hYzu_v2k&6A3uJKkB?7C zNJvafOiD^hPEJlqNl8sj{q*TmT3T9qdU{4iMrLMaR#sMac6LrqPHt{)US3{)e*Wjr zpTB(hQczG(SXfw8R8(ACTvAd}T3T9GR#skKUQtm|Sy}n@>({EPs_N?Mnwpy0+ShQ`LmrlzLv-@pI(@uRu9xuvD$=g*(5t*vcsZSC#tzkdDd=;-L| z?EL-vcUMn< zJ{}+}j(+7p)+eh4(evp&5JkXsqJ^oj1vx!gMrnG9dS$tNc@`zEW36R**8yS!6sKLD zKUCt}1;sUUA?qsu!v5b`zC;MFxdH>uf->;q!Oo4LBpC%o)6J2BMA9tq3Lr&F<~smF zIKO^X>0(c|HpPKLyS60#>hhJ5%KPZ?U)2?u31kohOo|s-4+jVk+%~x!JZRTeZK4ND zOlZgkQ4lz119AV!NcA*cDjuQTTmCU2O0w-6RHS+z(k4dOi>4joKg;hg#rjT zn~*`e1sl2bfqDV05HM#(H%83t%K;z<5K!lweuARU>dcUw2m-Di3`R&;K^x#u64w76 z{z@ci1sj6q$)X4PS1c>NW;-%02Ue|X{5Dr-M+PvrkbzVz!d8P=+a|Ewo)I-+-x4Kc zm}wO!i-5;L4m)eU5w;%QaOoxGjPW2<2a6#1H0zNqkI`}x)B{W;?TButW1K01^%bbDUU7`{9yxUtmSnhp~(3QIf6l zK=5c<6ig=)AVf*J6oW5_w2k?7q4roQ2tLoHNB9s2?01R=1TW#bA=;e|5M(@-HWtB# znZ}9qC|G~~%?j_8r6UsLWDw#qc-3F*f!;bjTIo)Htx`4sacg}Ay)BJG27-OuxepZ{ z5YGcifmQzkO}a7#3Aycq$OnrZDM;_+U{N5Kv?oD%cVlUw P#1lhM!Q<8`pn%dpyq8-| literal 0 HcmV?d00001 diff --git a/gfx/result.png b/gfx/result.png new file mode 100644 index 0000000000000000000000000000000000000000..64c4524eddfdbf7ffbc5244bf8e918cab3c761dc GIT binary patch literal 678 zcmV;X0$KfuP);2E_PC2q7`NLfzn6ZXu?_jX3qWcn>pv6dtD8N4foK*4f6jYVmKrvV50#0gCo|u$eeuP z!{?57a*y>J4~(L7$C7m>^eP>lPD&>hjr%SbWI zaD;9yVmscJlKY9$k=e_qPBKWaR?;v&|va?Ibg3IItLZXyVd4{ zJTV1`Z+U#n#>Ib0a<4_;nc1(X;WSEEE#yky#Vn-+`lAS!x}W6XnU*3DmPZ%D{_(kK zG8w#clI1{0#j=j(pp2aJs%}ZGQj9w3l(Ac?@sXJ}lHE=Mpm%y27JhV<-$lad%2pA# z@>pxT>}`UkS(nDo6Uh4_9tdSJk|K&wFK;axO=NGA=%OF&RN(>>keWNhIIU~J+y0t; zVsCn)xEk1RSemCx)Y^?qSuJspRbDA>h%?re;H>qYwwPALHZr6-N_$P{A(cY90^@Y{4>IQ{Y_w9j@avf|GWEeY6#0DU$7H~oYSA(NfCc;u*1SqF- zy!N{quoVYc?X}i9+ZfMhoAYuMKOV#cB{DzS<50Rj{+TQ32Kig$5Asyph^ZuIz5oCK M07*qoM6N<$f)1fQoB#j- literal 0 HcmV?d00001 From 9fb5ff2f6c00ff0d8e05f5362be9a499eacca189 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Wed, 16 Oct 2013 23:54:11 +0100 Subject: [PATCH 31/40] test script to print converted images --- pimage | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pimage diff --git a/pimage b/pimage new file mode 100644 index 0000000..982fa91 --- /dev/null +++ b/pimage @@ -0,0 +1,17 @@ +from __future__ import print_function +import RPi.GPIO as GPIO +import subprocess, time, Image, socket +from Adafruit_Thermal import * +# Print greeting image +# Because the hello/goodbye images are overall fairly light, we can +# get away with using a darker heat time for these, then reset to the +# default afterward. +ht = printer.defaultHeatTime * 2 +if(ht > 255): ht = 255 + +printer.begin(ht) # Set temporary dark heat time +printer.printImage(Image.open('gfx/result.png'), True) +printer.feed(3) +printer.printImage(Image.open('gfx/result.gif'), True) +printer.feed(3) +printer.begin() # Reset default heat time From aceb93fb31b0424b462ed559020643623df85cfd Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 17 Oct 2013 02:33:40 +0100 Subject: [PATCH 32/40] renamed and chmod --- imgbw.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 imgbw.py diff --git a/imgbw.py b/imgbw.py new file mode 100755 index 0000000..69edbfb --- /dev/null +++ b/imgbw.py @@ -0,0 +1,7 @@ +from PIL import Image +image_file = Image.open("gfx/partlycloudy.gif") # open colour image +image_file = image_file.convert('L') # convert image to black and white +image_file.save('result.png') +image_file = Image.open("result.png") # open colour image +image_file = image_file.convert('1') # convert image to black and white +image_file.save('result.gif') \ No newline at end of file From 140f85ac7c1c7c0747fa741d5533ddb6407c7f93 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 17 Oct 2013 02:34:23 +0100 Subject: [PATCH 33/40] renamed, chmod and added code to actually print in two styles --- pimage.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 pimage.py diff --git a/pimage.py b/pimage.py new file mode 100755 index 0000000..3201076 --- /dev/null +++ b/pimage.py @@ -0,0 +1,31 @@ + +from __future__ import print_function +import RPi.GPIO as GPIO +import subprocess, time, Image, socket +from Adafruit_Thermal import * + +printer = Adafruit_Thermal("/dev/ttyAMA0", 19200, timeout=5) + +# Print greeting image +# Because the hello/goodbye images are overall fairly light, we can +# get away with using a darker heat time for these, then reset to the +# default afterward. +ht = printer.defaultHeatTime * 2 +if(ht > 255): ht = 255 + +printer.begin(ht) # Set temporary dark heat time +printer.println("Greyscale") +printer.printImage(Image.open('gfx/result.png'), True) +printer.feed(3) +printer.println("B&W") +printer.printImage(Image.open('gfx/result.gif'), True) +printer.feed(3) +printer.inverseOn() +printer.println("Greyscale") +printer.printImage(Image.open('gfx/result.png'), True) +printer.feed(3) +printer.println("B&W") +printer.printImage(Image.open('gfx/result.gif'), True) +printer.feed(3) +printer.inverseOff() +printer.begin() # Reset default heat time From 600766fb132e77f57eee53d7d180d22206090d65 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 17 Oct 2013 02:35:04 +0100 Subject: [PATCH 34/40] files renamed --- imgbw | 7 ------- pimage | 17 ----------------- 2 files changed, 24 deletions(-) delete mode 100644 imgbw delete mode 100644 pimage diff --git a/imgbw b/imgbw deleted file mode 100644 index 69edbfb..0000000 --- a/imgbw +++ /dev/null @@ -1,7 +0,0 @@ -from PIL import Image -image_file = Image.open("gfx/partlycloudy.gif") # open colour image -image_file = image_file.convert('L') # convert image to black and white -image_file.save('result.png') -image_file = Image.open("result.png") # open colour image -image_file = image_file.convert('1') # convert image to black and white -image_file.save('result.gif') \ No newline at end of file diff --git a/pimage b/pimage deleted file mode 100644 index 982fa91..0000000 --- a/pimage +++ /dev/null @@ -1,17 +0,0 @@ -from __future__ import print_function -import RPi.GPIO as GPIO -import subprocess, time, Image, socket -from Adafruit_Thermal import * -# Print greeting image -# Because the hello/goodbye images are overall fairly light, we can -# get away with using a darker heat time for these, then reset to the -# default afterward. -ht = printer.defaultHeatTime * 2 -if(ht > 255): ht = 255 - -printer.begin(ht) # Set temporary dark heat time -printer.printImage(Image.open('gfx/result.png'), True) -printer.feed(3) -printer.printImage(Image.open('gfx/result.gif'), True) -printer.feed(3) -printer.begin() # Reset default heat time From 8bc2e1bb8f836201cf28da05d3fdfcbbb1bf734d Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 17 Oct 2013 11:26:39 +0100 Subject: [PATCH 35/40] added color file --- pimage.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pimage.py b/pimage.py index 3201076..4a00ee0 100755 --- a/pimage.py +++ b/pimage.py @@ -1,4 +1,3 @@ - from __future__ import print_function import RPi.GPIO as GPIO import subprocess, time, Image, socket @@ -14,18 +13,14 @@ if(ht > 255): ht = 255 printer.begin(ht) # Set temporary dark heat time -printer.println("Greyscale") -printer.printImage(Image.open('gfx/result.png'), True) +printer.println("Colour") +printer.printImage(Image.open('gfx/partlycloudy.gif'), True) printer.feed(3) -printer.println("B&W") -printer.printImage(Image.open('gfx/result.gif'), True) -printer.feed(3) -printer.inverseOn() printer.println("Greyscale") printer.printImage(Image.open('gfx/result.png'), True) printer.feed(3) printer.println("B&W") printer.printImage(Image.open('gfx/result.gif'), True) printer.feed(3) -printer.inverseOff() printer.begin() # Reset default heat time + From 13aef1e39b2aa8ef76079aac44d64f033615abb1 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Fri, 18 Oct 2013 08:17:34 +0100 Subject: [PATCH 36/40] updated images --- gfx/partlycloudy.gif | Bin 2061 -> 1727 bytes gfx/result.gif | Bin 1647 -> 1688 bytes gfx/result.png | Bin 678 -> 597 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/gfx/partlycloudy.gif b/gfx/partlycloudy.gif index c8df0d0a8116e6f691763f001f405e982985ddf7..117f06d22a2537eae07b32f3b929a97f3ed4e569 100644 GIT binary patch delta 777 zcmeAb*w0(nP|jd#Bf!c;qKkL3=9na|1<30zu(;4{QUXz3JMDE-@g|S5J*T! zm_L6$A0J0Ri{#GXw_*3kU#JG6)$MF!c8`1Oza+y1Et=0PX%i z*^tp@b1&luMg=D)V`o!yCksOZlh=wy!7{0l2e zyw*mozp7 z4so_xCr-BH*v48>#u+nbin7-f#dmki5Y!SAlb+efksibBtT;nWhH1+dC5;*N9Q>R$ zD;4vC8##no`_yE&o@7#=b#^AlfqUXI}&gM@+RN1}Kvm6#|e}Df#^Y5}bCmFTXSk=B1 r9otiB%*;8nP|jd#PBSE;rkT1>+e719(?%k$H&H#&u3hHlC~r(JsebA`vx^Y|8^x(d)?+n-7e;U61{{R2~C-&J-T%fq|><2~#H)lgb7fV+cLl-9t zLqk^sM`LFT7dJ;2S2H(5Qy_2hT_zcrB3GP>B$*8q+zc$84b7d5fQpQ54dok80Fz7G<0VqBh*#9>qG&Q%hwzYS3c6Imk_VrJgIBD{fsne#V;RplA5p!?$DST2_6238sD?xaI!>yw&$3++(Gd8T|VD4a**dy`b zO=Z)?MN4F>cOH7`G%v6CR$yqw zl11XW*D|h$yPeeNaQ|>K>BggO&y!{xjBz}I2PS%`t$gA)$;V8Sr7!kM!wrR^%D{un z5@{=!PBZd&d6cQ8GO+Ktql%KW|v&ceD2O>(7>oy^X=vH U`3-DZFBY_jWo0NfGB8*J0PTDRwg3PC diff --git a/gfx/result.gif b/gfx/result.gif index ee138993f80a2983bef63494b2e7329841fe9178..30312a424f9a0451d27f433fe66b9fb010da8505 100644 GIT binary patch delta 892 zcmXYveN0t#7{{M;4|+$uTnJxqOpX#EK@1CGEoa9t$0ojD&6b%GFuM2#&1s{R{7z0+ zvNmn8!fbK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7b_y#C-ZBy>+Z@PDO!Z=c@2{;vPv zKqKQH?Hmc16QO~=8W>hUUGT7mCB6_~7-jzj2KtRnsou<>!~zO_Xv_lT&|?i~03`ZA j9{FqiiXvV_y27F{P@Jo#9$2ou_)Gz diff --git a/gfx/result.png b/gfx/result.png index 64c4524eddfdbf7ffbc5244bf8e918cab3c761dc..b3b789c6b5cea3e9e384327540de021c6b8323ca 100644 GIT binary patch delta 572 zcmV-C0>k~L1=R$QB!3)9L_t(|obA;yYui8+!12FJXK^1u!mlH! zGF>vIHib-~ZXi<@J6#JscQKe^lC97TwueGJ$q=ZfVhPmQLSNuI*pg+(v7NCrZ#(gR zr}yr3r;O&I@#Mkck^CE^A8uiE9FC)P4_oUirPs!sASSv;UVl#nYx1?$^TMp~8h}=q z-=?qzN-Jc~MqWvj*0!8%D69c$oXj$wScpwT+aSSwQ>*O(65*_Gzo)e>z)r{aec%6a z0HSVN0J5M~k_MvcNOo@hS-em8D(;|+W>oY5^P3T8H5-_v{VWjNv;u6kxL_F#^uM(D zbdVC2rv-g{WiFfZ z*_xkpg(Jymt}m^({faSIZec}~htu9K+LDhJpT9pWAYd5*QB*par$xq0000< KMNUMnLSTaTH5*m{ delta 654 zcmV;90&)G-1f~U$B!6v5L_t(|ob8p%PZLoThrf2lPNtpK4%7}HrKE@k#P~=EAu;Y* zxzIn;l`BZZ1tHOm(!>S{lo6~c6s%J_eceePF4{tY(ns8A!dd-h&i(S6Ip>~xT@8i} z_t3-*^8X@YI3y)tqX7GZBi6deoP6QK=Z<%BkM$c5jH0!E3x5+6L}JqDkBE0M3kz?_ zgiofk(C@7$C7m>^eP>lPD&>hjr%SbWIaD;9yVmscJlKY9$k=e_qPBKYwaGyW%3&vU1Gd)V5ib7p3!D)y(-;lq<;lLwU*2BpmCsPHndoocoy< zN+2Ww;xI=zHggF%TIJh;Mm(%f`ijNpi16;F;O4sNpn9SS{pA z-^DDY1p1>0m%5+i;hB~q5SB+5!v68OX)+nSbCTsiM}Nh#j^?0@ob#$~Nv%?hI_Z?L zTdMJqnKqK$P6D8JdKwmfbd}#l!s*IZ5x4SKYrE`if~HxQ#?KST`yw6)WipZ?icl|a zEgDT^Zxr%Tk@jZ9fBagbGBDQ<`} z)|KF_^?#nWm{!C#GNd|6drjyel|s4#;|HmyG6<&n5C(u2*#nL2Fh`&228CAl?SYVT z9c&b27&}hH1|X^ya6$xEgQHa@!ct!ZD5rD0_PZLe6$e@EwbnV?7|&;$^KukF9>fGC oGC$hmP`W<;nJeiA`CH@<@>JZ2sU&8;00000Ne4wvM6N<$g7oG+H~;_u From 91691f1a82715777486d83d165a73f25f35aed63 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Fri, 18 Oct 2013 08:18:37 +0100 Subject: [PATCH 37/40] updated test code --- imgbw.py | 1 + pimage.py | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/imgbw.py b/imgbw.py index 69edbfb..f79fae2 100755 --- a/imgbw.py +++ b/imgbw.py @@ -1,5 +1,6 @@ from PIL import Image image_file = Image.open("gfx/partlycloudy.gif") # open colour image +#image_file = image_file.resize((100,100),Image.ANTIALIAS) image_file = image_file.convert('L') # convert image to black and white image_file.save('result.png') image_file = Image.open("result.png") # open colour image diff --git a/pimage.py b/pimage.py index 4a00ee0..eb497e1 100755 --- a/pimage.py +++ b/pimage.py @@ -1,3 +1,4 @@ + from __future__ import print_function import RPi.GPIO as GPIO import subprocess, time, Image, socket @@ -13,14 +14,20 @@ if(ht > 255): ht = 255 printer.begin(ht) # Set temporary dark heat time -printer.println("Colour") -printer.printImage(Image.open('gfx/partlycloudy.gif'), True) +image_file = Image.open('gfx/partlycloudy.gif') +image_100 = image_file.resize((100,100),Image.ANTIALIAS) +image_200 = image_file.resize((200,200),Image.ANTIALIAS) +image_file = image_file.convert('L') +image_100 = image_100.convert('L') +image_200 = image_200.convert('L') +printer.println("Image 50x50") +printer.printImage(image_file, True) printer.feed(3) -printer.println("Greyscale") -printer.printImage(Image.open('gfx/result.png'), True) +printer.println("Image 100x100") +printer.printImage(image_100, True) printer.feed(3) -printer.println("B&W") -printer.printImage(Image.open('gfx/result.gif'), True) +printer.println("Image 200x200") +printer.printImage(image_200, True) printer.feed(3) printer.begin() # Reset default heat time From 95f816304ec652aceb24c72b5fcfffeb6e251b12 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Sun, 20 Oct 2013 10:26:16 +0100 Subject: [PATCH 38/40] testing alt code --- pimage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pimage.py b/pimage.py index eb497e1..a8e1197 100755 --- a/pimage.py +++ b/pimage.py @@ -20,13 +20,13 @@ image_file = image_file.convert('L') image_100 = image_100.convert('L') image_200 = image_200.convert('L') -printer.println("Image 50x50") +printer.print("Image 50x50") printer.printImage(image_file, True) printer.feed(3) -printer.println("Image 100x100") +printer.print("Image 100x100") printer.printImage(image_100, True) printer.feed(3) -printer.println("Image 200x200") +printer.print("Image 200x200") printer.printImage(image_200, True) printer.feed(3) printer.begin() # Reset default heat time From da45f4c3bb0f8ec024528258bb6f7e716c180152 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Thu, 24 Oct 2013 09:55:15 +0100 Subject: [PATCH 39/40] removed sudoku from daily print --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index e2ab9a9..73ed8d0 100755 --- a/main.py +++ b/main.py @@ -65,7 +65,7 @@ def interval(): def daily(): GPIO.output(ledPin, GPIO.HIGH) subprocess.call(["python", "forecast.py"]) - subprocess.call(["python", "sudoku-gfx.py"]) + #subprocess.call(["python", "sudoku-gfx.py"]) GPIO.output(ledPin, GPIO.LOW) From 49facdc4d7d0621fff273f2239338fdc43d04a16 Mon Sep 17 00:00:00 2001 From: SmartCoda Date: Sun, 27 Oct 2013 12:49:13 +0000 Subject: [PATCH 40/40] start of wunderground forecast --- wgforecast.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 wgforecast.py diff --git a/wgforecast.py b/wgforecast.py new file mode 100755 index 0000000..5554ae4 --- /dev/null +++ b/wgforecast.py @@ -0,0 +1,9 @@ +#!/usr/bin/python +# +# Forecast for adafruit raspberry pi thermal +# internet of things printer. +# This version uses wunderground for the +# weather data. Later revisions will have +# weather icon support. +# +