Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Radiobrowser - Access Error issue on some models #79

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jonnieZG
Copy link

@jonnieZG jonnieZG commented Dec 3, 2020

Fixed issues:

…ngs, to work with some older radios

- Fixed radiobrowser service stations/byuuid/ REST method name
- Version bumped to 1.1.1
@jonnieZG jonnieZG changed the title - Station UUIDs used by radiobrowser are translated into shorter stri… Fixed Radiobrowser - Access Error issue on some models Dec 3, 2020
@@ -61,14 +64,15 @@ def request(url):


def get_station_by_id(uid):
station_json = request('stations/byid/' + str(uid))
station_json = request('stations/byuuid/' + str(id_registry[uid]))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already fixed in #77

Copy link
Author

@jonnieZG jonnieZG Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly, because this line is changed to fetch the original UUID from the registry - str(id_registry[uid]) instead of just str(uid) :

station_json = request('stations/byuuid/' + str(id_registry[uid]))

ycast/my_stations.py Show resolved Hide resolved
@@ -13,6 +13,7 @@
SHOW_BROKEN_STATIONS = False
ID_PREFIX = "RB"

id_registry = {}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's that for? We can use self.id

Copy link
Author

@jonnieZG jonnieZG Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we can't because the Access Error issue was caused by ID size limit to 15 chars in some radios. That's why we have to translate UUID (36 chars) to a fairly unique ID that will fit the limitation. Currently it is 12 chars, because with the prefix "RB_" it comes to exactly 15 chars.

I am using this dictionary in memory to avoid reading fetching the stations all over again from the remote service. While my_stations reads the stations all over again from the file, calculates ID and matches it on the fly, there are usually much more stations returned by the radiobrowser and going there twice just to find a matching UUID would be really slow.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand.
Can we split this cache speed improvement off of the functionality fix? Would be nice for testing and traceability.

Copy link
Author

@jonnieZG jonnieZG Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry, I am not quite sure what you meant by that. There is no "cache speed improvement" here. Just keeping the ID-UUID dictionary of the last search response. How else would you be able to find the original station when the radio returns an ID that is nothing but a digest value that you calculated from the original station UUID?

The id_registry is absolutely necessary for this fix to work.

ycast/__init__.py Outdated Show resolved Hide resolved
@milaq
Copy link
Owner

milaq commented Dec 3, 2020

Thanks for your work 👍 I've annotated a few things for you.

The main fix is the shortening of the ID. Am I getting this right?

@jonnieZG
Copy link
Author

jonnieZG commented Dec 3, 2020

The main fix is the shortening of the ID. Am I getting this right?

Exactly. Tested and working on my ancient V477.

@KHAGENA-123
Copy link

Hello

I tested version 1.1.1 with my Yamaha NP-S2000.

The following result:

Operation directly on the Yamaha NP-S2000:
seems to be OK. I haven't seen any errors so far.

Operation via the “NP controller” APP does not work.
When selecting a station, the error appears on the Yamaha: "unable to play" (app: Android and IOS)
Example: Radiobrowser-> Country-> Germany-> Classic Radio-> Error "unable to play"

If I use the search function on the iPad (IOS), all listed stations can be played.
Search: "WDR" -> "WDR 1Live - DJ Session" -> OK, station is played back

I'm not a Phyton programmer, who can help? Suspect missing code in the APP part (Translate UUID into shorter strings)

Thank you for the great work so far.

Regards K. Hagena - Germany

@jonnieZG
Copy link
Author

jonnieZG commented Dec 4, 2020

@milaq this might be an off-topic question, but why the additional_info parameter in method get_station_by_id? Since station_tracking is currently hard-coded to False, it fetches the url from the service twice.

File server.py:
station = get_station_by_id(stationid, additional_info=(not station_tracking))

@jonnieZG
Copy link
Author

jonnieZG commented Dec 4, 2020

Operation via the “NP controller” APP does not work.
When selecting a station, the error appears on the Yamaha: "unable to play" (app: Android and IOS)
Example: Radiobrowser-> Country-> Germany-> Classic Radio-> Error "unable to play"

