This repository contains a Greybus module for the Zephyr Real-Time Operating System.
First, ensure that all required tools are installed by following Zephyr's Getting Started Guide.
Next, clone and synchronize repositories.
west init -m https://github.com/cfriedt/greybus-for-zephyr.git zephyrproject
cd zephyrproject
west update
While that is updating, choose a board from Zephyr's list of Supported Boards.
Next, update git submodules. Currently, there is a git submodule for the
manifesto
utility.
cd greybus
git submodule init
git submodule update
cd ..
Lastly, flash firmware for the chosen $BOARD
using the commands below.
cd zephyr
source zephyr-env.sh
git apply ../greybus/zephyr-gpio-get-direction.patch
git apply ../greybus/zephyr-sys-byteorder-posix.patch
git apply ../greybus/zephyr-dynamic-pthread-stacks.patch
west build -b $BOARD -t flash ../greybus/samples/subsys/greybus/net
A number of patches are required until respective functionality is added upstream in the Zephyr Project.
Note, there may be an overlay required for the connectivity options that a particular board supports.
In that case, say for IEEE 802.15.4 support, the west build
command
above should be modified as shown below.
west build -b $BOARD -t flash ../greybus/samples/subsys/greybus/net \
-- -DOVERLAY_CONFIG="overlay-802154.conf"
In that case, say for BLE support, the west build
command
above should be modified as shown below.
west build -b $BOARD -t flash ../greybus/samples/subsys/greybus/net \
-- -DOVERLAY_CONFIG="overlay-ble.conf"
While Greybus is capable of operating over any reliable transport, the focus of this project is TCP/IP (although quite an assortment of physical and data-link layers are supported in Zephyr).
Depending on the board that was chosen and the available connectivity options, some additional steps may be required for network connectivity.
Once network connectivity is established, it should be possible to use an mDNS browser such as Avahi to scan for service discovery.
avahi-browse -t -r _greybus._tcp
+ lowpan0 IPv6 zephyr _greybus._tcp local
= lowpan0 IPv6 zephyr _greybus._tcp local
hostname = [zephyr.local]
address = [2001:db8::1]
port = [4242]
txt = []
A Linux machine is required in order to connect to and control our Zephyr device via Greybus so be sure to follow Linux Software Requirements.
At this point, we should be ready to perform some I/O on our remote devices using Greybus. Currently, this module supports the protocols below.
In case a board was chosen that does not yet support Greybus, consider submitting a DeviceTree overlay file similar to cc1352r_sensortag.overlay and a board-specific configuration file similar to cc1352r_sensortag.conf.
The contribution guidelines for this module follow the Zephyr Contribution Guidelines.
To summarize,
- Create an Issue
- Code up your contribution
- Code up any tests and samples as required
- Ensure that tests pass and samples run as expected
- Make a Pull Request
Additional Information about Greybus including videos, slide presentations, and deprecated demo instructions can be found here.
A compiled version of the Greybus Specification is available here.