Hallo @Andreas,
danke für die schnelle Antwort. Meine aktuelle Settings.py sieht so aus:
"""Datalogger configuration"""
# General settings.
main = {
# Measurement interval in seconds.
# TODO: Please note this is not the _real thing_ yet at it will just use
# this value to apply to ``time.sleep()`` after each duty cycle.
'interval': 2.0,
# Whether to use deep sleep between measurement cycles.
'deepsleep': False,
# Configure logging.
'logging': {
# Enable or disable logging completely.
'enabled': True,
# Log configuration settings at system startup.
'configuration': True,
},
# Configure Watchdog.
'watchdog': {
# Enable or disable Watchdog completely.
'enabled': False,
# Watchdog timeout in milliseconds.
'timeout': 20000,
},
# Configure RGB-LED.
'rgb_led': {
'heartbeat': True,
},
}
# Interface settings.
interfaces = {
'uart0': {
'terminal': True,
}
}
# Networking configuration.
networking = {
'wifi': {
# WiFi stations to connect to in STA mode.
'stations': [
# Variant 1: Use DHCP.
# Variant 1a: Straight forward.
{'ssid': 'Speedy_Gonzales', 'password': '{redacted}'},
# Variant 1b: Configure timeout (default: 15 seconds).
# Configure this to decrease or increase the maximum time in
# seconds to wait for the connection to succeed.
#{'ssid': 'FooBar', 'password': 'SECRET', 'timeout': 5.0},
# Variant 2: Using static IP address.
#{
# 'ssid': 'FooBar',
# 'password': 'SECRET',
# # Use static network configuration (ip, subnet_mask, gateway, DNS_server).
# 'ifconfig': ('192.168.42.42', '255.255.255.0', '192.168.42.1', '192.168.42.1'),
#},
],
},
}
# Telemetry configuration.
telemetry = {
'targets': [
# Hiveeyes telemetry: JSON over MQTT
{
# Enable/disable this telemetry target.
'enabled': True,
# Define telemetry endpoint and address information.
'endpoint': 'mqtt://swarm.hiveeyes.org',
'topology': 'mqttkit',
'address': {
"realm": "hiveeyes",
"network": "testdrive",
"gateway": "Waggi-micropyton",
"node": "FiPY-Test",
},
},
# Beep telemetry: JSON over HTTP
{
# Enable/disable this telemetry target.
'enabled': True,
# Define telemetry endpoint and address information.
'endpoint': 'https://bee-observer.org/api/sensors',
'topology': 'beep-bob',
'data': {
'key': '{redacted}',
},
},
],
}
# Sensor configuration.
sensors = {
'system': {
# Adjust voltage divider resistor values matching the board.
#
# See also
# - https://forum.pycom.io/topic/3776/adc-use-to-measure-battery-level-vin-level
# - https://github.com/hiveeyes/hiveeyes-micropython-firmware/issues/5
# - https://community.hiveeyes.org/t/batterieuberwachung-voltage-divider-und-attenuation-fur-microypthon-firmware/2128
#
# As a reference (all readings using 6dB attenuation unless otherwise noted):
#
# - Pycom Expansion board v3.0: 115 kΩ / 56 kΩ
# - Pycom Expansion board v3.1: 1 MΩ / 1 MΩ
# - Pycom Expansion board v3.2: 1 MΩ / 1 MΩ
# - BOB-HAT-V5: 1 MΩ / 470 kΩ or 220 kΩ
# - BOB-SHIELD: 10 MΩ / 2 MΩ
# - Air Quality monitor: 100kΩ / 47 kΩ, measured with 2.5dB attenuation
# These settings are matching the resistor values of the Pycom Expansion Board 3.1 and 3.2.
'vcc': {
'pin': 'P16',
# Main resistor value (R1).
'resistor_r1': 1000,
# Resistor between input pin and ground (R2).
'resistor_r2': 1000,
},
# Settings for button events, e.g. through touch pads.
'buttons': {
'enabled': False,
},
},
'registry': {
'hx711': {
'address': 0x00,
'pin_dout': 'P22',
'pin_pdsck': 'P21',
'scale': 3.1592,
'offset': -3159.0,
},
'ds18x20': {
'bus': 'onewire:0',
},
'bme280': {
'bus': 'i2c:0',
'address': 0x77,
},
},
'busses': [
{
"family": "i2c",
"number": 0,
"enabled": True,
"pin_sda": "P9",
"pin_scl": "P10",
},
{
"family": "onewire",
"number": 0,
"enabled": True,
"pin_data": "P11",
},
]
}
# Map sensor field names to telemetry field names.
# Right now, please adapt this according to your sensor configuration by
# looking at the console output of the line
# `[terkin.datalogger] INFO: Sensor data`. Thanks!
#
# Remark:
# This will be replaced by runtime configuration through
# HTTP API and captive portal.
sensor_telemetry_map = {
"_version": "1.0.0",
"temperature.0x77.i2c:0": "t",
"humidity.0x77.i2c:0": "h",
"pressure.0x77.i2c:0": "p",
"weight.0": "weight",
"temperature.282df57997040326.onewire:0": "t_i_1",
"temperature.28d5f979970403d4.onewire:0": "t_i_2",
"temperature.28becd7997040374.onewire:0": "t_i_3",
"temperature.282657799704036e.onewire:0": "t_i_4",
"temperature.2863e879970403d0.onewire:0": "t_i_5",
"temperature.284ba979970403e3.onewire:0": "t_i_6",
"system.temperature": "t_i_7",
}
Und hier ein eine Kopie aus meinem Log:
rature.2863e879970403d0.onewire:0': 22.0, 'scale.0.kg': -47003.88, 'system.wifi.rssi': -60, 'system.wifi.country': 'DE', 'temperature.284ba979970403e3.onewire:0': 22.625, 'system.time': 2097, 'scale.0.offset': -3159.0, 'system.wifi.channel': 6, 'humidity.0x77.i2c:0': 53.32, 'temperature.28becd7997040374.onewire:0': 22.3125, 'system.memfree': 2391536, 'temperature.28d5f979970403d4.onewire:0': 22.5625, 'system.voltage': 1.642, 'scale.0.raw': -151653.7, 'pressure.0x77.i2c:0': 1002.46, 'weight.0': -47003.88, 'scale.0.scale': 3.1592, 'system.wifi.max_tx_power': 78, 'system.wifi.bandwidth': 2, 'system.uptime': 2097.534, 'system.runtime': 2082, 'temperature.282df57997040326.onewire:0': 22.875}
2104.3203 [terkin.telemetry ] DEBUG : MQTT topic: hiveeyes/testdrive/Waggi-micropyton/FiPY-Test/data.json
2104.3365 [terkin.telemetry ] DEBUG : MQTT payload: {"temperature.282657799704036e.onewire:0": 23.125, "temperature.0x77.i2c:0": 22.63, "system.temperature": 29.82608, "temperature.2863e879970403d0.onewire:0": 22.0, "scale.0.kg": -47003.88, "system.wifi.rssi": -60, "system.wifi.country": "DE", "temperature.284ba979970403e3.onewire:0": 22.625, "system.time": 2097, "scale.0.offset": -3159.0, "system.wifi.channel": 6, "humidity.0x77.i2c:0": 53.32, "temperature.28becd7997040374.onewire:0": 22.3125, "system.memfree": 2391536, "temperature.28d5f979970403d4.onewire:0": 22.5625, "system.voltage": 1.642, "scale.0.raw": -151653.7, "pressure.0x77.i2c:0": 1002.46, "weight.0": -47003.88, "scale.0.scale": 3.1592, "system.wifi.max_tx_power": 78, "system.wifi.bandwidth": 2, "system.uptime": 2097.534, "system.runtime": 2082, "temperature.282df57997040326.onewire:0": 22.875}
2104.5134 [terkin.telemetry ] INFO : Sending HTTP request to https://bee-observer.org/api/sensors
2104.5275 [terkin.telemetry ] DEBUG : Payload: {"t_i_4": 23.125, "p": 1002.46, "t_i_1": 22.875, "t_i_2": 22.5625, "t_i_3": 22.3125, "h": 53.32, "t_i_6": 22.625, "weight": -47003.88, "t_i_7": 29.82608, "key": "{redacted}", "t_i_5": 22.0, "t": 22.63}
2106.8265 [terkin.datalogger ] INFO : Telemetry status: SUCCESS (2/2)
2106.9696 [terkin.device ] INFO : Entering light sleep for 2.0 seconds
2108.9814 [terkin.datalogger ] INFO : --- loop ---
2108.9942 [terkin.datalogger ] INFO : Reading 8 sensor ports
2109.0057 [terkin.datalogger ] INFO : Reading sensor port "SystemMemoryFree"
2109.0868 [terkin.datalogger ] INFO : Reading sensor port "SystemTemperature"
2109.2250 [terkin.datalogger ] INFO : Reading sensor port "SystemBatteryLevel"
2109.2470 [terkin.sensor.system ] DEBUG : Reading battery level on pin P16 with voltage divider 1000/1000
2109.3535 [terkin.sensor.system ] DEBUG : SystemBatteryLevel: Mean of ADC readings (0-4095) = 1630.3400039672852
2109.3714 [terkin.sensor.system ] DEBUG : SystemBatteryLevel: Mean of ADC voltage readings (0-1899mV) = 819.9999809265137
2109.3900 [terkin.sensor.system ] DEBUG : SystemBatteryLevel: Variance of ADC readings = 16.3727703094482
2109.4081 [terkin.sensor.system ] DEBUG : SystemBatteryLevel: 10**6*Variance/(Mean**2) of ADC readings = 6.0000000000000
2109.4301 [terkin.sensor.system ] DEBUG : Battery level: 1.64
2109.4496 [terkin.datalogger ] INFO : Reading sensor port "SystemUptime"
2109.4687 [terkin.datalogger ] INFO : Reading sensor port "SystemWiFiMetrics"
2109.4911 [terkin.datalogger ] INFO : Reading sensor port "HX711Sensor"
2111.6648 [terkin.datalogger ] INFO : Reading sensor port "DS18X20Sensor"
2120.9829 [terkin.datalogger ] INFO : Reading sensor port "BME280Sensor"
Wenn ich noch mit weiteren Daten zur Lösung beitragen kann, dann gib mir bitte Bescheid.
Gruß
Andreas