George in Discussions
上次活动时间: 2022-12-10

Hi there, I am trying to reach out to anyone who has successfully completed the project of building a weather station using an Arduino MKRFOX1200 board, a dht11 sensor across the Sigfox and Thingspeak networks. I’ve been attempting to build the weather station over the SigFox and things.io network for over a year now but I was unsuccessful. I then found this tutorial on how to build this using Thingspeak: https://create.arduino.cc/projecthub/masteruan/arduino-mkr-fox-1200-sigfox-meteo-station-423609 . I have now been attempting to build it using this network but am still unsuccessful. My SigFox and arduino is working. I made the arduino code convert temperature to Celsius (rather than Kelvin which is what the tutorial does). However, I am unable to access the location of the device on Thingspeak (my SigFox atlas is activated) and I am getting humidity values of approximately -30k. Please may someone assist me or give me a detailed approach on how to fix these issues. My goal is to have my thingspeak like this: https://thingspeak.com/channels/227248. I have followed the tutorial and projecthub but I cannot figure out why I am obtaining a confusing humidity reading. Please please may someone help. Thank you so much for your time. Weather station using dht11 sensor, Thingspeak and Sigfox This sounds like a hardware problem more than a ThingSpeak problem. You could try the projecthub if they have a forum or perhaps Arduino, though that is a stretch again since the problem seems to be with the sensor. I recomend drastic simplification. Write a program to read the sensor from your Arduino and output it to the serial monitor. Once you have that working, add another layer of complexity one at a time. Hi there, that makes sense, I will do that, thank you. However, I also wanted to know if you knew how to sned the location of the device per reading from Sigfox to Thingspeak (my Sigfox Atlas is enabled). I have found sources to do this with thethings.io but i am unsure on how to do it using thingspeak. When i try to do the "channel location" option on thingspeak, it gives me a default poaition og Lat.=0 and Long.=0. However, on my "device" tab on Sigfox, i can see a pretty accurate computed location of where my device is. How do I send this to Thingspeak? I am unsure on how to create a callback for this. Please may you assist if you can. Thank you The channel location is the base location of the device, such as your business or home. The device location parameters are in the channel feed data. See the Write data documentation for the parameters. https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxx&field1=10&lat=40.2&long=50.1&elevation=200 Here is code to create a map from that data. You can create a MATLAB visualization to run this code and add it to your channel. Note the change from the word alititude to elevation. I modified this code from a different application, so if you get errors please let me know so I can fix it. myChannel=999999999999999; ReadAPIKey='xxxxxxxxxxxxxxxx'; myData=thingSpeakRead(myChannel,'ReadKey', ReadAPIKey,'numpoints',260,'outputformat','timetable','location',1); myVector=(myData.Latitude).^2+(myData.Longitude).^2+myData.Altitude.^2; maxVector=max(myData.Latitude)^2+max(myData.Longitude)^2+max(myData.Altitude)^2; myVector=myVector/maxVector; myMap=geoscatter(myData.lat,myData.long,15,myVector,'filled'); geobasemap('satellite'); colormap jet; %ax=gca; %ax.ZoomLevel=15; %probably dont need this since scale is set above Thank you very much for this helpful response. Will this line of code (https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxx&field1=10&lat=40.2&long=50.1&elevation=200) be the Sigfox callback? Also, when running the MATLAB visualization code, i get the following error: "Channel ID must be a positive integer." . However, I do not see where my Channel ID is being used (nor where it could be a negative or not an integer). How could i ammend this? Or where is it reading my channel ID? Sorry, I've never used Sigfox, I probably should check it out. If you find out, please let us know. Regarding the error the channel ID is the first line in the code. The channel ID must exist. myChannel=999999999999999; Channel 999999999999999 does not exist. Change it to your channel ID. Also be sure to change the Read API key. So where would the line: "https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxx&field1=10&lat=40.2&long=50.1&elevation=200" be used? As previously I would have assumed it to be a SigFox callback And I see, thank you. I got this error: "Warning: 'Unable to read 260 points as requested. Only 68 points available in the channel. Error using . Unrecognized table variable name 'lat'." Where could I change the number of points? Would it affect the output? Also, where can i define the variable "lat"? sigfox thingspeak mkrfox1200 dht11 location arduino humidity weather station
Martino Bertagnoli in Discussions
上次活动时间: 2022-10-19

I receive and visualize data from my weather station. (This is my channel: https://thingspeak.com/channels/1700157). I want to know and show the date of last time it rained. How can i do it? The data are updated every 15 minutes. Show last time it rained Use a MATLAB analysis to read the channel every day (or however often you want to see the last time it rained). First read the last time it rained, perhaps you could store it in the matadata field for you channel (see thec channel info read API and write channel API). Then read the rainfall data from the channel and find out the last time it was positive. Then compare that to the data you read from the meta data field and rewrite if the new value is more recent. You can use the timecontrol app to run the code as often as you want to check. You can create a MATLAB visualization to show the data from the last time it reained in a figure window, perhaps using the test() command. I was going to suggest using the status field for you channel, but if you write to the status asynchronously compared to the weather data, it will create gaps in your other channel data. Thanks. I created a MATLAB analysis to read the field of the rain. It checks the value and it decides if write it in another field. In MATLAB visualization, It reads when the last value was written. I also created a Time Control to run the code. It works good. Excellent! I appreciate that you let us know you got it working. Just keep in mind if you write to another field in the same channel, the other fields get null entries. You could consider using another channel to record the rain data and then showing it on the weather channel using a custom visualization. Yes, I write in a field, that it hasn't other entries. I replaced the Time Control with a React, so the code runs every time I receive a new data from the weather station. weather station rain
Lutfi Can Koseoglu in MATLAB Answers
上次活动时间: 2021-6-4

Wireless Weather Station - ThingSpeak IoT Hello, I want to make a weather forecast for the next 3 days using the data I received from my sensors on the thingsspeak server I gave the link above, how can I do this? I need to do it with mathlab code in Thingsspeak system but I am very new to Mathlab. Thanks for your help.
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")
Pavel Roslovets in File Exchange
上次活动时间: 2017-5-12

Standalone Arduino Weather Station that's uploading data directly to ThingSpeak

关于 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.