ofono with sim5320 module
by David Ashley
Hello, I'm at my wits' end trying to get ofono working with the
sim5320 module. I'm using the plugins/sim900.c module as a starting
point. I think the issue has something to do with the difference
between the MUX functionality between the 900 and the 5320. The sim900
supports the elaborate parameters sent on the
AT+CMUX=0,x,x,x,x, etc.
but the SIM5320 only supports
AT+CMUX=0
There's that... but also the way the sim900 plugin creates a
SETUP_DLC, initiates muxing, then deletes the setup DLC and creates 4
new DLC's... it didn't work for the sim5320 until I remapped the DLC's
somewhat like this:
#define NUM_DLC 4
#define VOICE_DLC 2
#define NETREG_DLC 1
//#define SMS_DLC 2
#define GPRS_DLC 3
#define SETUP_DLC 0
static char *dlc_prefixes[NUM_DLC] = {
[VOICE_DLC]="Voice: ",
[NETREG_DLC]="Net: ",
// [SMS_DLC]= "SMS: ",
[GPRS_DLC]= "GPRS: " ,
[SETUP_DLC]= "Setup: ",
};
Note I have to eliminate the SMS_DLC usage later in sim5320_post_sim:
// ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem",
// data->dlcs[SMS_DLC]);
OK everything is *ALMOST* working. ofonod interacts fine with
connmand, connmand tells ofonod to activate the sim5320, which
actually establishes a ppp connection and sets up a ppp device:
ppp0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-0
inet addr:30.97.132.47 P-t-P:30.97.132.47 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:124 (124.0 B)
Here's the rub: No matter what I do, I never get any RX packets from
that ppp device, and even when it appears to TX packets (I'm trying to
ping out) the machine on the internet isn't actually receiving them.
I'm running on a beaglebone with a custom board with a sim5320 module on it.
I have no idea what to try... Any advice would be appreciated...
Thanks very much!!!!
-Dave
3 years, 3 months
How to port Telit LE910V2 module
by Ashida
Hi Experts
How do I to extend oFono to support Telit LE910V2 module which is Intel
solution and use AT+CGDATA="M-RAW_IP"...?
First, I modified plugins/udevng.c by adding driver_list[], vendor_list[]
and other related sub function. Second, I copied the gprs_context.c from
ifxmodem to telitmodem folder and also modified codes for LE910V2. However,
oFono goes to GLib-CRITICAL issue after establishing data call.
Can anyone help me?
Here comes my log:
ofonod[1571]: src/gprs.c:ofono_gprs_status_notify() /le910v2_0 status 1
ofonod[1571]:
drivers/telitmodem/gprs-context.c:telit_gprs_activate_primary() cid 1
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: >
AT+CGDCONT=1,"IP","internet"\r
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: < \r\nOK\r\n
ofonod[1571]: drivers/telitmodem/gprs-context.c:setup_cb() ok 1
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: > AT#NCM=1,1\r
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: < \r\nOK\r\n
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: > AT+CGACT=1,1\r
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: < \r\nOK\r\n
ofonod[1571]: drivers/telitmodem/gprs-context.c:activate_cb() ok 1
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: > AT+CGPADDR=1\r
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: < \r\n+CGPADDR:
1,"10.113.62.162"\r\n\r\nOK\r\n
ofonod[1571]: drivers/telitmodem/gprs-context.c:address_cb() ok 1
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: > AT#NWDNS=1\r
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: < \r\n#NWDNS:
1,"0.0.0.0","0.0.0.0"\r\n\r\nOK\r\n
ofonod[1571]: drivers/telitmodem/gprs-context.c:dns_cb() ok 1
ofonod[1571]: IP: 10.113.62.162
ofonod[1571]: DNS: 0.0.0.0, 0.0.0.0
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: >
AT+CGDATA="M-RAW_IP",1\r
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: < \r\nCONNECT
ofonod[1571]: plugins/le910v2.c:le910v2_debug() Modem: < \r\n\r\nOK\r\n
ofonod[1571]: drivers/telitmodem/gprs-context.c:session_cb() ok 1
ofonod[1571]: drivers/telitmodem/gprs-context.c:setup_rawip()
ofonod[1571]: src/gprs.c:pri_activate_callback() 0x89d47f0
(ofonod:1571): GLib-CRITICAL **: g_io_channel_write_chars: assertion
'channel != NULL' failed
(ofonod:1571): GLib-CRITICAL **: g_source_remove: assertion 'tag > 0' failed
(ofonod:1571): GLib-CRITICAL **: g_io_channel_write_chars: assertion
'channel != NULL' failed
(ofonod:1571): GLib-CRITICAL **: g_source_remove: assertion 'tag > 0' failed
4 years, 8 months
[PATCH] call-forwarding: allow multiple pending GetProperties
by Slava Monich
The very first call that that every org.ofono.CallForwarding
client makes is GetProperties. With multiple clients, only the
first one was waiting for the completion of the initial query,
all other calls were rejected with org.ofono.Error.InProgress.
In theory, the clients could retry the call later, but in
reality very few clients actually do that.
This patch allows multiple GetProperties requests to be pending
simultaneously.
---
src/call-forwarding.c | 37 +++++++++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 2746771..762fffe 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -60,6 +60,7 @@ struct ofono_call_forwarding {
GSList *cf_conditions[4];
int flags;
DBusMessage *pending;
+ GSList *pending_get_prop;
int query_next;
int query_end;
struct cf_ss_request *ss_req;
@@ -526,6 +527,14 @@ static DBusMessage *cf_get_properties_reply(DBusMessage *msg,
return reply;
}
+static void cf_send_properties(gpointer data, gpointer user_data)
+{
+ DBusMessage *msg = data;
+ DBusMessage *reply = cf_get_properties_reply(msg, user_data);
+
+ __ofono_dbus_pending_reply(&msg, reply);
+}
+
static void get_query_cf_callback(const struct ofono_error *error, int total,
const struct ofono_call_forwarding_condition *list,
void *data)
@@ -546,8 +555,9 @@ static void get_query_cf_callback(const struct ofono_error *error, int total,
}
if (cf->query_next == CALL_FORWARDING_TYPE_NOT_REACHABLE) {
- __ofono_dbus_pending_reply(&cf->pending,
- cf_get_properties_reply(cf->pending, cf));
+ g_slist_foreach(cf->pending_get_prop, cf_send_properties, cf);
+ g_slist_free(cf->pending_get_prop);
+ cf->pending_get_prop = NULL;
return;
}
@@ -574,11 +584,18 @@ static DBusMessage *cf_get_properties(DBusConnection *conn, DBusMessage *msg,
if (cf->driver->query == NULL)
return __ofono_error_not_implemented(msg);
+ if (cf->pending_get_prop) {
+ /* GetProperties is already in progress */
+ cf->pending_get_prop = g_slist_append(cf->pending_get_prop,
+ dbus_message_ref(msg));
+ return NULL;
+ }
+
if (__ofono_call_forwarding_is_busy(cf) ||
__ofono_ussd_is_busy(cf->ussd))
return __ofono_error_busy(msg);
- cf->pending = dbus_message_ref(msg);
+ cf->pending_get_prop = g_slist_append(NULL, dbus_message_ref(msg));
cf->query_next = 0;
get_query_next_cf_cond(cf);
@@ -1261,7 +1278,7 @@ static void cf_unregister_ss_controls(struct ofono_call_forwarding *cf)
gboolean __ofono_call_forwarding_is_busy(struct ofono_call_forwarding *cf)
{
- return cf->pending ? TRUE : FALSE;
+ return cf->pending || cf->pending_get_prop;
}
static void sim_cfis_read_cb(int ok, int total_length, int record,
@@ -1371,6 +1388,13 @@ static void sim_cphs_cff_read_cb(int ok, int total_length, int record,
DBUS_TYPE_BOOLEAN, &cfu_voice);
}
+static void cf_cancel_get_prop(gpointer data)
+{
+ DBusMessage *msg = data;
+
+ __ofono_dbus_pending_reply(&msg, __ofono_error_canceled(msg));
+}
+
static void call_forwarding_unregister(struct ofono_atom *atom)
{
struct ofono_call_forwarding *cf = __ofono_atom_get_data(atom);
@@ -1378,6 +1402,11 @@ static void call_forwarding_unregister(struct ofono_atom *atom)
DBusConnection *conn = ofono_dbus_get_connection();
struct ofono_modem *modem = __ofono_atom_get_modem(cf->atom);
+ if (cf->pending_get_prop) {
+ g_slist_free_full(cf->pending_get_prop, cf_cancel_get_prop);
+ cf->pending_get_prop = NULL;
+ }
+
ofono_modem_remove_interface(modem, OFONO_CALL_FORWARDING_INTERFACE);
g_dbus_unregister_interface(conn, path,
OFONO_CALL_FORWARDING_INTERFACE);
--
1.9.1
4 years, 8 months
designated way for modems disappearing from bus during +CFUN=1
by Harald Welte
Dear all,
I've been struggling for quite some time to find out what is the
designated way in ofono to deal with modems that actually perform a
cold/warm reset (and hence USB device stack reset) when you send them an
AT+CFUN=1 message.
Examples for this are e.g. the Sierra Wireless SL808x series of modems,
where this behavior is documented and expected. But I'm sure there are
others, at least I recall having seen this several times in the past.
It is somewhat logical, as a +CFUN+1 is supposed to reset _all_ of the
status in the modem, not just the protocol stack. So the fact that most
modems don't disappear from the bus afterwards actually means that they
are cheating.
The actual behavior of ofono with such a modem is:
* modem first appears as a /wavecom_X device
* if you issue enable_modem via dbus, the modem goes thrugh CFUN=1
* the modem disappears from USB, ofono destroys its structures
* the client program (e.g. the one from tests/) simply hangs and fails
at timeout
* the modem re-enumerates on the bus and ofono creates a new /wavecom_Y
device, where Y != the X before the modem restart.
So for an application it is not possible to continue to talk to one
modem via dbus accross modem resets.
Not issuing a +CFUN=1 is also not really an option, as then you loose
the ability to completely disable the modem. +CFUN=4 can be used to
force an IMSI detach and disable it from the network point of view, but
the modem is still talking to the SIM card and will not re-read SIM
card state if brought back online from +CFUN=4.
I'm sure this issue has been seen before, and somebody must have a
solution for it - or at least some ideas on how to solve this in a ofono
driver plugin. I'm willing to spend some time on it, but my
experience/exposure to the code base is limited.
Thanks in advance.
Regards,
Harald
--
- Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
4 years, 9 months
HFP HF - Reject SCO Issue
by Jomon John
Hi,
I am trying to configure HFP with Bluez(5.34), Ofono(1.17) and pulseaudio(6) on a Freescale i.MX6 board using Linux 4.1.15 kernel, the idea is to use the target board in HFP/Handsfree Unit role. The bluetooth controller is a Pluggable USB Bluetooth Dongle (0a5c:21e8 - BCM20702A0) with updated firmware.
The procedure followed is,
* Pair & connect with the android mobile phone with the bluetoothctl
* Enable modem and dial number using ofono test scripts
After this the call is being made but the audio routing fails with "Reject SCO : Agent not registered" message from oFono. While checking with btmon its found that the SCO Connect Request has been rejected with the reason of limited resources(0x0d).
Can anyone help me to identify the root cause, I spent a lot of time trying different version combinations, loading firmware and checking logs but still nothing.
-
With Regards
John J
4 years, 9 months
oFono chat
by Alexander Smirnov
Dear oFono community,
I'm a little bit confused, but is there any way to send oFono custom AT
commands?
In my case, I have chip with integrated GPS module, so I want to have
possibility to manage its settings in runtime according to some
environment settings.
Reading oFono API documentation, I wondered, why there is no chat
interface? Are there any restrictions?
--
With best regards,
Alexander Smirnov
ilbers GmbH
Baierbrunner Str. 28c
D-81379 München
+49 (89) 122 67 24-0
http://ilbers.de/
Commercial register Munich, HRB 214197
General manager: Baurzhan Ismagulov
4 years, 9 months
Re: cellular reconnect
by Patrik Flykt
On Thu, 2016-06-30 at 18:10 +0300, Alexander Smirnov wrote:
> Dear all,
>
> could you also please help me with another issue, I've observed.
>
> What I did:
>
> - Connect cellular service in connmanctl (ppp0 appears in ifconfig)
> - Disconnect physical GSM antenna (ppp0 disappears)
> - Connect physical GSM antenna
>
> After these steps I don't see cellular service (connmanctl services
> is empty) till I reset the modem.
>
> How should I handle network strength events to automatically
> reconnect the cellular? Why I don't see cellular in connman services
> anymore?
This needs a bit more oFono debugging, as ConnMan will present all
networks provided by oFono as separate services. So if a cellular
connection does not show up in ConnMan, check what oFono is sending or
if oFono needs further setup in the case of a reconnected antenna. It
is also important to know which cellular driver is being used here.
Adding oFono mailing list to catch a wider audience.
Cheers,
Patrik
4 years, 9 months
[PATCH] ril_sofia3gr: Add vendorize SoFiA to send modem shutdown
by Ankit Navik
since ril_send_power request mapped with airplane mode, it should
be wrapped modem shutdown of oem hook.
---
plugins/ril_sofia3gr.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/plugins/ril_sofia3gr.c b/plugins/ril_sofia3gr.c
index f8bf2bb..bba34df 100644
--- a/plugins/ril_sofia3gr.c
+++ b/plugins/ril_sofia3gr.c
@@ -554,6 +554,9 @@ static int ril_disable(struct ofono_modem *modem)
DBusConnection *conn = ofono_dbus_get_connection();
struct ril_data *rd = ofono_modem_get_data(modem);
const char *path = ofono_modem_get_path(modem);
+ struct parcel rilp;
+ int cmd_id;
+ char buf[4];
DBG("%p", modem);
@@ -562,7 +565,17 @@ static int ril_disable(struct ofono_modem *modem)
ofono_modem_remove_interface(modem,
THERMAL_MANAGEMENT_INTERFACE);
- ril_send_power(rd->ril, FALSE, ril_send_power_off_cb, modem, NULL);
+ /* RIL_OEM_HOOK_STRING_SET_MODEM_OFF = 0x000000CF */
+ cmd_id = 0x000000CF;
+ sprintf(buf, "%d", cmd_id);
+ parcel_init(&rilp);
+ parcel_w_int32(&rilp, 1);
+ parcel_w_string(&rilp, buf);
+
+ g_ril_append_print_buf(rd->ril, "{cmd_id=0x%02X}", cmd_id);
+
+ g_ril_send(rd->ril, RIL_REQUEST_OEM_HOOK_STRINGS, &rilp,
+ ril_send_power_off_cb, modem, NULL);
return -EINPROGRESS;
}
--
1.9.1
4 years, 9 months
[PATCH] sim: Query the status of SC facility lock
by Slava Monich
Resending after adjusting code style.
---
src/sim.c | 72 +++++++++++++++++++++++++++++++--------------------------------
1 file changed, 35 insertions(+), 37 deletions(-)
diff --git a/src/sim.c b/src/sim.c
index aedc617..e2da78d 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -2449,58 +2449,50 @@ static void sim_free_state(struct ofono_sim *sim)
sim_free_main_state(sim);
}
-static void sim_query_fac_imsilock_cb(const struct ofono_error *error,
- ofono_bool_t status,
- void *data)
+static void sim_set_locked_pin(struct ofono_sim *sim,
+ enum ofono_sim_password_type type, gboolean locked)
{
- struct ofono_sim *sim = data;
- DBusConnection *conn = ofono_dbus_get_connection();
- const char *path = __ofono_atom_get_path(sim->atom);
char **locked_pins;
- if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
- ofono_error("Querying Facility Lock for IMSI Lock failed");
+ if (sim->locked_pins[type] == locked)
return;
- }
-
- sim->locked_pins[OFONO_SIM_PASSWORD_PHSIM_PIN] = status;
+ sim->locked_pins[type] = locked;
locked_pins = get_locked_pins(sim);
- ofono_dbus_signal_array_property_changed(conn,
- path,
- OFONO_SIM_MANAGER_INTERFACE,
- "LockedPins", DBUS_TYPE_STRING,
- &locked_pins);
+ ofono_dbus_signal_array_property_changed(ofono_dbus_get_connection(),
+ __ofono_atom_get_path(sim->atom),
+ OFONO_SIM_MANAGER_INTERFACE, "LockedPins",
+ DBUS_TYPE_STRING, &locked_pins);
g_strfreev(locked_pins);
}
-static void sim_query_fac_networklock_cb(const struct ofono_error *error,
- ofono_bool_t status,
- void *data)
+static void sim_query_fac_imsilock_cb(const struct ofono_error *error,
+ ofono_bool_t status, void *data)
{
- struct ofono_sim *sim = data;
- DBusConnection *conn = ofono_dbus_get_connection();
- const char *path = __ofono_atom_get_path(sim->atom);
- char **locked_pins;
-
- if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
- ofono_error("Querying Facility Lock for Network Lock failed");
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
return;
- }
- sim->locked_pins[OFONO_SIM_PASSWORD_PHNET_PIN] = status;
+ sim_set_locked_pin(data, OFONO_SIM_PASSWORD_PHSIM_PIN, status);
+}
- locked_pins = get_locked_pins(sim);
+static void sim_query_fac_networklock_cb(const struct ofono_error *error,
+ ofono_bool_t status, void *data)
+{
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
+ return;
- ofono_dbus_signal_array_property_changed(conn,
- path,
- OFONO_SIM_MANAGER_INTERFACE,
- "LockedPins", DBUS_TYPE_STRING,
- &locked_pins);
+ sim_set_locked_pin(data, OFONO_SIM_PASSWORD_PHNET_PIN, status);
+}
- g_strfreev(locked_pins);
+static void sim_query_fac_pinlock_cb(const struct ofono_error *error,
+ ofono_bool_t status, void *data)
+{
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
+ return;
+
+ sim_set_locked_pin(data, OFONO_SIM_PASSWORD_SIM_PIN, status);
}
void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
@@ -2529,14 +2521,20 @@ void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
call_state_watches(sim);
if (inserted) {
- sim->driver->query_facility_lock(sim,
+ if (sim->driver->query_facility_lock) {
+ sim->driver->query_facility_lock(sim,
OFONO_SIM_PASSWORD_PHSIM_PIN,
sim_query_fac_imsilock_cb, sim);
- sim->driver->query_facility_lock(sim,
+ sim->driver->query_facility_lock(sim,
OFONO_SIM_PASSWORD_PHNET_PIN,
sim_query_fac_networklock_cb, sim);
+ sim->driver->query_facility_lock(sim,
+ OFONO_SIM_PASSWORD_SIM_PIN,
+ sim_query_fac_pinlock_cb, sim);
+ }
+
sim_initialize(sim);
} else {
sim->pin_type = OFONO_SIM_PASSWORD_NONE;
--
1.9.1
4 years, 9 months