NanoSound Official Help

Thanks for your answer. I’m looking forward to the next updates.
Another question, is it possible to use a long press on the buttons? Something like this:

[code]#!/usr/bin/python

import time
import os
from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate

Initialize the LCD plate. Should auto-detect correct I2C bus. If not,

pass ‘0’ for early 256 MB Model B boards or ‘1’ for all later versions

lcd = Adafruit_CharLCDPlate()

time.sleep(1)

pressed_time = None

while True:

if lcd.buttonPressed(lcd.RIGHT):
    if pressed_time is None:
        #just pressed
        pressed_time = time.time()
    elif time.time() - pressed_time >= 5.0:
        #reboot
        lcd.clear()
        lcd.message("Reboot!")
        time.sleep(2)
        lcd.clear()
        lcd.backlight(lcd.OFF)
        os.system("sudo reboot")

elif lcd.buttonPressed(lcd.SELECT):
    if pressed_time is None:
        #just pressed
        pressed_time = time.time()
    elif time.time() - pressed_time >= 3.0:
        #shutdown
        lcd.clear()
        lcd.message("Power off!")
        time.sleep(2)
        lcd.clear()
        lcd.backlight(lcd.OFF)
        os.system("sudo shutdown -h now")

else:
    pressed_time = None

time.sleep(0.1)

[/code]
Which command can I add to your code? Example:
Normal press = next
Long press = fast forward
Thanks in advance.

I got the Nanomesher Set for my Pi3.
Volumio works.
But only the following keys work on the remote Control:

Power
Play/Pause
Next Title
Previous Title
FastForward
FastBack

Yes thats all and I am a bit disapointed.

no Shuffle
no Mute
no Repeat
not to Speak of anything else.

thats a lot of “no” funcion for a lot of money… :confused:

Thats my first Problem.

The Second:
I would love to set it up for my Logitec Harmony…so the question is “How?” :question:

Hi, thanks for the feedback.

We are indeed working on the commands you mentioned via infrared control.

A free software update will be made available, hopefully in a month.

Regarding logitech harmony, can you get it to learn the infrared commands so it sends the same infrared signal as the one comes with the dac?

Cheers

Hello, I installed Nanosound DAC PRO on RPI3.
It comes up with remote control, and the R/C is not working.
I played with headphones, playing musics is OK.
Also OLED is good, either. What is wrong?

Hi Nanomesher,

I see two Nanosound plugins in the Volumio repository - one of them is dated 22.1.2018.
Is it the long awaited v2 or is it a bug in the repository ?

Josef

Hello, have you tried again after rebooting? Which function in the remote did you press? Have you made sure the nanosound plug-in is enabled?
If problem persist, try reinstall the plugin and let us know. thanks

Nanomesher

Hi Josef,
Thanks for your support. This is the v1.4 (not v2) which contains some improvements listed http://nanomesher.com/nanosound-plug-in-v1-4-for-volumio/ which many were previously requested.

We are continuing to improve it.

Cheers,

Nanomesher

HI Twist,

The remote control and display now include mute/random/repeat - details are here - http://nanomesher.com/nanosound-plug-in-v1-4-for-volumio/

Cheers

Nanomesher

Did you really test scrolling?
In your code, this:

try: for x in range(100,-10,-1):
lets scroll only 20 characters on my 0.96’’ OLED.
So, if a title has for example 50 characters we can not read the full title because it is cut off.
I tried this:

try: for x in range(100,-20,-1):
lets only 21 characters scroll,

try: for x in range(100,-100,-1):
lets only 34 characters scroll.

Hi tigger-gg,

where is the file located ?
34 chars is better than like it is now

  • Josef

Hi Josef,

the file nanodac_oled.py is located in/home/volumio/nanosound_oled

I think we need something similar like https://github.com/adafruit/Adafruit_Python_SSD1306/blob/master/examples/animate.py

Hi tigger-gg,

Thank you very much. That works.

Do you know how i could make also the second line scrolling ?
There are many radio stations with long names and i only can see the middle of the text.

Maybe you even know how to make it scroll a little bit faster ?

-Josef

For scrolling the second line (artist) you have to change from

draw.text((left, 18), artist,font=font1, fill="white")

to

draw.text((x, 18), artist,font=font1, fill="white")

If you want the second line is only scrolling for Webradio, you can do this:

[code]# draw.text((left, 18), artist,font=font1, fill=“white”)

                            RDSText = (trackType)
                            if(RDSText=="webradio"):
                                    draw.text((x, 21), artist,font=font1, fill="white")
                            else:
                                    draw.text((left, 21), artist,font=font1, fill="white")[/code]

Now the artist line is only scrolling when webradio is playing.

try: for x in range(100,-10,-1):
You have to change the “-1” to for example -4. This lets scroll faster.

Again, my respect for nanomesher and this plugin. But, please have look to this scrolling issue.

github.com/adafruit/Adafruit_Py … animate.py
I tried this to intecrate in nanodac_oled.py, unfortunately so far without success.

Thanks a lot, tigger-gg.
Works perfect.

-Josef

I did it.
My code is not elegant or perfect.
I’m not an expert, nor have I ever learned python. Trial and error, is my motto.
We need to use the Adafruit library. Please install the library as described here:
https://learn.adafruit.com/ssd1306-oled-displays-with-raspberry-pi-and-beaglebone-black/usage

First we do a backup of the file nanodac_oled.py:

cd /home/volumio/nanosound_oled
mv nanodac_oled.py nanodac_oled.py.old

Download my edited nanodac_oled.py from https://drive.google.com/file/d/1cSP2SndPqWXn5SkqYsTQk-ummIHIUzhV/view?usp=sharing
and copy it to /home/volumio/nanosound_oled/
Restart nanosound_oled service:

sudo service nanosound_oled restart

@Josef,
for scrolling the second line (artist) I will have a look later. For now I need a break :wink:
Or try it by yourself :wink:

Thanks
Installed it just now…will test it later. Also the learning of my Harmony…
Sound is good and now the usability is at least as good as the old Ipod touch +dock it replaced.

Hi! thanks for taking time to help improving the plugin. Its greatly appreciated. What is the problem with the scrolling and how does the adafruit library help? Thanks

Thats the problem. Your code doesnt scroll the entire title. I dont know how to describe perfect in english. For example: when the title has 60 chacters, yor code scroll only 20 characters with the used font. I think, no matter how long the title is, the entire title has to be scrolled (not only 20 characters).

Honestly? I dont know :wink:
I found the example https://github.com/adafruit/Adafruit_Python_SSD1306/blob/master/examples/animate.py. I found animate.py quite perfect for nonosound. So I tried, made mistakes, tried, made mistakes again. And at some point it works.
Im not an python expert to say how the adafruit library helps.

Thanks a lot for your prompt reply and description. We will take a look into it and evaluate whether there is a need to switch to Adafruit library.

Thanks for making these suggestions and that’s exactly why NanoSound’s software is open sourced.

Cheers,

Nanomesher