Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide Play DAB+ Radio in Moode
#1
Hi guys

I want you tell you my solution to hear DAB+ radio on a Raspberry Pi and Moode.
It works but in the end there also much work.

Here is my step-by-step guide.

Hardware 
Firstly you need a Raspberry Pi with Moode. I use a Pi3. All faster Pi should work but older Pis should be tested if it works. I think a Pi1 wouldn't work.
Also you need a RTL-SDR USB Stick. I use this one.... Nooelec NESDR SMArt v4
Please forget you need a antenna for the stick.

Connect the RTL stick to your Pi, connect a antenna on the RTL stick and start up the Pi.

Install RTL-SDR drivers
Code:
cd /home/pi
sudo apt-get install -y  git cmake pkg-config libusb-1.0-0-dev
git clone git://git.osmocom.org/rtl-sdr.git

Code:
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
sudo ldconfig

To prevent some driver problems edit a blacklist for the old drivers.
Code:
sudo nano /etc/modprobe.d/blacklist-rtl.conf

Insert this in the editor....
Code:
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

Save it with ctrl+o and exit the editor.
Now should reboot the Pi and test the driver.
Code:
sudo reboot
rtl_test -t

You should see something like that.
Code:
Found 1 device(s):
 0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.
pi@moode:~ $


Install DAB+ software

To run DAB on the Pi I decidet to use welle.io. More likely a part of this project.... welle.io-CLI

Code:
sudo apt-get update
sudo apt install libfaad-dev libmpg123-dev libmpg123-dev libfftw3-dev librtlsdr-dev libusb-1.0-0-dev libpulse-dev libsoapysdr-dev libairspy-dev libmp3lame-dev
cd /usr/src/
sudo git clone https://github.com/AlbrechtL/welle.io
cd welle.io
sudo git checkout v2.0-beta1
sudo mkdir build
cd build
sudo cmake .. -DRTLSDR=1 -DBUILD_WELLE_IO=0
sudo make

Using DAB+ Webplayer

Now you need to know the used DAB Channels in your region.
Do you don't know it, take a look on fmscan.org. Here you get all infos about channels, ensembles, services ect.

Code:
/usr/src/welle.io/build/welle-cli -w 7979 -c <your channel> -C 2 -P -u

At <your channel> use your deside channel. 

In my case I take "DR Deutschland" 5C. 
Code:
sudo /usr/src/welle.io/build/welle-cli -w 7979 -c 5C -C 2 -P -u

Now you can play DAB+ on your PC by using a browser. 
All you have to do is enter the following address in the browser.

<The_Ip_adress_of_your_moodeplayer>: 7979

Here you can see all information about the selected channel. The SiD (service ID) of the station that is to be played in Moode is important for the further procedure.

For example, we will play Radio ENERGY. This runs in Germany in channel 5C (we have already selected it) and the SiD 0x1a45.

In order to play this station in Moode we create a PLS file with the following content.
Code:
[playlist]
numberofentries=1
File1=http://localhost:7979/mp3/0x1a45
Title1=DAB+ Radio: ENERGY
Length1=-1
version=2

Start your playlist in Moode.... congratulations your are hearing DAB+ in Moode.  Wink


But now there are some bad news.
Unfortunately it is only possible to decode one channel. There are several ways to change the channel.
1. You shut down the server and start it with another channel
2. You send an HTTP POST request to the server.
3. It is said to still be possible via JSON. I have to make myself smart here.

Unfortunately, this is not possible directly from Moode.

Despite all of this, I wish you lots of fun with it.  Wink
Reply
#2
Hey guys!

Now I have a solution for othe channel switching problem.

I have written a skript to switch automaticly the channels.

download it here:
https://github.com/Peziman/Moode-DAB-ADDON

How to work....

Create some Webradio station in Moode.

URL: http://localhost:7979/mp3/<your_sID_from your _DAB+_program>
Name: DAB+ - <the_name_of_the_program> - <the_channel_of_the_DAB+_programm>

For the example above it must look like this.

URL: http://localhost:7979/mp3/0x1a45
Name: DAB+ - ENERGY - C5

It's important that the Name Starts with DAB+ and ends with the Channel of the DAB+ program.

Start welle.io and the DABclient.py

