« Close

Datasheets and User Guides

App Notes

Software & Driver

 

7.0 WiFi (T7-Pro only)

Overview

Communication Protocol: Modbus TCP

Connector Type: Female RP-SMA

Transceiver: 2.4 GHz 802.11 b/g (Compatible with ac, and n routers)

Range: Similar to laptops and other WiFi devices with stock antenna 

Max Packet Size: 500 bytes/packet

The T7-Pro has a wireless module. Refer to this WiFi and Ethernet tutorial to get started.

DHCP is enabled from the factory, so to get WiFi going from the factory write the desired SSID string (case sensitive) to WIFI_SSID_DEFAULT and the proper password string (case sensitive) to WIFI_PASSWORD_DEFAULT. Then write a 1 to WIFI_APPLY_SETTINGS and watch the status codes. If you get back code 2900 the WiFi chip is associated to your network, and you can then read the assigned IP from WIFI_IP.  Find more details and troubleshooting tips in the WiFi and Ethernet tutorial.

Data Speed: It's possible to get data faster on a T7-Pro using its Ethernet interface instead of its WiFi interface, both for command response and streaming modes. Wireless bridges and access points do not introduce a speed bottleneck, so a bridge is a good way to get fast wireless data from any T-series device. See the Convert Ethernet to WiFi App Note for setup information.

Port

The T7's WiFi module responds to connections or packets on port 502 for both UDP and TCP.

Config (_DEFAULT) Registers

Use the following _DEFAULT registers to configure WiFi:

WiFi Config Registers
Name Start Address Type Access
WIFI_IP_DEFAULT 49250 UINT32 R/W
WIFI_SUBNET_DEFAULT 49252 UINT32 R/W
WIFI_GATEWAY_DEFAULT 49254 UINT32 R/W
WIFI_DHCP_ENABLE_DEFAULT 49260 UINT16 R/W
WIFI_SSID_DEFAULT 49325 STRING R/W
WIFI_PASSWORD_DEFAULT 49350 STRING W
WIFI_APPLY_SETTINGS 49400 UINT32 W
WIFI_IP_DEFAULT
- Address: 49250
The new IP address of WiFi. Use WIFI_APPLY_SETTINGS.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
WIFI_SUBNET_DEFAULT
- Address: 49252
The new subnet of WiFi. Use WIFI_APPLY_SETTINGS.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
WIFI_GATEWAY_DEFAULT
- Address: 49254
The new gateway of WiFi. Use WIFI_APPLY_SETTINGS.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
WIFI_DHCP_ENABLE_DEFAULT
- Address: 49260
The new Enabled/Disabled state of WiFi DHCP. Use WIFI_APPLY_SETTINGS
  • Data type: UINT16  (type index = 0)
  • Readable and writable
  • Minimum firmware version: 0.9014
WIFI_SSID_DEFAULT
- Address: 49325
The new SSID (network name) of WiFi. Use WIFI_APPLY_SETTINGS.
  • Data type: STRING  (type index = 98)
  • Readable and writable
WIFI_PASSWORD_DEFAULT
- Address: 49350
Write the password for the WiFi network, then use WIFI_APPLY_SETTINGS.
  • Data type: STRING  (type index = 98)
  • Write-only
WIFI_APPLY_SETTINGS
- Address: 49400
Apply all new WiFi settings: IP, Subnet, Gateway, DHCP, SSID, Password. 1=Apply
  • Data type: UINT32  (type index = 1)
  • Write-only

These registers can also be read, except WIFI_PASSWORD_DEFAULT.  Configure the WiFi network configurations in Kipling software.

These _DEFAULT registers are non-volatile.  Whatever value you write to a _DEFAULT register will be retained through a reboot or power-cycle.  New values written to these _DEFAULT registers are not applied until power-up or until a 1 is written to WIFI_APPLY_SETTINGS.

Status Registers

Use the following read-only registers to read the status of WiFi:

WiFi Status Registers
Name Start Address Type Access
WIFI_IP 49200 UINT32 R
WIFI_SUBNET 49202 UINT32 R
WIFI_GATEWAY 49204 UINT32 R
WIFI_DHCP_ENABLE 49210 UINT16 R
WIFI_SSID 49300 STRING R
WIFI_STATUS 49450 UINT32 R
WIFI_RSSI 49452 FLOAT32 R
WIFI_IP
- Address: 49200
Read the current IP address of WiFi.
  • Data type: UINT32  (type index = 1)
  • Read-only
