From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [RFC PATCH 1/2] Add basic Telit UC864-G support:
Date: Wed, 25 May 2011 09:12:37 -0700 [thread overview]
Message-ID: <1306339957.2681.22.camel@aeonflux> (raw)
In-Reply-To: <4DDCFDBE.3050905@hale.at>
[-- Attachment #1: Type: text/plain, Size: 6430 bytes --]
Hi Bernhard,
> >> + * +CFUN=1: mobile full functionality with power saving disabled (factory default).
> >> + * +CFUN=5: mobile full functionality with power saving enabled.
> >> + */
> >> + g_at_chat_send(chat, "AT+CFUN=1", none_prefix, cfun_enable_cb, modem, NULL);
> > If you are supporting online mode, then this is wrong. You need to start
> > in offline mode. So most likely CFUN=4.
> >
>
> Ok, I switched it. The only problem about being in state 4 is that #QSS
> returns "sim not inserted". But after test/online-modem everything wakes
> up properly. I was not sure about attaching a full log or not. I can
> upload it to pastebin if you like.
>
> ...
> ofonod[5796]: src/sim.c:ofono_sim_add_state_watch() 0x9488ad0
> ofonod[5796]: Modem: > AT#QSS=1\r
> ofonod[5796]: Modem: < \r\nOK\r\n
> ofonod[5796]: Modem: > AT#QSS?\r
> ofonod[5796]: Modem: < \r\n#QSS: 1,0\r\n\r\nOK\r\n
> ofonod[5796]: plugins/telit.c:telit_qss_cb() SIM not inserted
> ofonod[5796]: Modem: > AT+CGMI\r
> ofonod[5796]: Modem: < \r\nTelit\r\n\r\nOK\r\n
> ofonod[5796]: Modem: > AT+CLCC\r
> ofonod[5796]: Modem: < \r\n+CME ERROR: 10\r\n
> ofonod[5796]: Modem: > AT+CGMM\r
> ofonod[5796]: Modem: < \r\nUC864-G\r\n\r\nOK\r\n
> ofonod[5796]: Modem: > AT+CGMR\r
> ofonod[5796]: Modem: < \r\n08.01.107\r\n\r\nOK\r\n
> ofonod[5796]: Modem: > AT+CGSN\r
> ofonod[5796]: Modem: < \r\n356265021006068\r\n\r\nOK\r\n
> ofonod[5796]: plugins/telit.c:telit_set_online() modem 0x9488438 online
> ofonod[5796]: Modem: > AT+CFUN=1\r
> ofonod[5796]: Modem: < \r\nOK\r\n
> ofonod[5796]: src/modem.c:common_online_cb() Online in PRE SIM state
> ofonod[5796]: Modem: < \r\n#QSS: 1\r\n
> ofonod[5796]: plugins/telit.c:telit_qss_notify() SIM inserted
> ofonod[5796]: Modem: > AT+CRSM=192,28599\r
> ...
you need to handle SIM hotswap if the modem does support and report it.
Check how other modem plugins do it.
> >> + /* enable sim state notification */
> >> + g_at_chat_send(chat, "AT#QSS=1", NULL, NULL, NULL, NULL);
> >> + g_at_chat_register(chat, "#QSS:", telit_qss_notify, FALSE, sim, NULL);
> >> + /* query current sim state */
> >> + g_at_chat_send(chat, "AT#QSS?", NULL, telit_qss_cb, sim, NULL);
> > Using NULL for prefix is most likely wrong here. Can you show us some
> > examples logs with OFONO_AT_DEBUG=1 for this?
> >
>
> ofonod[30582]: drivers/atmodem/voicecall.c:at_voicecall_initialized()
> voicecall_init: registering to notifications
> ofonod[30582]: src/sim.c:ofono_sim_add_state_watch() 0x18cb6b0
> ofonod[30582]: > AT#QSS=1\r
> ofonod[30582]: < \r\nOK\r\n
> ofonod[30582]: > AT#QSS?\r
> ofonod[30582]: < \r\n#QSS: 1,1\r\n\r\nOK\r\n
> ofonod[30582]: plugins/telit.c:telit_qss_cb() SIM inserted
> ofonod[30582]: > AT+CGMI\r
> ofonod[30582]: < \r\nTelit\r\n\r\nOK\r\n
> ofonod[30582]: > AT+CLCC\r
> ofonod[30582]: < \r\nOK\r\n
>
> But I followed your adwise and added a prefix for #QSS for the new patch
> (see output above)
For AT#QSS=1 you do want to use none_prefix. And for AT#QSS? you want to
use a special qss_prefix.
In case you are using NULL as prefix it would consume all events and
that means that any other unsolicited notification will be missed.
> >> + if (gps)
> >> + g_at_chat_send(chat, "AT$GPSP=1", NULL, NULL, NULL, NULL);
> > So in general the post_online, pre_sim and post_sim states should only
> > be used to add atoms and not to send commands.
> >
> > If you wanna support GPS, then please create a proper atom driver
> > specific for the Telit modem.
> >
>
> Ok, I will remove the GPS attempts of the patch and try to support it
> later.
>
> As far as I read the doc a correct implemented GPS atom is opening the
> GPS tty line, so I cannot longer use it with gypsy?
It does not need to be. You can have multiple TTY and also the location
reporting atoms return a file descriptor via D-Bus. So that would be
easy to use from Gypsy as well. However the TTY is actually owned by
oFono in the end.
> >> +static void add_telit(struct ofono_modem *modem,
> >> + struct udev_device *udev_device)
> >> +{
> >> + struct udev_list_entry *entry;
> >> + const char *devnode;
> >> + gboolean found = FALSE;
> >> + gboolean gps = FALSE;
> >> +
> >> + DBG("modem %p", modem);
> >> +
> >> + entry = udev_device_get_properties_list_entry(udev_device);
> >> + while (entry) {
> >> + const char *name = udev_list_entry_get_name(entry);
> >> + const char *value = udev_list_entry_get_value(entry);
> >> +
> >> + if (g_str_equal(name, "OFONO_TELIT_TYPE") == TRUE&&
> >> + g_str_equal(value, "modem") == TRUE) {
> >> + found = TRUE;
> >> + }
> >> + if (g_str_equal(name, "OFONO_TELIT_MODEL") == TRUE&&
> >> + g_str_equal(value, "UC864-G") == TRUE) {
> >> + gps = TRUE;
> >> + }
> >> + entry = udev_list_entry_get_next(entry);
> >> + }
> >> +
> >> + if (found == FALSE)
> >> + return;
> >> +
> >> + devnode = udev_device_get_devnode(udev_device);
> >> + ofono_modem_set_string(modem, "Device", devnode);
> >> +
> >> + if(gps)
> >> + ofono_modem_set_integer(modem, "GPS", 1);
> >> +
> >> + ofono_modem_register(modem);
> >> +}
> >> +
> >
> > Do you happen to have the output of /proc/bus/usb/devices for this
> > device?
> >
>
> #uname -a
> Linux entw48 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC
> 2011 x86_64 GNU/Linux
>
> # ls -lah /proc/bus/
> total 0
> dr-xr-xr-x 4 root root 0 2011-05-25 14:32 .
> dr-xr-xr-x 237 root root 0 2011-05-24 10:53 ..
> dr-xr-xr-x 2 root root 0 2011-05-25 14:32 input
> dr-xr-xr-x 3 root root 0 2011-05-25 14:32 pci
>
>
> root(a)entw48:~# ls -lah /sys/bus/usb-serial/devices/
> total 0
> drwxr-xr-x 2 root root 0 2011-05-25 14:33 .
> drwxr-xr-x 4 root root 0 2011-05-25 14:32 ..
> lrwxrwxrwx 1 root root 0 2011-05-25 14:33 ttyUSB0 ->
> ../../../devices/pci0000:00/0000:00:1d.2/usb8/8-2/8-2:1.0/ttyUSB0
> lrwxrwxrwx 1 root root 0 2011-05-25 14:33 ttyUSB1 ->
> ../../../devices/pci0000:00/0000:00:1d.2/usb8/8-2/8-2:1.1/ttyUSB1
> lrwxrwxrwx 1 root root 0 2011-05-25 14:33 ttyUSB2 ->
> ../../../devices/pci0000:00/0000:00:1d.2/usb8/8-2/8-2:1.2/ttyUSB2
> lrwxrwxrwx 1 root root 0 2011-05-25 14:33 ttyUSB3 ->
> ../../../devices/pci0000:00/0000:00:1d.2/usb8/8-2/8-2:1.3/ttyUSB3
There is a script usbdevices.sh if you do not have usbfs mounted
anymore.
Regards
Marcel
prev parent reply other threads:[~2011-05-25 16:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-19 10:40 [RFC PATCH 1/2] Add basic Telit UC864-G support: Bernhard.Guillon
2011-05-19 10:40 ` [RFC PATCH 2/2] network-registration.c: implement CIND for Telit UC864-G Bernhard.Guillon
2011-05-19 17:51 ` Marcel Holtmann
2011-05-19 17:48 ` [RFC PATCH 1/2] Add basic Telit UC864-G support: Marcel Holtmann
2011-05-25 13:01 ` Bernhard Guillon
2011-05-25 16:12 ` Marcel Holtmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1306339957.2681.22.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox