GET_IP
Syntax
GET_IP
Description
Returns the IP address of the board and how it was obtained. At boot the board asks a DHCP server for an address; if none answers within 10 seconds it uses its fixed fallback address.
Response
IP <a.b.c.d> src=<source>
src | Meaning |
|---|---|
dhcp | Address assigned by a DHCP server. |
fallback | No DHCP answer: the board uses its fixed fallback address. |
static | Fixed address configured on the board. |
none | No address yet. |
Example
get_ip.py
from hmcls_udp import Board
board = Board("192.168.1.11")
print(board.query("GET_IP")[0]) # IP 192.168.1.11 src=fallback