_images/alpaca128.png

Alpaca Device Server Discovery

This module provides Alpaca device server discovery service. Search your local network segment (or VLAN) for Alpaca device servers, returning a list consisting of ipaddress:port strings for each one found. Each Alpaca device server may provide access to multiple Alpaca device types, and multiple Alpaca devices of a given type.

Note

Use the Alpaca Device Server Management functions to learn the details of the served device(s). See the example there.

Example:

from alpaca import discovery

svrs = discovery.search_ipv4()  # Note there is an IPv6 function as well
print(svrs)

Output:

['127.0.0.1:32323', '192.168.1.12:11111', '192.168.1.31:11111']

This example shows one Alpaca server on the local host, two Alpaca servers on the LAN.

alpaca.discovery.search_ipv4(numquery: int = 2, timeout: int = 2) List[str]

Discover Alpaca device servers on the IPV4 LAN/VLAN

Returns a list of strings of the form ipaddress:port, each corresponding to a discovered Alpaca device server. Use Alpaca Device Server Management functions to enumerate the devices.

Parameters:
  • numquery – Number of discovery queries to send (default 2)

  • timeout – Time (sec.) to allow for responses to each discovery query. Optional, defaults to 2 seconds.

Raises:

To be determined.

Note

  • This function uses IPV4

  • UDP protocol restricted to the LAN/VLAN is used to perform the query.

  • Adapters which show an APIPA address (169.254.*.*) are skipped in order to avoid a guaranteed timeout trying to receive the datagram replies. See Why Do I Have the 169.254 IP Address?

  • See section 4 of the Alpaca API Reference for Discovery details.

alpaca.discovery.search_ipv6(numquery: int = 2, timeout: int = 2) List[str]

Discover Alpaca device servers on the IPV6 LAN/VLAN

Returns a list of strings of the form [ipv6address%intfc]:port, each corresponding to a discovered Alpaca device server. Use Alpaca Device Server Management functions to enumerate the devices.

Parameters:
  • numquery – Number of discovery queries to send (default 2)

  • timeout – Time (sec.) to allow for responses to the discovery query. Optional, defaults to 2 seconds.

Raises:

To be determined.

Note

  • This function uses IPV6

  • UDP protocol, restricted link-local addresses to the LAN/VLAN attached to each interface, is used to perform the query. Does not query global IPv6.

  • ISATAP addresses are specifically excluded.

  • See section 4 of the Alpaca API Reference for Discovery details.