WIFI_SUBNET
- Address: 49202
Read the current subnet of WiFi.
  • Data type: UINT32  (type index = 1)
  • Read-only
WIFI_GATEWAY
- Address: 49204
Read the current gateway of WiFi.
  • Data type: UINT32  (type index = 1)
  • Read-only
WIFI_DHCP_ENABLE
- Address: 49210
Read the current Enabled/Disabled state of WiFi DHCP.
  • Data type: UINT16  (type index = 0)
  • Read-only
  • Minimum firmware version: 0.9014
WIFI_SSID
- Address: 49300
Read the current SSID (network name) of WiFi
  • Data type: STRING  (type index = 98)
  • Read-only
WIFI_STATUS
- Address: 49450
Status Codes: ASSOCIATED = 2900, ASSOCIATING = 2901, ASSOCIATION_FAILED = 2902, UNPOWERED = 2903, BOOTING = 2904, START_FAILED = 2905, APPLYING_SETTINGS = 2906, DHCP_STARTED = 2907, OTHER = 2909
  • Data type: UINT32  (type index = 1)
  • Read-only
  • Minimum firmware version: 0.7500
Constant Value
ASSOCIATED 2900
ASSOCIATING 2901
ASSOCIATION_FAILED 2902
UNPOWERED 2903
BOOTING 2904
START_FAILED 2905
APPLYING_SETTINGS 2906
DHCP_STARTED 2907
OTHER 2909
WIFI_RSSI
- Address: 49452
WiFi RSSI (signal strength). Typical values are -40 for very good, and -75 for very weak. The T7 microcontroller only gets a new RSSI value from the WiFi module when WiFi communication occurs.
  • Data type: FLOAT32  (type index = 3)
  • Read-only
  • Minimum firmware version: 0.8000

Config (_DEFAULT) vs. Status Registers

Example: If you write WIFI_IP_DEFAULT="192.168.1.208" (you actually write/read the 32-bit numeric equivalent—not an IP string), then that value will be retained through reboots and is the default IP address.  If DHCP is disabled, this will be the static IP of the device and what you get if you read WIFI_IP.  If DHCP is enabled, then a read of WIFI_IP will return the IP set by the DHCP server. 

Power

The following registers configure WiFi power:

WiFi Power Registers
Name Start Address Type Access
POWER_WIFI 48004 UINT16 R/W
POWER_WIFI_DEFAULT 48054 UINT16 R/W
POWER_WIFI
- Address: 48004
The current ON/OFF state of the WiFi module.
  • Data type: UINT16  (type index = 0)
  • Readable and writable
  • Minimum firmware version: 0.8600
POWER_WIFI_DEFAULT
- Address: 48054
The ON/OFF state of the WiFi module after a power-cycle to the device. Provided to optionally reduce power consumption.
  • Data type: UINT16  (type index = 0)
  • Readable and writable
  • Minimum firmware version: 0.8600

Examples

Read IP Example: To read the wireless IP address of a device, perform a Modbus read of address 49200.  The value will be returned as an unsigned 32-bit number, such as 3232235691.  Change this number to an IP address by converting each binary group to an octet, and adding decimal points as necessary.  The result in this case would be "192.168.0.171"

Write IP Example: To change the Wireless IP Address of a device, perform a Modbus write to address 49250.  The IP address must be passed as an unsigned 32-bit number, such as 3232235691.  Change this IP address "192.168.0.171" by converting each octet to a binary group, and sticking them together. 

Updating WiFi Firmware

At the time of this writing we recommend using Kipling to update WiFi firmware, since Kipling connects to the FTP server to identify what firmware is available, and monitors the WIFI_FIRMWARE_UPDATE_STATUS register automatically.

The WiFi chip on the T7 is a separate chip from the main processor, and it can be updated using the WIFI_FIRMWARE_UPDATE_TO_VERSIONX register:

Name Start Address Type Access
WIFI_VERSION 60008 FLOAT32 R
WIFI_FIRMWARE_UPDATE_TO_VERSIONX 49402 FLOAT32 W
WIFI_VERSION
- Address: 60008
The current firmware version of the WiFi module, if available.
  • Data type: FLOAT32  (type index = 3)
  • Read-only
WIFI_FIRMWARE_UPDATE_TO_VERSIONX
- Address: 49402
Start an update by using USB or Ethernet to write the desired version to update to.
  • Data type: FLOAT32  (type index = 3)
  • Write-only
  • Minimum firmware version: 0.9206

