From 7ee85cd4f41c754d3649eb6c7a352da9f20da7a6 Mon Sep 17 00:00:00 2001 From: jimmy Date: Sun, 17 Jul 2022 14:32:14 +1200 Subject: [PATCH] Stuff --- Pipfile | 3 + Pipfile.lock | 144 ++++++++++++++++++++++++++++++++++++++++++++- button.py | 12 ++++ image.jpg | Bin 0 -> 76672 bytes micro/button.py | 20 +++++++ printer.py | 12 ---- printer/printer.py | 41 +++++++++++++ 7 files changed, 218 insertions(+), 14 deletions(-) create mode 100644 button.py create mode 100644 image.jpg create mode 100644 micro/button.py delete mode 100755 printer.py create mode 100755 printer/printer.py diff --git a/Pipfile b/Pipfile index 92ad5b0..a3a47b1 100644 --- a/Pipfile +++ b/Pipfile @@ -7,6 +7,9 @@ name = "pypi" python-vlc = "*" opencv-python = "*" screeninfo = "*" +serial = "*" +paho-mqtt = "*" +startspimage = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 44aa189..6a5f097 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "d72464444b1b004eb4741f9b93e3e91f495577de972178bcc007fb5417876453" + "sha256": "ed6f5adc48a375df01b39e00b0c026dd3add47599e4fc4e05bb75513cace77d1" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,21 @@ ] }, "default": { + "future": { + "hashes": [ + "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" + ], + "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==0.18.2" + }, + "iso8601": { + "hashes": [ + "sha256:27f503220e6845d9db954fb212b95b0362d8b7e6c1b2326a87061c3de93594b1", + "sha256:d7bc01b1c2a43b259570bb307f057abc578786ea734ba2b87b836c5efc5bd443" + ], + "markers": "python_full_version >= '3.6.2' and python_full_version < '4.0.0'", + "version": "==1.0.2" + }, "numpy": { "hashes": [ "sha256:1408c3527a74a0209c781ac82bde2182b0f0bf54dea6e6a363fe0cc4488a7ce7", @@ -41,7 +56,7 @@ "sha256:d748ef349bfef2e1194b59da37ed5a29c19ea8d7e6342019921ba2ba4fd8b624", "sha256:e0d7447679ae9a7124385ccf0ea990bb85bb869cef217e2ea6c844b6a6855073" ], - "markers": "python_version >= '3.10'", + "markers": "python_version >= '3.7'", "version": "==1.23.1" }, "opencv-python": { @@ -57,6 +72,77 @@ "index": "pypi", "version": "==4.6.0.66" }, + "paho-mqtt": { + "hashes": [ + "sha256:2a8291c81623aec00372b5a85558a372c747cbca8e9934dfe218638b8eefc26f" + ], + "index": "pypi", + "version": "==1.6.1" + }, + "pillow": { + "hashes": [ + "sha256:0030fdbd926fb85844b8b92e2f9449ba89607231d3dd597a21ae72dc7fe26927", + "sha256:030e3460861488e249731c3e7ab59b07c7853838ff3b8e16aac9561bb345da14", + "sha256:0ed2c4ef2451de908c90436d6e8092e13a43992f1860275b4d8082667fbb2ffc", + "sha256:136659638f61a251e8ed3b331fc6ccd124590eeff539de57c5f80ef3a9594e58", + "sha256:13b725463f32df1bfeacbf3dd197fb358ae8ebcd8c5548faa75126ea425ccb60", + "sha256:1536ad017a9f789430fb6b8be8bf99d2f214c76502becc196c6f2d9a75b01b76", + "sha256:15928f824870535c85dbf949c09d6ae7d3d6ac2d6efec80f3227f73eefba741c", + "sha256:17d4cafe22f050b46d983b71c707162d63d796a1235cdf8b9d7a112e97b15bac", + "sha256:1802f34298f5ba11d55e5bb09c31997dc0c6aed919658dfdf0198a2fe75d5490", + "sha256:1cc1d2451e8a3b4bfdb9caf745b58e6c7a77d2e469159b0d527a4554d73694d1", + "sha256:1fd6f5e3c0e4697fa7eb45b6e93996299f3feee73a3175fa451f49a74d092b9f", + "sha256:254164c57bab4b459f14c64e93df11eff5ded575192c294a0c49270f22c5d93d", + "sha256:2ad0d4df0f5ef2247e27fc790d5c9b5a0af8ade9ba340db4a73bb1a4a3e5fb4f", + "sha256:2c58b24e3a63efd22554c676d81b0e57f80e0a7d3a5874a7e14ce90ec40d3069", + "sha256:2d33a11f601213dcd5718109c09a52c2a1c893e7461f0be2d6febc2879ec2402", + "sha256:337a74fd2f291c607d220c793a8135273c4c2ab001b03e601c36766005f36885", + "sha256:37ff6b522a26d0538b753f0b4e8e164fdada12db6c6f00f62145d732d8a3152e", + "sha256:3d1f14f5f691f55e1b47f824ca4fdcb4b19b4323fe43cc7bb105988cad7496be", + "sha256:408673ed75594933714482501fe97e055a42996087eeca7e5d06e33218d05aa8", + "sha256:4134d3f1ba5f15027ff5c04296f13328fecd46921424084516bdb1b2548e66ff", + "sha256:4ad2f835e0ad81d1689f1b7e3fbac7b01bb8777d5a985c8962bedee0cc6d43da", + "sha256:50dff9cc21826d2977ef2d2a205504034e3a4563ca6f5db739b0d1026658e004", + "sha256:510cef4a3f401c246cfd8227b300828715dd055463cdca6176c2e4036df8bd4f", + "sha256:5aed7dde98403cd91d86a1115c78d8145c83078e864c1de1064f52e6feb61b20", + "sha256:69bd1a15d7ba3694631e00df8de65a8cb031911ca11f44929c97fe05eb9b6c1d", + "sha256:6bf088c1ce160f50ea40764f825ec9b72ed9da25346216b91361eef8ad1b8f8c", + "sha256:6e8c66f70fb539301e064f6478d7453e820d8a2c631da948a23384865cd95544", + "sha256:727dd1389bc5cb9827cbd1f9d40d2c2a1a0c9b32dd2261db522d22a604a6eec9", + "sha256:74a04183e6e64930b667d321524e3c5361094bb4af9083db5c301db64cd341f3", + "sha256:75e636fd3e0fb872693f23ccb8a5ff2cd578801251f3a4f6854c6a5d437d3c04", + "sha256:7761afe0126d046974a01e030ae7529ed0ca6a196de3ec6937c11df0df1bc91c", + "sha256:7888310f6214f19ab2b6df90f3f06afa3df7ef7355fc025e78a3044737fab1f5", + "sha256:7b0554af24df2bf96618dac71ddada02420f946be943b181108cac55a7a2dcd4", + "sha256:7c7b502bc34f6e32ba022b4a209638f9e097d7a9098104ae420eb8186217ebbb", + "sha256:808add66ea764ed97d44dda1ac4f2cfec4c1867d9efb16a33d158be79f32b8a4", + "sha256:831e648102c82f152e14c1a0938689dbb22480c548c8d4b8b248b3e50967b88c", + "sha256:93689632949aff41199090eff5474f3990b6823404e45d66a5d44304e9cdc467", + "sha256:96b5e6874431df16aee0c1ba237574cb6dff1dcb173798faa6a9d8b399a05d0e", + "sha256:9a54614049a18a2d6fe156e68e188da02a046a4a93cf24f373bffd977e943421", + "sha256:a138441e95562b3c078746a22f8fca8ff1c22c014f856278bdbdd89ca36cff1b", + "sha256:a647c0d4478b995c5e54615a2e5360ccedd2f85e70ab57fbe817ca613d5e63b8", + "sha256:a9c9bc489f8ab30906d7a85afac4b4944a572a7432e00698a7239f44a44e6efb", + "sha256:ad2277b185ebce47a63f4dc6302e30f05762b688f8dc3de55dbae4651872cdf3", + "sha256:b6d5e92df2b77665e07ddb2e4dbd6d644b78e4c0d2e9272a852627cdba0d75cf", + "sha256:bc431b065722a5ad1dfb4df354fb9333b7a582a5ee39a90e6ffff688d72f27a1", + "sha256:bdd0de2d64688ecae88dd8935012c4a72681e5df632af903a1dca8c5e7aa871a", + "sha256:c79698d4cd9318d9481d89a77e2d3fcaeff5486be641e60a4b49f3d2ecca4e28", + "sha256:cb6259196a589123d755380b65127ddc60f4c64b21fc3bb46ce3a6ea663659b0", + "sha256:d5b87da55a08acb586bad5c3aa3b86505f559b84f39035b233d5bf844b0834b1", + "sha256:dcd7b9c7139dc8258d164b55696ecd16c04607f1cc33ba7af86613881ffe4ac8", + "sha256:dfe4c1fedfde4e2fbc009d5ad420647f7730d719786388b7de0999bf32c0d9fd", + "sha256:ea98f633d45f7e815db648fd7ff0f19e328302ac36427343e4432c84432e7ff4", + "sha256:ec52c351b35ca269cb1f8069d610fc45c5bd38c3e91f9ab4cbbf0aebc136d9c8", + "sha256:eef7592281f7c174d3d6cbfbb7ee5984a671fcd77e3fc78e973d492e9bf0eb3f", + "sha256:f07f1f00e22b231dd3d9b9208692042e29792d6bd4f6639415d2f23158a80013", + "sha256:f3fac744f9b540148fa7715a435d2283b71f68bfb6d4aae24482a890aed18b59", + "sha256:fa768eff5f9f958270b081bb33581b4b569faabf8774726b283edb06617101dc", + "sha256:fac2d65901fb0fdf20363fbd345c01958a742f2dc62a8dd4495af66e3ff502a4" + ], + "markers": "python_version >= '3.7'", + "version": "==9.2.0" + }, "python-vlc": { "hashes": [ "sha256:92f98fee088f72bd6d063b3b3312d0bd29b37e7ad65ddeb3a7303320300c2807", @@ -65,6 +151,45 @@ "index": "pypi", "version": "==3.0.16120" }, + "pyyaml": { + "hashes": [ + "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293", + "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b", + "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57", + "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b", + "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4", + "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07", + "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba", + "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9", + "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287", + "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513", + "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0", + "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0", + "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92", + "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f", + "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2", + "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc", + "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c", + "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86", + "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4", + "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c", + "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34", + "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b", + "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c", + "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb", + "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737", + "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3", + "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d", + "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53", + "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78", + "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803", + "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a", + "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174", + "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5" + ], + "markers": "python_version >= '3.6'", + "version": "==6.0" + }, "screeninfo": { "hashes": [ "sha256:9501bf8b8458c7d1be4cb0ac9abddddfa80b932fb3f65bfcb54f5586434b1dc5", @@ -72,6 +197,21 @@ ], "index": "pypi", "version": "==0.8" + }, + "serial": { + "hashes": [ + "sha256:542150a127ddbf5ed2acc3a6ac4ce807cbcdae3b197acf785bbda6565c94f848", + "sha256:e887f06e07e190e39174b694eee6724e3c48bd361be1d97964caef5d5b61c73b" + ], + "index": "pypi", + "version": "==0.0.97" + }, + "startspimage": { + "hashes": [ + "sha256:4f726cc244baad240dcdac4ec387211d46a2d67abe6ce60e366d87b2915acd89" + ], + "index": "pypi", + "version": "==0.2.6" } }, "develop": {} diff --git a/button.py b/button.py new file mode 100644 index 0000000..aa01b58 --- /dev/null +++ b/button.py @@ -0,0 +1,12 @@ +import serial + +def main(): + ser = serial.Serial('/dev/ttyUSB0') # open serial port + print(ser.name) # check which port was really used + ser.write(b'hello') # write a string + ser.close() # close port + + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/image.jpg b/image.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7b230a6ff5f276aed3e40e1d7ab97910d24a6053 GIT binary patch literal 76672 zcmeIb2|Sc<-}iqq!`QM#kztexA!L`aC0i<6MOm|i?1Z7QhsZAcLe@$`i0s*oErddZ zF}CamG4}s-JLLMFC&H$7MBqF`4BQ{YHB)KI<{lS*u+l5PmBHCucHQl zi3;`!_6b6E1|Vl5gD{aDwEzgx_oN{E%M1A5FEVlnl!6jQMNLCXD)62WASZ)B$e|Dl z3MiCR+L!b`0A-?JK7B!%^0@9@*cn$AvB0=2DxOOvjjVcoYe;bmw;*bo6DQf&Po3rE z<3A@LAt@y-BYRQhvZ|W8hUOLh8#iwm7~Z~PX=Q!S#@6n>`vVV8FSNH$@S~8>u*cyM z@d-~8lahaXmXe+G;^nK{*LiQ=m6p9Puc)l5Zfb66#kRF~boLK?{xUc;{B>j!KQ%ow zJNJElfv~=@`D1IFxU>7SUSt5|e^rb0^M6(Buj<7_suwvF3W36Y){BhXi*!MlpcJPs zP%dM_g}>)xxch<^)n=@+{$J)&5emzpY|H|4_~Ttz!ST zULybR#WUO?90xwHg#>;%QN!Pm%^6HRvyd#{$puOF_^ zY8evh?53Hrrvt>=0^^nT?Weo_r<|jHOxq^w#9R%G6;#hX{WzXOt|H!;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u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o z02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o z02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02u%o02%ld I14m!~KkXZrdjJ3c literal 0 HcmV?d00001 diff --git a/micro/button.py b/micro/button.py new file mode 100644 index 0000000..558afd4 --- /dev/null +++ b/micro/button.py @@ -0,0 +1,20 @@ +from machine import Pin, UART +from time import sleep_ms +import os + + +def button_irq(pin): + + print("pressed") + + +#button = Pin(5, Pin.IN, Pin.PULL_UP) +#button.irq(trigger=Pin.IRQ_FALLING, handler=button_irq) + +os.dupterm(None, 1) +uart = UART(0, baudrate=9600) + +while True: + if uart.any(): + u = uart.read() + uart.write(u) \ No newline at end of file diff --git a/printer.py b/printer.py deleted file mode 100755 index a3debd0..0000000 --- a/printer.py +++ /dev/null @@ -1,12 +0,0 @@ -import StarTSPImage -from PIL import Image, ImageDraw - -image = Image.new('RGB', (500, 500), color='White') -draw = ImageDraw.Draw(image) -draw.ellipse((0, 0, 500, 500), fill='Black') -draw.ellipse((10, 10, 490, 490), fill='White') - -raster = StarTSPImage.imageToRaster(image, cut=True) - -printer = open('/dev/usb/lp0', "wb") -printer.write(raster) \ No newline at end of file diff --git a/printer/printer.py b/printer/printer.py new file mode 100755 index 0000000..b8ba75d --- /dev/null +++ b/printer/printer.py @@ -0,0 +1,41 @@ +import StarTSPImage +from PIL import Image, ImageDraw + + + +import paho.mqtt.client as mqtt + +# The callback for when the client receives a CONNACK response from the server. +def on_connect(client, userdata, flags, rc): + print("Connected with result code "+str(rc)) + + # Subscribing in on_connect() means that if we lose the connection and + # reconnect then subscriptions will be renewed. + client.subscribe("print") + +# The callback for when a PUBLISH message is received from the server. +def on_message(client, userdata, msg): + print(msg.topic+" "+str(msg.payload)) + image = Image.new('RGB', (2000, 2000), color='White') + draw = ImageDraw.Draw(image) + draw.ellipse((0, 0, 500, 500), fill='Black') + draw.ellipse((10, 10, 490, 490), fill='White') + image.show() + image.save("image.jpg") + + # raster = StarTSPImage.imageToRaster(image, cut=True) + + # printer = open('/dev/usb/lp0', "wb") + # printer.write(raster) + +client = mqtt.Client() +client.on_connect = on_connect +client.on_message = on_message + +client.connect("10.1.1.162", 1883, 60) + +# Blocking call that processes network traffic, dispatches callbacks and +# handles reconnecting. +# Other loop*() functions are available that give a threaded interface and a +# manual interface. +client.loop_forever() \ No newline at end of file