Re: syncing pda + phone on linux?
On Mon, Jul 26, 2004 at 01:23:34PM +0800, Arne Götje (?????????) wrote:
>
> Sounds cool. can you give me more information on that? I was playing
> with the idea of getting a Pocket PC (Asus A716 with integrated
> Bluetooth and WiFi) and have the desire to do the same like you...
> syncing addressbooks with my notbooks and mobile phone (also
> bluetooth).
> Any infos about gotchas and success stories with Pocket PCs and Linux?
This is the best article on getting bluetooth sync working:
http://www.grinta.net/howto/bluez-ipaq.html
My scripts and C# app are at this point an utter hack utterly specific
to me and my tastes, so my code wouldn't be any use to you.
I purchased a C# api called "Pocket Outlook"
(http://www.inthehand.com/index.php?page=6&show=1,2) which lets you
programatically create appointments and tasks. For instance, for my
list of family names, address, birthdays, I create a contact for each,
assign it to the "Personal" category, and automatically create tasks and
appointments 1 week before to buy them a card, but only if it's going to
occur in the next two months. Junk like that. I blow away all the data
on each sync and recreate it all, so it's always in a "good state."
I linked already to the GTK app I use on the Linux side to manage the
data (which I wrote, and works well). I also use it to view the diffs.
Since it uses XML, when combined with xsltproc it's basically infinitely
flexible.
I'll put my C# code up sometime. Here's the script I use on the linux
side:
if [[ "$1" == 'up' ]]; then
echo Cleaning up...
/etc/init.d/vsftpd stop
mkdir -p /home/ftp/pub/{down,up}
rm -r /home/ftp/pub/{down,up}/* 2>/dev/null
mv /home/tom/share/down/* /home/ftp/pub/down 2>/dev/null
chmod -R a+r /home/ftp/pub/down/* 2>/dev/null
echo Exporting Data...
/x/x/sync
chown tom /home/ftp/pub/import.xml.gz /home/tom/share/down/*
2>/dev/null
/etc/init.d/vsftpd start
/etc/init.d/bluez-utils start
echo Waiting 2 seconds...
sleep 2
hciconfig up
hcitool dev
pand -s --role NAP
dund --listen --msdun call dun
fi
if [[ "$1" == 'down' ]]; then
echo Stopping services...
killall dund
killall pand
/etc/init.d/bluez-utils stop
/etc/init.d/vsftpd stop
echo Saving data...
mkdir -p /home/tom/share/{up,down}
mv /home/ftp/pub/up/* /home/tom/share/up 2>/dev/null
rm /home/ftp/pub/{import.xml.gz,books.html,serials.pwi} 2>/dev/null
mv /home/ftp/pub/*.gz /x/d/h 2>/dev/null
if [[ `ls /home/ftp/pub/down | wc -l` -ne 0 ]]; then
dt=`date +"%y%m%d_%H%M%S"`
mkdir -p /home/tom/share/bak/$dt
chown tom /home/tom/share/bak/$dt
mv /home/ftp/pub/down/* /home/tom/share/bak/$dt
fi
fi
if [[ "$1" == 'ip' ]]; then
ifconfig bnep0 10.10.2.1 netmask 255.255.255.0
echo Waiting 4 seconds...
sleep 4
ping -c 4 10.10.2.2
fi
if [[ "$1" == 't' ]]; then
ping -c 4 10.10.2.2
fi
The sequence of steps is:
(1) Run /x/x/dun up: which collects all the data, starts bluetooth on the pc,
and starts the ftp server.
(2) Start bluetooth on the iPaq and establish the bluetooth connection.
(3) Run /x/x/dun ip: assign an ip-over-bluetooth address on the PC side, and
make sure you can ping the iPaq.
(4) Run the C# app on the iPaq which connects to the ftp, pulls down the
gzipped xml, imports it, exports up some new xml, and also syncs files.
(5) Disable bluetooth on the iPaq.
(6) Run /x/x/dun down on the PC; which stops all the services, archives the
transferred files, archives the logs for diffing later.
Like I said, it's all a totally-specific-to-me grotesque hackfest, but it's
working pretty good. It's still a newborn project: probably within a
year I'll put some spit and polish on it and publish it.
Reply to: