openmv/scripts/examples/Arduino/Portenta H7/38-Ethernet/peer_to_peer.py
2021-01-07 00:44:59 +02:00

16 lines
335 B
Python

# Ethernet LAN Peer to Peer example.
# On the PC try the following:
#
# $> sudo ifconfig eth0 192.168.1.102 up
# $> ping 192.168.1.102
import network, time
lan = network.LAN()
lan.active(True)
lan.ifconfig(('192.168.1.100', '255.255.255.0', '192.168.1.1', '192.168.1.1'))
while (True):
# Nothing else to do.
time.sleep(1.0)