Skip to content
Snippets Groups Projects
Commit 620d0cda authored by Andreas Gattringer's avatar Andreas Gattringer
Browse files

updated for testing

parent 24dc1243
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,6 @@ async def aggregate_and_send( ...@@ -22,7 +22,6 @@ async def aggregate_and_send(
device: MeasurementDevice, sht45: SHT45, p_sensor: LPS28DFW device: MeasurementDevice, sht45: SHT45, p_sensor: LPS28DFW
): ):
comm = device.communicator comm = device.communicator
t, rh = await sht45.measure() t, rh = await sht45.measure()
p, p_t = await p_sensor.measure() p, p_t = await p_sensor.measure()
data = f"{t},{rh},{p},{p_t}" data = f"{t},{rh},{p},{p_t}"
...@@ -37,10 +36,21 @@ async def main(): ...@@ -37,10 +36,21 @@ async def main():
0, 2_000_000, mosi=machine.Pin(19), miso=machine.Pin(16), sck=machine.Pin(18) 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( 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) device.add_network_adapter(ether)
comm = device.create_communicator() comm = device.create_communicator()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment