Ethernet Examples

Using the PyEthernet adapter on the Pygate board, we are able to connect to the local area network. The Ethernet functionality works separately from the PoE (Power over Ethernet) feature and works without a PoE power injector attached.

Note: Make sure you have flashed the SG Wireless firmware to your -py board!

from network import ETH
import time
import socket

eth = ETH()

while not eth.isconnected():
    print(".", end='')

print(socket.getaddrinfo("", 80))

Note: If you get the error Expected Device ID 0x8870, got 0x0, your PoE module is not plugged in (correctly)