View Single Post
TomJ's Avatar
Posts: 505 | Thanked: 665 times | Joined on Oct 2009
#9
Originally Posted by TomJ View Post
I had originally considered charging the phone from the TV's USB port, but that resulted in some nasty noise from the TV when displaying the N900's output; some sort of interference with the audio line for some reason. Then I remembered that about 5 years ago I had acquired an energy saving plug that was being given away by a newspaper in conjunction with a power company; it's designed to kill power to peripherals (monitor, printer etc for PB, DVD player or similar for TV) when the main device powers down. With the N900 charging from that, a script detecting charger state could toggle not only TV-Out, but also bluetooth and until I come up with a reason for it to be online all the time, wi-fi.
.
I've not progressed much with this for reasons various - getting interviewed for new job, looking into moving to area of new job, sorting out paperwork for same, USB port coming out of SIMless phone. The last might seem to make this next post seem like nugatory effort, but I hope to get access to an SMT soldering station at new job (there is a sensor lab in the building I'll be working in, which you'd have thought would have the necessary kit), so will attempt to fit a micro AB port. In the meantime, I can test on my everyday N900.

Searching tmo and the wiki, I reckon the best way to do this is Dbus-Scripts. From http://talk.maemo.org/showpost.php?p...48&postcount=1, the way to monitor for charging is:

Code:
SCRIPT * * com.nokia.bme.signal charger_connected
where SCRIPT is the path to this script:

Code:
#!/bin/sh

#Check if TV out is attached:
video_cable=$(lshal | grep 'line-out.*video-out')

if [[ "$video_cable" != "" ]]; then

#Switch to "Today Screen" of desktop
gconftool-2 -s /apps/osso/hildon-desktop/views/current -t int 1

#Fire up Bluetooth
run-standalone.sh dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:true
fi
As I am currently not using a dedicated device for the TV, I only want this to run if the video out's plugged in, so pinched the check from http://talk.maemo.org/showpost.php?p...4&postcount=27


The BT on part has the auto-detect adapter command from http://wiki.maemo.org/Phone_control#Enable so anyone can use it unmodified; a little work needed to tailor to your own device and save it a little work each time it's run.
__________________
Want to know how to add public holidays to your device calendar? See the instructions wiki page.

Want to improve the location bar's search capabilities? there's a wiki page for that too...