Difference between revisions of "IoTGateway/Features/Linux/Module"

From ESS-WIKI
Jump to: navigation, search
(AM Telecom AMM561KT)
Line 1: Line 1:
 
<noinclude>{{DISPLAYTITLE:Linux Module Features}}</noinclude><includeonly>{{DISPLAYTITLE:Android Module Features}}</includeonly>
 
<noinclude>{{DISPLAYTITLE:Linux Module Features}}</noinclude><includeonly>{{DISPLAYTITLE:Android Module Features}}</includeonly>
==3G==
+
== 3G ==
===EWM-C106FT01E===
+
 
===Sierra AirPrime MC8090===
+
=== EWM-C106FT01E ===
 +
 
 +
=== Sierra AirPrime MC8090 ===
 +
 
 
The following operations are performed with UBC-221 using U221LBV1050.
 
The following operations are performed with UBC-221 using U221LBV1050.
* linux kernel config
+
 
 +
*linux kernel config
 +
 
 
:set the following lines to <tt>meta-advantech/recipes-kernel/linux/linux-yocto-clanton/advantech.cfg</tt>
 
:set the following lines to <tt>meta-advantech/recipes-kernel/linux/linux-yocto-clanton/advantech.cfg</tt>
<div style="margin-left: 2em;"><source lang="text">
+
<div style="margin-left: 2em;"><syntaxhighlight lang="text">
 
CONFIG_USB_SERIAL_FTDI_SIO=m
 
CONFIG_USB_SERIAL_FTDI_SIO=m
 
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
 
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
</source></div>
+
</syntaxhighlight></div>
 
:add the following line to <tt>meta-advantech/recipes-kernel/advantech-init/files/advantech.conf</tt>
 
:add the following line to <tt>meta-advantech/recipes-kernel/advantech-init/files/advantech.conf</tt>
<div style="margin-left: 2em;"><source lang="text">
+
<div style="margin-left: 2em;"><syntaxhighlight lang="text">
 
sierra
 
sierra
</source></div>
+
</syntaxhighlight></div>
 
:execute the following command
 
:execute the following command
<div style="margin-left: 2em;"><source lang="text">
+
<div style="margin-left: 2em;"><syntaxhighlight lang="text">
 
$ bitbake advantech-init
 
$ bitbake advantech-init
</source></div>
+
</syntaxhighlight></div>
 
+
*rebuild the kernel
* rebuild the kernel
+
<div style="margin-left: 2em;"><syntaxhighlight lang="bash">
<div style="margin-left: 2em;"><source lang="bash">
 
 
$ bitbake linux-yocto-clanton
 
$ bitbake linux-yocto-clanton
</source></div>
+
</syntaxhighlight></div>
* rebuild the full image
+
*rebuild the full image
<div style="margin-left: 2em;"><source lang="bash">
+
<div style="margin-left: 2em;"><syntaxhighlight lang="bash">
 
$ bitbake image-full
 
$ bitbake image-full
</source></div>
+
</syntaxhighlight></div>
* practical test on target board
+
*practical test on target board
<div style="margin-left: 2em;">
+
<div style="margin-left: 2em;"><syntaxhighlight lang="text">
<source lang="text">
 
 
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
 
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
 
user username password password /dev/ttyUSB3 460800 nodetach crtscts debug usepeerdns defaultroute &
 
user username password password /dev/ttyUSB3 460800 nodetach crtscts debug usepeerdns defaultroute &
</source>
+
</syntaxhighlight>[[File:Sierra AirPrime MC8090 connecting.png|850px|Sierra AirPrime MC8090 connecting.png]]<syntaxhighlight lang="text">
[[File:Sierra_AirPrime_MC8090_connecting.png|850px]]
 
<source lang="text">
 
 
# ifconfig
 
# ifconfig
</source>
+
</syntaxhighlight> [[File:Sierra AirPrime MC8090 ifconfig.png|600px|Sierra AirPrime MC8090 ifconfig.png]]<syntaxhighlight lang="text">
[[File:Sierra_AirPrime_MC8090_ifconfig.png|600px]]
 
<source lang="text">
 
 
# pinc -c5 8.8.8.8
 
# pinc -c5 8.8.8.8
</source>
+
</syntaxhighlight> [[File:Sierra AirPrime MC8090 ping.png|500px|Sierra AirPrime MC8090 ping.png]]</div>
[[File:Sierra_AirPrime_MC8090_ping.png|500px]]
+
=== Telit HE910-D ===
</div>
 
  
===Telit HE910-D===
 
 
The following operations are performed with UBC-221 using U221LBV1050.
 
The following operations are performed with UBC-221 using U221LBV1050.
* practical test on target board
+
 
<div style="margin-left: 2em;">
+
*practical test on target board
<source lang="text">
+
<div style="margin-left: 2em;"><syntaxhighlight lang="text">
 
# modprobe cdc-acm
 
# modprobe cdc-acm
</source>
+
</syntaxhighlight>[[File:Telit HE910-D modprobe.png|750px|Telit HE910-D modprobe.png]]<syntaxhighlight lang="text">
[[File:Telit_HE910-D_modprobe.png|750px]]
 
<source lang="text">
 
 
# dmesg | grep ttyACM
 
# dmesg | grep ttyACM
</source>
+
</syntaxhighlight> [[File:Telit HE910-D dmesg.png|480px|Telit HE910-D dmesg.png]]<syntaxhighlight lang="text">
[[File:Telit_HE910-D_dmesg.png|480px]]
 
<source lang="text">
 
 
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
 
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
 
user username password password /dev/ttyACM0 460800 nodetach crtscts debug usepeerdns defaultroute &
 
user username password password /dev/ttyACM0 460800 nodetach crtscts debug usepeerdns defaultroute &
 
# pinc -c5 8.8.8.8
 
# pinc -c5 8.8.8.8
</source>
+
</syntaxhighlight> [[File:Telit HE910-D pppd 2.png|RTENOTITLE]] [[File:Telit HE910-D ping.png|RTENOTITLE]]</div>
[[File:Telit_HE910-D_pppd_2.png]]
+
=== Quectel UC20 ===
[[File:Telit_HE910-D_ping.png]]
+
 
</div>
+
3G module Porting (QUECTEL UC20) (1) In linux kernel
 +
 
 +
1. You need to add the mechanism for processing zero packets during transmission of “usb_wwan.c” file under “[KERNEL]/drivers/usb/serial”.
 +
 
 +
You need to add the following statements to the “usb_wwan_write” and “usb_wwan_setup_urb” function, as shown below:
 +
<pre>#include "usb-wwan.h"
 +
 
 +
+ #ifdef CONFIG_ARCH_ADVANTECH
 +
+ #define HW_bcdUSB 0x0110
 +
+ #define HUAWEI_VENDOR_ID 0x12d1
 +
+ #endif
 +
 
 +
void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
 +
 +
 +
 +
 
 +
int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
 +
  const unsigned char *buf, int count)
 +
{
 +
 +
 +
int left, todo;
 +
struct urb *this_urb = NULL; /* spurious */
 +
+ #ifdef CONFIG_ARCH_ADVANTECH
 +
+ struct usb_host_endpoint *ep=NULL;
 +
+ #endif
 +
int err;
 +
unsigned long flags;
 +
 +
 +
 +
/* send the data */
 +
memcpy(this_urb->transfer_buffer, buf, todo);
 +
this_urb->transfer_buffer_length = todo;
 +
 
 +
+ #ifdef CONFIG_ARCH_ADVANTECH 
 +
+  if (IS_RSB_6410)
 +
+  {
 +
+      if((HUAWEI_VENDOR_ID == port->serial->dev->descriptor.idVendor)
 +
+      && (HW_bcdUSB&nbsp;!= port->serial->dev->descriptor.bcdUSB)){
 +
+      ep = usb_pipe_endpoint(this_urb->dev, this_urb->pipe);
 +
+      if(ep && (0&nbsp;!= this_urb->transfer_buffer_length)
 +
+      && (0 == this_urb->transfer_buffer_length&nbsp;%
 +
+      ep->desc.wMaxPacketSize)){
 +
+      this_urb->transfer_flags |= URB_ZERO_PACKET;
 +
+      }
 +
+      }
 +
+  }
 +
+ #endif
 +
 
 +
spin_lock_irqsave(&intfdata->susp_lock, flags);
 +
if (intfdata->suspended) {
 +
usb_anchor_urb(this_urb, &portdata->delayed);
 +
 +
 +
 +
 +
 +
 +
 +
/* Helper functions used by usb_wwan_setup_urbs */
 +
static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port,
 +
      int endpoint,
 +
      int dir, void *ctx, char *buf, int len,
 +
      void (*callback) (struct urb *))
 +
{
 +
struct usb_serial *serial = port->serial;
 +
struct urb *urb;
 +
 
 +
urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
 +
if (!urb)
 +
return NULL;
 +
 
 +
/* Fill URB using supplied data. */
 +
usb_fill_bulk_urb(urb, serial->dev,
 +
  usb_sndbulkpipe(serial->dev, endpoint) | dir,
 +
  buf, len, callback, ctx);
 +
 
 +
+ #ifdef CONFIG_ARCH_ADVANTECH
 +
+  if (IS_RSB_6410)
 +
+  {
 +
+    if (dir == USB_DIR_OUT) {
 +
+    struct usb_device_descriptor *desc = &serial->dev->descriptor;
 +
+    if (desc->idVendor == 0x05C6 && (desc->idProduct == 0x9003 || desc->idProduct ==
 +
+    0x9090 || desc->idProduct == 0x9215))
 +
+    urb->transfer_flags |= URB_ZERO_PACKET;
 +
+    }
 +
+  }
 +
+ #endif
 +
return urb;
 +
}
 +
</pre>
 +
 
 +
2. Add UC15/UC20/EC20's Vendor ID and Product ID in "option_ids[]" in the file "drivers/usb/serial/option.c":
 +
<pre>static const struct usb_device_id option_ids[] = {
 +
 +
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9090) }, //for Quectel UC15
 +
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9003) }, //for Quectel UC20
 +
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9215) }, //for Quectel EC20
 +
 +
}
 +
</pre>
  
 
==4G==
 
==4G==

Revision as of 07:56, 2 November 2016

3G

EWM-C106FT01E

Sierra AirPrime MC8090

The following operations are performed with UBC-221 using U221LBV1050.

  • linux kernel config
set the following lines to meta-advantech/recipes-kernel/linux/linux-yocto-clanton/advantech.cfg
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
add the following line to meta-advantech/recipes-kernel/advantech-init/files/advantech.conf
sierra
execute the following command
$ bitbake advantech-init
  • rebuild the kernel
$ bitbake linux-yocto-clanton
  • rebuild the full image
$ bitbake image-full
  • practical test on target board
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
user username password password /dev/ttyUSB3 460800 nodetach crtscts debug usepeerdns defaultroute &
Sierra AirPrime MC8090 connecting.png
# ifconfig
Sierra AirPrime MC8090 ifconfig.png
# pinc -c5 8.8.8.8
Sierra AirPrime MC8090 ping.png

Telit HE910-D

The following operations are performed with UBC-221 using U221LBV1050.

  • practical test on target board
# modprobe cdc-acm
Telit HE910-D modprobe.png
# dmesg | grep ttyACM
Telit HE910-D dmesg.png
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
user username password password /dev/ttyACM0 460800 nodetach crtscts debug usepeerdns defaultroute &
# pinc -c5 8.8.8.8
RTENOTITLE RTENOTITLE

Quectel UC20

3G module Porting (QUECTEL UC20) (1) In linux kernel

1. You need to add the mechanism for processing zero packets during transmission of “usb_wwan.c” file under “[KERNEL]/drivers/usb/serial”.

You need to add the following statements to the “usb_wwan_write” and “usb_wwan_setup_urb” function, as shown below:

#include "usb-wwan.h"

+ #ifdef CONFIG_ARCH_ADVANTECH
+ #define HW_bcdUSB 0x0110
+ #define HUAWEI_VENDOR_ID 0x12d1
+ #endif

