• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Simple Python Web App for WiiM Mini Display

Brantome

Major Contributor
Joined
Apr 4, 2020
Messages
1,187
Likes
1,031
I’ll try and retrace my steps and get back with what I remember I did ;)
Hi, when dealing with new stuff like this I tend to take a scattergun approach, so maybe one of the following steps was what did the trick for me, so as best I can recall this is what I did:

1. Download and install Python 3.7.9 on Windows 11, probably choosing the default options, including the one to set the PATH variable
2. Download the github contents into a folder, F:\Software\Python in my case
3. Amended server.py with the IP address of my WiiM Mini
4. As I recall, I did pip installs for each import line in that script e.g. pip install upnpclient, pip install xmltodict etc - I think some may already have been included in the core Python system anyway, but I still ran thru each. I may have run a pip update first too i.e. pip install --upgrade pip
5. Followed the instructions for the chrome extension at http://mytypings.com/converting-website-to-a-google-chrome-extension/
6. Set up a small batch file wiim.bat in that same folder to run up the server with the lines
CD f:\Software\Python
.\server.py
exit /b
7. When I fire up my PC, I run that batch file then click on the extension in Chrome, and all's well...

If I remember any other steps I took, I'll come back and update this
 

JeremyFife

Addicted to Fun and Learning
Joined
Jan 8, 2022
Messages
754
Likes
857
Location
Scotland
Hi, when dealing with new stuff like this I tend to take a scattergun approach, so maybe one of the following steps was what did the trick for me, so as best I can recall this is what I did:

1. Download and install Python 3.7.9 on Windows 11, probably choosing the default options, including the one to set the PATH variable
2. Download the github contents into a folder, F:\Software\Python in my case
3. Amended server.py with the IP address of my WiiM Mini
4. As I recall, I did pip installs for each import line in that script e.g. pip install upnpclient, pip install xmltodict etc - I think some may already have been included in the core Python system anyway, but I still ran thru each. I may have run a pip update first too i.e. pip install --upgrade pip
5. Followed the instructions for the chrome extension at http://mytypings.com/converting-website-to-a-google-chrome-extension/
6. Set up a small batch file wiim.bat in that same folder to run up the server with the lines
CD f:\Software\Python
.\server.py
exit /b
7. When I fire up my PC, I run that batch file then click on the extension in Chrome, and all's well...

If I remember any other steps I took, I'll come back and update this
Time to start reading! Thanks for this, it's hand-holding above and beyond :)
 
OP
Ralph_Cramden

Ralph_Cramden

Major Contributor
Joined
Dec 6, 2020
Messages
2,595
Likes
3,497
Nope. WiiM Mini doesn't allow CORS. So, we're stuck with an intermediary web server.

View attachment 215925
Well, actually....

Been reading up on this - it CAN be done without the python server, in a background.js script. I've posted a VERY preliminary example over on the WiiM forum.

 
OP
Ralph_Cramden

Ralph_Cramden

Major Contributor
Joined
Dec 6, 2020
Messages
2,595
Likes
3,497
Put this up on github. MUCH easier to install, no Python required, just a Chrome extension for the Chrome (and Cromium-based) browser.

For you Radio Paradise fans, the WiiM app now supports the RP FLAC streams, but not their metadata. This will detect which RP stream you're playing on the WiiM, and show the metadata pulled directly from RP.


1677373994375.png
 

dijx

New Member
Joined
Dec 9, 2023
Messages
1
Likes
0
Hi,
I hope that project is not dead and recent update did not break anything

I cannot start server.py and cannot tell what am I doing wrong:
- cloned from here: https://github.com/retired-guy/WiiM-Web.git
Code:
$ python server.py  
ERROR: No list of UPnP location URLs was provided.
Starting servers...

when I replace variable
Code:
- wiim = findWiiM(locations, 'WiiM Mini')
+ wiim = 'http://192.168.0.8:49152/description.xml'
it gets worse:
Code:
python server.py 
Traceback (most recent call last):
  File "/home/user/git_apps/WiiM-Web/server.py", line 192, in <module>
    main()
  File "/home/user/git_apps/WiiM-Web/server.py", line 167, in main
    devs.append(upnpclient.Device(w))
                ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/upnpclient/upnp.py", line 111, in __init__
    resp = requests.get(
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 575, in request
    prep = self.prepare_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 486, in prepare_request
    p.prepare(
  File "/usr/lib/python3.11/site-packages/requests/models.py", line 368, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3.11/site-packages/requests/models.py", line 439, in prepare_url
    raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL 'h': No scheme supplied. Perhaps you meant https://h?

schema from my device:

Code:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:dlna="urn:schemas-dlna-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<dlna:X_DLNADOC>DMR-1.50</dlna:X_DLNADOC>
<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
<friendlyName>WiiM Mini-4912</friendlyName>
<manufacturer>Linkplay Technology Inc.</manufacturer>
<manufacturerURL>https://www.wiimhome.com</manufacturerURL>
<modelDescription>WiiM Mini Receiver</modelDescription>
<modelName>WiiM Mini Receiver</modelName>
<modelURL>https://www.wiimhome.com</modelURL>
<UDN>uuid:FF970016-F08A-AA30-F832-3B4BFF970016</UDN>
<modelNumber>V01-Nov 29 2023 </modelNumber>
<serialNumber>00001</serialNumber>
<ssidName>WiiM Mini-4912</ssidName>
<uuid>FF970016F08AAA30F8323B4B</uuid>
<qq:X_QPlay_SoftwareCapability xmlns:qq="http://www.tencent.com">QPlay:2</qq:X_QPlay_SoftwareCapability>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/upnp/grender-48x48.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/upnp/grender-120x120.png</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/upnp/grender-48x48.jpg</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/upnp/grender-120x120.jpg</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
<serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
<SCPDURL>/upnp/rendertransportSCPD.xml</SCPDURL>
<controlURL>/upnp/control/rendertransport1</controlURL>
<eventSubURL>/upnp/event/rendertransport1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<SCPDURL>/upnp/renderconnmgrSCPD.xml</SCPDURL>
<controlURL>/upnp/control/renderconnmgr1</controlURL>
<eventSubURL>/upnp/event/renderconnmgr1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
<serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
<SCPDURL>/upnp/rendercontrolSCPD.xml</SCPDURL>
<controlURL>/upnp/control/rendercontrol1</controlURL>
<eventSubURL>/upnp/event/rendercontrol1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-wiimu-com:service:PlayQueue:1</serviceType>
<serviceId>urn:wiimu-com:serviceId:PlayQueue</serviceId>
<SCPDURL>/upnp/PlayQueueSCPD.xml</SCPDURL>
<controlURL>/upnp/control/PlayQueue1</controlURL>
<eventSubURL>/upnp/event/PlayQueue1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-tencent-com:service:QPlay:1</serviceType>
<serviceId>urn:tencent-com:serviceId:QPlay</serviceId>
<SCPDURL>/upnp/QPlaySCPD.xml</SCPDURL>
<controlURL>/upnp/control/QPlay1</controlURL>
<eventSubURL>/upnp/event/QPlay1</eventSubURL>
</service>
</serviceList>
</device>
</root>

and chrome extension works...
 
OP
Ralph_Cramden

Ralph_Cramden

Major Contributor
Joined
Dec 6, 2020
Messages
2,595
Likes
3,497
I'm guessing the name of your WiiM device isn't 'WiiM Mini'. Change that line to the name of your WiiM device if so.
 
Top Bottom