milaq / YCast

Self hosted vTuner internet radio service emulation
Other
243 stars 93 forks source link

RX-N600 support #37

Open lampra1 opened 4 years ago

lampra1 commented 4 years ago

I am trying to setup ycast for a yamaha RX-N600. I am running armbian(debian) buster on cubietruck and Python 3.7.3 On my router (mikrotik) i use static DNS for radioyamaha.vtuner.com and radioyamaha2.vtuner.com I use iptables to redirect ports: iptables -t nat -A PREROUTING -s 192.168.10.10 -p tcp --dport 80 -j REDIRECT --to-port 8010 Here is the debug info:

root@cubietruck:~# python3 -m ycast -l 0.0.0.0 -p 8010 -d
2020-02-22 19:28:28 INFO: YCast (1.0.0) server starting
2020-02-22 19:28:28 DEBUG: Debug logging enabled
 * Serving Flask app "ycast.server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
2020-02-22 19:28:28 INFO:  * Running on http://0.0.0.0:8010/ (Press CTRL+C to quit)
2020-02-22 19:28:31 INFO: 192.168.10.10 - - [22/Feb/2020 19:28:31] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:28:36 INFO: 192.168.10.10 - - [22/Feb/2020 19:28:36] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:28:40 INFO: 192.168.10.10 - - [22/Feb/2020 19:28:40] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:28:43 INFO: 192.168.10.10 - - [22/Feb/2020 19:28:43] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:33:34 INFO: 192.168.10.4 - - [22/Feb/2020 19:33:34] "GET /ycast/ HTTP/1.1" 200 -
2020-02-22 19:35:20 INFO: 192.168.10.10 - - [22/Feb/2020 19:35:20] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:35:23 INFO: 192.168.10.10 - - [22/Feb/2020 19:35:23] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
^Croot@cubietruck:~# 

On the RX-N600 i get Connect error If I try the ycast on my browser i get: -1Dirhttp://192.168.10.7:8010/ycast/radiobrowser/?vtuner=truehttp://192.168.10.7:8010/ycast/radiobrowser/?vtuner=true4Dirhttp://192.168.10.7:8010/ycast/my_stations/?vtuner=truehttp://192.168.10.7:8010/ycast/my_stations/?vtuner=true3

Here is the tcpdump file ycast_debug.zip

Any suggestion?

lampra1 commented 4 years ago

I attach also the tcpdump file with the connection to the original vtuner ip. original_vtuner.zip

Edit: The only difference i can see is that in the original vtuner connection, the xml file does not include Itemcount

milaq commented 4 years ago

Thanks for the extensive debug info :+1:

I just took a look at it. As you already mentioned, the only issue I see is the absence of ItemCount. I vaguely remember that we had some problem with exactly this missing. Maybe this time it is the other way round.

Can you please comment this line: https://github.com/milaq/YCast/blob/master/ycast/vtuner.py#L40 in your local vtuner.py with a # so it looks like this: #ET.SubElement(xml, 'ItemCount').text = str(self.count) restart YCast and try again. Maybe also a quick replug of your AVR could help to clear its web cache. This removes the ItemCount from the output XML. You can verify this with a browser.

vtuner.py should be at /usr/local/lib/python3*/dist-packages/ycast/vtuner.py if you installed YCast via pip system wide. Judging from your report, I reckon you are are technically versatile enough to handle this. Hit me up if you need a helping hand regardless; I could then package a modded version for you.

Cheers

lampra1 commented 4 years ago

Thank you for your reply. Commenting out ItemCount takes me one step further. I can now browse, both Radiobrowser and Mystations folders. Though I am still not able to browse the stations and play. Here is the debug info (i also attach the new tcpdump file)

sudo python3 -m ycast -l 0.0.0.0 -p 80 -d
2020-02-24 19:36:42 INFO: YCast (1.0.0) server starting
2020-02-24 19:36:42 DEBUG: Debug logging enabled
 * Serving Flask app "ycast.server" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
