Showing posts with label gateway. Show all posts
Showing posts with label gateway. Show all posts

Tuesday, 26 February 2019

Colorado: Accessing to 802.15.4 networks from Raspberry Pi. Hardware

Rasberry Pi B+ connected to a Digi Xbee 802.15.4 module
This document describes the integration between a Raspberry Pi and a Digi Xbee 802.15.4 module from a hardware perspective. The document is completed with the notes about the needed operations from a software perspective available here.

The objective of the Colorado project is developing a STEAM concentrator based on Raspberry PI accessing to a 802.15.4 network by using a Digi XBee module. To do that, it is necessary to connect the Raspberry with the Xbee module using a RS232 link, since both devices integrate at least one 232 serial port.

This document takes as base a Raspberry Pi board with a 40 pin connector (specifically RPi B+) and a Digi Xbee Pro S1 802.15.4 module. The description is suitable to be applied to any Digi Xbee module (S1, S2x, S3, standard or PRO) whenever the module specific power requirements were taken into account (see Powe Supply notes)

Serial connection

The modules connection can be simple, ie just by connecting the Tx-Rx lines, or can be more complex by connecting the hardware synchronization lines (RTS and CTS). In the first case a serial hardware control flow will NOT be feasible. Both wiring methods are covered in the next scheme, in which these connections can be seen:
  • Raspberry Tx output (pin 8) is connected to the Xbee DIN input (pin 3)
  • Xbee DOUT output (pin 2) is connected to the Raspberry Rx input (pin 10)
  • In order to provide hardware flow control support:
    • Raspberry RTS output (pin 11) is connected to the Xbee CTS input (pin 12)
    • XBee RTS output (pin 16) is connected to the Raspberry CTS input (pin 36)
Raspberry Pi - Digi Xbee connection diagram

If the hardware flow control option is being implemented, it will be necessary to allow Raspberry Pi to use its pins as RTS/CTS (disabled by default). To do that, follow the instructions defined in the VMW Productions site.

Power supply

Apart of the serial connection, it will be necessary to power the Xbee module from a supply generating, in case of using a Xbee S1 module, a voltage in the range 2,8V-3,4V and a max. current that will depend on the S1 module used, but that ranges from 50 to 340 mA (see power requirements on page 13 of the Xbee S1 User Manual) .

The Raspberry Pi uses four of its pins as power outputs (check full Raspberry Pi pinout here):
  • Pins 1 and 17 outputs 3,3V with a max current of 50mA. Though the voltage is in the Xbee voltage input range, the current is in the higher limit of the smallest module, so using this option is not recommended. Note, however, that in case of using a Xbee S2C (the standard version, NOT the pro version) the max current would be between 33 and 45 mA and therefore taking the power supply from these pins would be feasible.
  • Pins 2 and 4 outputs 5V with a max current up to 1500mA (depending on the RPi power supply). This current is suitable to power the Xbee module, but requires a voltage regulation.
In order to perform a voltage regulation, a TI TPS7A4700 regulator configured to output 3,3V is used. As can be seen in the previous schematic, the Raspberry Pi pin 2 output (+5V) is connected to the TPS7A4700 input, and its output (+3,3V) is connected to the Xbee module pin 1. To know more about the TI TPS7A4700, click here.


Monday, 11 February 2019

Colorado projects started

STEAM Colorado/Elbert projects
A new branch in the project repository addressed to develop two new subprojects has been created. The new subprojects are:
  • Litem (Mount) Elbert project, addressed to develop a set of Litems based on the Texas Instruments CC26x2 Lauchpad evaluation board (see evaluation board clicking here), using 802.15.4 as network protocol for communicating with the gateway. The code is localted in the subdirectory SteamProject/software/litems/802.15.4/ti-cc26x2-lp/elbert/ of the GitHub repository (direct access clicking here). Given that Elbert works will be developed on a evaluation board, all the results will be considered as experimental.
  • Gateway Colorado (river) project, addressed to develop a gateway running on Raspberry Pi (Raspbian OS) implementing 802.15.4 in the underlying network by integrating a Digi Xbee module as interface. The code is located in the subdirectory SteamProject/software/gateways/802.15.4/raspbian/colorado/ of the GitHub repository (direct access clicking here). Colorado source code will be developed in Java and the expected result will be potentially feasible to be put into production.
