Code Monkey home page Code Monkey logo

tinyticker's Introduction

๐Ÿš€ tinyticker ๐Ÿš€

Discord


tinyticker uses a Raspberry Pi zero W and a small ePaper display to periodically display a stock or crypto chart.

A flask web interface is created to set the ticker options and control the Raspberry Pi.

tinyticker uses the cryptocompare API to query the crypto price information, you'll need to get yourself a free API key. As well as the yfinance package to get the stock financial data.

๐Ÿ›’ Hardware

Shopping list:

๐Ÿ“ฆ Installation

Recommended setup

Flash the tinyticker image onto a SD card and you should be good to go.

Note

To build your own image, see the pi-gen repo.

Manual setup

Note

This is much more involved than the recommended setup and will most likely require some debugging.

Expand

I highly recommend using comitup to setup the networking on your RPi.

  • Write the comitup image to your sd card

  • Boot up the RPi and setup the networking

  • ssh into your RPi, you'll probably want to change the password while you're at it

  • Enable the SPI interface

  • (Optional) rename the hostname of your RPi by editing the /etc/hostname and /etc/hosts file

  • (Optional) rename the Wifi AP name by editing the /etc/comitup.conf file

  • Install the BCM2835 driver:

    curl http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz | tar xzv
    cd bcm2835-1.60/
    ./configure
    make
    make install
    • Install pip:
    sudo apt install python3-pip
    • Install dependency requirements:
    sudo apt install libxml2-dev libxslt1-dev libatlas-base-dev ninja-build patchelf libopenjp2-7 libtiff-dev libjpeg-dev
    • Install tinyticker:
    pip install tinyticker

๐Ÿ‘ข First boot

On first boot, you will need to connect your RPi to your wifi network.

  • Connect to the tinyticker wifi AP
  • Select the wifi network you want your RPi to connect to
  • Enter the wifi password

Your RPi will now connect to your wifi and the tinyticker services will start.

Once the web app is running, head over to http://tinyticker.local to configure it.

tinyticker's People

Contributors

loiccoyle avatar github-actions[bot] avatar

Stargazers

 avatar Jirawat S avatar Hakim | Nodes Squad avatar John Manos avatar RoCry avatar  avatar  avatar Bartek Szatkowski avatar Rob Hulley avatar  avatar Lukรกลก Melega avatar  avatar

Watchers

 avatar  avatar

tinyticker's Issues

SSID isn't broadcast on boot

Hey, I'm not sure if I have an incompatible board or something but whenever I attempt to flash an sd and boot it in a pi zero w 1.1 I'm unable to find a broadcasted wifi network from the device, nor am I able to connect to it via a usb ethernet adapter.

It also doesn't write anything to the display, I'm using a waveshare 2.13 v3.

Weirdly a blank comitup image works but then after installing tinyticker the services always exit out with an error code and nothing is written to the screen.

update command

The update command just runs: pipx upgrade tinyticker regardless of whether or not it was installed using pipx in the first place.

A check to see if it was installed through pipx should be added, if it wasn't then use pip.

create RPi images

It would be great to create a preconfigured RPi image which can just be written to an sd card and it works out of the box.

Bonus: have it create an image automatically on new release.

Some links:

Ticker Data is backwards

First, I want to say that this project is awesome. Thank you for making it.

I just installed the latest build of tinyticker from the image hosted on google drive. The problem I'm seeing is that all the data displayed on the e-paper display is all backwards.

See attached image for reference. Any idea as to what is causing this or how to fix it? This is a v2 waveshare 2.13in. No other packages or dependencies are installed.
PXL_20240711_135927721 (1)

Incorrect current price

When the market is in pre or post market, the "lastPrice" given by yfinance is the last price of the regular market.

outdated data infinite loop

When all configured tickers are giving outdated data, i.e. when the exchanges are closed, tinyticker just loops forever querying data on every loop.

while True:
for ticker in self.tickers:
min_delta: pd.Timedelta = max(pd.to_timedelta("5m"), ticker._interval_dt) # type: ignore
# when fetching daily data from yfinance, the timestamps are 00:00:00 of the day in question
# which covers the full day's trade from open to close, so we relax the outdated constraint.
if min_delta == pd.to_timedelta("1d"):
min_delta *= 2
try:
response = ticker.single_tick()
except Exception as e:
LOGGER.error(f"{ticker} failed with {e}")
continue
if self.skip_empty and (
response.historical is None or response.historical.empty
):
LOGGER.debug(f"{ticker} response empty, skipping.")
continue
if self.skip_outdated and (
(utils.now() - response.historical.index[-1]) # type: ignore
> min_delta
):
LOGGER.debug(f"{ticker} response outdated, skipping.")
continue

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.