twWifiScan

Wiai AP Sensor for TWSNMP series.

View on GitHub

twWifiScan

Wifi AP sensor for TWSNMP FC

Godoc Reference Go Report Card

日本語の説明

Overview

twWifiScan is a sensor program that collects information on wireless LAN access points in the surrounding area and sends it to TWSNMP FC, etc., via syslog or MQTT.

In the current version, the following information can be obtained:

Status

Build

Build the project using the make command:

$ make

Available targets:

  all        Build all executable files (default)
  clean      Delete the built executable files
  zip        Create Zip files for distribution

Running make creates executable files for Windows, Linux (AMD64), Linux (ARM), and Linux (ARM64) in the dist directory.

To create distribution zip files:

$ make zip

Run

Usage

Usage of dist/twWifiScan:
  -debug
    	Enable debug mode
  -iface string
    	Monitor interface (default "wlan0")
  -interval int
    	Send interval (sec) (default 600)
  -mqtt string
    	MQTT broker URL
  -mqttClientID string
    	MQTT client ID (default "twWifiScan")
  -mqttPassword string
    	MQTT password
  -mqttTopic string
    	MQTT topic prefix (default "twWifiScan")
  -mqttUser string
    	MQTT user
  -syslog string
    	Syslog destination list

Syslog destinations can be specified as a comma-separated list. You can also specify the port number after a colon.

-syslog 192.168.1.1,192.168.1.2:5514

To start, a monitoring LAN I/F (-iface) and a destination (-syslog or -mqtt) are required.

Example (Linux):

# ./twWifiScan -iface wlan0 -syslog 192.168.1.1 -mqtt tcp://broker.example.com:1883

Data Format

Syslog

The transmitted syslog message uses the local5 facility with the tag twWifiScan.

Example (APInfo):

type=APInfo,ssid=F660T-VFyM-X,bssid=FC:C8:97:B0:xx:D5,rssi=-73,Channel=1,info=Encrypt;802.11i/WPA2 Version 1,count=9593,change=0,vendor=zte,ft=2024-12-06T15:48:57+09:00,lt=2025-01-26T16:38:57+09:00

MQTT

Messages are published in JSON format to topics based on the mqttTopic prefix:

License

See LICENSE.

Copyright 2021-2026 Masayuki Yamai