These two projects will run in parallel, since it is necessary their mutual integration to have a practical result (litem without gateway and viceversa is nonsense). However, even being closely related, it is important to state that the individual results will be compatible with the STEAM specification, ie, Elbert will be compatible with any STEAM 802.15.4 gateway and Colorado will be compatible with any STEAM 802.15.4 litem.

Since both the Colorado river and the mount Elbert have strong relationship with the Colorado state, the above icon is selected to represent graphically these two projects.

For detailed Elbert project information (description, planning and current status) click here. For detailed Colorado project information (description, planning and current status) click here.

Thursday, 26 July 2018

Upgrading a Digi Connectport X2 from Zigbee to 802.15.4 coordinator

Digi ConnectPort X2 coordinator
In order to create a star topology XBee/802.15.4 network, a coordinator is necessary. That coordinator will be the responsible of managing some aspects of the network and, optionally, acting as gateway to other networks.

I own an old Digi Connectport X2 with ZB firmware, therefore suitable to act as a coordinator of a Zigbee network. This device has an ethernet port that, properly configured, allows sending and receiving radio network packets to or from a TCP/UDP connection, what is really useful in order to make tests from any computer able to access to the ethernet gateway port.

Since I need to form not a Zigbee but a 802.15.4 network, some changes are necessary in order to convert the Connectport X2 Zigbee coordinator into a 802.15.4 coordinator. These are the steps to be done: Upgrading the X2 gateway and Xbee PRO radio module firmwares or, in the last case, replacing the radio module by a 802.15.4 compliant module.

Upgrading the X2 gateway firmware

In order to get the proper firmware, go to the Digi Support Page, "Firmware updates" section and search "Connectport X2 - 802.15.4 - Ethernet" (link here). In case that the installed version was older than the available versions, the best is updating first the POST firmware and then updating the Connectport X2D (that was the exact name of my gateway firmware) firmware. Both the POST and the gateway installed firmwares can be checked in the Gateway "Administration/System information" page. In this case I updated the firmwares to version 1.1.3 release 82002548_B for POST and version 2.17.1.2 release 82002549_G1 04/20/2017 for gateway firmware.

Upgrading the Xbee PRO radio module

After upgrading the gateway firmware, it is necessary upgrading the radio module. The way to do depends on the installed radio module:
  • If the gateway contains a Xbee Pro S2(B) module, it is not compatible with the 802.15.4 firmware and therefore it must be replaced by another, 802.15.4 compatible, radio module. The valid options are two:
    • Replacing it by a Xbee Pro S1 module: it is old, expensive and it will become deprecated on December 2018, so it is not a good option to buy one.
    • Replacing it by a Xbee Pro S2C module: better and cheaper than the S1 module, it is compatible with Connectport X2D from firmware version 2.17.1.1, so upgrading the gateway firmware to that version (or higher) is necessary.
  • If the gateway contains a Xbee Pro S2C module, just upgrade the firmware by downloading the latest from the Digi support page (go to the Digi Support Page, "Firmware updates" section and search "XBee / XBee-PRO S2C 802.15.4 Modules", link here). The usual firmware option should be that containing "TH" (through hole) in its name, that is addressed to the Xbee Pro through hole modules that usually are mounted in the X2 gateways. However, in case of trying to upgrade the module with a wrong firmware, the gateway will generate an error and the process will be aborted, so no risk in this step in case of choosing the wrong firmware.
In order to know the radio module used by the gateway, open a session via the gateway web interface and go to Configuration/Xbee Network/Gateway Firmware Update and check the radio type: If it is "Xbee-PRO XNet 2.5 / ZB / SE (0x1a47)" your gateway contains a Xbee Pro S2 radio module, being 0x1a47 the radio module hardware version. If not sure, the last option is just opening the gateway enclosure and checking the installed radio module.