agent

command
v0.0.0-...-737f52e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

README

Agent

This directory contains the WiFi management component that runs on the Link022 Pi AP.

Get Started

For documentation on installing a full demo system (with both a gNMI client and link022 access point) please see the full demo documentation which explains a fully complete system.

The following instructions will get you a Link022 AP on a Linux-based device.

Prerequisites

Have a device set up. (Tested with Raspian Stretch)

Install Golang.

If running on Raspberry Pi:
wget https://storage.googleapis.com/golang/go1.7.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.7.linux-armv6l.tar.gz

For other systems:
Install golang 1.7+ (get it from: https://golang.org/doc/install#install)

Set up Path:

export PATH=$PATH:/usr/local/go/bin

Install dependencies.

sudo apt-get install udhcpc bridge-utils hostapd git
Download Link022 agent
export GOPATH=$HOME/go
go get github.com/google/link022/agent
Download certificates

Download sample certificates from the demo directory. Or you can use your own cert. Sample commands to generate certificates can be found here.

Configuring network interfaces of device

Editing the file /etc/network/interfaces on device.

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

# Disable all WLAN interfaces.
auto wlan0
iface wlan0 inet static
    address 0.0.0.0

# Repeat for other WLAN interfaces.

Note: Reboot the device to make change take effect.

Running Link022 agent
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
sudo env PATH=$PATH agent -ca=<path to ca.crt> -cert=<path to server.crt> -key=<path to server.key> -eth_intf_name=<the eth interface> -wlan_intf_name=<the wlan interface for AP radio> -gnmi_port=<port number>

The default log file is "/tmp/agent.INFO". It can be modified by "-log_dir" option.

Note: Make sure the chosen wireless device supports AP mode and has enough capability.

Documentation

Overview

The agent program is the link022 AP agent. It converts the target device to an Link022 AP and runs in the background as a management daemon.

Directories

Path Synopsis
Package context stores context data of the Link022 device.
Package context stores context data of the Link022 device.
Package controller contains methods that are related to AP controller.
Package controller contains methods that are related to AP controller.
Package gnmi contains GNMI server and related methods.
Package gnmi contains GNMI server and related methods.
Package service contains methods that manage Link022 AP device.
Package service contains methods that manage Link022 AP device.
Package syscmd contains methods that run external commands on device.
Package syscmd contains methods that run external commands on device.
util
ocutil
Package ocutil contains helper functions related to OpenConfig models.
Package ocutil contains helper functions related to OpenConfig models.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL