openLuup: AV plugins

I still get the iptables error when i start openluup:

Yes, I get that for the Sonos, but it works just fine…

… I’ll look more closely at the plugin’s code now.

[quote=“akbooer, post:61, topic:189395”]

I still get the iptables error when i start openluup:

Yes, I get that for the Sonos, but it works just fine.[/quote]

Is there any other logging i can enable that would help us figure this out? Thanks.

Does the plugin itself have a debug mode for extended logging?

“Debug” is on in the logs i sent your way and i am not aware of any way to set deeper log levels unfortunately. Is it possible there is somewhere else we need to change to completely disable chunking? Thanks.

The chunks it is talking about are not mine! We have completely disabled that. My biggest surprise is that everything else seems to work OK without them. That’s not the case on my systems, so perhaps you are doing something slightly different.

OK, I installed this plugin - but to be fair, I really don’t have anything to connect to except my Sonos devices. Both plugins were created by Lolodomo so it’s to be expected that they behave similar to the Sonos plugin.

[1] Fresh install (startup.lua is nothing more than AltUI).
[2] Executed install of plugin.
[3] Discovered Sonos device.
[4] Hit play on some random mix my wife has setup.
[5] Played fine…

No errors within the log or the console…
I do hope this helps out in some way, if you need me to test something specific I’ll leave this intact.

Um, er, yes! I didn’t know that DLNA worked with Sonos, but it also found a Robert Radio I have online. Works flawlessly for music.

Startup log here, for comparison:

2015-11-17 10:44:22.911   luup_log:4: DLNA: #4 starting up with id 
2015-11-17 10:44:22.911   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.PluginVersion was: EMPTY now: 1.4 #hooks:0
2015-11-17 10:44:22.911   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.DMRDiscoveryResult was: EMPTY now:  #hooks:0
2015-11-17 10:44:22.911   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.DMSDiscoveryResult was: EMPTY now:  #hooks:0
2015-11-17 10:44:22.911   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.BrowseResult was: EMPTY now:  #hooks:0
2015-11-17 10:44:22.911   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.PlaybackResult was: EMPTY now:  #hooks:0
2015-11-17 10:44:22.911   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.RouterIp was: EMPTY now:  #hooks:0
2015-11-17 10:44:22.911   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.RouterPort was: EMPTY now: 80 #hooks:0
2015-11-17 10:44:22.911   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.DelayBeforePlayback was: EMPTY now: 0 #hooks:0
2015-11-17 10:44:22.912   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.CheckStateRate was: EMPTY now: 0 #hooks:0
2015-11-17 10:44:22.912   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.DebugLogs was: EMPTY now: 0 #hooks:0
2015-11-17 10:44:22.986   luup.variable_set:4: 4.urn:dlna-org:serviceId:DLNAMediaController1.DiscoveryPatchInstalled was: EMPTY now: 0 #hooks:0
2015-11-17 10:44:22.986   openLuup.scheduler:: [4] device startup completed: status=nil, msg=nil, name=nil

However, TTS generated an error

/data_request?id=lu_action&output_format=xml&DeviceNum=4&serviceId=urn:dlna-org:serviceId:DLNAMediaController1&action=Say&Text=Hello%20there!&Language=en&Engine=GOOGLE&Volume= tcp{client}: 0x1c98d08
2015-11-17 10:52:39.700   luup.call_action:0: 4.urn:dlna-org:serviceId:DLNAMediaController1.Say 
2015-11-17 10:52:39.732   openLuup.context_switch::  ERROR: ./L_DLNATTS.lua:108: attempt to index local 'fh' (a nil value)

…but I put that down to Google TTS misbehaving (it seems flakey these days.) Didn’t try with Microsoft.

