Hallo,
mein Problem ist das sich mein Arduino Uno Wifi rev.2 zwar mit dem Internet verbinden kann, das allerdings wie mit einem Wackelkontakt. Manchmal verbindet er sich ganz schnell, manchmal aber auch gar nicht. Ich versuche mich mit dem Wlan der FRITZ!Box 7490 oder meinem Handyhotspot (Samsung Galaxy A55) zu verbinden. Bei beiden selbes Ergebnis. Habe schon lange im Netz nach Lösungen gesucht, und habe auch schon öfter von dieser Problematik gelesen, konnte aber keine Lösung finden.
Zu mir, ich haben erst wenig erfahrung mit arduinos, kennen mich aber schon soweit im Code aus, das ich ihn grob verstehe
#include <WiFiNINA.h>
#include "arduino_secrets.h"
#include "ThingSpeak.h" // always include thingspeak header file after other header files and custom macros
#include <Wire.h>
int ML8511Out = A0; //Daten vom sensor
int Ref_3V3 = A1; //Referenz-Messung 3.3V power vom Arduino board
char ssid[] = SECRET_SSID; // your network SSID (name)
char pass[] = SECRET_PASS; // your network password
int keyIndex = 0; // your network key Index number (needed only for WEP)
WiFiClient client;
unsigned long myChannelNumber = SECRET_CH_ID;
const char * myWriteAPIKey = SECRET_WRITE_APIKEY;
void setup() {
Serial.begin(115200); // Initialize serial
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo native USB port only
}
Serial.println("");
// check for the WiFi module:
if (WiFi.status() == WL_NO_MODULE) {
Serial.println("Communication with WiFi module failed!");
// don't continue
while (true);
}
ThingSpeak.begin(client); //Initialize ThingSpeak
Serial.print("Attempting to connect to SSID: ");
Serial.println(SECRET_SSID);
while(WiFi.status() != WL_CONNECTED){
WiFi.begin(ssid, pass); // Connect to WPA/WPA2 network. Change this line if using open or WEP network
Serial.print(".");
delay(5000);
}
Serial.println("\nConnected.");
}
void loop() {
int analogerUVWert = averageAnalogRead(ML8511Out);
int analogRefWert = averageAnalogRead(Ref_3V3);
float MesswVolt = analogerUVWert * 3.3 / analogRefWert;
float uvIntensity = mapfloat(MesswVolt, 0.99, 2.8, 0.0, 15.0); //Konvertiere von Volt nach UV-Index
Serial.print("UV-Wert: ");
Serial.print(uvIntensity);
Serial.println("");
// Connect or reconnect to WiFi
if(WiFi.status() != WL_CONNECTED){
Serial.print("Attempting to connect to SSID: ");
Serial.println(SECRET_SSID);
while(WiFi.status() != WL_CONNECTED){
WiFi.begin(ssid, pass); // Connect to WPA/WPA2 network. Change this line if using open or WEP network
Serial.print(".");
delay(5000);
}
Serial.println("\nConnected.");
}
// Write to ThingSpeak. There are up to 8 fields in a channel, allowing you to store up to 8 different
// pieces of information in a channel. Here, we write to field 1.
int x = ThingSpeak.writeField(myChannelNumber, 1, uvIntensity, myWriteAPIKey);
if(x == 200){
Serial.println("Channel update successful.");
}
else{
Serial.println("Problem updating channel. HTTP error code " + String(x));
}
delay(60000); // Wait 20 seconds to update the channel again
}
int averageAnalogRead(int pinToRead) {
byte numberOfReadings = 8;
unsigned int runningValue = 0;
for (int x = 0; x < numberOfReadings; x++)
runningValue += analogRead(pinToRead);
runningValue /= numberOfReadings;
return (runningValue);
}
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
Im englischen Teil des Forum müssen die Beiträge und Diskussionen in englischer Sprache verfasst werden.
Deswegen wurde diese Diskussion in den deutschen Teil des Forums verschoben.
Na ja wen man viel Geld ausgibt möchte man schon dass das funktioniert, nur wie oft im Leben, was viel kostet muss nicht sofort besser sein.
Das NINA Modul was ist verbaut auf dem UNO WIFI Rev.2 hat ein ESP32 on Board genau ESP32 LX6 Dual Core MCU, nur wahrscheinlich wurde was falsch gemacht, das die Unos so oft Probleme mit BLE und WIFI machen. @flogae Ich wurde versuchen den als "normalen" ESP32 Dev Module oder WROM ansprechen, ob funktioniert weiß nicht.
Was mir gar nicht gefällt auf dem Uno ist die Angabe DC Current for 3.3V Pin 50 mA Damit kann kein ESP, egal welscher nicht auskommen, oder bin auf falschem Dampfer?
Ach...., dazu habe ich einen (evtl.) guten bis brauchbaren Tipp:
Vor dem Kauf genaustens über das Produkt Informationen einholen.
Und nicht alles glauben, was so im Internet steht.
na wenn das der einzige Grund ist. Jeder wie er mag.
Ich dachte es gäbe vielleicht echte Zwänge, wie z.B. die Schule will das unbedingt.
Meiner Meinung sind die Nerven und Zeit für dieses Board es nicht wert. Nimm ein Makerboard mit einem ESP32 und das Wifi wird auch bei dir stabil laufen.
Danke schonmal für eure Antworten. Ich habe das board gewählt weil es im Gegensatz zu den esp boards mehrere analoge Pins hat. Ich brauche min. 2, um einen UV Sensor anzuschließen. Ich könnte das board schon wechseln und weiß auch dass es mit esps besser geht, hab aber kein anderes Board gesehen.
Und solltest du mit den analogen Pins am ESP nicht auskommen, egal ob es der ESP8266 oder ein ESP32 ist, kannst du die problemlos mittels ads1115 per I2C erweitern.
Dann frage ich mal, warum du keinen ESP genommen hast ?
Das Wichtige hat dir noiasca ja schon geschrieben. Was du dir allerdings auch noch merken kannst, es ist kein Arduino, sondern ein "ESP32 NodeMCU", der mittels Arduino IDE programmiert werden kann.