diff --git a/programs/umnp-rhtp.py b/programs/umnp-rhtp.py index 6f0518e2bc9b7ddeb44b1d06dd72f4c055f9c46e..ee04d853faf924642d02d829e16d6c4b9ee083d2 100644 --- a/programs/umnp-rhtp.py +++ b/programs/umnp-rhtp.py @@ -22,7 +22,6 @@ async def aggregate_and_send( device: MeasurementDevice, sht45: SHT45, p_sensor: LPS28DFW ): comm = device.communicator - t, rh = await sht45.measure() p, p_t = await p_sensor.measure() data = f"{t},{rh},{p},{p_t}" @@ -37,10 +36,21 @@ async def main(): 0, 2_000_000, mosi=machine.Pin(19), miso=machine.Pin(16), sck=machine.Pin(18) ) - i2c = machine.I2C(id=1, scl=machine.Pin(27), sda=machine.Pin(26)) + i2c = machine.I2C(id=1, scl=machine.Pin(5), sda=machine.Pin(4)) ether = EthernetW5500( - spi, machine.Pin(17), machine.Pin(20), mac=device.generated_mac_raw(), dhcp=True + spi, + machine.Pin(17), + machine.Pin(20), + mac=device.generated_mac_raw(), + dhcp=False, ) + + ip = "192.168.0.33" # IP of computer with receiver software FIXME name + subnet_mask = "255.255.255.0" # ... + gateway = "192.168.0.1" # ... + dns = "192.168.0.2" # technically not necessary + + ether.set_network(ip, subnet_mask, gateway, dns) device.add_network_adapter(ether) comm = device.create_communicator()