Giter VIP home page Giter VIP logo

balena-io-experimental / inkyshot Goto Github PK

View Code? Open in Web Editor NEW
124.0 22.0 35.0 4.92 MB

Get a daily random inspirational quote delivered direct to your desk with Inkyshot. Build multiple Inkyshots and share the inspiration with your friends, family and loved ones ❤️

License: MIT License

Dockerfile 1.81% Python 95.11% Shell 3.07%
balena balenacloud raspberry-pi raspberrypi raspberry-pi-zero inkyphat inky

inkyshot's Introduction

Inkyshot - a shot of inspiration to start the day

Get a daily random inspirational quote delivered direct to your desk with Inkyshot. Build multiple Inkyshots and share the inspiration with your friends, family and loved ones ❤️

Hardware required

Setup & Installation

Running this project is as simple as deploying it to a balenaCloud application. You can do it in just one click by using the button below:

You can also deploy in the traditional manner using the balena CLI and balena push command. For more information check out the docs.

Customization

Your fleet of Inkyshots can all be managed centrally via balenaCloud. Try any of the environment variables below to add some customization.

Update time

Inkyshot wants to deliver a shot of inspiration to start your day, and by default will do this at 9AM/0900 hours UTC. You can change the hour that the update will happen with the UPDATE_HOUR variable; set it anywhere from 0 to 23.

Timezone

In order for the update time to work correctly, you'll of course have to tell Inkyshot what timezone you'd like to use. Set the TZ environment variable to any IANA timezone, e.g. Europe/London, America/Los_Angeles, Asia/Taipei etc.

This timezone is also used for displaying the correct date when the environment variable MODE is set to weather.

Message override

Is there a special occasion in your family? Override the daily quote with a shot of celebration by setting the INKY_MESSAGE environment variable. Try Happy birthday Sister!, Congratulations on the new job, mate!, or Happy mother's day!.

Quote of the day category

The quote api has several quote categories available. Use the QOD_CATEGORY environment variable to change the type of quote retreived. Available categories: inspire (default), management, sports, life, funny, love, art, students.

Font

There are a few fonts built in that you can try. The default is AmaticSC, but you can use the FONT variable and set it to any of: FredokaOne, HankenGrotesk, Intuitive, SourceSerifPro, SourceSansPro, Caladea, Roboto and Grand9KPixel. You're welcome to PR more options into the project!

Font size

Inkyshot will automatically choose the largest font size for your message that still fits on the display. Too big? Override it with the FONT_SIZE variable and Inkyshot will use this as a maximum and continue to resize downwards if your message doesn't fit.

Test character

When figuring out what size font to use, Inkyshot (invisibly) fills the screen with the a character to see how many will fit. You can override this by setting the TEST_CHARACTER environment variable with any wider (w) or slimmer (i) characters of your choosing to adjust this behavior.

Rotation

If Inkyshot is living in a different house where things aren't necessarily always the same way up, use the ROTATE environment variable to rotate the output by 180 degrees.

Weather

To enable the weather display, set the environment variable MODE to weather.

Next, use either LATLONG (e.g. 39.9199,32.8543) or WEATHER_LOCATION (e.g. Ankara, Turkey) environment variables to define the location for weather information. Entering only an empty WEATHER_LOCATION is also sufficient and in this case Inkyshot will lookup the latitude and longitude information from device's IP address.

Set SCALE environment variable to F to display the temperature values in Fahrenheit scale. The default is Celcius scale.

Use the WEATHER_FONT variable to customize the font used in weather display mode.

Use the WEATHER_INVERT variable to invert the Image being displayed - WAVESHARE specific.

LOCALE variable allows to display the date of temperature reading in any language supported by the date library.

Finally, you can set the environment variable MODE to alternate for Inkyshot to rotate between quote and weather modes. You can put number of minutes in the ALTERNATE_FREQUENCY environment variable in order to configure Inkyshot to update periodically. By default, the first display is quote mode and you can instead chose weather by setting current_display tag to weather on the device.

Hostname

By default the device will be assigned the hostname inkyshot so it can be easily found on a network. This can be changed with the SET_HOSTNAME environment variable.

Wifi Connect

As from v1.2.0 this project includes wifi-connect which is a utility for dynamically setting the WiFi configuration on a Linux device via a captive portal. If your device is not connected to the internet, an access point will be created. You can refer to the docs here for customizing the different settings for wifi-connect.

Case

STL files are included within the assets folder of the project for you to 3D print your own case.

The case has two positions for a captive M3 nut, and can be fastened together with two countersunk 8mm M3 machine screws. If you're using design 2, the screws you'll need are something like this.

A position is open in the rear of the case for the use of a micro USB PCB socket, allowing for direct connection of power to the back of a Raspberry Pi Zero.

Contributing & Commit structure

When submitting a pull request, please use the guidance outlined below.

Each commit message should consist of a body and a footer, structured in the following format:

<scope (optional)>: <subject (mandatory)>
--BLANK LINK--
(optional) <body>
--BLANK LINE--
(optional) Connects-to: #issue-number
(mandatory) Change-type: major | minor | patch
(optional) Signed-off-by: Foo Bar <[email protected]>

Credits

Quotes are delivered from the theysaidso.com They Said So® REST API.

Location information based on IP address is retrieved from ipinfo.io.

We use Norwegian Meteorological Institute's weather API to get the weather forecast of the day. Weather symbols are customized from yr.no's repository.

inkyshot's People

Contributors

