Intro to the WLAN Pi API
What is the WLAN Pi API?
The WLAN Pi API is a way to access information and control your WLAN Pi over a networked interface.
Here are some reasons why you may want to do that
You may want to copy some data out of your Pi for a report or some further debugging
Your WLAN Pi may be at a remote customer site and you may want to perform some tests and retrieve the data.
The WLAN Pi API is something which will continue to grow as the community contribute to it.
These are the current supported APIs
System API
These are high level APIs to provide information about the WLAN Pi System. They also allow the starting and stopping of common apps or services on your WLAN Pi.
They closely represent the system menu in FPMS
Device Info
Gives back information on the model, name, software version and the mode the device is in
Device Stats
Provides information about the CPU, Memory and Disk
Device Model
Allows you to identify the model (this is useful for app integrations)
Service Status
Tells you whether a particular service (such as grafana or kismet) is running
Start Service
Allows you to start a service (such as grafana or kismet)
Stop Service
Allows you to stop a service (such as grafana or kismet)
Utils API
These closely represent the Util menu in FPMS
Reachability
This runs the reachability tests, exactly the same as from within FPMS, and returns the data. With this API you will be able to tell if the device can reach common services such as Google.com
USB Interfaces
Provides details of the USB interfaces and what is connected (exactly the same as from within FPMS)
UFW Info
Provides the detail about the UFW firwall configuration (exactly the same as from within FPMS)
Bluetooth API
These closely represent the Bluetooth menu in FPMS and allows you to enable or disable Bluetooth
Bluetooth Status
Provide the details of what the Bluetooth adapter may be connected to
Bluetooth On
Enables the Bluetooth adapter (Note, the Host/Device switch must be in Host mode)
Bluetooth Off
Disables the Bluetooth adapter
Network API
This is a new API which allows you to manage your wireless interface. From within the API you can scan and connect to Wi-Fi networks.
Before you continue
A detailed run-through of the Network API is provided in the next section, however for reference, for this API to work you need to setup the services which are managing the wireless adapter.
You need to use the Stop Service API to stop
wpa_supplicant
You need to use the Start Service API to start
wpa_supplicant@wlan0
Get Interfaces
Returns the interfaces which are managed by the API. Currently only wlan0 can be managed by the API (you must perform the supplicant service management above first)
Get Scan
Will scan for a period of time (configurable in the API) and return the results of all the Wi-Fi networks found
Set Network
Allows you to configure a wireless network and join it.
Get Connected
Provides details of any connected Wi-Fi network
Last updated
Was this helpful?