From 620d0cda65ff41140a99e684681ee9ae03183c79 Mon Sep 17 00:00:00 2001 From: Andreas Gattringer <andreas.gattringer@univie.ac.at> Date: Tue, 16 Apr 2024 09:28:59 +0200 Subject: [PATCH] updated for testing --- programs/umnp-rhtp.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/programs/umnp-rhtp.py b/programs/umnp-rhtp.py index 6f0518e..ee04d85 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() -- GitLab