๐Ÿ“™
WLAN Pi Cookbook
2025 M4+
2025 M4+
  • ๐Ÿ˜Ž1. Getting Started
    • ๐ŸŽWLAN Pi M4+
      • ๐Ÿ–จ๏ธPhysical Case Design
    • โšกPowering Up Your WLAN Pi
    • โš™๏ธInitial setup items
    • ๐Ÿ”ผDisplay and Buttons (FPMS)
    • Device USB Mode (OTG)
    • ๐Ÿ†•WebUI
      • ๐ŸŽขSpeed Test
      • ๐Ÿ”Network
      • ๐Ÿง‘โ€โœˆ๏ธCockpit
      • โŒจ๏ธTerminal
    • ๐Ÿ”ตBluetooth
    • ๐Ÿ“บSoftware Update
    • ๐Ÿ“”Quick Reference
    • โšกPowering Down
    • ๐Ÿ’ฌThe WLAN Pi Project
  • ๐Ÿ”ฆ2. Lab: Wi-Fi Scanner
    • ๐ŸšจKismet
      • ๐ŸงชKismet Lab
    • ๐ŸŽ‰Windows: WiFi Explorer Pro
    • ๐ŸmacOS: WiFi Explorer Pro 3
  • ๐Ÿค“3. Lab: Wi-Fi Frame Capture
    • โš™๏ธSetup Instructions
      • ๐ŸชŸWindows Setup
      • ๐ŸmacOS Setup
        • 1๏ธโƒฃ Wireshark (macOS)
        • 2๏ธโƒฃ Airtool 2
    • ๐ŸฆˆWireshark Resources
    • ๐ŸงชCapture Labs
      • ๐ŸคฏWireshark Lab
      • ๐ŸAirtool Lab
      • ๐Ÿ“ถBonus: Capture Different 6 GHz Frames
      • 7๏ธโƒฃ Bonus Capture Wi-Fi 7 Management Frames
    • ๐Ÿ“กCapture beacons in PCAP or CSV format
    • ๐Ÿ“ฑBonus: Capture using WLAN Pi and iPhone or iPad
    • ๐ŸŽBonus: Passwordless SSH using Public-Private Key Pairs
  • ๐Ÿ“Š4. Lab: WLAN Pi Grafana
    • ๐ŸงจStart Grafana
    • ๐Ÿ“ˆWeb-Based Wi-Fi Scanner
    • ๐Ÿ“‰Monitor Your Internet Connection
    • ๐Ÿ“ˆBuild Your Own WLAN Pi Health Dashboard
    • ๐Ÿ“ถSpectrum Analysis
  • 5. Lab: API into your Pi
    • Intro to the WLAN Pi API
    • Accessing the API
    • API access via Postman
    • Using the WLAN Pi API
    • Stop wpa_supplicant@wlan0
  • ๐Ÿ“ฒ6. Lab: The WLAN Pi App
    • Getting Started
    • Connect to your Pi
    • Explore the App
  • ๐Ÿ’ซ7. Lab: Wi-Fi Channel Tool (wifichannel)
  • ๐Ÿ“ถ8. Wi-Fi 6E and Wi-Fi 7 Client
    • โš™๏ธConnect as a client using wpa_supplicant
    • 7๏ธโƒฃ Bonus lab: Connect as a Wi-Fi 7 MLO client
    • ๐Ÿ“กBonus lab: Detect faulty antenna
  • ๐Ÿ”Ž9. Lab: Profiler
    • ๐ŸŽBonus Lab: Extra Profiler tasks
  • ๐Ÿš€10. Lab: Network Performance
    • โšกCLI Power Tools
    • โœ…Verify Wired Connection
    • โฌLibreSpeed
    • โฌOfficial Speedtest.net CLI Client
    • โฌiPerf3
      • Bonus Lab: Compile iPerf2 from source
  • ๐Ÿ“ก11. Lab: Hotspot Mode
  • ๐Ÿ–ฅ๏ธ12. Demo: Server Mode
  • ๐Ÿ“ฑ13. Demo: Tailscale
    • ๐ŸŽBonus Lab: Remote Access
  • ๐Ÿ”ง14. Demo: Wi-Fi Console Mode
Powered by GitBook
On this page
  • What is the WLAN Pi API?
  • System API
  • Utils API
  • Bluetooth API
  • Network API

Was this helpful?

Export as PDF
  1. 5. Lab: API into your Pi

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

  1. You may want to copy some data out of your Pi for a report or some further debugging

  2. 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.

  1. You need to use the Stop Service API to stop wpa_supplicant

  2. 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

Previous5. Lab: API into your PiNextAccessing the API

Last updated 1 month ago

Was this helpful?