PDA

Bekijk de volledige versie : Automatyczne startowanie gnokii



kaczor1984
31-01-2010, 15:24
Witam,

Mam Asusa Wl500gPv2, używam go w połączeniu z modemem Huawei E160. Zainstalowałem na nim gnokii i chciałem go startować automatycznie żeby odbierał SMSy jednak nie wiem dlaczego nie startuje.
Jeśli startuję go ręcznie
gnokii --smsreader to wszystko jest ok - program uruchamia się i odiera SMSy.
Dodałem go do pliku post-mount ale nie chce ruszać przy restarcie.
Próbowałem już wiele sposobów z nohupem, & po komendzie i wszelkich innych kombinacji. Próbowałem też czy wogóle plik jest wykonywany (wpisałem /usr/bin/gnokii --help > /tmp/mylog) i po restarcie w tym pliku miałem wypisanego helpa gnokii więc zarówno plik post-mount jest wykonywany jak i gnokii w odpowiednim miejscu.
Co jeszcze może być nie tak?

Lesiuk
01-02-2010, 18:15
Do pliku post-mount wpisywałeś na pewno pełną ścieżkę?
Może daj trochę sleepa przed odczytywaniem smsów.

kaczor1984
01-02-2010, 21:49
Do pliku post-mount wpisywałeś na pewno pełną ścieżkę?
Może daj trochę sleepa przed odczytywaniem smsów.

Próbowałem tak:

#!/bin/sh

# Enter your commands here
/opt/bin/gnokii --smsreader > /tmp/mylog
/opt/bin/gnokii --smsreader > /tmp/mylog2
/opt/bin/gnokii --smsreader > /tmp/mylog3 &
/usr/bin/nohup /opt/bin/gnokii --smsreader > /tmp/mylog4 &
/bin/sleep 20;/usr/bin/nohup /opt/bin/gnokii --smsreader > /tmp/mylog5 &
/bin/sleep 21 && /usr/bin/nohup /opt/bin/gnokii --smsreader > /tmp/mylog6 &
/bin/sleep 22 && /usr/bin/nohup /opt/bin/gnokii --smsreader > /tmp/mylog7
/usr/bin/nohup /opt/bin/gnokii --smsreader > /tmp/mylog8 && /bin/sleep 17
/opt/bin/gnokii --smsreader && /bin/sleep 18
/bin/sleep 19 && /opt/bin/gnokii --smsreader

Po zalogowaniu na router widziałem jeszcze sleepy w 'ps' ale gnokii się nie uruchomiło. Coś robię nie tak?

filet187
03-02-2010, 12:40
Witam mógłbyś napisać jak skonfigurowałeś gnokii bo też by mnie interesowała taka forma odbierania sms z modemu

Pozdrawiam

kaczor1984
03-02-2010, 23:01
Witam mógłbyś napisać jak skonfigurowałeś gnokii bo też by mnie interesowała taka forma odbierania sms z modemu

Pozdrawiam

Konfigurujesz w pliku /tmp/local/root/.gnokiirc


[global]
model = AT
port = /dev/usb/tts/1
connection = serial

port wybierasz 'drugi' tzn. nie ten który masz ustawiony przy połączeniu GPRS.
Wypisane masz je w logu w Diagnostics sekcja USB devfs Devices
Wiadomości odbierasz z pamięci SM


gnokii --getsms SM 1 end

Jedno co zauważyłem to że w windowsowym programie mam kupę smsów a tu widzi tylko kilka sztuk.
Możesz też sprawdzić ile smsów jest w jakiej pamięci wpisując


gnokii --showsmsfolderstatus

w0rm
05-02-2010, 10:28
Hello!

I'm trying to connect nokia5500 to wl500w in PC Suite mode, and dmesg outputs this:

hub.c: new USB device 01:03.0-1, assigned address 3
usb.c: USB device 3 (vend/prod 0x421/0x43f) is not claimed by any active driver.

So considering this config i do not have "/dev/usb/tts/1"


[global]
model = AT
port = /dev/usb/tts/1
connection = serial

Is there any way to make this work? I need it to send and receive sms.

w0rm
05-02-2010, 11:52
I added this into /usr/local/sbin/post-boot


insmod usbserial vendor=0x421 product=0x43f

And now I am able to send sms with


echo "text" | gnokii --sendsms +number

But reading sms outputs:


[admin@wl500w188 root]$ gnokii --smsreader
GNOKII Version 0.6.28
Error: Unknown error - well better than nothing!!


Is there anything I can do to make it work or is it just because my phone model isn't supported?

kaczor1984
05-02-2010, 12:57
I added this into /usr/local/sbin/post-boot


insmod usbserial vendor=0x421 product=0x43f

And now I am able to send sms with


echo "text" | gnokii --sendsms +number

But reading sms outputs:


[admin@wl500w188 root]$ gnokii --smsreader
GNOKII Version 0.6.28
Error: Unknown error - well better than nothing!!


Is there anything I can do to make it work or is it just because my phone model isn't supported?

Maybe you should set different model for your phone?
Here is a list http://wiki.gnokii.org/index.php/Config of phones and settings for them.

w0rm
05-02-2010, 14:41
I have a symbian s60 3rd edition phone (Nokia 5500 sport) so according to http://wiki.gnokii.org/index.php/Config the only option for me is model = AT.

kaczor1984
05-02-2010, 20:20
I have a symbian s60 3rd edition phone (Nokia 5500 sport) so according to http://wiki.gnokii.org/index.php/Config the only option for me is model = AT.
Does


gnokii --showsmsfolderstatus

work for you? If yes then you could see if gnokii is able to read SMSes from your phone at all.

You could also try to receive sms-es with smsd. I tried it but it takes quite a lot of memory (mysql has to be running).

Or you can go the 'hard' way and read smses with i.e.

serialcomm /dev/your/phone AT+CMGF=1
serialcomm /dev/your/phone AT+CMGL='ALL'
serialcomm /dev/your/phone AT+CMGR=0
First command sets modem to text mode, second retrieves all messages (doesn't work for me), last reads a single message.

kaczor1984
05-02-2010, 22:54
Udało mi się sobie poradzić z problemem... co za głupota. Gnokii 'zdychał' bo nie znajdował configu.
Przy wykonywaniu tego skryptu szukał go w /.gnokiirc lub /etc/gnokiirc a u mnie był w katalogu usera (/tmp/local/root/.gnokiirc).