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

API: webradioFS Web Interface doesn't appear in newer OpenWebif / OpenATV version #1039

Closed
blueicehaller opened this issue Sep 16, 2020 · 20 comments
Labels
BUG 🐞 Not working as expected

Comments

@blueicehaller
Copy link

blueicehaller commented Sep 16, 2020

Describe the bug
webradioFS Web Interface doesn't appear in newer OpenWebif / OpenATV version.
Was there an API change?
How to implement it?

To Reproduce
Steps to reproduce the behavior:

  1. Open OpenWebif
  2. append /webradiofs to the URL (Example: http://xpeedlx3/webradiofs )
  3. Result:
Error 404: Page not found
The requested URL was not found on this server.

Expected behavior
In OpenATV 6.3 / enigma2-plugin-extensions-openwebif - 1.3.5+git3383+b79cfb7-r0 the expected page is shown.

Screenshots
If applicable, add screenshots to help explain your problem.

Image (please complete the following information):

  • OS: OpenATV
  • Version: 6.3 works, 6.4 Error 404 Not found

Desktop (please complete the following information):

  • Browser: Mozilla Firefox
  • Version: 80.0.1 (64-Bit)

Additional context

Environment
2 x Golden Interstar Xpeed LX3:

  • Wohnzimmer - Produktiv

    • OpenATV 6.3.0 (2020-02-18)
    • Python 2.7.15
    • enigma2-plugin-extensions-openwebif - 1.3.5+git3383+b79cfb7-r0
    • enigma2-plugin-extensions-webradiofs - 18.15
  • Schlafzimmer - Test

    • OpenATV 6.4.20200528 (2020-05-28)
    • Python 2.7.16
    • enigma2-plugin-extensions-openwebif - 1.3.9+git3429+8688157-r0
    • enigma2-plugin-extensions-webradiofs - 19.28

webradioFS Plugin | Info | Download
Discussion that the Plugin is closed source. add webradioFS? #537
Xpeed LX3, webradioFS Steuerung 404 Not Found, OpenATV 6.4.20200528 (2020-05-28) - OpenATV Forum

Same behaviour with E2iPlayer, see Post #2

@blueicehaller blueicehaller added the BUG 🐞 Not working as expected label Sep 16, 2020
@jbleyel
Copy link
Contributor

jbleyel commented Sep 16, 2020

closed source plugins are not supported.

@jbleyel jbleyel closed this as completed Sep 16, 2020
@jbleyel
Copy link
Contributor

jbleyel commented Sep 16, 2020

external plugins needs to use this interface.
https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/plugin/pluginshook.src#L4

@jbleyel
Copy link
Contributor

jbleyel commented Sep 16, 2020

Please check this:

#453

@blueicehaller
Copy link
Author

blueicehaller commented Sep 16, 2020

Thank you.
When I call http://xpeedlx3/api/external it shows:

{
  "exception": "TypeError(\"FilePath('/usr/lib/enigma2/python/Plugins/Extensions/webradioFS') is not JSON serializable\",)",
  "request": "/api/external",
  "result": false
}

Update 02.12.2020
When I call http://xpeedlx3/web/external it shows:

<?xml version="1.0" encoding="UTF-8"?>
<e2webifexternals>
	<e2webifexternal>
		<e2path>webradiofs</e2path>
		<e2name>webradiofs</e2name>
		<e2externalversion>19.28</e2externalversion>
	</e2webifexternal>
</e2webifexternals>

@jbleyel
Copy link
Contributor

jbleyel commented Sep 16, 2020

Please check the call in webradioFS.
The correct syntax is:

addExternalChild( ("webradiofs", root, "Web Radio", '1.0') )

root must be a twisted Resource class.

I can't help you if i don't have the source of the webradioFS plugin.

@jbleyel
Copy link
Contributor

jbleyel commented Sep 16, 2020

I will change the addExternalChild function to support more than 4 parameter.

@jbleyel
Copy link
Contributor

jbleyel commented Sep 16, 2020

0986149

@blueicehaller
Copy link
Author

blueicehaller commented Dec 2, 2020

@jbleyel wrote

Please check this:

#453

What exactly should I look at?

I tried on both Receivers to call the pre-installed FAN Control ( enigma2-plugin-systemplugins-fancontrol - 6.4+git2632+5d93773-r1 , installation path /usr/lib/enigma2/python/Plugins/SystemPlugins/FanControl/ ) by appending /fancontrol to the URL (Example: http://xpeedlx3/fancontrol ) and both show

Error 404: Page not found
The requested URL was not found on this server.

Maybe this is the wrong one?

Please provide an Hello World reference implementation for Developers.

Thank you in advance.

@jbleyel
Copy link
Contributor

jbleyel commented Dec 2, 2020

			# syntax
			# addExternalChild( (Link, Resource, Name, Version, HasGUI, WebTarget) )
			# example addExternalChild( ("webadmin", root, "WebAdmin", 1, True, "_self") )

@blueicehaller
Copy link
Author

Why does it still not work?

        if reason == 0 and kwargs.has_key("session"):
                from Plugins.Extensions.WebInterface.WebChilds.Toplevel import
addExternalChild
                from webradioFSSite import webradioFSweb
                from twisted.web import static
                root =
static.File("/usr/lib/enigma2/python/Plugins/Extensions/webradioFS")
                root.putChild("", webradioFSweb())
                f=open("/tmp/wbrfsweb.txt","a")
                if
os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web/external.xml"):
                        try:
                                addExternalChild( ("webradiofs", root, "webradioFS", myversion, True) )
                                f.write("use new WebIf\n")
                        except:
                                addExternalChild( ("webradiofs", root) )
                                f.write("Error, fall back to old WebIf\n")
                else:
                        addExternalChild( ("webradiofs", root) )
                        f.write("use old WebIf")
                if
os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/pluginshook.src"):
                        try:
                                addExternalChild( ("webradiofs", root, "webradioFS", myversion) )
                                f.write("use OpenWebIf\n")
                        except:
                                f.write(str(e)+"\n")
                f.close()

@jbleyel
Copy link
Contributor

jbleyel commented Dec 3, 2020

Do we talk about fancontrol or webradio.
Do you have only openwebif or do you have also the webinterface plugin installed?

@blueicehaller
Copy link
Author

blueicehaller commented Dec 4, 2020

We're talking about webradioFS. I only have OpenWebif but the code provided by the author of webradioFS contains an detection if old or new is used.

root@schlafzimmer-receiver:~# opkg list-installed | grep webi
enigma2-plugin-extensions-openwebif - 1.3.9+git3699+d89a95b-r0
enigma2-plugin-extensions-openwebif-terminal - 1.3.9+git3699+d89a95b-r0
enigma2-plugin-extensions-openwebif-webtv - 1.3.9+git3699+d89a95b-r0

When I call http://schlafzimmer-receiver/web/external it shows:

<?xml version="1.0" encoding="UTF-8"?>
<e2webifexternals>
	<e2webifexternal>
		<e2path>webradiofs</e2path>
		<e2name>webradiofs</e2name>
		<e2externalversion>19.28</e2externalversion>
	</e2webifexternal>
</e2webifexternals>

@jbleyel
Copy link
Contributor

jbleyel commented Dec 4, 2020

Then open terminal to the box.
Type init 5
Type enigma2

Open http://schlafzimmer-receiver/webradiofs in a browser.

Post the terminal output after open the link here.

Type CTRL+C
Type init 3

@blueicehaller
Copy link
Author

19:33:41.9921 dvb/epgcache.cpp:1611 finishEPG [EPGCache] next update in 60 min
19:33:55.2339 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:33:55+0100 [-] "::ffff:192.168.123.97" - - [07/Dec/2020:18:34:12 +0000] "GET /api/statusinfo?_=1607278624993 HTTP/1.1" 200 516 "http://192.168.123.12/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
19:34:10.2424 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:10+0100 [-] "::ffff:192.168.123.97" - - [07/Dec/2020:18:34:12 +0000] "GET /api/statusinfo?_=1607278624994 HTTP/1.1" 200 516 "http://192.168.123.12/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
19:34:25.2554 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:25+0100 [-] "::ffff:192.168.123.97" - - [07/Dec/2020:18:34:12 +0000] "GET /api/statusinfo?_=1607278624995 HTTP/1.1" 200 516 "http://192.168.123.12/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
19:34:32.3724 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:32+0100 [-] Timing out client: IPv6Address(type='TCP', host='::ffff:192.168.123.97', port=62820, flowInfo=0, scopeID=0)
19:34:32.4016 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:32+0100 [-] [OpenWebif] page '/robots.txt' not found
19:34:32.4067 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:32+0100 [-] "::ffff:192.168.123.179" - - [07/Dec/2020:18:34:32 +0000] "GET /robots.txt HTTP/1.1" 404 151 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
19:34:32.5483 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:32+0100 [-] [OpenWebif] page '/webradiofs' not found
19:34:32.5534 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:32+0100 [-] "::ffff:192.168.123.179" - - [07/Dec/2020:18:34:32 +0000] "GET /webradiofs HTTP/1.1" 404 151 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
19:34:32.6569 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:32+0100 [-] [OpenWebif] page '/favicon.ico' not found
19:34:32.6619 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:32+0100 [-] "::ffff:192.168.123.179" - - [07/Dec/2020:18:34:32 +0000] "GET /favicon.ico HTTP/1.1" 404 151 "http://192.168.123.12/webradiofs" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
19:34:40.2711 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:40+0100 [-] "::ffff:192.168.123.97" - - [07/Dec/2020:18:34:32 +0000] "GET /api/statusinfo?_=1607278624996 HTTP/1.1" 200 516 "http://192.168.123.12/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
19:34:55.2748 /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes  2020-12-07 19:34:55+0100 [-] "::ffff:192.168.123.97" - - [07/Dec/2020:18:34:40 +0000] "GET /api/statusinfo?_=1607278624997 HTTP/1.1" 200 516 "http://192.168.123.12/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"

@jbleyel
Copy link
Contributor

jbleyel commented Dec 7, 2020

The Problem must be here ->

root.putChild2(plugin[0], plugin[1])

A) loaded_plugins does not contain webradiofs in the time of calling HttpdStart
B) something is wrong with this root value:

                root =
