pufferfish-tech / octopus-agile-pi-prices

Display the upcoming prices on the Octopus Energy "Agile" tariff.
Apache License 2.0
71 stars 27 forks source link

Changes to code for non EEPROM InkyPHATs #20

Open richm90 opened 1 year ago

richm90 commented 1 year ago

More of a tip for anyone else who's in the same boat as me! (in the hope that you don't lose hours to trying to make it work). Amazing project and incredibly grateful to the time and effort that has been put into it, it's absolutely perfect for our household now we're on Agile!!

I ended up with an older InkyPHAT that doesn't have an EEPROM chip so the 'auto' sections of octoprice_main_inky.py produce an error.

You need to work out what 'type' of Inky board you have; the easiest way to do that is by trial and error of one of the example Pimoroni scripts; as EEPROM is also used to detect the colour, you need to specify that too otherwise the script can't run; so you'll need to specify that each time too.

Eg cd to the examples folder and run: python3 logo.py --type {what,phat,phatssd1608,impressions,7colour,whatssd1683,impressions73} --colour {red,black,yellow}

Mine is a red phatssd1608 - so it worked with: python3 logo.py --type "phatssd1608" --colour "red"

Now you have to lookup the correct Inky class instance, which is what needs to be substituted into the octoprice code (I found this by looking at /usr/local/lib/python3.9/dist-packages/inky/auto.py but have summarised it here:)

phat -> InkyPHAT phatssd1608 -> InkyPHAT_SSD1608 what -> InkyWHAT whatssd1683 -> InkyWHAT_SSD1683 impressions/7colour -> InkyUC8159 impressions73 -> InkyAC073TC1A

[obviously some of these devices wont work with the octoprice layout that is coded!!]

So to make it work with your device you need to change the following lines:

[example given for a red phatssd1608]]

Line 9 from: from inky.auto import auto to: from inky.auto import InkyPHAT_SSD1608

and Line 23 from: inky_display = auto(ask_user=False, verbose=True) to: inky_display = InkyPHAT_SSD1608("red")

And it should work :)

Hope this is helpful to someone else too!

Rich

M0TFF commented 3 months ago

Do you know what I would have to do to get the Waveshare 2.13 Inch e-Paper Display HAT 250x122 Resolution E-Ink Screen to work?

jerbzz commented 3 months ago

Install the relevant library and rewrite/modify the display handling code. I’m sure it can accept a Pillow image but the way you talk to it is different to the Pimoroni gear.

On Fri, 29 Mar 2024 at 16:56, M0TFF @.***> wrote:

Do you know what I would have to do to get the Waveshare 2.13 Inch e-Paper Display HAT 250x122 Resolution E-Ink Screen to work?

— Reply to this email directly, view it on GitHub https://github.com/pufferfish-tech/octopus-agile-pi-prices/issues/20#issuecomment-2027483431, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZ77JC4OQ7RT7FFG36NRTTY2WFKZAVCNFSM6AAAAAAW7QLMIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXGQ4DGNBTGE . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

M0TFF commented 3 months ago

Are there any forums where I can ask for help with this, it's very complicated for me to understand how to do what you suggested. I have been able to get the demo display program working but no idea how to rewrite the code. Chatgpt kept telling me to change this and that and spent an hour and still did not work. I think it's easier if I get another display that just works.

jerbzz commented 3 months ago

Depending on how you value your time, it's almost certainly cheaper to get an Inky pHat :)

M0TFF commented 3 months ago

Is there any specific one that I should buy that will just work, thanks for the help.

jerbzz commented 3 months ago

Yes, you need an “Inky pHat”.

https://shop.pimoroni.com/products/inky-phat?variant=12549254217811

On Fri, 29 Mar 2024 at 17:50, M0TFF @.***> wrote:

Is there any specific one that I should buy that will just work, thanks for the help.

— Reply to this email directly, view it on GitHub https://github.com/pufferfish-tech/octopus-agile-pi-prices/issues/20#issuecomment-2027544108, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZ77JECEBCZO5HCS2PBS73Y2WLVXAVCNFSM6AAAAAAW7QLMIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXGU2DIMJQHA . You are receiving this because you commented.Message ID: @.***>