Is there any way to get the Now playing information(at least song and artist) from volumio installed raspberry to a microcontroller
Through i2c or any other communication methods??
Application
I am building a streaming player / amplifier with separate Bluetooth and Aux input and inputs are selecting by using an input selector powered by arduino,
So Right now I am using 2 separate small displays in my system, one for displaying volumio playback details(connected to raspberry) and other one for displaying the present input details(connected to Arduino )…
If I can fetch the now playing information from raspberry, I can display all details together in a single display? if anyone has any idea about this please help thanks in advance …
Using serial communication you can communicate both directions.
I had build streamer working like this: arduino controls pt231 as a sound selector and equalizer and displays what i want on VFD display, raspberry as a streamer and to receives and sends status/commands to home assistant.
Below code for sending strings to arduino from raspberry:
Python code:
import serial,time
if __name__ == '__main__':
print('Running. Press CTRL-C to exit.')
with serial.Serial("/dev/ttyUSB1", 115200, timeout=1) as arduino:
time.sleep(0.1) #wait for serial to open
if arduino.isOpen():
print("{} connected!".format(arduino.port))
try:
while True:
your_string = "your string"
cmd_to_send = your_string+"\n"
arduino.write(cmd_to_send.encode())
time.sleep(1)
except KeyboardInterrupt:
print("KeyboardInterrupt has been caught.")
Arduino code:
add to: void setup()
Serial.begin(115200);
add to: void loop()
String pi_string;
if (Serial.available())
{
delay(10);
while (Serial.available() > 0)
{
pi_string = Serial.readStringUntil('\n'); #recived string
}
Serial.flush();
Thank you for the reply, I think this is the one I need, I have some doubts regarding the python parts, I am not good in that, how we will add the python code in volumio?
I found like this from some other forums
Install Python using SSH
then SSH I can access python
and run the script
is this correct?
if possible, can you just give the steps for this ??
Blockquote
I found like this from some other forums
Install Python using SSH
then SSH I can access python
and run the script
is this correct?
if possible, can you just give the steps for this ??
Also you need to also install needed python modules.
Steps:
read how to connect to Volumio via SSH and connect