Ulrich Engel in Discussions
上次活动时间: 2021-3-24

Hallo,ich bin Anfänger und nutze ThingSpeak um meine Wetterdaten (ESP8266 mit BME280 Sensor) und meine Feinstaubdaten (ESP8266 und PMS5003) anzuzeigen. Der erste ESP überträgt Temperatur, Luftfeuchte und Luftdruck in die Felder 1-3 bei ThingSpeak und der zweite ESP die Feinstaubwerte in die Felder 5-7 bei ThingSpeak. Alle 30 Sekunden werden jeweils Daten geschickt. Im Serial Monitor erfolgt die Übertragung wie geplant im Programm. Mein Problem: Die Ausgabe in ThingSpeak enthält viele Aussetzer. Es gehen Daten verloren und werden nicht angezeigt. Freue mich über Rückmeldungen. Ulli ThingSpeak Wetterdaten und Luftqualität Are you using the <https://github.com/mathworks/thingspeak-arduino ThingSpeak Library> ? What are you seeing on the serial monitor? Are both devices posting to the same channel? If two devices post to the same channel on a free account, there may be collisions that cause your data to be lost. We recommend one channel per device. esp8266 bme280 pms5003
Yash Mehta in MATLAB Answers
上次活动时间: 2020-8-20

I need help with weatherstation code. I am new to ThingsSpeak. i have set up this code for bme280 to monitor room temprature. I have no idea what configure haeader and connection address is. i have highlited it in the code below please help me . import time from w1thermsensor import W1ThermSensor import board import busio import adafruit_bme280 i2c = busio.I2C(board.SCL, board.SDA) bme = adafruit_bme280.Adafruit_BME280_I2C(i2c) #import adafruit_ads1x15.ads1015 as ADS #from adafruit_ads1x15.analog_in import AnalogIn import RPi.GPIO as GPIO import urllib import http.client key = "*MY KEY" interval = 5 #How long we want to wait between loops (seconds) while True: time.sleep(interval) #Pull Temperature from DS18B20 # temperature = ds18b20.get_temperature() #Pull temperature from BME280 temperature = bme.temperature #Pull pressure from BME280 Sensor & convert to kPa pressure_pa = bme.pressure pressure = pressure_pa / 10 #Pull humidity from BME280 humidity = bme.humidity #Print the results # print( 'Temperature: ' , temperature) # print( 'Humidity: ' , humidity, '%') # print( 'Pressure: ' , pressure, 'kPa') # print( ' ') params = urllib.parse.urlencode({'field1' : temperature, 'field2' : humidity, 'field3' : pressure}) ####Configure header / connection address### headers = {"Content-typZZe": "application/x-www-form-urlencoded","Accept": "text/plain"} conn = http.client.HTTPConnection("api.thingspeak.com/update:80") #Try to connect to ThingSpeak and send Data try: conn.request("POST", "/update", params, headers) response = conn.getresponse() print( response.status, response.reason) data = response.read() conn.close() #Catch the exception if the connection fails except: print( "connection failed")

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.