Code Monkey home page Code Monkey logo

opimc's Introduction

OpiMc

Internet-radio player for Orange Pi Zero written in Python2.

Device use HD44780 display and sensor buttons to control it. Also, use build-in http server to handle request remotely via json-api, using https connection and basic http auth

Requirements

  • ds18b20 sensor
  • 16*2 HD44780 display with i2c adapter
  • 4 click buttons and resistor
  • configured spdif kernel module for audio output
  • configured i2c and w1_therm, w1gpio, wire kernel modules

Feautures

  • playing internet radio stations
  • display time and date
  • display temperature
  • display cpu and mem load
  • build-in python http-server to handle commands from remote

Dependencies

Python modules smbus, python-vlc, pyA20, pyyaml

Module pyA20 was wrote for Python version 2, so Python2 only

Preparations

  • Add stream radio sources to stations.json file
  • Change temp_sensor_file value in config.yaml file to your ds18b20 sensor w1 address
  • Change lcd i2c address in devices/I2C_LCD_driver.py file from 0x3F to your address
  • Generate ssl key for build-in http-server with command openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes and put server.pem file to certfile directory. Notice, that during of running openssl command, you should specify parameter common name as your device local ip address.
  • Change server_user_name and server_user_password params to yours for base http authentication

Source of the lcd driver was found here


To run app on system startup (systemd) edit WorkingDirectory and ExecStart params
in opimc.service and then copy file to /lib/systemd/system/ directory

chmod 644 opimc.service
sudo systemctl daemon-reload
sudo systemctl enable opimc.service

App will start on next reboot.
To run immediately type sudo systemctl start opimc.service

Notes

Tested on Orange Pi Zero H2+ 256Mb edition

opimc's People

Contributors

flotzilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

42ne pythoniot

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.