Results for
Hi there,
I am attempting to obtain a location history (thus the location of each of the previous messages recived) and the current location of my device on Thingspeak. I have not found any examples of how to do this on Thingspeak. Please may someone guide me or advise me on how to do this.
Thank you
Hi there, I have been attempting to try and access the loaction of my device using the following code:
myChannel=*******;
ReadAPIKey='xxxxxxxxxxxx';
myData=thingSpeakRead(myChannel,'ReadKey', ReadAPIKey,'numpoints',100,'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;
I have about 100 entry points at this stage. However, i get the following error:
Error using .
Unrecognized table variable name 'lat'.
Error in Custom (no starter code) 2 (line 7)
myMap=geoscatter(myData.lat,myData.long,15,myVector,'filled');
I am attempting to access the location of a moving device. Meaning, the longitude and latitude values will be constantly changing, thus, I do not want to set my latitude or longitude value as a constant but i want it to keep on updating as my device moves around. How would I do this? How would I ammend this error without setting the "lat" or "long" as a consant before hand?
Further, my device should be constantly sending messages, this, the number of entries to which it will see the location of will be contantly changing. How can I thus not set the entry points as a specific value but rather have it update as my device sends messags?
Is there an easier or better way to do this?
Thanks
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.
Kindly assist I have been trying to create a small weather station with with DHT11 sensor and CC3200 launchpad and connect it to ThingSpeak but the code won't compile as I am using an Arduino code.
Anyone to please help
if true #include <SPI.h> #include <WiFi.h> #include <WiFiClient.h> #include <DHT.h> // Including library for dht
String apiKey = ""; // Enter your Write API key from ThingSpeak
const char *ssid = "Virus"; // replace with your wifi ssid and wpa2 key const char *pass = ""; const char* server = "api.thingspeak.com";
#define DHTPIN 11 //pin where the dht11 is connected
#define DHT dht(DHTPIN, DHT11);
WiFiClient client;
void setup() { Serial.begin(115200); delay(10); dht.begin();
Serial.println("Connecting to "); Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected");
} void loop() {
float h = dht.readHumidity(); float t = dht.readTemperature();
if (isnan(h) || isnan(t)) { Serial.println("Failed to read from DHT sensor!"); return; }
if (client.connect(server,80)) // "184.106.153.149" or api.thingspeak.com {
String postStr = apiKey; postStr +="&field1="; postStr += String(t); postStr +="&field2="; postStr += String(h); postStr += "\r\n\r\n";
client.print("POST /update HTTP/1.1\n"); client.print("Host: api.thingspeak.com\n"); client.print("Connection: close\n"); client.print("X-THINGSPEAKAPIKEY: "+apiKey+"\n"); client.print("Content-Type: application/x-www-form-urlencoded\n"); client.print("Content-Length: "); client.print(postStr.length()); client.print("\n\n"); client.print(postStr);
Serial.print("Temperature: "); Serial.print(t); Serial.print(" degrees Celcius, Humidity: "); Serial.print(h); Serial.println("%. Send to Thingspeak."); } client.stop();
Serial.println("Waiting...");
// thingspeak needs minimum 15 sec delay between updates delay(1000); } end