Sign up here and you can log into the forum!

BeagleBone Black

The Traditional Anything Goes Section

BeagleBone Black   

Postby PaulF » Tue May 20, 2014 10:32 pm

Hi, Long time no type. :D I bought a Beaglebone Black at Maker Faire SF for ~$60. It has many of the same things as the WDTV. It is ARM based with Debian Linux installed(including a web server) so all of the things I learned here about a Debian system is very useful.Thank you, devs. It would be interesting to try porting things like a UMSP plugin simulator and the web config code.

http://beagleboard.org/Products/BeagleBone+Black

Image
User avatar
PaulF
Developer
 
Posts: 427
Joined: Sat May 08, 2010 8:34 pm
Location: Oregon

Re: BeagleBone Black   

Postby mad_ady » Wed May 21, 2014 12:11 am

Glad to see you back PaulF!

The UMSP code should be easily ported to other servers. There is also an older UMSPX project that did that, but with an older version of UMSP.

To try to port the code you would need the following:
* add php5-cgi support to your server/webserver
* add the code under /usr/share/umsp to your SERVERROOT/umsp
* add a cron script that periodically calls "wget http://127.0.0.1/umsp/send-ssdp.php?btnSend=Submit -O /dev/null 2>/dev/null >/dev/null" so that it will broadcast its presence
* tweak the code in /usr/share/umsp/hardware-dependent.php to set a unique UDN (the WDTV uses the MAC address), and also to add the paths to the /conf and /tmp directories (so that the plugins can get their data).

Problems:
* you are left with downloading and activating the plugins yourself (/conf/umsp-plugins-status)
* a lot of plugins don't use the calls in hardware-dependent.php to get the path to /conf and /tmp and use hardcoded values. You could change those scripts or you could add symlinks in your filesystem to fix these issues.
* keep an eye on your error logs until you make it work
* some plugins should work with XBMC, others will only work on WDTV (incomplete DLNA implementations).
* additional details here: http://wiki.wdlxtv.com/UMSP_plugin_development#Plugins_that_work_with_UMSP_LAN_feature

If you manage to do the port make sure to let us know :)
User avatar
mad_ady
Developer
 
Posts: 4529
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: BeagleBone Black   

Postby PaulF » Tue Jun 03, 2014 3:24 pm

Thanks. I have been thinking and WDTV has a player with a lot of codecs and the BeagleBone doesn't have that capability built in. I suppose I could make UMSP DLNA media server and connect with my PC, but you pointed out it is a lot of work.

I got into writing WD PHP to port a perl script I found to fetch podcasts . I had to rewite the perl to use libraries similar to PHP before porting. I put the simplified perl on the beaglebone and it works great. I download the Podcasts using the same clunky xml. I added code to put a cover art tag into the mp3s.

I'm traveling a lot, hence no WDTV, I ordered a wifi dongle for the Beaglebone. so I can download podcasts on the road. The beaglebone writes a USB stick that plays w/Album Art on my Kenwood DNX570HD Touchscreen car radio/DVD player.

Anyone want my old WDTV and/or the serial cable? I live close to KAD, I think. The serial CA42 cable only has drivers for XP and older.

The BeagleBone has a tiny GTK based X server that you might want to look into. I log into the Beaglebone from an xterm on my PC using ssh -Y tunneling. I start an X app on the Beaglebnoe from that xterm and it displays the app on my PC. It sure nice running an X editor like gvim. http://en.wikipedia.org/wiki/LXDE
User avatar
PaulF
Developer
 
Posts: 427
Joined: Sat May 08, 2010 8:34 pm
Location: Oregon

Re: BeagleBone Black   

Postby PaulF » Thu Jul 03, 2014 10:06 pm

I have decided to just set up the UPNP server for clients on my network.

I got php working finally. I had to put test php script in the /usr/lib/cgi-bin directory and set /etc/php5/cgi/php.ini cgi.force_redirect = 0

Two simple things. Days of web searching. Most how-to pages do not refer to the latest Debian Apache setup.

I need to figure out how to make serverroot/umsp a cgi bin directory.

The reason for the post I need to know where in the svn is the latest /usr/share/umsp that I should use that has the external client feature?
User avatar
PaulF
Developer
 
Posts: 427
Joined: Sat May 08, 2010 8:34 pm
Location: Oregon

Re: BeagleBone Black   

Postby mad_ady » Fri Jul 04, 2014 12:16 am

You can extract it from here:
http://svn.wdlxtv.com/listing.php?repname=wdlxtv-live&path=%2Ftrunk%2Fusr%2Fshare%2Fumsp%2F&#aa9b2ac2a16107b660f2cf9fe23840ea4

You will also need:
* a way to download plugins (you can use the old SVN method, or copy the /usr/bin/umsp-plugman-web plugin from the firmware)
* /conf/umsp-plugins, /conf/umsp-plugins-status
* the apache configuration and the particularities regarding UMSP initialization: /etc/init.d/S64umsp, /etc/init.d/S66apache2 (some of the apache config just tries to disable HTTP auth for the /umsp directory)
* you need to edit some UMSP files to fit your system (/usr/share/umsp/hardware-dependent.php) - please note that most plugins use hardcoded paths to get to /conf/config, so you might need to keep at least a link pointing to that path.
* reimplement the UMSP announcement periodically (currently it is done in /usr/bin/wdlxtv.watch). It can be done in cron, every 5 seconds with "wget http://127.0.0.1/umsp/send-ssdp.php?btnSend=Submit -O /dev/null 2>/dev/null >/dev/null"

Use packet captures and check log files to see that the server is announced and is visible on the network. Also, I tested it with xbmc and some specific plugins only...

Good luck!
User avatar
mad_ady
Developer
 
Posts: 4529
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: BeagleBone Black   

Postby PaulF » Wed Jul 09, 2014 9:50 pm

mad_ady wrote:* the apache configuration and the particularities regarding UMSP initialization: /etc/init.d/S64umsp, /etc/init.d/S66apache2 (some of the apache config just tries to disable HTTP auth for the /umsp directory)
* you need to edit some UMSP files to fit your system (/usr/share/umsp/hardware-dependent.php) - please note that most plugins use hardcoded paths to get to /conf/config, so you might need to keep at least a link pointing to that path.
* reimplement the UMSP announcement periodically (currently it is done in /usr/bin/wdlxtv.watch). It can be done in cron, every 5 seconds with "wget http://127.0.0.1/umsp/send-ssdp.php?btnSend=Submit -O /dev/null 2>/dev/null >/dev/null"

Use packet captures and check log files to see that the server is announced and is visible on the network. Also, I tested it with xbmc and some specific plugins only...
I got /var/www/umsp populated from svn and then spent many hours figuring out how get the php files to run from a browser on my PC.

hardware-dependent.php fills in the parameters when I browse MediaServerServiceDesc.php :D I will edit hardware-dependent.php.

Code: Select all
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">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>
<friendlyName>UMSP (on WDTV)</friendlyName>
<manufacturer>WDLXTV</manufacturer>
<manufacturerURL>http://forum.wdlxtv.com/viewforum.php?f=49</manufacturerURL>
<modelDescription>
UMSP media server gives you access to internet media via plugins
</modelDescription>
<modelName>UMSP</modelName>
<modelNumber>0.2</modelNumber>
<modelURL>http://forum.wdlxtv.com/viewforum.php?f=49</modelURL>
<serialNumber>0</serialNumber>
<UDN>uuid:badbabe1-6666-6666-6666-000000000000</UDN>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<width>170</width>
<height>114</height>
<depth>8</depth>
<url>http://wiki.wdlxtv.com/images/logo.png</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>
<controlURL>/umsp/control-reply.php</controlURL>
<eventSubURL>/umsp/cdEvent.xml</eventSubURL>
<SCPDURL>/umsp/MediaServerContentDirectory.xml</SCPDURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<controlURL>/umsp/cmControl.xml</controlURL>
<eventSubURL>/umsp/cmEvent.xml</eventSubURL>
<SCPDURL>/umsp/MediaServerConnectionManager.xml</SCPDURL>
</service>
</serviceList>
<presentationURL>/umsp/umsp-test.php</presentationURL>
</device>
</root>
Plugins use /conf/conf, but do they use config_tool . If so where can I get config_tool ?
User avatar
PaulF
Developer
 
Posts: 427
Joined: Sat May 08, 2010 8:34 pm
Location: Oregon

Re: BeagleBone Black   

Postby mad_ady » Thu Jul 10, 2014 3:02 am

config_tool is probably used only when changing or saving things to the configuration. When searching for configuration items the plugins I know of use grep at most. You can create your own config_tool wrapper that saves a value over /conf/config in an ini-like format.

Code: Select all
root@Deneb:/root# config_tool -h
Copyright (C) 2007, Alphanetworks, inc.
Usage: config_tool [options]
       -s,--save                      :save the config to flash
       -l,--load                      :load the flash config
       -m,--monitor <time>            :start the flash monitor, the attribue
       -c,--change <VAL=KEY, -c>      :save the value and key
       -t,--savedir <srdir=targefile> :save the dir to the target file
       --regiondata <clean>           :clean all region data sections to zero
       --regiondata <get>             :print region data info
       --regiondata <set tv_mode-region-location> :set region data info
                                      e.g.: 0-0-15, USA; 0-0-4, Canada.
root@Deneb:/root# which config_tool
/sbin/config_tool
root@Deneb:/root# config_tool -c UMSP=OFF
config saved val:key => (UMSP,OFF)
root@Deneb:/root# config_tool -s
F:mkconfig_translate_config_dir_to_file,75: [load config] ret_config=0
save config_file=/dev/sigmblockk, config_id=8459
write to block file OK.
root@Deneb:/root# file /sbin/config_tool
/sbin/config_tool: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.12, with unknown capability 0xf41 = 0x756e6700, stripped
root@Deneb:/root# head /conf/config
LAN_TYPE='d'
LAN_TYPE_WIRELESS='d'
IP2='192.168.1.4'
NETMASK2='255.255.255.0'
GATEWAY='0'
GATEWAY2='192.168.1.1'
SET_DNS_SRV='a'
LANDNS='192.168.1.1'
IP_WIRELESS='192.168.0.88'
NETMASK_WIRELESS='255.255.255.0'


Don't even try to port config_tool to your system - it also manages the /conf/ partition so you could get into trouble.

You should only make a shell/whatever script to take the -c parameter and save the value to file, and -s should just pass through.
User avatar
mad_ady
Developer
 
Posts: 4529
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania


Return to Unrelated

Who is online

Users browsing this forum: No registered users and 1 guest