gnokii

From Gentoo Wiki
Jump to:navigation Jump to:search

Resources

gnokii is a modem and fax driver for mobile phones.

Installation

USE flags

USE flags for app-mobilephone/gnokii User space driver and tools for use with mobile phones

X Add support for X11
bluetooth Enable Bluetooth Support
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
ical Enable support for dev-libs/libical
irda Enable infrared support
mysql Add mySQL Database support
nls Add Native Language Support (using gettext - GNU locale utilities)
pcsc-lite Enable smartcard support with sys-apps/pcsc-lite
postgres Add support for the postgresql database
sms Enable SMS support (build smsd)
usb Add USB support to applications that have optional USB support (e.g. cups)

Emerge

root #emerge --ask app-mobilephone/gnokii

Configuration

Edit the /etc/gnokiirc file:

FILE /etc/gnokiirc
[global]
port = /dev/ttyUSB0
model = AT
initlength = default
connection = serial
use_locking = yes
serial_baudrate = 19200
smsc_timeout = 10

[gnokiid]
bindir = /usr/sbin/

[connect_script]
TELEPHONE = 12345678

[disconnect_script]

[logging]
debug = on

rlpdebug = off
xdebug = off

Setup save the password for PIN login

FILE /etc/sms-pin
ABORT BUSY
ABORT ERROR
ABORT 'NO CARRIER'
REPORT CONNECT
TIMEOUT 10
# Set your pin here
"" "AT+CPIN=0000

Usage

Set PIN to work with gnokii

/usr/sbin/chat is part of net-dialup/ppp.

root #/usr/sbin/chat -V -f /etc/sms-pin >> /dev/ttyUSB0 < /dev/ttyUSB0

An other way is just using gnokii:

user $gnokii --entersecuritycode PIN

Show the PIN status:

user $gnokii --getsecuritycodestatus | grep PIN

Sending SMS

user $echo "test" | gnokii --sendsms +land_and_telephonenumber

Write calendar notes

FILE gnokii-import.sh
#!/bin/bash
#########################################################
# gnokii ical import script to fix buggy write mode     #
# don't forget to use "irattach irda0 -s" if using ira  #
#########################################################
read -p "Please give path and file name: " file

declare -i a
a=$(grep -ir "SUMMARY:" $file | wc -l) # count the entries


for i in `seq 1 $a`;do
echo $i
gnokii --writecalendarnote $file $i
sleep 1 # wait a second before the next entry is written
done
FILE cal.ical
BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
CATEGORIES:MISCELLANEOUS
SUMMARY:09:00-18:00h New calendar entry
DTSTART:20080415T210000
DTEND:20080415T210000
DALARM:20080414T210000
END:VEVENT
END:VCALENDAR
user $gnokii-import.sh
user $cal.ica