CMGS <CTRL-Z> appears with terminate IO stream in Ofono
by Frederik Lotter
Hi Enrico,
> I had a similar problem and the reason was the hangout of the modem on the
> SMS sending.
>
> I solved with the following command on my plaugin:
>
> g_at_chat_send(data->chat, "AT&C0", NULL, NULL, NULL, NULL);
>
>Hope this helps.
>
>Enrico
I already have AT&C0 on both my AT chat and data channel. Maybe there is an
issue with this setup on my modem.
The root issue appears in the callback:
static gboolean received_data(GIOChannel *channel, GIOCondition cond, gpointer
data)
The g_io_channel_read_chars function gets an EOF status on read and returns
zero bytes. This happens after the CTRL-Z of the CMGS write (it appears).
What I am hoping someone can explain, is if this could be caused only by
the modem doing something on the line, or whether this could be cause by
the GLIB IO channel interpreting the CTRL-Z as a signal to close the
channel?
(I do not know which avenue to persue in debugging).
Right in the beginning of my modem init code I do:
g_at_chat_send(data->chat, "ATE0+CMEE=1", none_prefix,
NULL, NULL, NULL);
g_at_chat_send(data->chat, "AT&C0", none_prefix,
NULL, NULL, NULL);
g_at_chat_send(data->chat, "AT&D0", none_prefix,
NULL, NULL, NULL);
g_at_chat_send(data->modem, "AT&C0", none_prefix,
NULL, NULL, NULL);
g_at_chat_send(data->modem, "AT&D0", none_prefix,
NULL, NULL, NULL);
Thank for the quick reply and assistance so far.
Frederik Lotter
MiX Telematics South Africa
5 years, 10 months
CMGS <CTRL-Z> appears with terminate IO stream in Ofono
by Frederik Lotter
Hi Ofono experts,
I am using a UBLOX U200 modem and I wrote the driver for it some months
ago, and have since been using GPRS successfully.
I have now added the SMS feature and I am running into a problem:
It looks like once the SMS PDU byte block is sent (with CTRL-Z) the stream
disconnects.
Aux: > 0011000A8170033962660000A7044679990C<CtrlZ>
Any ideas? It looks like the g_io_channel_set_encoding() is called on both
my tty channels to RAW mode, so I am not sure why the CTRL-Z (I guess) is
causing this.
Instrumented output below:
------------------------------------
ofonod[1502]:
/home/flotter/mix6000-angstrom/build/tmp-angstrom_v2014_06-eglibc/work/armv7at2hf-vfp-angstrom-linux-gnueabi/ofono/1.14-r0/ofono-1.14/drivers/atmodem/sms.c:at_cmgl_done()
ofonod[1502]: Aux: > AT+CGSMS=3\r
FRED[Write watcher destroyed...]
ofonod[1502]: Aux: < \r\nOK\r\n
FRED>>[
OK
] - 6 - 6 <<
ofonod[1502]: Aux: > AT+CMGS=17\r
FRED[Write watcher destroyed...]
ofonod[1502]: RegisterProfile() replied an error:
org.freedesktop.DBus.Error.UnknownMethod, Method "RegisterProfile" with
signature "osa{sv}" on interface "org.bluez.ProfileManager1" doesn't exist
ofonod[1502]: Aux: < \r\n>
FRED>>[
> ] - 4 - 4 <<
ofonod[1502]: Aux: > 0011000A8170033962660000A7044679990C<CtrlZ>
FRED[Write watcher destroyed...]
FRED[Read watcher destroyed...]
FRED[IO Disconnect]
5 years, 11 months
Why doesn't ofono match all +CGEV notification ? How can I implement a GPRS watchdog ?
by Viallard Anthony
Hello,
I'm looking for an issue with GPRS. I have the SIMCOM5216E module with
ofono 1.12. The problem was see in France with SFR provider. I didn't
reproduce this with another provider and in another country... But maybe
it's a question of uptime...
During a good period of time, my device is well connected through the
GPRS connection. All work perfectly. In recent log, I can see the GPRS
is reactivated several time along the weeks but the PPP is back online
soon after.
But, few days ago, I saw the GPRS connection was unusable for 10 days. I
saw the problem began the 12th February. According to different logs,
the network connectivity have began to fail since the 2th February.
Unfortunately, I couldn't get logs from ofono during the period of time
(it's an embedded device, so the size of the log file is only 64k bytes.
But it will be a good idea for the future to increment it ...). However,
the device had others logs. I could see the log from our program that
deals with ofono (it sends dbus commands and listen for dbus signals)
and I saw there is a blank period from the 2th to the 12th. It's like
ofono or the module was dead.
So, I begin to read the code, especially the simcom driver, to see if I
miss something. And I see something weird.
According to the SIMCOM AT document, the +CGEV notification can be send
with this list of event:
REJECT
NW REACT
NW DEACT
ME DEACT
NW DETACH
ME DETACH
NW CLASS
ME CLASS
But in gprs-context.c, I see we deal only with the "NW DETACH" event.
Maybe It's the point. Maybe the modem send to ofono an another event and
therefore ofono begins to be in incorrect state about the GPRS
connection... Is it possible ?
Otherwise, I'm thinking about implement a GPRS watchdog. Does it exist
an AT command which could do that ? My idea is to send an AT command
each XX period of time and check the GPRS connection is really here.
Regards,
Anthony Viallard.
--
-----------------------------------------
Viallard Anthony (+41 024 455 24 82)
[ Embedded System | Software Designer ]
-----------------------------------------
Syscom Instruments SA
Rue de l'industrie 21
1450 Sainte-Croix
-----------------------------------------
5 years, 11 months
Re: Re: [PATCH 0/2] Add ResetProperties method to ConnectionContext interface
by Tommi Kenakkala
> Date: Fri, 20 Feb 2015 10:00:31 -0600
> From: Denis Kenzior <denkenz(a)gmail.com>
> To: ofono(a)ofono.org
> Subject: Re: [PATCH 0/2] Add ResetProperties method to
> ConnectionContext interface
> Message-ID: <54E75A1F.8070709(a)gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Tommi,
>
> On 02/19/2015 05:59 AM, Tommi Kenakkala wrote:
>> In some cases it is useful to reset connection context settings back to ones
>> ofono provisioning resolved initially.
>> What's your opinion on the API design, implementation and use-case described
>> next?
>>
> Why don't you just remove the settings file and restart oFono?
oFono handles many other services so restarting would have undesirable effects.
For a moment clients would think there is no telephony at all: no SIM,
no cellular signal strength, no voice/emergency calls, no SIM ATK etc.
>> Deactivation of the context is obviously mandatory. The reasoning for placing
>> this into ofono is handling client requests consistently and avoiding race
>> conditions. Using this approach ofono does not re-activate the context, that's
>> done by ConnMan or whatever connection manger the system uses.
>>
> I'm not so sure that this is a good idea. A 'live' reset of the
> settings just seems wrong to me. Why would you ever want to do that
> anyway? If something is working, why bother resetting the settings?
Generally speaking I agree with the point of view. The main point was
not the 'live' part, but to allow running provisioning again, e.g. if
user has set wrong ones.
FYI a MMS context may be active using a correct APN but messages don't
flow due to a wrong proxy. In such a case context remains active for
some time.
> oFono supports arbitrary number of contexts, so your UI can always add
> more. So if you need to re-provision, let your UI handle this. The UI
> should be capable of reading the provisioning database anyway in order
> to handle duplicates, etc.
When ofono already implements the initial provisioning logic it is not
tempting to duplicate it but instead trigger it again.
(A more suitable name for the new method could be "ProvisiongContext"
or similar.)
If reverting provisioned settings is done by creating a new empty
context, one would still want to run ofono provisioning for that
(ofono restart not an option).
>
> Regards,
> -Denis
Thanks for your feedback Denis, I appreciate it. All tips to make
changes more upstream-worthy, or if not then otherwise better, are
welcome.
Thanks
--
Tommi
5 years, 11 months
[PATCH 0/2] Add ResetProperties method to ConnectionContext interface
by Tommi Kenakkala
In some cases it is useful to reset connection context settings back to ones
ofono provisioning resolved initially.
What's your opinion on the API design, implementation and use-case described
next?
Deactivation of the context is obviously mandatory. The reasoning for placing
this into ofono is handling client requests consistently and avoiding race
conditions. Using this approach ofono does not re-activate the context, that's
done by ConnMan or whatever connection manger the system uses.
Ps. Patches on behalf of Slava whose emails didn't get through to the mailing
list.
Slava Monich (2):
gprs: Add ResetProperties method to ConnectionContext interface
doc: Document ResetProperties method
doc/connman-api.txt | 9 ++
src/gprs.c | 292 +++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 295 insertions(+), 6 deletions(-)
--
1.7.9.5
5 years, 11 months
Re: Which desktop linux distribution uses ofono natively?
by Sanjay Mehta
> From: Christian Gagneraud
> I use to use Ubuntu 13.04 and 13.10 with custom built ofono.
> The problem when you experiment with ofono on your dev machine is that
> you will loose your internet connection in case ofono goes nuts. So I
I’ve brought up ofono and econnman on Ubuntu 14.04.01 LTS
using the packages available via apt-get on a generic Intel laptop.
Haven’t tested Bluetooth, but it’s working with wifi and wired ethernet. I’m now
trying to figure out how to add “cellular” to the technologies supported by ofono.
After upgrading the linux kernel to 3.19, I can see wwan0 showing up
in /sys/class/net so the device (a Huawei E3272 LTE dongle) is being
detected by the kernel properly (and it works if I use sakis3g).
I think there was a Huawei specific bug in the shipped version of the
kernel that blocked me earlier.
Short of reading the ofono code - which I can do later this week - any pointers
on connecting cellular with ofono?
> would say it's better to run ofono experiment on the embedded board.
> Set up your dev computer with the cross toolchain, and mount (part of)
> the board rootfs on your dev computer and build (or install) ofono there.
My target board isn’t ready yet. I could try an experiment with an old
Raspberry Pi B.
thanks!
Sanjay
5 years, 11 months
+CUSD charset
by Enrico Sau
Hi all,
I'm trying to use supplementary services and I have a problem in decoding
the response string.
The received charset is AT_UTIL_CHARSET_IRA, which is not evaluated in the
switch case statement.
I noticed that it seems to decode correctly the string if I apply the same
function as for AT_UTIL_CHARSET_GSM.
The question is: am I doing it wrong?
I cannot understand the difference between GSM and IRA charsets.
Thank you.
Enrico
5 years, 11 months
Which desktop linux distribution uses ofono natively?
by Sanjay Mehta
Is there a preferred version of desktop Linux to install to experiment with ofono
configuration?
My target will be an embedded board (ARM) with a USB 3g/LTE dongle. I’d like
to get the ofono/connman settings done before taking it to the board.
thanks in advance,
Sanjay
5 years, 11 months
[PATCH 2/2] unit: SMS-DELIVER decoding/encoding test for long alphanum address
by Tommi Kenakkala
---
unit/test-sms.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/unit/test-sms.c b/unit/test-sms.c
index 7b644df..259594e 100644
--- a/unit/test-sms.c
+++ b/unit/test-sms.c
@@ -38,6 +38,12 @@ static const char *simple_deliver = "07911326040000F0"
"040B911346610089F60000208062917314480CC8F71D14969741F977FD07";
static const char *alnum_sender = "0791447758100650"
"040DD0F334FC1CA6970100008080312170224008D4F29CDE0EA7D9";
+static const char *unicode_deliver = "04819999990414D0FBFD7EBFDFEFF77BFE1E001"
+ "9512090801361807E00DC00FC00C400E400D600F600C500E500D800F800C"
+ "600E600C700E700C900E900CA00EA00DF003100320033003400350036003"
+ "7003800390030002000540068006900730020006D0065007300730061006"
+ "7006500200069007300200036003300200075006E00690063006F0064006"
+ "5002000630068006100720073002E";
static const char *simple_submit = "0011000B916407281553F80000AA"
"0AE8329BFD4697D9EC37";
@@ -362,6 +368,38 @@ static void test_deliver_encode(void)
g_assert(strcmp(alnum_sender, encoded_pdu) == 0);
g_free(encoded_pdu);
+
+ /* test unicode_deliver*/
+ decoded_pdu = decode_hex(unicode_deliver, -1, &pdu_len, 0);
+ g_assert(decoded_pdu);
+ g_assert(pdu_len == (long)strlen(unicode_deliver) / 2);
+
+ ret = sms_decode(decoded_pdu, pdu_len, FALSE, 149, &sms);
+
+ g_free(decoded_pdu);
+
+ g_assert(ret);
+ g_assert(sms.type == SMS_TYPE_DELIVER);
+
+ ret = sms_encode(&sms, &encoded_pdu_len, &encoded_tpdu_len, pdu);
+
+ if (g_test_verbose()) {
+ int i;
+
+ for (i = 0; i < encoded_pdu_len; i++)
+ g_print("%02X", pdu[i]);
+ g_print("\n");
+ }
+
+ g_assert(ret);
+ g_assert(encoded_tpdu_len == 149);
+ g_assert(encoded_pdu_len == pdu_len);
+
+ encoded_pdu = encode_hex(pdu, encoded_pdu_len, 0);
+
+ g_assert(strcmp(unicode_deliver, encoded_pdu) == 0);
+
+ g_free(encoded_pdu);
}
static void test_simple_submit(void)
--
1.7.9.5
5 years, 11 months
[PATCH] sms: SMS-DELIVER TP-OA Alphanum decoding and encoding fix
by Tommi Kenakkala
TP-OA max length comparisons were incorrect because TP-OA's 7-bit
coded octets transport eleven 8-bit chars which take 23 bytes in UTF-8.
Increase address array accordingly and don't compare byte length to
character limit, but to a proper limit.
---
src/smsutil.c | 12 +++++++++---
src/smsutil.h | 6 +++++-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index be60ee9..213e50e 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -524,7 +524,8 @@ static gboolean encode_validity_period(const struct sms_validity_period *vp,
gboolean sms_encode_address_field(const struct sms_address *in, gboolean sc,
unsigned char *pdu, int *offset)
{
- size_t len = strlen(in->address);
+ const char *addr = (const char *)&in->address;
+ size_t len = strlen(addr);
unsigned char addr_len = 0;
unsigned char p[10];
@@ -546,7 +547,8 @@ gboolean sms_encode_address_field(const struct sms_address *in, gboolean sc,
unsigned char *gsm;
unsigned char *r;
- if (len > 11)
+ /* TP-OA's 10 octets transport 11 8-bit chars */
+ if (g_utf8_strlen(addr, strlen(addr)) > 11)
return FALSE;
gsm = convert_utf8_to_gsm(in->address, len, NULL, &written, 0);
@@ -675,7 +677,11 @@ gboolean sms_decode_address_field(const unsigned char *pdu, int len,
if (utf8 == NULL)
return FALSE;
- if (strlen(utf8) > 20) {
+ /*
+ * TP-OA's 10 octets transport 11 8-bit chars,
+ * 22 bytes+terminator in UTF-8.
+ */
+ if (strlen(utf8) > 22) {
g_free(utf8);
return FALSE;
}
diff --git a/src/smsutil.h b/src/smsutil.h
index b1001f8..d252810 100644
--- a/src/smsutil.h
+++ b/src/smsutil.h
@@ -220,7 +220,11 @@ enum cbs_geo_scope {
struct sms_address {
enum sms_number_type number_type;
enum sms_numbering_plan numbering_plan;
- char address[21]; /* Max 20 in semi-octet, 11 in alnum */
+ /*
+ * An alphanum TP-OA is 10 7-bit coded octets, which can carry
+ * 11 8-bit characters. 22 bytes + terminator in UTF-8.
+ */
+ char address[23];
};
struct sms_scts {
--
1.7.9.5
5 years, 11 months