Autorun on Boot - O!Play HDP-R1

Autorun on Boot - O!Play HDP-R1

Postby evilash » 13 Aug 2011, 03:55

I've been searching around for an answer to this, and have found several that don't answer much.
I know we can specific scripts to run on boot, and they can do things like mount a network drive.

But, can we tell the O!Play device to start playing the files (say, images) located on a USB device, or on a network mount.

My specific scenario is to autplay images on a USB thumb drive.

I'm using the O!Play as a slideshow player in a local business, and sometimes it likes to crash. Then I have to restart the slideshow.
I can do this blindly with the remote in moServices, which is nice - but sometimes it stays on the home screen for hours before I notice (it's a big building).

Anyways, is it possible? I'm not well versed in Linux, or the inner workings of the O!Play.

I have 1.40N and moServices on all of my devices.

Thanks.

EDIT: I recently purchased the WDTV Live and autorun is a defualt feature of its firmware. I'm considering replacing all my O!Plays with the WDTV Live, but before I go through that cost, I wanted to see if I could do some magic with what I got.
evilash
 
Posts: 5
Joined: 13 Aug 2011, 03:48

Re: Autorun on Boot - O!Play HDP-R1

Postby evilash » 16 Aug 2011, 00:31

So I've made a BIT of progress on this.

I found this:
viewtopic.php?f=16&t=276&start=0&hilit=autoplay

However I don't know Russian, so I'm working from the translated text. It seems to only support HD2+ firmware. I understand what its doing though, basically running a script at startup that process a list of commands via the IPODcfg.cgi remote control script.

I'm trying to modify this to work with HDPR1 and moServcies cmd.cgi script.

I'm broken it down so I can run commands via URL like so:

http://127.0.0.1/cgi-bin/cmd.cgi?#

# = the command.

Though I'm stuck there at the moment. I'll keep working at it, but any help would be appreciated!
evilash
 
Posts: 5
Joined: 13 Aug 2011, 03:48

Re: Autorun on Boot - O!Play HDP-R1

Postby evilash » 16 Aug 2011, 03:12

I've reworked the script from the above thread to try and work with HDP-R1 and moServices.

Here is my altered autoplaysh script:
Code: Select all
#!/bin/sh
#
# description: executes remote commands via ipod RC interface.
#
##Global variables
AUTO_CONF=$1 #configuration file containing commands in format: <command> <delay>

#Check for a Config file
if [ -f "$AUTO_CONF" ]; then

##Read the Config file, ignoring lines with "#" as comments
sed '/^ *#/d;s/#.*//' "$AUTO_CONF" | while read LINE

do

DELAY=$LINE
COMMAND=$LINE

#strip non-numeric charachters from DELAY string
lft=${DELAY%%[0-9]*}
rght=${DELAY##*[0-9]}
temp=${DELAY#"$lft"}
DELAY=${temp%"$rght"}
#echo $DELAY

#strip non-alphabetic charachters from COMMAND string
lft=${COMMAND%%[a-z]*}
rght=${COMMAND##*[a-z]}
temp=${COMMAND#"$lft"}
COMMAND=${temp%"$rght"}
#echo $COMMAND

if [ "$DELAY" -gt 0 ]; then  #Check if argument is a number
DELAY=$((${DELAY}*1000))   #convert delay to uS
usleep $DELAY #execute delay
fi

if [ "$COMMAND" ]; then  #Check if argument is not an empty string
#send remote command
RC_CMD='wget ''http://127.0.0.1/cgi-bin/cmd.cgi?'${COMMAND}''
echo $RC_CMD
$RC_CMD
fi

done
else
echo "No Valid Configuration File Found"
exit 1
fi


The only modified line is in RC_CMD='wget ''http://127.0.0.1/cgi-bin/cmd.cgi?'${COMMAND}''. The other scripts remain the same (Autoplay, control) except for 'playradio' which has the proper commands for working with the cmd.cgi script.

THE ISSUE IS I KEEP GETTING THIS ERROR WHEN THE SCRIPT EXECUTES:

-sh: /usr/local/etc/mos/scripts/autoplay: not found

But the file is there, and the path and spelling are correct. I also applied to chmod +x.

So I do not know why this is happening... any help?
evilash
 
Posts: 5
Joined: 13 Aug 2011, 03:48

Re: Autorun on Boot - O!Play HDP-R1

Postby evilash » 16 Aug 2011, 21:13

My scripts were corrupting because I was editing them in notepad and copy/pasting.

I opened them up in Notepad++ and properly tabbed/spaced the code.

They work now.

I have a series of commands that execute when the script is run, but it's not properly running on startup.
I have to connect to the moServices GUI, then either SAVE changes to the Autoplay script on the GUI or disable/enable, then the script runs.
Doesn't run on loadup yet, but I'm working on it... closer than ever.
evilash
 
Posts: 5
Joined: 13 Aug 2011, 03:48

Re: Autorun on Boot - O!Play HDP-R1

Postby evilash » 19 Aug 2011, 04:16

Got it working using:

echo"command">>/tmp/ir

Instead of the:

wget "http://127.0.0.1/cgi-bin/cmd.cgi?command"

100% working now and good to go. Was so excited I made a video:

http://www.youtube.com/watch?v=vZzoqkaoNPs

Thanks for letting me talk to myself on your forums and figure this out.
evilash
 
Posts: 5
Joined: 13 Aug 2011, 03:48

Re: Autorun on Boot - O!Play HDP-R1

Postby dpacurari » 29 Feb 2012, 00:27

can you share code used and steps to do?
dpacurari
 
Posts: 1
Joined: 29 Feb 2012, 00:24


Return to About moServices

Who is online

Users browsing this forum: No registered users and 11 guests