gnokii

From Gentoo Wiki
Jump to: navigation, search

Resources

gnokii is a modem and fax driver for mobile phones.

Installation

USE flags

Cannot load package information. Is the atom app-mobilephone/gnokii correct?

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