static.File("/usr/lib/enigma2/python/Plugins/Extensions/webradioFS")
                root.putChild("", webradioFSweb())

@blueicehaller
Copy link
Author

blueicehaller commented Dec 7, 2020

OK.

And who need to repair that and how?

@jbleyel
Copy link
Contributor

jbleyel commented Dec 8, 2020

I can try this, but i need the full source of the webradioFS plugin.
I't must be the exact version as you have.

@jbleyel
Copy link
Contributor

jbleyel commented Dec 8, 2020

I can only find a closed source version of webradioFS.
I will never install closed source plugins on my box.
Therefore i can't help you.

@blueicehaller
Copy link
Author

blueicehaller commented Dec 9, 2020

It would be good if you can mention further 3rd party open source plugins like "FAN Control 2" #1039 (comment) from that webradioFS (which is unfortunately closed source) can copy/fork that code part of the "interface" #1039 (comment) to work again.

I would like to understand the basics how OpenWebif is handling and communicating with 3rd party Plugins like webradioFS.

Which Plugin initiate the communication - OpenWebif or the 3rd party plugin?

Does OpenWebif search for files and/or folders in any path for example #1039 (comment) and tries to call them via the example call provided in #1039 (comment) ?

Or are there further conditions that need to fulfilled to end up in success or error?

For example valid or invalid parameters, wrong data types or missing imports.

Is there any test command ( python ... ) I can execute in the shell or can I enable further debug outputs/print messages?

I need to read The Python Tutorial — Python 2.7 documentation to understand the basics.

Thank you in advance.

@jbleyel
Copy link
Contributor

jbleyel commented Dec 9, 2020

I have found the problem.
It's the name of the plugin.

All plugins will be loaded by alphabet.
webradioFS will loaded after openwebif.

I will try to fix this.

jbleyel added a commit that referenced this issue Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG 🐞 Not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants