Maxx GW4100: Unterschied zwischen den Versionen

Aus WIKI IoTmaxx GmbH
Zur Navigation springen Zur Suche springen
Bernhard Bleitner (Diskussion | Beiträge)
Bernhard Bleitner (Diskussion | Beiträge)
Zeile 48: Zeile 48:
! Typ !! Signal !! Pin !! Pin !! Signal
! Typ !! Signal !! Pin !! Pin !! Signal
|-
|-
| Multi-purpose I/O || style="text-align:right" | GPIO 1 || style="background:#b3bac5" | 1 || style="background:#b3bac5"| 2 || GPIO 2
| Multi-purpose I/O
| style="text-align:right" | GPIO 1
| style="background:#b3bac5" | 1
| style="background:#b3bac5"| 2
| GPIO 2
|-
|-
| || style="text-align:right" | GND || style="background:#b3bac5"| 3 || style="background:#b3bac5"| 4 || GND
|
| style="text-align:right" | GND
| style="background:#b3bac5"| 3
| style="background:#b3bac5"| 4
| GND
|-
|-
| rowspan="2" | Digital inputs || style="text-align:right" | GPI 1 || style="background:#b3bac5"| 5 || style="background:#b3bac5"| 6 || GPI 2
| rowspan="2" | Digital inputs
| style="text-align:right" | GPI 1
| style="background:#b3bac5"| 5
| style="background:#b3bac5"| 6
| GPI 2
|-
|-
| style="text-align:right" | GPI 3 || style="background:#b3bac5"| 7 || style="background:#b3bac5"| 8 || GPI 4
| style="text-align:right"| GPI 3
 
| style="background:#b3bac5"| 7
| style="background:#b3bac5"| 8
| GPI 4
|}
|}



Version vom 29. April 2021, 22:23 Uhr

The Device

Linux login

Per default login to the Linux system is possible by the use of a ssh connection on eth0 or via the serial console on the RS232 interface (115.200 baud, 8N1).

login: root

password: root

Please be advised to at least change the password and deactivate the serial console before deploying the device. The use of further security measures (PSK etc.) is strongly encouraged.


Interfaces

The following section describes the various interfaces of the GW4100 in detail. This graphic shows the distribution of the interfaces:


Beschreibung



Pinout RS232, RS485, CAN-Bus, 1-Wire connector

Typ Signal Pin Pin Signal
1-Wire Data 1 2 +5V
CAN High 3 4 Low
GND 5 6 GND
RS485 D- 7 8 D+
RS232 TXD 9 10 CTS
RXD 11 12 RTS

Pinout Digital IN/OUT connector

Typ Signal Pin Pin Signal
Multi-purpose I/O GPIO 1 1 2 GPIO 2
GND 3 4 GND
Digital inputs GPI 1 5 6 GPI 2
GPI 3 7 8 GPI 4

Power

The device requires an external ES1/PS2 DC power supply 8-30V, 25W.

Ethernet

10/100MBit ethernet interface, per default configured as DHCP server with IP address 192.168.1.1.

USB

USB 2.0 host interface for connection of external USB devices. Please note that an appropriate Linux driver ist required for many devices.

SD card

Micro SD card interface for adding additional non-volatile memory to the system. Please use a SD card to store rapidly changing data (e.g. databases etc.) as the internal flash memory allows limited write cycles before potential memory corruption may occur.

CAN

The interface according to the CAN 2.0B protocol specification is relaized using the i.MX7D’s flexcan interface and a NXP TJA1051 transceiver. It features a switchable 120R termination resistor.

On the Linux side a SocketCAN interface (can0) with a default bitrate of 250.000 bit/s is provided.

The termination resistor is activated by driving CAN_TERM_EN_n low. See Linux mapping for details.

RS485

A non-isolated RS485 interface is available as /dev/ttymxc3. The interface does not include a termination resistor.

RS232

A 4-wire RS232 interface is available as /dev/ttymxc2. In default configuration this interface will provide a Linux serial console at 115200 baud (8N1).

1-wire

The GW4100 incorporates a DS2482 I2C to 1-wire bridge device from Maxim Integrated (https://www.maximintegrated.com/en/products/interface/controllers-expanders/DS2482-100.html#). The corresponding driver is integrated in the Linux mainline kernel and all 1-wire functions are exposed to the sysfs filesystem.

Please see https://www.kernel.org/doc/html/latest/w1/w1-generic.html for a detailed description of the user space interface.

Digital inputs

The following diagram shows the internal design of the four digital inputs:



This design allows the connection of push-pull- and open-collector-outputs with a threshold of about 4.5V. It is also possible to use a mechanical switch or a relais to connect the input to GND without the need for an additional pullup resistor.

Following diagram shows a simplified design:


Please note that the input is inverted internally so that in case the input is either unconnected or connected to a voltage above the threshold will be read as logical 0 (low level), when connected to a voltage below the threshold (e.g. 0V) it will be read as logical 1 (high level)

The GPIs are exposed to the sysfs filesystem on the linux side an can be automatically inverted again for user conveniance.

TODO: add linux example

Multi-purpose I/O

The device contains two multi-purpose GPIOs which can be configured as in- or output. When required an internal pullup resistor can be activated.

Furthermore can the GPIO be used as an analog input as the input voltage is also connected to one of the internal 12-bit ADC channels (s. On board ADCs) .


The GPIO is current limited (tbd mA) in the high- and lowside current paths so closing high- and lowside switches at the same time will not damage the device (neither will an external short-circuit condition), it is nevertheless not advised to do so and use break-before-make logic instead.

TODO: add linux example

GSM

TE connectivity with fallback to 3G and 2G is provided by an integrated Quectel EC21 module. On the Linux side the device is controlled by ModemManager (see https://core.docs.ubuntu.com/en/stacks/network/modem-manager/docs/).

ModemManager uses /dev/ttyUSB3 for communication with the EC21, /dev/ttyUSB2 is available for AT command execution from user space.

The status of the GSM module can additionally be monitored by the means of GSM_PWR_IND_n which will be driven low when the module is on.

The GW4100 contains two SIM holders to allow the use of 2FF (Mini SIM) or 3FF (Micro SIM) cards. It is possible to populate both cards to allow e.g. the use of different networks. The active SIM card is selected by the following procedure.

SIM select procedure

First the EC21 has to be configured via AT commands to allow SIM hot-swapping:

((ABB))

Please note that a module restart by AT+CFUN is required, the setting will be persistent.

Next the SIM has to be “logically removed” by setting SIM_EN low.

Afterwards the active SIM can be selected by SIM_SEL (default high -> 2FF SIM)

Then the SIM can be “logically inserted” again by driving SIM_EN high

TODO: check if accessible old/new interface

Activating the data connection

The modem can then be used with:



After every reset the modem increases its number.

To add a new connection issue:


And then to enable the connection:

GNSS

For geo positioning a GNSS receiver integrated in the Quectel EC21 module is available. NMEA data is output on /dev/ttyUSB1. The GNSS receiver is activated with the following AT command:

AT+QGPS=1

For a detailed description of the available configuration options please consult the EC21 documentation (https://www.quectel.com/product/ec21.htm).

Active antenna supply is provided by regulator 9 of the Qorvo ACT8847 power management ic (PMIC). Following commands from user space are required to activate the supply:

User LEDs

The device contains two user controllable LEDs (e.g. status signal). These are exposed to the sysfs under /sys/class/leds/. See Linux mapping for details.

please see https://www.kernel.org/doc/Documentation/leds/leds-class.txt for details.

User Button

There is a consealed button available for user defined functions (e.g. reset to factory default)

TODO: add linux example, picture

on board ADCs

The following diagram shows the usage of the eight 12-bit ADCs of the i.MX7D processor.

ADC 0 provides access to the voltage levels of the two multi-purpose GPIOs and the supply voltage as well as a board temperature indicator while ADC 1 is used to monitor system health status.

All ADC values are accessible from Linux user space via sysfs mapping (/sys/bus/iio/devices/).

Example 1: reading the actual value of the 5V supply lane


Calculation of voltage:


Example 2: reading the system supply voltage


Calculation of voltage:


Please note that measurement is taken behind the input diode and therefor the actual supply voltage is aprox. 0.5V higher (in this case the actual supply voltage is 24V)

Example 3: reading the board temperature


Calculation of NTC resistance:




Consulting the resistance lookup table in the resistors (NCP15XV103J03RC) datasheet the board temperature is at about 37°C.


Linux mapping

Digital and analog I/Os (deprecated sysfs mapping)

Digital and analog I/Os (new libgpiod mapping)

GPIO Linux user space examples (deprecated sysfs mapping)

Example: exporting and reading GPIN1 (high level applied to input pin)



Example: exporting and enabling GPIO1 pullup


Please see https://www.kernel.org/doc/html/latest/admin-guide/gpio/sysfs.html for a detailed description of the sysfs gpio interface.

GPIO Linux user space examples (new libgpiod mapping)

Example: reading GPIN1 (high level applied to input pin), no export required


Example: enabling GPIO1 pullup, no export required


Please see https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/README for a description of the libgpiod interface.

Serial interfaces and busses