I think i’m stuck :(.

Here is what the render’s url http://192.168.1.125:49154/description.xml returns in chrome in case there are any hints here? Thanks.

<root xmlns="urn:schemas-upnp-org:device-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <device> <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType> <presentationURL>/renderpres.html</presentationURL> <friendlyName>ROCKI_Sam</friendlyName> <manufacturer>Ivo Clarysse</manufacturer> <manufacturerURL>http://gmrender.nongnu.org/</manufacturerURL> <modelDescription>gmediarender 0.0.6</modelDescription> <modelName>Epitome</modelName> <modelURL>http://gmrender.nongnu.org/</modelURL> <UDN>uuid:5f9ec1b3-ed59-1900-4530-00117FB7DF48</UDN> <modelNumber>12</modelNumber> <dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC> <iconList> <icon> <mimetype>image/png</mimetype> <width>64</width> <height>64</height> <depth>24</depth> <url>/upnp/grender-64x64.png</url> </icon> <icon> <mimetype>image/png</mimetype> <width>128</width> <height>128</height> <depth>24</depth> <url>/upnp/grender-128x128.png</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> </serviceList> </device> <URLBase>http://192.168.1.125:49154/</URLBase> </root>

The log shows that request going to 192.168.1.126 and not 125. Is there a problem there?

Sorry, I have several of these ROCKI (myrocki.com) devices on the network. One is at .125, another is at .126. The problem occurs on all of them (sorry for the confusion I just grabbed the url from the other device accidentally to paste into the message).

Sent from my iPhone using Tapatalk

OK, so you’ve tested it from a browser, but what does THIS do if you paste it into the Lua Test window and run it:

local a,b = luup.inet.wget "http://192.168.1.125:49154/description.xml"
print (a,b)

[quote=“akbooer, post:71, topic:189395”]OK, so you’ve tested it from a browser, but what does THIS do if you paste it into the Lua Test window and run it:

local a,b = luup.inet.wget "http://192.168.1.125:49154/description.xml"
print (a,b)
[/code][/quote]

It returns:

[code]Return Result:
nil

Console Output:
invalid chunk size	

Screen shot attached.

But using LuaTest on my vera, it returns:

[code]LuaTest 1.6

Lua file: /etc/cmh-ludl/luatest.lua

Results
No errors
Runtime: 26.8 ms
Code returned: nil

Print output
0

1
0

urn:schemas-upnp-org:device:MediaRenderer:1
/renderpres.html
ROCKI_Sam
Ivo Clarysse
http://gmrender.nongnu.org/
gmediarender 0.0.6
Epitome
http://gmrender.nongnu.org/
uuid:5f9ec1b3-ed59-1900-4530-00117FB7DF48
12
DMR-1.50

image/png
64
64
24
/upnp/grender-64x64.png

image/png
128
128
24
/upnp/grender-128x128.png

urn:schemas-upnp-org:service:AVTransport:1
urn:upnp-org:serviceId:AVTransport
/upnp/rendertransportSCPD.xml
/upnp/control/rendertransport1
/upnp/event/rendertransport1

urn:schemas-upnp-org:service:ConnectionManager:1
urn:upnp-org:serviceId:ConnectionManager
/upnp/renderconnmgrSCPD.xml
/upnp/control/renderconnmgr1
/upnp/event/renderconnmgr1

urn:schemas-upnp-org:service:RenderingControl:1
urn:upnp-org:serviceId:RenderingControl
/upnp/rendercontrolSCPD.xml
/upnp/control/rendercontrol1
/upnp/event/rendercontrol1

http://192.168.1.125:49154/

Code
1 local a,b = luup.inet.wget “http://192.168.1.125:49154/description.xml
2 print (a,b)[/code]

So I’ve lost track of what server.lua file you’re using… is it still the non-chunked version? Or are you now running Release 6 ?

We appear to have homed in on the problem, though.

…and on both machines can you try:

local http = require "socket.http"
local a,b = http.request "http://192.168.1.125:49154/description.xml"
print (a,b)

…and also, for completeness:

local http = require "socket.http"
local ltn12 = require "ltn12"
local t = {}
local a,b = http.request {
  url = "http://192.168.1.125:49154/description.xml",
  sink = ltn12.sink.table(t),
}
print (a,b, table.concat (t))

Thanks.

[quote=“akbooer, post:73, topic:189395”]So I’ve lost track of what server.lua file you’re using… is it still the non-chunked version? Or are you now running Release 6 ?

We appear to have homed in on the problem, though.[/quote]

Here is the server.lua file i am using. I believe it is v5.3 with the chunking turned off.

[quote=“akbooer, post:74, topic:189395”]…and on both machines can you try:

local http = require "socket.http"
local a,b = http.request "http://192.168.1.125:49154/description.xml"
print (a,b)
[/code][/quote]

on my vera, this returns:

[code]Results
No errors
Runtime: 26.5 ms
Code returned: nil

Print output
nil     invalid chunk size     

Code
   1   local http = require "socket.http" 
   2   local a,b = http.request "http://192.168.1.125:49154/description.xml" 
   3   print (a,b)[/code]

on openluup this returns:

[code]Return Result:
nil

Console Output:
nil	invalid chunk size
...and also, for completeness:
local http = require "socket.http"
local ltn12 = require "ltn12"
local t = {}
local a,b = http.request {
  url = "http://192.168.1.125:49154/description.xml",
  sink = ltn12.sink.table(t),
}
print (a,b, table.concat (t))

Thanks.

on my vera this returns:

[code]Results
No errors
Runtime: 2003.8 ms
Code returned: nil

Print output
nil timeout

Code
1 local http = require “socket.http”
2 local ltn12 = require “ltn12”
3 local t = {}
4 local a,b = http.request {
5 url = “http://192.168.1.125:49154/description.xml”,
6 sink = ltn12.sink.table(t),
7 }
8 print (a,b, table.concat (t))[/code]

and on openluup it returns:

[code]Return Result:
nil

Console Output:
nil invalid chunk size [/code]

Thanks

Well, OK. I’m beginning to think that there is something seriously odd with either your DLNA server, or your LuaSocket library install.

The LuaSocket documentation for the http.request call states:

If there is a body, you need to provide an appropriate "content-length" request header field, or the function will attempt to send the body as "chunked" (something few servers support).

Well, the request doesn’t have a body, so the code you ran should never try to send chunked.

Just to give a little more information, could I trouble you to try out this test, again on both Vera and openLuup?

local http = require "socket.http"
local ltn12 = require "ltn12"

local function test (url)
  local t = {}
  local a,b,c,d = http.request {
    url = url,
    sink = ltn12.sink.table(t),
  }
  print "------"
  print (url)  
  print (a,b,pretty(c))
  print (d)
  print "------"
  print (table.concat (t))
end

test "http://192.168.1.125:49154/description.xml"
print ''
test "http://code.mios.com/trac/mios_alternate_ui/browser/compress.bat?format=txt"

The other smoking gun is that others don’t seem to have run into this problem.

On my vera i get:

Results
No errors
Runtime: 412.9 ms
Code returned: nil

[code]Print output

http://192.168.1.125:49154/description.xml
nil invalid chunk size nil



http://code.mios.com/trac/mios_alternate_ui/browser/compress.bat?format=txt
1 200 { set-cookie=“trac_affinity=trac_wsgi_06; path=/; domain=code.mios.com; expires=Thu, 19-Nov-2015 19:03:17 GMT, trac_session=fdc5027c7380ca5839dcbd63; expires=Wed, 17-Feb-2016 18:03:18 GMT; Path=/trac/mios_alternate_ui”, date=“Thu, 19 Nov 2015 18:03:17 GMT”, last-modified=“Fri, 20 Mar 2015 18:03:59 GMT”, content-type=“text/plain”, expires=“Fri, 01 Jan 1999 00:00:00 GMT”, cache-control=“no-cache”, content-disposition=“attachment”, vary=“Accept-Encoding”, connection=“close”, pragma=“no-cache”, content-length=“60”, server=“Apache” }
HTTP/1.1 200 Ok

for %%f in (*.js) DO c:jsmin <“%%f” >“Minified%%f”
pause

Code
1 local http = require “socket.http”
2 local ltn12 = require “ltn12”
3
4 local function test (url)
5 local t = {}
6 local a,b,c,d = http.request {
7 url = url,
8 sink = ltn12.sink.table(t),
9 }
10 print “------”
11 print (url)
12 print (a,b,pretty(c))
13 print (d)
14 print “------”
15 print (table.concat (t))
16 end
17
18 test “http://192.168.1.125:49154/description.xml
19 print ‘’
20 test “http://code.mios.com/trac/mios_alternate_ui/browser/compress.bat?format=txt”[/code]

On openluup i get:

[code]Return Result:
nil

Console Output:

http://192.168.1.125:49154/description.xml
nil invalid chunk size nil
nil


http://code.mios.com/trac/mios_alternate_ui/browser/compress.bat?format=txt
1 200 {
cache-control = “no-cache”,
connection = “close”,
content-disposition = “attachment”,
content-length = “60”,
content-type = “text/plain”,
date = “Thu, 19 Nov 2015 18:06:16 GMT”,
expires = “Fri, 01 Jan 1999 00:00:00 GMT”,
last-modified = “Fri, 20 Mar 2015 18:03:59 GMT”,
pragma = “no-cache”,
server = “Apache”,
set-cookie = “trac_affinity=trac_wsgi_03; path=/; domain=code.mios.com; expires=Thu, 19-Nov-2015 19:06:16 GMT, trac_session=5ce3bea383d426d7c98fe0ee; expires=Wed, 17-Feb-2016 18:06:16 GMT; Path=/trac/mios_alternate_ui”,
vary = “Accept-Encoding”}
HTTP/1.1 200 Ok

for %%f in (*.js) DO c:jsmin <“%%f” >“Minified%%f”
pause[/code]

Thanks!

Well, what can I say? Both Vera and openLuup give the same response for these tests:

[ol][li]access to your server fails with the ‘chunked’ message[/li]
[li]access to another website (MiOS Trac repository, in this case) works fine[/li][/ol]

However, your Vera DLNA plugin can access it, and so too, apparently, your browser. Almost my only thought left is that there is some HTTP header that the server is expecting that it does not get from a default http.request() call. To find that out it would be necessary to examine headers that Vera, or your browser, generate in the request to the server.

Assuming you know how to access the Web console on your browser, can you get that information?

From chrome developer tools when accessing http://192.168.1.125:49154/description.xml

[code]> General
Remote Address:192.168.1.125:49154
Request URL:http://192.168.1.125:49154/description.xml
Request Method:GET
Status Code:200 OK

Response Headers
view source
CONNECTION:close
CONTENT-LENGTH:2107
CONTENT-TYPE:text/xml
DATE:Thu, 19 Nov 2015 19:27:56 GMT
LAST-MODIFIED:Wed, 18 Nov 2015 04:00:24 GMT
SERVER:Linux/2.6.28.3, UPnP/1.0, Portable SDK for UPnP devices/1.6.6
X-User-Agent:redsonic

Request Headers
view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Host:192.168.1.125:49154
If-Modified-Since:Wed, 18 Nov 2015 04:00:24 GMT
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36[/code]

As a reminder for quick reference, this call returns (when using Chrome):

<?xml version="1.0"?> <root xmlns="urn:schemas-upnp-org:device-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <device> <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType> <presentationURL>/renderpres.html</presentationURL> <friendlyName>ROCKI_Sam</friendlyName> <manufacturer>Ivo Clarysse</manufacturer> <manufacturerURL>http://gmrender.nongnu.org/</manufacturerURL> <modelDescription>gmediarender 0.0.6</modelDescription> <modelName>Epitome</modelName> <modelURL>http://gmrender.nongnu.org/</modelURL> <UDN>uuid:5f9ec1b3-ed59-1900-4530-00117FB7DF48</UDN> <modelNumber>12</modelNumber> <dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC> <iconList> <icon> <mimetype>image/png</mimetype> <width>64</width> <height>64</height> <depth>24</depth> <url>/upnp/grender-64x64.png</url> </icon> <icon> <mimetype>image/png</mimetype> <width>128</width> <height>128</height> <depth>24</depth> <url>/upnp/grender-128x128.png</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> </serviceList> </device> <URLBase>http://192.168.1.125:49154/</URLBase> </root>

For comparison, the 1 rendered I have hat the DLNA plugin running on openluup does Discover and connecs to looks like this when i call it at http://192.168.1.14:8080/description.xml (note this is a Denon receiver while the ones that error out on ROCKI’s):

[code]> General
Remote Address:192.168.1.14:8080
Request URL:http://192.168.1.14:8080/description.xml
Request Method:GET
Status Code:200 OK

Response Headers
view source
CONTENT-LANGUAGE:en
CONTENT-LENGTH:3084
CONTENT-TYPE:text/xml;charset=“utf-8”

Request Headers
view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Host:192.168.1.14:8080
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36[/code]

and it returns:

<?xml version="1.0"?> <root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:ms=" urn:microsoft-com:wmc-1-0" xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/11" xmlns:df="http://schemas.microsoft.com/windows/2008/09/devicefoundation"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <device> <dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC> <pnpx:X_compatibleId>MS_DigitalMediaDeviceClass_DMR_V001 </pnpx:X_compatibleId> <pnpx:X_deviceCategory>MediaDevices </pnpx:X_deviceCategory> <pnpx:X_hardwareId>VEN_0126&amp;DEV_0001&amp;REV_01 </pnpx:X_hardwareId> <df:X_deviceCategory>Multimedia.DMR </df:X_deviceCategory> <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType> <friendlyName>Theater &amp; Whole Home Audio</friendlyName> <manufacturer>DENON</manufacturer> <manufacturerURL>http://www.denon.com</manufacturerURL> <modelDescription>AV SURROUND RECEIVER</modelDescription> <modelName>*AVR-4520</modelName> <modelNumber>4520</modelNumber> <modelURL>http://www.denon.com/</modelURL> <serialNumber>0005CD34F6E1</serialNumber> <UDN>uuid:5f9ec1b3-ff59-19bb-8530-0005cd34f6e1</UDN> <UPC>123810928305</UPC> <iconList> <icon> <mimetype>image/jpeg</mimetype> <width>48</width> <height>48</height> <depth>24</depth> <url>/BCO_device_sm_icon.jpg</url> </icon> <icon> <mimetype>image/jpeg</mimetype> <width>120</width> <height>120</height> <depth>24</depth> <url>/BCO_device_lrg_icon.jpg</url> </icon> <icon> <mimetype>image/png</mimetype> <width>48</width> <height>48</height> <depth>24</depth> <url>/BCO_device_sm_icon.png</url> </icon> <icon> <mimetype>image/png</mimetype> <width>120</width> <height>120</height> <depth>24</depth> <url>/BCO_device_lrg_icon.png</url> </icon> </iconList> <serviceList> <service> <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType> <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId> <SCPDURL>/RenderingControl/desc.xml</SCPDURL> <controlURL>/RenderingControl/ctrl</controlURL> <eventSubURL>/RenderingControl/evt</eventSubURL> </service> <service> <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType> <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId> <SCPDURL>/ConnectionManager/desc.xml</SCPDURL> <controlURL>/ConnectionManager/ctrl</controlURL> <eventSubURL>/ConnectionManager/evt</eventSubURL> </service> <service> <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType> <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId> <SCPDURL>/AVTransport/desc.xml</SCPDURL> <controlURL>/AVTransport/ctrl</controlURL> <eventSubURL>/AVTransport/evt</eventSubURL> </service> </serviceList> <presentationURL>http://192.168.1.14</presentationURL> </device> </root>

Thanks!