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
- ds18b20 sensor
- 16*2 HD44780 display with i2c adapter
- 4 click buttons and resistor
- configured
spdif
kernel module for audio output - configured
i2c
andw1_therm
,w1gpio
,wire
kernel modules
- 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
Python modules smbus, python-vlc, pyA20, pyyaml
Module pyA20
was wrote for Python version 2, so Python2 only
- Add stream radio sources to
stations.json
file - Change
temp_sensor_file
value inconfig.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 putserver.pem
file tocertfile
directory. Notice, that during of running openssl command, you should specify parametercommon name
as your device local ip address. - Change
server_user_name
andserver_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
Tested on Orange Pi Zero H2+ 256Mb edition