Code: Select all
>>> sta_if = network.WLAN(network.STA_IF)
>>> sta_if.active(True)
True
>>> sta_if.ifconfig(('192.168.10.99', '255.255.255.0', '192.168.10.1', '8.8.8.8'))
>>> sta_if.isconnected()
False
>>>
Code: Select all
>>> sta_if = network.WLAN(network.STA_IF)
>>> sta_if.active(True)
True
>>> sta_if.ifconfig(('192.168.10.99', '255.255.255.0', '192.168.10.1', '8.8.8.8'))
>>> sta_if.isconnected()
False
>>>
1) what is the format for ESPNow.send for a ESP8266?import network
w0 = network.WLAN(network.STA_IF)
w0.active(True)
.. method:: ESPNow.send(mac, msg, [sync=True]) (ESP32 only)
ESPNow.send(msg) (ESP32 only)
Send the data contained in ``msg`` to the peer with given network ``mac``
address. In the second form, ``mac=None`` and ``sync=True``.
Arguments:
- ...
- ``True``: (default) send ``msg`` to the peer and wait for a response
(or not). Returns ``False`` if any peers fail to respond.
- ``False`` handover ``msg`` to the esp_now software stack for
transmission and return immediately.
Responses from the peers will be discarded.
Always returns ``True``.