Now you can switch the DAB+ programs automaticly.

Some hints:
- DAB programs on the same channels switch very fast
- DAB programs on different channels take a few seconds to start
- if you start welle.io and the DABclient script at autostart, it need to sleep 60 seconds before you start the DABclient script.
Reply
#3
Hello Peziman,
I tried your proposed solution and I got some problems:
1. If I start welle-cli (in my case sudo /usr/src/welle.io/build/welle-cli -w 7979 -c 12A -P) and start an URL with the
correct SID everything is running until the "putty client" is alive.
2. I have tried the second ADDON but probably I am not so able to follow you: what you mean with: "Start welle.io and
the DABclient.py". In other terms I have tried to run the above command on a putty session and have tried, on an
other putty session and I get back some errors:

sudo python DABclient.py
Traceback (most recent call last):
File "DABclient.py", line 4, in <module>
from mpdclass import MPDConnect
File "/home/pi/mpdclass.py", line 8, in <module>
from mpd import MPDClient, MPDError, CommandError, ConnectionError
ImportError: No module named mpd

or

sudo python3.7 DABclient.py
File "DABclient.py", line 25
print cur_ch
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(cur_ch)?

I have modified all the print command including parentheses but I get similar errors:

sudo python3.7 DABclient.py
Traceback (most recent call last):
File "DABclient.py", line 4, in <module>
from mpdclass import MPDConnect
File "/home/pi/mpdclass.py", line 25
except(socket_error, ConnectionError):
^
TabError: inconsistent use of tabs and spaces in indentation

Would you please br so kind to try to help me to find where I go wrong?
Best regards and thanks in advance,
Francesco
Reply
#4
Hi Francesco!


Sorry for late answering!

Quote:sudo python DABclient.py
Traceback (most recent call last):
File "DABclient.py", line 4, in <module>
from mpdclass import MPDConnect
File "/home/pi/mpdclass.py", line 8, in <module>
from mpd import MPDClient, MPDError, CommandError, ConnectionError
ImportError: No module named mpd

That's the right way, but you have not installed the python mpd package.
Do the following in the terminal.
Code:
sudo apt-get update
sudo apt-get install python-mpd

That should fix the error message!

The best way would be if you let welle.io and the DAB addon start automatically when starting the Raspberry.

Best regards
Thomas
Reply
#5
(08-04-2020, 10:12 AM)Peziman Wrote: Hi Francesco!


Sorry for late answering!

Quote:sudo python DABclient.py
Traceback (most recent call last):
File "DABclient.py", line 4, in <module>
from mpdclass import MPDConnect
File "/home/pi/mpdclass.py", line 8, in <module>
from mpd import MPDClient, MPDError, CommandError, ConnectionError
ImportError: No module named mpd

That's the right way, but you have not installed the python mpd package.
Do the following in the terminal.
Code:
sudo apt-get update
sudo apt-get install python-mpd

That should fix the error message!

The best way would be if you let welle.io and the DAB addon start automatically when starting the Raspberry.

Best regards
Thomas
Hi Thomas, 
Thanks a lot for you replay. I will try next week and I will inform you about the results.
Thanks again and CIAO,
Francesco
Reply
#6
(08-11-2020, 10:52 PM)fdealexa Wrote:
(08-04-2020, 10:12 AM)Peziman Wrote: Hi Francesco!


Sorry for late answering!

Quote:sudo python DABclient.py
Traceback (most recent call last):
File "DABclient.py", line 4, in <module>
from mpdclass import MPDConnect
File "/home/pi/mpdclass.py", line 8, in <module>
from mpd import MPDClient, MPDError, CommandError, ConnectionError
ImportError: No module named mpd

That's the right way, but you have not installed the python mpd package.
Do the following in the terminal.
Code:
sudo apt-get update
sudo apt-get install python-mpd

That should fix the error message!

The best way would be if you let welle.io and the DAB addon start automatically when starting the Raspberry.

Best regards
Thomas
Hi Thomas, 
Thanks a lot for you replay. I will try next week and I will inform you about the results.
Thanks again and CIAO,
Francesco


