├── recipes-kernel └── linux │ ├── linux-yocto_4.4.bbappend │ ├── linux-raspberrypi_4.4.bbappend │ ├── linux-yocto │ └── 0001-Add-Quectel-EC25-USB-Serial-Driver-Support.patch │ └── linux-raspberrypi │ └── 0001-Add-Quectel-EC25-USB-Serial-Driver-Support.patch ├── recipes-quectel-community └── quectel-ppp │ ├── quectel-ppp-0.1 │ ├── quectel-chat-disconnect │ ├── quectel-chat-connect │ └── quectel-ppp │ └── quectel-ppp_0.1.bb ├── conf └── layer.conf └── README.md /recipes-kernel/linux/linux-yocto_4.4.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI += "file://0001-Add-Quectel-EC25-USB-Serial-Driver-Support.patch" 4 | 5 | -------------------------------------------------------------------------------- /recipes-kernel/linux/linux-raspberrypi_4.4.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI += "file://0001-Add-Quectel-EC25-USB-Serial-Driver-Support.patch" 4 | 5 | -------------------------------------------------------------------------------- /recipes-quectel-community/quectel-ppp/quectel-ppp-0.1/quectel-chat-disconnect: -------------------------------------------------------------------------------- 1 | ABORT "ERROR" 2 | ABORT "NO DIALTONE" 3 | SAY "\NSending break to the modem\n" 4 | "" +++ATH 5 | SAY "\nGood bye\n" 6 | -------------------------------------------------------------------------------- /conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have recipes-* directories, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 6 | ${LAYERDIR}/recipes-*/*/*.bbappend" 7 | 8 | BBFILE_COLLECTIONS += "quectel-community" 9 | BBFILE_PATTERN_quectel-community = "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_quectel-community = "5" 11 | 12 | -------------------------------------------------------------------------------- /recipes-quectel-community/quectel-ppp/quectel-ppp-0.1/quectel-chat-connect: -------------------------------------------------------------------------------- 1 | ABORT "BUSY" 2 | ABORT "NO CARRIER" 3 | ABORT "NO DIALTONE" 4 | ABORT "ERROR" 5 | ABORT "NO ANSWER" 6 | TIMEOUT 120 7 | "" AT 8 | OK ATE0 9 | OK ATI 10 | OK AT+CSQ 11 | OK AT+CPIN? 12 | OK AT+COPS? 13 | OK AT+CGREG? 14 | OK ATZ 15 | # Connection to the network 16 | # Set LTE_APN variable before executing chat -E ... 17 | # Check with service provider for required details 18 | OK AT+CGDCONT=1,"IP","$LTE_APN",,0,0 19 | # Dial the number 20 | OK ATDT*99# 21 | CONNECT 22 | -------------------------------------------------------------------------------- /recipes-quectel-community/quectel-ppp/quectel-ppp-0.1/quectel-ppp: -------------------------------------------------------------------------------- 1 | #/etc/ppp/peers/quectel-ppp 2 | # Usage:root>pppd call quectel-ppp 3 | # Hide password in debug messages 4 | hide-password 5 | # The phone is not required to authenticate 6 | noauth 7 | # The chat script 8 | connect '/usr/sbin/chat -E -s -v -f /etc/ppp/peers/quectel-chat-connect' 9 | # The close script 10 | disconnect '/usr/sbin/chat -E -s -v -f /etc/ppp/peers/quectel-chat-disconnect' 11 | # Debug info from pppd 12 | debug 13 | # Serial Device to which the HSPDA phone is connected 14 | # Modem path, like /dev/ttyUSB3,/dev/ttyACM0, it depends on your module. 15 | # Exmaple given is with the modem mounted at /dev/ttyUSB3 16 | /dev/ttyUSB3 17 | # Serial port line speed 18 | 115200 19 | # If you want to use the HSDPA link as your gateway 20 | defaultroute 21 | # pppd must not propose any IP address to the peer 22 | noipdefault 23 | # No ppp compression 24 | novj 25 | novjccomp 26 | noccp 27 | ipcp-accept-local 28 | ipcp-accept-remote 29 | local 30 | # For sanity, keep a lock on the serial line 31 | lock 32 | dump 33 | # Keep pppd attached to the terminal 34 | # Comment this to get daemon mode pppd 35 | nodetach 36 | # Network access credenatials. 37 | # Set LTE_USERNAME and LTE_PASSWORD before executing pppd -C call 38 | # Check with service provider for required details 39 | user $LTE_USERNAME 40 | password $LTE_PASSWORD 41 | # Hardware flow control 42 | crtscts 43 | remotename 3gppp 44 | ipparam 3gppp 45 | # Ask the peer for up to 2 DNS server addresses 46 | usepeerdns 47 | -------------------------------------------------------------------------------- /recipes-quectel-community/quectel-ppp/quectel-ppp_0.1.bb: -------------------------------------------------------------------------------- 1 | # 2 | # Copy the ppp script files for Quectel chips to the target filesystem 3 | # These files are based on the details provided in 4 | # Quectel_WCDMA<E_Linux_USB_Driver_User_Guide_V1.5.pdf and are shared 5 | # as part of this layer with their permissoin. 6 | # 7 | 8 | SUMMARY = "PPP Scripts for Basic Quectel Chip Operation" 9 | SECTION = "net" 10 | LICENSE = "MIT" 11 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 12 | DESCRIPTION = "A set of Linux PPP scripts that provide connect, disconnect and other basic Point-to-Point Protocol functionality for Quectel wireless modems. " 13 | 14 | RDEPENDS_${PN} = "ppp" 15 | 16 | SRC_URI += "file://quectel-ppp" 17 | SRC_URI += "file://quectel-chat-connect" 18 | SRC_URI += "file://quectel-chat-disconnect" 19 | 20 | S = "${WORKDIR}" 21 | 22 | inherit allarch 23 | 24 | # Install script on target's root filesystem 25 | do_install () { 26 | # Install init script and default settings 27 | # ${sysconfdir} 28 | install -d ${D}${sysconfdir}/ 29 | install -d ${D}${sysconfdir}/ppp 30 | install -d ${D}${sysconfdir}/ppp/peers 31 | install -m 0755 ${S}/quectel-ppp ${D}${sysconfdir}/ppp/peers/ 32 | install -m 0755 ${S}/quectel-chat-connect ${D}${sysconfdir}/ppp/peers/ 33 | install -m 0755 ${S}/quectel-chat-disconnect ${D}${sysconfdir}/ppp/peers/ 34 | } 35 | 36 | # Mark the files which are part of this package 37 | FILES_${PN} += "{sysconfdir}/ppp/" 38 | FILES_${PN} += "{sysconfdir}/ppp/peers/" 39 | FILES_${PN} += "{sysconfdir}/ppp/peers/quectel-ppp" 40 | FILES_${PN} += "{sysconfdir}/ppp/peers/quectel-chat-connect" 41 | FILES_${PN} += "{sysconfdir}/ppp/peers/quectel-chat-disconnect" 42 | 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # meta-quectel-community 2 | 3 | This README file contains information on the contents of the 4 | quectel-community layer. 5 | 6 | Please see the sections below for details. 7 | 8 | ## Dependencies 9 | 10 | This layer depends on: 11 | 12 | URI: git://git.openembedded.org/bitbake 13 | branch: master 14 | 15 | URI: git://git.openembedded.org/openembedded-core 16 | layers: meta 17 | branch: master 18 | 19 | ## Patches 20 | 21 | Please submit any patches against the quectel-community layer to the 22 | meta-quectel-community project repositoy on GitHub. 23 | 24 | Repository: https://github.com/Quectel-Community/meta-quectel-community 25 | 26 | ## Table of Contents 27 | 28 | 1. Adding the quectel-community layer to your build 29 | 2. About This Layer 30 | 3. Using the PPPd scripts 31 | 32 | # 1. Adding the quectel-community layer to your build 33 | 34 | In order to use this layer, you need to make the build system aware of 35 | it. 36 | 37 | Assuming the quectel-community layer exists at the top-level of your 38 | yocto build tree, you can add it to the build system by adding the 39 | location of the quectel-community layer to bblayers.conf, along with any 40 | other layers needed. e.g.: 41 | 42 | ``` 43 | BBLAYERS ?= " \ 44 | /path/to/yocto/meta \ 45 | /path/to/yocto/meta-poky \ 46 | /path/to/yocto/meta-yocto-bsp \ 47 | /path/to/yocto/meta-quectel-community \ 48 | " 49 | ``` 50 | 51 | # 2. About This Layer 52 | 53 | This layer adds kernel modifications to support the following Quectel 54 | hardware: 55 | 56 | * EC25 LTE Module 57 | 58 | Once the Linux Kernel adds support for a module it can be removed from 59 | this layer. 60 | 61 | This layer also adds a set of three Point-to-Point Protocol daemon 62 | scripts which allow the use of a `pppd call questel-ppp` command. Both 63 | these scripts and the kernel modifications are based on instructions 64 | provided by the Quectel WCDMA<E Linux USB Driver User Guide. 65 | 66 | This layer is not produced or supported by Quectel. It is developed by 67 | users of Quectel hardware who wish to add support to Yocto systems. 68 | Initally the development focuses on supporting the hardware under a 69 | Raspberry Pi 3. 70 | 71 | # 3. Using the PPPd scripts 72 | 73 | Once your Quectel hardware is connected and the appropreate USB driver 74 | is associated with it you can initiate a call with: 75 | 76 | ``` 77 | pppd -E call quectel-ppp 78 | ``` 79 | 80 | Before using the script you will need to set the appropriate Access 81 | Point Name (APN), Username and Password for your LTE network 82 | connection. To do this set `LTE_APN`, `LTE_USERNAME` and 83 | `LTE_PASSWORD` environment variables before calling the pppd script 84 | with the `-E` option. 85 | -------------------------------------------------------------------------------- /recipes-kernel/linux/linux-yocto/0001-Add-Quectel-EC25-USB-Serial-Driver-Support.patch: -------------------------------------------------------------------------------- 1 | From 8126a05642c6481acadcfd927712450e7afdef40 Mon Sep 17 00:00:00 2001 2 | From: Thomas Thorne 3 | Date: Thu, 10 Nov 2016 15:30:21 +0000 4 | Subject: [PATCH] Add Quectel EC25 USB Serial Driver Support 5 | 6 | Adds USB Serial Driver support for the Quectel EC25 LTE module. This 7 | patch is based on instructions by Quectel's WCDMA<E Linux USB 8 | Driver User Guide, rev. WCDMA<E_Linux_USB_Driver_User_Guide_V1.5 and 9 | has been published with their permission. 10 | 11 | The Quectel EC25 has a similar interface to the Quectel UC20 which is 12 | already supported in this version of the kernel. 13 | 14 | Signed-off-by: Thomas Thorne 15 | --- 16 | drivers/usb/serial/option.c | 8 ++++++++ 17 | drivers/usb/serial/usb_wwan.c | 6 ++++++ 18 | 2 files changed, 14 insertions(+) 19 | 20 | diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c 21 | index 9894e34..4cd8069 100644 22 | --- a/drivers/usb/serial/option.c 23 | +++ b/drivers/usb/serial/option.c 24 | @@ -1161,6 +1161,8 @@ static const struct usb_device_id option_ids[] = { 25 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ 26 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9003), /* Quectel UC20 */ 27 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 28 | + { USB_DEVICE(0x2c7c, 0x0125), /* Quectel EC25 */ 29 | + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 30 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, 31 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, 32 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), 33 | @@ -2034,6 +2036,7 @@ static struct usb_serial_driver option_1port_device = { 34 | #ifdef CONFIG_PM 35 | .suspend = usb_wwan_suspend, 36 | .resume = usb_wwan_resume, 37 | + .reset_resume = usb_wwan_resume, 38 | #endif 39 | }; 40 | 41 | @@ -2073,6 +2076,11 @@ static int option_probe(struct usb_serial *serial, 42 | iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) 43 | return -ENODEV; 44 | 45 | + /* Quectel EC25's interface 4 can be used as USB Network device */ 46 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2c7c) && 47 | + serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) 48 | + return -ENODEV; 49 | + 50 | /* Store the blacklist info so we can use it during attach. */ 51 | usb_set_serial_data(serial, (void *)blacklist); 52 | 53 | diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c 54 | index be9cb61..b1eb3bb 100644 55 | --- a/drivers/usb/serial/usb_wwan.c 56 | +++ b/drivers/usb/serial/usb_wwan.c 57 | @@ -505,6 +505,12 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, 58 | usb_sndbulkpipe(serial->dev, endpoint) | dir, 59 | buf, len, callback, ctx); 60 | 61 | + if (dir == USB_DIR_OUT) { 62 | + struct usb_device_descriptor *desc = &serial->dev->descriptor; 63 | + if (desc->idVendor == cpu_to_le16(0x2c7c)) 64 | + urb->transfer_flags |= URB_ZERO_PACKET; 65 | + } 66 | + 67 | return urb; 68 | } 69 | 70 | -- 71 | 2.7.4 72 | 73 | -------------------------------------------------------------------------------- /recipes-kernel/linux/linux-raspberrypi/0001-Add-Quectel-EC25-USB-Serial-Driver-Support.patch: -------------------------------------------------------------------------------- 1 | From 8126a05642c6481acadcfd927712450e7afdef40 Mon Sep 17 00:00:00 2001 2 | From: Thomas Thorne 3 | Date: Thu, 10 Nov 2016 15:30:21 +0000 4 | Subject: [PATCH] Add Quectel EC25 USB Serial Driver Support 5 | 6 | Adds USB Serial Driver support for the Quectel EC25 LTE module. This 7 | patch is based on instructions by Quectel's WCDMA<E Linux USB 8 | Driver User Guide, rev. WCDMA<E_Linux_USB_Driver_User_Guide_V1.5 and 9 | has been published with their permission. 10 | 11 | The Quectel EC25 has a similar interface to the Quectel UC20 which is 12 | already supported in this version of the kernel. 13 | 14 | Signed-off-by: Thomas Thorne 15 | --- 16 | drivers/usb/serial/option.c | 8 ++++++++ 17 | drivers/usb/serial/usb_wwan.c | 6 ++++++ 18 | 2 files changed, 14 insertions(+) 19 | 20 | diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c 21 | index 9894e34..4cd8069 100644 22 | --- a/drivers/usb/serial/option.c 23 | +++ b/drivers/usb/serial/option.c 24 | @@ -1161,6 +1161,8 @@ static const struct usb_device_id option_ids[] = { 25 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ 26 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9003), /* Quectel UC20 */ 27 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 28 | + { USB_DEVICE(0x2c7c, 0x0125), /* Quectel EC25 */ 29 | + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 30 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, 31 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, 32 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), 33 | @@ -2034,6 +2036,7 @@ static struct usb_serial_driver option_1port_device = { 34 | #ifdef CONFIG_PM 35 | .suspend = usb_wwan_suspend, 36 | .resume = usb_wwan_resume, 37 | + .reset_resume = usb_wwan_resume, 38 | #endif 39 | }; 40 | 41 | @@ -2073,6 +2076,11 @@ static int option_probe(struct usb_serial *serial, 42 | iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) 43 | return -ENODEV; 44 | 45 | + /* Quectel EC25's interface 4 can be used as USB Network device */ 46 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2c7c) && 47 | + serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) 48 | + return -ENODEV; 49 | + 50 | /* Store the blacklist info so we can use it during attach. */ 51 | usb_set_serial_data(serial, (void *)blacklist); 52 | 53 | diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c 54 | index be9cb61..b1eb3bb 100644 55 | --- a/drivers/usb/serial/usb_wwan.c 56 | +++ b/drivers/usb/serial/usb_wwan.c 57 | @@ -505,6 +505,12 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, 58 | usb_sndbulkpipe(serial->dev, endpoint) | dir, 59 | buf, len, callback, ctx); 60 | 61 | + if (dir == USB_DIR_OUT) { 62 | + struct usb_device_descriptor *desc = &serial->dev->descriptor; 63 | + if (desc->idVendor == cpu_to_le16(0x2c7c)) 64 | + urb->transfer_flags |= URB_ZERO_PACKET; 65 | + } 66 | + 67 | return urb; 68 | } 69 | 70 | -- 71 | 2.7.4 72 | 73 | --------------------------------------------------------------------------------