2020-02-24 19:36:42 INFO:  * Running on http://0.0.0.0:80/ (Press CTRL+C to quit)
2020-02-24 19:36:59 INFO: 192.168.10.10 - - [24/Feb/2020 19:36:59] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=ada4d3ce784b4b8c0646d573d18bd9c3&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-24 19:37:01 INFO: 192.168.10.10 - - [24/Feb/2020 19:37:01] "GET /ycast/my_stations/?vtuner=true&mac=ada4d3ce784b4b8c0646d573d18bd9c3&dlang=eng&start=1&howmany=8 HTTP/1.1" 200 -
2020-02-24 19:37:04 INFO: 192.168.10.10 - - [24/Feb/2020 19:37:04] "GET /ycast/my_stations/Electronic?vtuner=true&mac=ada4d3ce784b4b8c0646d573d18bd9c3&dlang=eng&start=1&howmany=8 HTTP/1.1" 200 -
2020-02-24 19:37:05 INFO: 192.168.10.10 - - [24/Feb/2020 19:37:05] "GET /ycast/my_stations/Electronic?vtuner=true&mac=ada4d3ce784b4b8c0646d573d18bd9c3&dlang=eng&start=1&howmany=8 HTTP/1.1" 200 -
2020-02-24 19:37:15 INFO: 192.168.10.10 - - [24/Feb/2020 19:37:15] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=ada4d3ce784b4b8c0646d573d18bd9c3&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-24 19:37:16 DEBUG: Radiobrowser API request: tags?hidebroken=true
2020-02-24 19:37:16 DEBUG: Starting new HTTP connection (1): www.radio-browser.info
2020-02-24 19:37:16 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/tags?hidebroken=true HTTP/1.1" 200 None
2020-02-24 19:37:16 DEBUG: Radiobrowser API request: countries?hidebroken=true
2020-02-24 19:37:16 DEBUG: Starting new HTTP connection (1): www.radio-browser.info
2020-02-24 19:37:16 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/countries?hidebroken=true HTTP/1.1" 200 2766
2020-02-24 19:37:16 DEBUG: Radiobrowser API request: languages?hidebroken=true
2020-02-24 19:37:16 DEBUG: Starting new HTTP connection (1): www.radio-browser.info
2020-02-24 19:37:17 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/languages?hidebroken=true HTTP/1.1" 200 3584
2020-02-24 19:37:17 DEBUG: Radiobrowser API request: stations?order=votes&reverse=true&limit=200
2020-02-24 19:37:17 DEBUG: Starting new HTTP connection (1): www.radio-browser.info
2020-02-24 19:37:17 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations?order=votes&reverse=true&limit=200 HTTP/1.1" 200 30072
2020-02-24 19:37:17 INFO: 192.168.10.10 - - [24/Feb/2020 19:37:17] "GET /ycast/radiobrowser/?vtuner=true&mac=ada4d3ce784b4b8c0646d573d18bd9c3&dlang=eng&start=1&howmany=8 HTTP/1.1" 200 -
2020-02-24 19:37:27 DEBUG: Radiobrowser API request: stations?order=votes&reverse=true&limit=200
2020-02-24 19:37:27 DEBUG: Starting new HTTP connection (1): www.radio-browser.info
2020-02-24 19:37:27 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations?order=votes&reverse=true&limit=200 HTTP/1.1" 200 30072
2020-02-24 19:37:28 INFO: 192.168.10.10 - - [24/Feb/2020 19:37:28] "GET /ycast/radiobrowser/popular/?vtuner=true&mac=ada4d3ce784b4b8c0646d573d18bd9c3&dlang=eng&start=1&howmany=8 HTTP/1.1" 200 -
2020-02-24 19:37:28 DEBUG: Radiobrowser API request: stations?order=votes&reverse=true&limit=200
2020-02-24 19:37:28 DEBUG: Starting new HTTP connection (1): www.radio-browser.info
2020-02-24 19:37:28 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations?order=votes&reverse=true&limit=200 HTTP/1.1" 200 30072
2020-02-24 19:37:28 INFO: 192.168.10.10 - - [24/Feb/2020 19:37:28] "GET /ycast/radiobrowser/popular/?vtuner=true&mac=ada4d3ce784b4b8c0646d573d18bd9c3&dlang=eng&start=1&howmany=8 HTTP/1.1" 200 -

test2_pcap.zip Looking at the attached pcap file (packet 44) and the original_vtuner.pcap (packet 157) for me the obvious differences are 1) the station id (only numbers) and 2) the station url includes the station id Any suggestion?

ROV28 commented 4 years ago

This look similar to my problem with the RX-V2700 and RX-V3800 ( #49 ). Any update meanwhile here?

BR, Robert

lampra1 commented 4 years ago

@ROV28 No update. It seems that the developer is not active on the project since February. ping @milaq We would appreciate some guidance if possible.

milaq commented 4 years ago

Hi, I am still here and reading every now and then. Unfortunately, since the coronavirus outbreak I have very limited freetime :( I'll try to address some of the open issues in the coming days.

For this one: It seems we need the functionality we discussed in another issue some time ago which allows us to make assumptions on how the various vendors are syntactically handled. I created a new issue for this: https://github.com/milaq/YCast/issues/50

I expect that we need to implement various exceptions for some models, e.g. the RB-N600.

yay6 commented 4 years ago

I can now browse, both Radiobrowser and Mystations folders. Though I am still not able to browse the stations and play.

I had similar problems, in my case it was caused by self closing tags in station info. You may be interested in my pull request #56