void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
…
…
…

int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
		   const unsigned char *buf, int count)
{
…
…
	int left, todo;
	struct urb *this_urb = NULL;	/* spurious */
+ #ifdef CONFIG_ARCH_ADVANTECH
+ 	 struct usb_host_endpoint *ep=NULL;
+ #endif
	int err;
	unsigned long flags;
…
…
…
		/* send the data */
		memcpy(this_urb->transfer_buffer, buf, todo);
		this_urb->transfer_buffer_length = todo;

+ #ifdef CONFIG_ARCH_ADVANTECH  
+   if (IS_RSB_6410)
+   {
+       if((HUAWEI_VENDOR_ID == port->serial->dev->descriptor.idVendor)
+       	&& (HW_bcdUSB != port->serial->dev->descriptor.bcdUSB)){
+       	ep = usb_pipe_endpoint(this_urb->dev, this_urb->pipe);
+       	if(ep && (0 != this_urb->transfer_buffer_length)
+       		&& (0 == this_urb->transfer_buffer_length %
+       		ep->desc.wMaxPacketSize)){
+       		this_urb->transfer_flags |= URB_ZERO_PACKET;
+       	}
+       }
+   }
+ #endif

		spin_lock_irqsave(&intfdata->susp_lock, flags);
		if (intfdata->suspended) {
			usb_anchor_urb(this_urb, &portdata->delayed);
…
…
…
}
…
…
…
/* Helper functions used by usb_wwan_setup_urbs */
static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port,
				      int endpoint,
				      int dir, void *ctx, char *buf, int len,
				      void (*callback) (struct urb *))
{
	struct usb_serial *serial = port->serial;
	struct urb *urb;

	urb = usb_alloc_urb(0, GFP_KERNEL);	/* No ISO */
	if (!urb)
		return NULL;

	/* Fill URB using supplied data. */
	usb_fill_bulk_urb(urb, serial->dev,
			  usb_sndbulkpipe(serial->dev, endpoint) | dir,
			  buf, len, callback, ctx);

+ #ifdef CONFIG_ARCH_ADVANTECH
+   if (IS_RSB_6410)
+   {
+     	if (dir == USB_DIR_OUT) {
+     		struct usb_device_descriptor *desc = &serial->dev->descriptor;
+     		if (desc->idVendor == 0x05C6 && (desc->idProduct == 0x9003 || desc->idProduct ==
+     			0x9090 || desc->idProduct == 0x9215))
+     			urb->transfer_flags |= URB_ZERO_PACKET;
+     	}
+   }
+ #endif
	return urb;
}

2. Add UC15/UC20/EC20's Vendor ID and Product ID in "option_ids[]" in the file "drivers/usb/serial/option.c":

static const struct usb_device_id option_ids[] = {
…
+	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9090) }, //for Quectel UC15
+	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9003) }, //for Quectel UC20
+	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9215) }, //for Quectel EC20
…
}

4G

AM Telecom AMM561KT

The following operations are performed with UBC-222(U222LBV2011).

  • linux kernel config

Device Drivers --->
[*] USB support --->
<M> Support for Host-side USB
[*] Network device support --->
USB Network Adapters --->
<M> Multi-purpose USB Networking Framework
<M> Host for RNDIS and ActiveSync devices (EXPERIMENTAL)

  • load drivers
# rmmod usbserial
# modprobe rndis_host
# modprobe usbserial vendor=0x1ECB product=0x0205

e.g. put the 3 lines to /etc/rc.local
AMM561KT load drivers.png

  • list usb devices
# lsusb
# ll /dev/ttyUSB[012]

AMM561KT list usb devices.png

Bluetooth

EWM-W155H01E

Please refer to Bluetooth Testing Guide for Quark Platform for all operations performed using UBC-222 with U222LBV2011.

WiFi

EWM-W142F01E

EWM-W151H01E

EWM-W155H01E

USB

EMIO-200U3

Set CONFIG_USB_XHCI_HCD=y in kernel config