If connected to the internet, the WiFi chip can download new firmware files from an FTP server. To initiate a download and update, write a new firmware version to the WIFI_FIRMWARE_UPDATE_TO_VERSIONX register.

Read from WIFI_FIRMWARE_UPDATE_STATUS to monitor progress:

Name Start Address Type Access
WIFI_FIRMWARE_UPDATE_STATUS 49454 UINT32 R
WIFI_FIRMWARE_UPDATE_STATUS
- Address: 49454
CONFIGURING = 2920, IN_PROGRESS = 2921, REBOOTING = 2923, UPDATE_SUCCESS = 2924, UPDATE_FAILED = 2925
  • Data type: UINT32  (type index = 1)
  • Read-only
  • Minimum firmware version: 0.9206
Constant Value
CONFIGURING 2920
IN_PROGRESS 2921
REBOOTING 2923
UPDATE_SUCCESS 2924
UPDATE_FAILED 2925
 

Antenna Details

The T7-Pro ships with a standard RP-SMA 2.4 GHz antenna similar to the W1030, or the A24-HASM-450.

The connection to the WiFi module on the T7-Pro PCB is made via a snap-on/snap-off ultra miniature coaxial connector called male U.FL (aka AMC, IPEX, IPAX, IPX, MHF, UMC or UMCC).  The normal T7-Pro uses a U.FL to bulkhead RP-SMA cable with a length of 140mm, similar to the Taoglas Limited CAB.622Emerson 415-0100-150, Laird 1300-00041, Amphenol 336306-14-0150, or Amphenol 336306-12-0150.

To search for U.FL to RP-SMA cable options at Digi-Key, go to the "Cable Assemblies => Coaxial Cables (RF)" section, and filter by Style = "RP-SMA to IPX" or "RP-SMA to MHF1" or "RP-SMA to UMC" or "RP-SMA to UMCC".  Then look at the picture and make sure it looks correct, as the application of the terms "male" and "female" are not totally standardized.

T7-Pro-OEM ships with a simple 30mm U.FL whip antenna such as the Anaren 66089-2406.

WiFi Range

The WiFi range on the T7 is typical for a modern WiFi device. In direct line-of-sight with the router, it's possible to get a decent connection at 100m. The table below shows signal strength at varying distances with a stock T7 antenna, and a simple WiFi router. Both the T7 and the router were positioned 3ft off of the ground, with direct line-of-sight.

DistanceRSSI
10m -44dBm
25m -45dBm
50m -55dBm
100m -59dBm

During testing, it was noted that the T7 had slightly better WiFi range than an HTC One V cell phone. The WiFi signal is spotty at RSSI lower than -75dBm, and the connection will cut off entirely around -80dBm. Note that 90° antenna orientation was used in testing above. That is to say, keep the antenna in the fully bent upright position, don't try to point it at the router, or accidentally leave it at 45° bent. At 45° bent, or directly pointed towards the router, the signal strength is reduced by about 5dBm.

Note that the RSSI value you can read (WIFI_RSSI) is only updated when WiFi communication occurs.  That is, if you talk to the T7 over USB to read the RSSI value, you will just get the value from the last WiFi communication that occurred.

OEM Whip Antenna

The OEM whip antenna is a short segment of wire, only 30mm in length. This whip antenna provides an inexpensive solution for adding WiFi to an OEM board, without the need to figure out mounting of a bigger antenna. The signal strength of a 30mm whip antenna is on average 11dB less than that of the stock antenna. The table below demonstrates the 30mm antenna signal strength at various distances.

DistanceRSSI
10m -49dBm
25m -58dBm
50m -70dBm
100m -73dBm

Improve signal strength

The first step to improve the signal strength at large distances is to insure direct line-of-sight. Beyond that, the next best thing is to elevate the transmitter and receiver antennas. Even an elevation of 1m off the ground helps quite a bit. Be sure to consider the probability of lightning strikes if the antenna is high relative to the surroundings.

The next step to improve signal strength is to use a directional WiFi antenna. Directional antennas improve range substantially, such that even a homemade solution can increase range to fifteen times that of a non-directional antenna. If you need something to work at 500m, it's possible to buy a simple yagi antenna for $60 USD approx.

Network Schemes

Figure 1 demonstrates a basic network diagram where the T7-Pro is connected to the "Office WiFi" network. The T7-Pro can be controlled by either host option (1 or 2). For much more information on Ethernet and WiFi networking see the Basic Networking & Troubleshooting App Note.

Figure 1. Most common configuration for a home, or small office network.