01-20-2019, 03:11 PM
(01-20-2019, 10:35 AM)dedero Wrote:(01-19-2019, 07:15 PM)Tim Curtis Wrote: Does the manufacturer of this device provide any instructions on how to integrate it?
Hi!, actually they don't provide detailed instructions for software implementation, it's probably on the other way around, I could read this post from their forum looking for an API to start the implementation from their side on moOde: https://nanomesher.com/forum/?view=thread&id=9
I remember reading a post that I cannot find anymore that was somebody asking to make this DAC work on moOde and somebody told him to choose HiFi Berry DAC to make it work but I cannot confirm this.
I was taking a look at the mentioned moOde API on nanosound forum but I couldn't find it, if you have any info about it, please let me know and I can post it on nanosound forum so they can start the implementation to moOde.
The other information is the GPIO connections which seems to be quite straightforward: https://nanomesher.com/nanosound-gpio-usage/
Cheers!
Bruno.
See below for how to interface to moOde for volume, playback control and lcd.
Volume control
Code:
pi@rp3:~ $ /var/www/vol.sh --help
Usage: vol.sh [OPTION] [VOLUME]
Change the volume and update the knob.
With no OPTION or VOLUME, print the current volume.
With just VOLUME, set current volume to VOLUME.
-up VOLUME value between 1 and 100
-dn VOLUME value between 1 and 100
-mute mute or unmute the volume
-restore set volume to current knob volume
--version print the program version
--help print this help text
pi@rp3:~ $
Playback control
Code:
mpc play
mpc pause
mpc next
mpc prev
Data for LCD
- Enable "External metadata" in System config
- when data changes the file is updated within 3 secs
Code:
Radio Station
pi@rp3:~ $ cat /var/local/www/currentsong.txt
file=http://aac-64.streamthejazzgroove.com:80/stream
artist=Radio station
album=The Jazz Groove
title=Pat Martino - How Insensitive
coverurl=images/radio-logos/The Jazz Groove.jpg
track=
date=
composer=
encoded=VBR
bitrate=69 kbps
outrate=16 bit, 44.1 kHz, Stereo, 1.411 mbps
volume=11
mute=0
state=play
pi@rp3:~ $
Song file
pi@rp3:~ $ cat /var/local/www/currentsong.txt
file=NAS/Music/Antoine Hervé/Summertime/01 Love for Sale.flac
artist=Antoine Hervé
album=Summertime
title=Love for Sale
coverurl=/coverart.php/NAS%2FMusic%2FAntoine%20Herv%C3%A9%2FSummertime%2F01%20Love%20for%20Sale.flac
track=1
date=2002
composer=Cole Porter
encoded=16/44.1 FLAC
bitrate=651 kbps
outrate=16 bit, 44.1 kHz, Stereo, 1.411 mbps
volume=11
mute=0
state=play
pi@rp3:~ $
Renderer (Bluetooth, Airplay, Spotify, Squeezelite)
pi@rp3:~ $ cat /var/local/www/currentsong.txt
file=Bluetooth Active
outrate=16 bit, 44.1 kHz, Stereo, 1.411 mbps
pi@rp3:~ $
Updating LCD Dsplay
Code:
Method #1 Using LCD Updater engine with a Python script
1. Turn on "LCD update engine" in System config
2. Write a Python script that updates the LCD using data parsed from currentsong.txt metadata file.
3. NOTE: this script MUST NOT have a polling loop for detecting changes in the metadata file. The LCD update engine provides the "loop" outside of the script. The advantage is that it uses the efficient inotifywait event system instead of a less efficient polling loop to detect when the data file changes.
Method #2 - Using stand-along Python Script with its own polling loop
1. Write a Python script that updates the LCD using data parsed from currentsong.txt file
2. NOTE: This script MUST contain its own polling loop to detect changes in the metadata file