Hi oFono list,

This is the first time I'm patching oFono so please excuse me for
mistakes or misunderstandings.

I am trying to add support for Quectel EG912Y. This modem seems to be
compatible with Quectel EC200, so I'm taking advantage of the existing
code in oFono 1.33 to handle it. This modem maps to 3 ttys:

  - ttyUSB0: Debug. Output only. (interface 02)
  - ttyUSB1: AT commands. (interface 03)
  - ttyUSB2: AT commands and PPP. (interface 04)

First, I edited udevng.c:

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 34ac1cc..97c5e88 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -892,6 +892,11 @@ static gboolean setup_quectel_usb(struct modem_info
*modem)
                  aux = info->devnode;
              else if (g_strcmp0(info->number, "03") == 0)
                  mdm = info->devnode;
+        } else if (g_strcmp0(info->interface, "255/0/0") == 0) {
+            if (g_strcmp0(info->number, "03") == 0)
+                aux = info->devnode;
+            else if (g_strcmp0(info->number, "04") == 0)
+                mdm = info->devnode;
          }
      }

@@ -1837,6 +1842,7 @@ static struct {
      { "samsung",    "option",    "04e8", "6889"    },
      { "samsung",    "kalmia"            },
      { "quectel",    "option",    "05c6", "9090"    },
+    { "quectel",    "option",    "2c7c", "6001"    }, /* Quectel EG912Y */
      { "quectelqmi",    "qmi_wwan",    "2c7c", "0121"    },
      { "quectelqmi",    "qcserial",    "2c7c", "0121"    },
      { "quectelqmi",    "qmi_wwan",    "2c7c", "0125"    },

And then quectel.c:

diff --git a/plugins/quectel.c b/plugins/quectel.c
index 950f7ce..e1a828a 100644
--- a/plugins/quectel.c
+++ b/plugins/quectel.c
@@ -64,7 +64,7 @@ static const char *cpin_prefix[] = { "+CPIN:", NULL };
  static const char *cbc_prefix[] = { "+CBC:", NULL };
  static const char *qinistat_prefix[] = { "+QINISTAT:", NULL };
  static const char *cgmm_prefix[] = { "UC15", "Quectel_M95",
"Quectel_MC60",
-                    "EC21", "EC200", NULL };
+                    "EC21", "EC200", "EG912Y", NULL };
  static const char *none_prefix[] = { NULL };

  static const uint8_t gsm0710_terminate[] = {
@@ -870,6 +869,10 @@ static void cgmm_cb(int ok, GAtResult *result, void
*user_data)
          DBG("%p model %s", modem, model);
          data->vendor = OFONO_VENDOR_QUECTEL_EC2X;
          data->model = QUECTEL_EC200;
+    } else if (strcmp(model, "EG912Y") == 0) {
+        DBG("%p model %s", modem, model);
+        data->vendor = OFONO_VENDOR_QUECTEL_EC2X;
+        data->model = QUECTEL_EC200;
      } else {
          ofono_warn("%p unknown model: '%s'", modem, model);
          data->vendor = OFONO_VENDOR_QUECTEL;

Now the modem *seems* to work, except when putting it online using
./test/online-modem because it immediately shuts down, but it's probably
a matter of power supply, so let's ignore that. The real issue is it
sometimes stops replying to AT commands, either during
./test/enable-modem or ./test/online-modem execution, causing timeouts,
as confirmed by exporting OFONO_AT_DEBUG=1. I also tried to replace
`g_at_syntax_new_gsmv1()` with `g_at_syntax_new_gsm_permissive()` to no
avail. Is that a known or common issue when adding support for new
modems that you can help me troubleshooting?

Kind regards,
Fabio.
_______________________________________________
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org

Reply via email to