www-home/blog/20070522-gnokii-tips.html

100 lines
5.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="canonical" href="https://www.mcmillen.dev/blog/20070522-gnokii-tips.html">
<link rel="alternate" type="application/atom+xml" href="https://www.mcmillen.dev/feed.atom" title="Colin McMillen's Blog - Atom">
<title>Gnokii Tips | Colin McMillen</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&display=block" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Fira+Mono:500&display=block" rel="stylesheet">
<link rel="stylesheet" href="/pygments.css">
<link rel="stylesheet" href="/style.css">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@mcmillen">
<meta name="twitter:title" content="Gnokii Tips | Colin McMillen">
<meta name="twitter:description" content="I own a Nokia 6102i phone (provided by Cingular). gnokii is a Linux program that lets me interface with the phone. Here are some recipes: File I/O">
</head>
<script>
function fixEmails() {
const mailtoArray = [
'm', 'a', 'i', 'l', 't', 'o', ':',
'c', 'o', 'l', 'i', 'n', '@',
'm', 'c', 'm', 'i', 'l', 'l', 'e', 'n',
'.', 'd', 'e', 'v'];
const mailtoLink = mailtoArray.join('');
const anchors = document.getElementsByTagName('a');
for (let i = 0; i < anchors.length; i++) {
const anchor = anchors[i];
if (anchor.href == 'mailto:email@example.com') {
anchor.href = mailtoLink;
if (anchor.innerText == 'colin at mcmillen dot dev') {
anchor.innerText = mailtoLink.substring(7);
}
}
}
}
</script>
<body onload="fixEmails()">
<div id="page-container">
<div id="content-wrap">
<div id="header">
<div class="content">
<a href="/" class="undecorated">Colin McMillen</a>
<span style="float: right;"><a href="/feed.atom"><img src="/img/rss.svg" alt="Atom feed" style="width: 17px; height: 17px; margin-bottom: 1px;"></a></span>
<span style="float: right;"><a href="https://twitter.com/mcmillen"><img src="/img/twitter.svg" alt="@mcmillen"></a></span>
</div>
</div>
<div class="content">
<h1 id="gnokii-tips">Gnokii Tips</h1>
<p><em>Posted 2007-05-22, updated 2021-07-01.</em></p>
<p>I own a Nokia 6102i phone (provided by Cingular). <a href="http://gnokii.org">gnokii</a> is a Linux program that lets me interface with the phone. Here are some recipes:</p>
<h2 id="file-io">File I/O</h2>
<p><code>gnokii --getfilelist "A:\\predefgallery\\predeftones\\predefringtones\\*"</code></p>
<p><code>gnokii --putfile WiiSports.mp3 "A:\\predefgallery\\predeftones\\predefringtones\\WiiSports.mp3"</code></p>
<h2 id="ring-tones">Ring Tones</h2>
<p>Voice mail picks up in 20 seconds, so a ring tone should be about 20 seconds long.</p>
<p>The easiest way to chop an MP3 in Linux is with <code>dd</code>; the drawback is that you need to specify length in KB, not time. To chop an MP3 to be 200 KB long, do:</p>
<p><code>dd if=Mii\ Channel.mp3 of=MiiChan2.mp3 bs=1k count=200</code></p>
<h2 id="phonebook">Phonebook</h2>
<p>To make a Phonebook.ldif file from the phone (suitable for import into Thunderbird):</p>
<p><code>gnokii --getphonebook ME 1 end --ldif &gt; Phonebook.ldif</code></p>
<p>To add the entries in Phonebook.ldif to the phone:</p>
<p><code>cat Phonebook.ldif | gnokii --writephonebook -m ME --find-free --ldif</code></p>
<p>You can specify <code>--overwrite</code> instead of <code>--find-free</code> if you want to overwrite all the entries, but this will lose some data (e.g. speed dial, preferred numbers).</p>
<h2 id="multimedia">Multimedia</h2>
<p>You can get photos like this:<br>
<code>gnokii --getfile "A:\\predefgallery\\predefphotos\\Image000.jpg"</code><br>
They are 640x480 JPG files. (You can also configure the camera so that it takes pictures at 80x96.)</p>
<p>You can also store files:<br>
<code>gnokii --putfile silly.jpg "A:\\predefgallery\\predefphotos\\silly.jpg"</code><br>
These show up on the phone in <code>My Stuff/Images</code>. The files don&rsquo;t need to be any specific size; they are autoscaled. GIFs probably also work.</p>
<p>Videos live here:<br>
<code>gnokii --getfile "A:\\predefgallery\\predefvideos\\Video000.3gp"</code><br>
VLC seems to be able to play <code>.3gp</code> files, but the audio doesn&rsquo;t work.</p>
<p>Audio recordings live here:<br>
<code>gnokii --getfile "A:\\predefgallery\\predefrecordings\\Audio000.amr"</code></p>
<p>Unfortunately, nothing I knew of in 2007 (when this page was first written) would play <code>.amr</code> files, but these days (2021) perhaps <code>ffmpeg input.amr output.mp3</code> would work. You might have to use the <code>-ar</code> flag to specify the audio rate. I haven&rsquo;t actually tried this though!</p>
</div>
</div>
<div id="footer">
<div class="content">
&copy; 2022 <a href="/" class="undecorated">Colin McMillen</a>. No cookies, no tracking.
</div>
</div>
</div>
</body>
</html>