I don-t have the NP Controller, but AV Controller, which are two branches of the same Yamaha app for different radio models. While browsing and playing on my RX-V477 works fine now, I noticed that on "AV Controller" app when browsing through categories list gets stuck somewhere after 1970's. I guess that might be an encoding problem that I'll look into. But definitely that's a different issue.

@mnasec
Copy link

mnasec commented Jan 10, 2021

since the upgrade to the RB uuid-API i had problems with my "old" RX-V777 using RB, tested with the lastest commits. In the past time we already had the 15 char problem with some old receivers. I tried just jonnieZG's code with my receiver and RB does work now!

@jonnieZG
Copy link
Author

since the upgrade to the RB uuid-API i had problems with my "old" RX-V777 using RB, tested with the lastest commits. In the past time we already had the 15 char problem with some old receivers. I tried just jonnieZG's code with my receiver and RB does work now!

I don't know why my changes are not merged into the main project, but I use it anyways since it works great, and I am not bothering with that. I will keep improving my version as I see fit and you are welcome to use it.

@yphyph01
Copy link

Any news about this fix? Is it merge @milaq @jonnieZG
I've got the same error on my RX-V677 and expecting this fix ;-)
Thank you for your work

@mppod
Copy link

mppod commented Feb 27, 2021

I can confirm this fixes the radio browser access error on Yamaha RX-A2010 (#77 does not) - the list of countries does not load fully though (stuck at Loading ...) - the same for other submenus under Radiobrowser->xxx->...

@SpeedyGoneZales
Copy link

Hello @milaq,
would there be any chance to merge this pull request?
My receiver, Marantz M-CR610, is affected, too.

Thanks.

@onkelbeh
Copy link

Can confirm this made it work again, have three RX-V679, and a RX-V481D.

@zofman
Copy link

zofman commented Sep 6, 2021

I would really like to try the JonnieZG version of Ycast to my rx-v577
I cant access subdirectories.
As a Github noob i cant find a way to download.
Please help

@Essoloani
Copy link

I would really like to try the JonnieZG version of Ycast to my rx-v577
I cant access subdirectories.
As a Github noob i cant find a way to download.
Please help

Hi,
I don't know if this is the right way to do it, but my method for testing each fork. Unfortunately none of them solved my problem.

cd /home/pi/tutorial-env/lib/python3.9/site-packages
svn --force export https://github.com/jonnieZG/YCast.git/trunk/ycast

To adapt to your directory tree.

@zofman
Copy link

zofman commented Sep 6, 2021

Thank you, i'll give it a go and let you know

@TheBossME
Copy link

TheBossME commented Sep 6, 2021

pip3 uninstall ycast
pip3 install git+https://github.com/jonnieZG/YCast

does ist for me....

Yamaha DSP-Z7

again tested a few minutes ago. (thanks to milaq and jonnieZG)

@zofman
Copy link

zofman commented Sep 6, 2021

pip3 uninstall ycast
pip3 install git+https://github.com/jonnieZG/YCast

does ist for me....

Yamaha DSP-Z7

again tested a few minutes ago. (thanks to milaq and jonnieZG)

Try that too, if everything else fails.
Thanks all of you !

@zofman
Copy link

zofman commented Sep 6, 2021

Problem is still there..
"Failed to get Net-usb list" is the error i get when i try to browse with my computerapp ( Home remote)
"access error"on the display of the rx-v577
I can access the first category but the next category gives the error.
Hope Milaq or one of you finds a way to make the radiobrowser accessable
In the Netherlands the FM frequencies are getting removed form the air in favour of DAB+
and cableproviders no longer provide analogue FM.
So internetradio is the best option. preferably through my yamaha receiver.

@Essoloani
Copy link

pip3 uninstall ycast
pip3 install git+https://github.com/jonnieZG/YCast

does ist for me....

Yamaha DSP-Z7

again tested a few minutes ago. (thanks to milaq and jonnieZG)

Thank you very much, my method was really barbaric.
Everything seems to be working fine but DENON N9 keeps saying
FILE FORMAT ERROR

@TheBossME
Copy link

My actual Setup is nginx Proxy on debian 11 bullseye arm64 on a proxmox lxc container, together with unbound and pihole.

The Rest of the Setup is completely Same as described By milaq for nginx.

pip3 uninstall ycast

pip3 install git+https://github.com/jonnieZG/YCast

does ist for me....

Yamaha DSP-Z7

again tested a few minutes ago. (thanks to milaq and jonnieZG)

Thank you very much, my method was really barbaric.

Everything seems to be working fine but DENON N9 keeps saying

FILE FORMAT ERROR

@Essoloani
Copy link

After testing several builds that of jonnieZG suits me best.
To facilitate installation:
pip3 install --upgrade --force-reinstall git+https://github.com/jonnieZG/YCast
My suggestion would be to put "My Stations" before "Radiobrowser" like yay6.
Merci beaucoup!

@zofman
Copy link

zofman commented Sep 9, 2021

Tried all of the above, sadly its not working for me.
I think there is something else going on in my network because the symptoms stay the same.
Mystations work, radiobrowser only 1 stage ...
Asus rt ac86u with Merlin to raspi2 to rx v577

@TheBossME
Copy link

Tried all of the above, sadly its not working for me.

I think there is something else going on in my network because the symptoms stay the same.

Mystations work, radiobrowser only 1 stage ...

Asus rt ac86u with Merlin to raspi2 to rx v577

I can not estimate how good your knowledge in routing Linux ... DNS.. etc... I am happy to help over a remote session if I can.

But i'm do not Programming in Python.. But, have also a Yamaha Setup Running Fine. Mine is a Network/receiver 2.0

@zofman
Copy link

zofman commented Sep 9, 2021

Thank you for you offer,
But its not worth the effort.
I manually put the stations in mystations.yml
And start saving money for a DAB receiver

@Essoloani
Copy link

Essoloani commented Sep 9, 2021

When I got interested in YCast I didn't know anything about raspberry and even less about linux. Today I am happy with what I learned at my age.
Vtuner sent a wrong message on Hi-Tech and YCast is a great response.

@Reisbrei
Copy link

Tried all of the above, sadly its not working for me. I think there is something else going on in my network because the symptoms stay the same. Mystations work, radiobrowser only 1 stage ... Asus rt ac86u with Merlin to raspi2 to rx v577

@zofman I had the same problem here
I recognized that i had two versions of ycast installed while "uninstalling it twice"

pi@raspberrypi:~ $ python3 -m pip uninstall ycast
Found existing installation: ycast 1.1.0
Uninstalling ycast-1.1.0:
  Would remove:
    /home/pi/.local/lib/python3.5/site-packages/ycast-1.1.0.dist-info/*

...


pi@raspberrypi:~ $ python3 -m pip uninstall ycast`
Found existing installation: ycast 1.0.0
Uninstalling ycast-1.0.0:
  Would remove:
    /usr/local/lib/python3.5/dist-packages/ycast-1.0.0.dist-info/*

...

pi@raspberrypi:~ $ python3 -m pip uninstall ycast
WARNING: Skipping ycast as it is not installed.

I just reinstalled ycast 1.1.0 and some dependencies via

pi@raspberrypi:~ $ python3 -m pip install ycast
pi@raspberrypi:~ $ apt-get install libopenjp2-7 libtiff5

@silverus777
Copy link

Thank you both guys, milaq and jonnieZG.
Thanks to you, my old Yamaha RX-V473 can play radio again without greedy vtuner service. Also Radiobrowser seems to be much faster than vtuner.
On the milaq version ‘My Stations’ worked fine, but Radiobrowser was returning Access Error after entering category.
That problem was resolved thanks to jonnieZG effort :) On his fork, Radiobrowser work just fine on my RX-V473.

@Andrey5577
Copy link

Yamaha rx-v477 access error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet