1 (edited by chumby3000 2011-11-18 12:06:16)

Topic: How to temporarily stop control panel

I am trying to use my Ironforge chumby as a caller id display/ringer. Chumby gets a png image via wget and uses imgtool to display it.

I am writing to both fb0 and fb1(saving the previous content) as I do not believe there as a way to tell which one is active.
The problem is the widgets/control panel interfere with the image.
I would like to stop the control panel for 30 seconds while the info is on the screen and then resume playing the current stream.
My script removes /tmp/flashplayer_started, sends SIGSTOP to control panel, writes to /tmp/movieheartbeat and /tmp/flashheartbeat while running and when it finishes sends SIGCONT.
In about 50% of the cases the panel gets restarted if one of My Streams is being played. This does not happen when widgets are running. Any ideas ? I am also attaching my script.

#!/bin/sh
echo Content-type: text/plain
echo

FILE=chumby.png
START=`date +%s`
END=$(( START + 30 ))
cd /tmp
rm -f $FILE
wget http://192.168.122.164/images/$FILE
[ -e splash0.bin ] && exit
dd if=/dev/fb0 of=splash0.bin bs=640 count=240
dd if=/dev/fb1 of=splash1.bin bs=640 count=240
# disable flashplayer watchdog
rm -f /tmp/flashplayer_started
read PID < /var/run/chumbyflashplayer.pid
kill -STOP $PID
imgtool --fb=1 $FILE
imgtool --fb=0 $FILE
btplay /psp/ring.mp3
while [ `date +%s` -lt $END ]; do
  kill -CONT $PID
  sleep 1
  kill -STOP $PID
  imgtool --fb=1 $FILE
  imgtool --fb=0 $FILE
  echo 1 > /tmp/movieheartbeat
  echo 1 > /tmp/flashheartbeat
  sleep 5
done
dd of=/dev/fb1 if=splash1.bin bs=640 count=240
dd of=/dev/fb0 if=splash0.bin bs=640 count=240
kill -CONT $PID
sleep 1
# enable flashplayer watchdog
echo 1 >/tmp/flashplayer_started
rm -rf splash?.bin

Re: How to temporarily stop control panel

I'm glad to see that someone else is using their Chumby as a caller ID. It sounds like we are working on very similar projects.

If I understand you right, you are having problems only when streaming?  I can't say that I've seen your problem, but I also (usually) don't stream anything, and I haven't (yet) thought of playing sounds on an incoming call. 

I also don't do any of the backup/restore of the framebuffer device (I only worry about /dev/fb0) and haven't seen any problems with the widgets coming right back to life.

Out of curiosity, what do you do to detect an incoming call and generate the image?

Re: How to temporarily stop control panel

Try "stop_control_panel" to stop it, and "start_control_panel" to start it up again.

Re: How to temporarily stop control panel

@Duane,

won't work as it will switch me back to running widgets.  I want to remain in My Streams.

Re: How to temporarily stop control panel

How do you get your image file on the Chumby, and then what do you do to launch the script above?

This is what I'm currently doing:  From a different computer, I use scp to copy the image file to the chumby (in /tmp) and then I run a command through SSH to run my equivalent to your script.

The problem (that I think I'm seeing) is that there is a lot of connection initialization overhead time in scp/ssh that puts about a 2 second delay in things, which isn't horrible, but for a caller ID application I would like to see it improved.

Re: How to temporarily stop control panel

Check http://wiki.chumby.com/index.php/Chumby … web_server to see how to run cgi scripts.