balena-ci avatar catt-tung avatar chrisys avatar flowzone-app[bot] avatar gelbal avatar klutchell avatar lmatter avatar maggie44 avatar nucleardreamer avatar page- avatar rahul-thakoor avatar sameureka avatar tmigone avatar vipulgupta2048 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inkyshot's Issues

Allow selection of quote category

The quotes.rest API offers alternative categories, the default is inspire but we have the following options. Could also randomise the category on our end.

  "inspire": "Inspiring Quote of the day",
  "management": "Management Quote of the day",
  "sports": "Sports Quote of the day",
  "life": "Quote of the day about life",
  "funny": "Funny Quote of the day",
  "love": "Quote of the day about Love",
  "art": "Art quote of the day ",
  "students": "Quote of the day for students"

Add WiFi Connect

Add WiFi connect feature so that we can easily add additional WiFi credentials

Logs are not shown when update is run via scheduler

When the display is updated on container start, the device logs in the dashboard show correctly and give information about the display type, size and font size. When the display update occurs via the scheduler (cron) then the logs do not show this information; they should.

Not working natively on 2.13 waveshare e-ink display v3 (and I assume v4)

Done all the installation right with Balena Cloud, I can see my device, I have enabled the parameter for waveshare display but it doesn't seem to work. I think it's due to the fact that my display has a shiny sticker v3 on it. I heard that v2 is being phased out and now the display from waveshare is at least v3 but can also be v4.

Could you please update the project to support this display ? Thank you. I need it to try the pull request I made to add custom phrases and French support.

Pixel font fails to load when run via cron

Traceback (most recent call last):
  File "/usr/app/update-display.py", line 66, in <module>
    font = ImageFont.truetype("./fonts/Grand9KPixel.ttf", font_size)
  File "/usr/local/lib/python3.7/site-packages/PIL/ImageFont.py", line 648, in truetype
    return freetype(font)
  File "/usr/local/lib/python3.7/site-packages/PIL/ImageFont.py", line 645, in freetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/usr/local/lib/python3.7/site-packages/PIL/ImageFont.py", line 194, in __init__
    font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource

Change the language

Hello,
I find this project amazing. I would love to contribute and give a ton of inspirational messages.
I think there's two options to resolve this :

  • add language option in the API
  • add the option to use a CSV/JSON/... File to get the messages

Thank you !

Error in draw_weather

Using Paris, France as location.
It doesn't happen all the time, most of the time it works.

INFO:root:Retrieving weather forecast
INFO:root:Prepare the weather data for drawing
Traceback (most recent call last):
  File "/usr/app/update-display.py", line 274, in <module>
    img = draw_weather(weather, img, SCALE)
  File "/usr/app/update-display.py", line 107, in draw_weather
    time_of_day = 'd' if weather['symbol'].split('_')[1] == 'day' else 'n'
IndexError: list index out of range

Update documentation to mention which screws that is used for the V2 case

Hello
Awsome project. I have build one myself and really like the V2 case. It could be good to update the documentation with info about which screws that is used in the V2 case. I could ofcourse try to experiment with the screws, but I have to order them and would like to order the right one :).
Thanks again for an awsome project.

The Font_Size dosen't change

Hello,

today I tried out this awesome projekt, but i had a littel Problem ... I can't change the FONT_SIZE. If i change the variable for example to 12 and the INKY_MESSAGE is only "HAY THERE" the programm boots with the Size of 8 [I dont think that it's the biggest that fits
IMG_6322
].
Maybe because i am useing the Waveshare display O_O

Sry for my bad english and thanks for help in advance.

INKY_MESSAGE var is broken.

Hey,

ran into an issue were adding the env var of "INKY_MESSAGE" actually doesn't work in the current code for "update-display.py"

between line 340 and 341 the following code needs to be added to make this work.

elif message is not None: pass
The way the current code works the custom message is over written by the qoute making the option for override not work.

its xmas tomorrow and I am tired so will make the changes and send to you over some time next week.

Inky display not updated

Inky phat display not changed, either with quote of the day, or a manual message.
This is on a Pi Zero with a fresh Balena OS install.

Also, I notice the code is set for Inky BLACK.
display = InkyPHAT("black") I'm new to Balena, so without SFTP/Desktop access, how do I change it for my YELLOW Inkyphat?

Thank you!

Weather image not displaying on the Waveshare display

18.05.21 00:00:17 (+0800) inkyshot INFO:root:Retrieving weather forecast
18.05.21 00:00:20 (+0800) inkyshot INFO:root:Prepare the weather data for drawing
18.05.21 00:00:20 (+0800) inkyshot INFO:root:Creating a transparency mask for the image
18.05.21 00:00:24 (+0800) inkyshot INFO:root:Done drawing

While the text is displayed, there is no symbol on the right hand side

image

Weather info is sometimes not displayed

In the logs I see:

04.12.20 09:58:14 (+0100)  main  INFO:root:Retrieving weather forecast
04.12.20 09:58:14 (+0100)  main  ERROR:root:HTTP Error 403: Forbidden

We need to understand why this happens and workaround 403 issues.

Inkyshot-offline

It seems to be working for 2 or 3 days and after that is offline for no particular reason, till I unplug it and plug it right in.

Case designs.

Hi,

Looking at the case design files, what is the difference between case-design1 and case-design2?

Thank you.

Waveshare 2.13" e-paper

Hi,

I can't make it work with the Waveshare 2.13" e-paper.
Did I miss something? Need to change some variable?

No new quote

I am getting no new quote but this errror message. Can someone help me?
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.