Resultados de

Hi all, don't upload data to Thingspeak (sorry my english) I'm build this counter geiger https://www.electronics-lab.com/project/new-improved-geiger-counter-now-wifi/ but not upload data, only appear this to my channel:
29T23:17:58Z","entry_id":112,"field1":null},{"created_at":"2022-03-29T23:22:58Z","entry_id":113,"field1":null},{"created_at":"2022-03-29T23:27:58Z","entry_id":114,"field1":null},{"created_at":"2022-03-29T23:32:58Z","entry_id":115,"field1":null},{"created_at":"2022-03-30T18:43:09Z","entry_id":116,"field1":null},{"created_at":"2022-03-30T19:00:19Z","entry_id":117,"field1":null},{"created_at":"2022-03-30T19:05:19Z","entry_id":118,"field1":null},{"created_at":"2022-03-30T19:10:19Z","entry_id":119,"field1":null}]}
The code I'm use is there https://www.electronics-lab.com/project/new-improved-geiger-counter-now-wifi/ sorry it does not allow me to upload it because it is long
I was testing some sensors using code that I've run before successfully on an Arduino device to update to thingspeak, but I keep getting the http error code -302.
if true % code #include <SPI.h> #include <WiFi101.h> #include <Wire.h> #include <secrets_new.h> #include <ThingSpeak.h> #include <SD.h>
char ssid[] = SECRET_SSID; // your network SSID (name)
WiFiClient client;
unsigned long myChannelNumber = SECRET_CH_ID; const char * myWriteAPIKey = SECRET_WRITE_APIKEY;
int soil_moisture_2cm = 0; int soil_moisture_5cm = 0; int soil_temperature_2cm = 0; int soil_temperature_5cm = 0;
void setup() { // put your setup code here, to run once: WiFi.setPins(8,7,4,2); Wire.begin(); delay(1000); Serial.begin(9600);
if (WiFi.status() == WL_NO_SHIELD) { Serial.println("Communication with WiFi module failed!"); // don't continue while (true); }
String fv = WiFi.firmwareVersion(); if (fv != "1.0.0") { Serial.println("Please upgrade the firmware"); }
ThingSpeak.begin(client);
}
void loop() {
if(WiFi.status() != WL_CONNECTED){ Serial.print("Attempting to connect to SSID: "); Serial.println(SECRET_SSID); while(WiFi.status() != WL_CONNECTED){ WiFi.begin(ssid); // Connect to WPA/WPA2 network. Change this line if using open or WEP network Serial.print("."); delay(5000); } Serial.println("\nConnected.");
}
soil_moisture_2cm = analogRead(A0); soil_moisture_5cm = analogRead(A1); soil_temperature_2cm = analogRead(A2); soil_temperature_5cm = analogRead(A3);
ThingSpeak.setField(1, soil_moisture_2cm); ThingSpeak.setField(2, soil_moisture_5cm);
ThingSpeak.setField(3, soil_temperature_2cm); ThingSpeak.setField(4, soil_temperature_5cm);
int y = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey); if(y == 200){ Serial.println("Channel 2 update successful."); }
else{ Serial.println("Problem updating channel 2. HTTP error code " + String(y)); } delay(30000); } end