Hello Thomas,
I have reinstalled everything on a scratch installation (6.7.1) and everythings is running well: thank you so much.
Now I have a couple of points to submit to your experience:
1. About the NAME of the Webradio station in Moode: it seems to me that must not be any space beetwen "DAB+" and "-" and beetween "-" and the Channel #.
Furthermore on the 6.7.1 there is the new editable field "Name (displayed)" : it must be the same of "Station name".
2. Which method you suggest to "automatically start" the commands:
         sudo /usr/src/welle.io/build/welle-cli -w 7979 -c 12A -C 2 -P -u
               and
         sudo python /home/pi/DAB-ADDON/DABclient.py
? Details will be very appreciated.

Sorry for my english.
Best regards and thanks again,
Francesco
Reply
#7
Hello everybody,
I found a different solution instead of DAB-ADDON, using only welle.io/welle.cli.
There is a change to the "webradiointerface.cpp" module that allows you to change channels directly with the URL request.
In other words, the URL request is http: // localhost: 7979 / mp3 / CHANNEL / SID.
Instructions can be found on: "https://github.com/AlbrechtL/welle.io/issues/559".
I have successfully integrated it on moOde player.
Best regards and thanks,
Francesco
Reply
#8
My project is to use an RPI4 running Moode with an RTL-SDR receiver (V4) in order to be used as a mobile DAB+ Radio installed in car replacing a conventionnal Car Radio.

Following this thread and with the kind help of fdealexa (Francesco) I have installed the RTL-SDR drivers and the welle-io software .

My understanding at this point is that I need to modify the "webradiointerface.cpp" module (with sudo nano command) located in usr/src/welle.io/src/welle-cli

At my location I have the following channel populated : 9A, 9C and 11C  (for the present I am staying at the same location)


I do not clearly see how to integrate the possibility to integrate into moode following the info provided by fdealexa in this thread.
Reply
#9
Hi Alain,
the modification consists in adding an IF instruction block, in the original "webradiointerface.cpp" module. I requested to the authors of "welle" to add it on their code (to have it in the following release) but, unfortunatly they did not accept.
The current release is 2.4 and the modification position reported on the issue "https://github.com/AlbrechtL/welle.io/issues/559" is different (500 instead of 474).
The modification is necessary to change channel and subchannel (or SID) because the original module accepted change of the subchannel only.
In other word, you need it to allow the request: http://localhost:7979/mp3/CHANNEL/SID: for example to listen to the "CHANTE FRANCE"
you have to create a radio station on moode with the URL "http://127.0.0.1:7979/mp3/9A/0xfe43"
I hope it is more clear than before, please do not hesitate to ask for any additional doubts.
Best regards,
Francesco
Reply
#10
(02-19-2024, 01:11 AM)fdealexa Wrote: Hi Alain,
the modification consists in adding an IF instruction block,  in the original "webradiointerface.cpp" module. I requested to the authors of "welle" to add it on their code (to have it in the following release) but, unfortunatly they did not accept.
The current release is 2.4 and the modification position reported on the issue "https://github.com/AlbrechtL/welle.io/issues/559" is different (500 instead of 474).
The modification is necessary to change channel and subchannel (or SID) because the original module accepted change of the subchannel only.
In other word, you need it to allow the request: http://localhost:7979/mp3/CHANNEL/SID: for example to listen to the "CHANTE FRANCE"
you have to create a radio station on moode with the URL "http://127.0.0.1:7979/mp3/9A/0xfe43"
I hope it is more clear than before, please do not hesitate to ask for any additional doubts.
Best regards,
Francesco

Ho Francesco

Thanks again for your help.

If my understanding is correct ,

1) I copy the code from athoik in the thread ""https://github.com/AlbrechtL/welle.io/issues/559" after having modified the -474,9 and +474,38 value with -500,9 and +500,38


2) I paste this code into the "webradiointerface.cpp" module (at any place into the file, so it will be at the end of the file)

3) I create a Radio station on Moode with the URL http://127.0.0.1:7979/mp3/9A/0xfe43

Well .. the result is an mpd Error:  Failed to decode http://XXX.XXX.XX.XX:7979/mp3/9A/0xfe43; got HTTP status 404

So my undesrtanding was not correct ....

At this point I do not see clearly how to have a real DAB radio player with moode, I mean having an automatic detection and prompt of the DAB Radio available in my area, and simply selectig the one I want to listen to.
Reply


Forum Jump: