Arduino kodunda veriyi firebase gönderirken istediğim şekilde olurken MIT app uygulamasına gönderirken kod doğru görünmüyor.
int h = dht.readHumidity();
int t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
timeClient.update();
String day = daysOfTheWeek[timeClient.getDay()];
String formattedTime = timeClient.getFormattedTime();
String formattedDayTime = String(day) + String(",") + String(formattedTime);
String fireHumid = formattedDayTime + String(": Nem: ") + String(h) + String("%");
String fireTemp = formattedDayTime + String(": Sicaklik: ") + String(t) + String("C");
uygulamada bu şekilde gösteriyor.
TIMAI2
April 9, 2024, 10:58am
2
Show your firebase console data and your blocks
firebasedeki veri mıt appden görülmüyor
TIMAI2
April 9, 2024, 12:38pm
5
Your blocks are doing everything expected of them, returning the value stored under the tag.
If you want to show the tag as well, then join the tag and value blocks (with a :
?)
nereyi değiştireceğimi anlamadım. görselde belirtebilir misiniz?
int h = dht.readHumidity();
int t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
timeClient.update();
String day = daysOfTheWeek[timeClient.getDay()];
String formattedTime = timeClient.getFormattedTime();
String formattedDayTime = String(day) + String(",") + String(formattedTime);
String fireHumid = formattedDayTime + String(": Nem: ") + String(h) + String("%");
String fireTemp = formattedDayTime + String(": Sicaklik: ") + String(t) + String("C");
blok diyagramını değiştirdim fakat "," karakterinden sonrası gözükmüyor.
TIMAI2
April 15, 2024, 8:24pm
10
I believe the problem is caused by the values on Firebase not being inside two sets of ""double quotes""
, because the data is not sent to firebase by the app.
Are you able to add another set of double quotes around your values when creating them?
(You could do this manually to one value in order to test if that is indeed the problem)
String formattedDayTime = ""String(day) + String(",") + String(formattedTime)"";
String fireHumid = ""formattedDayTime + String(": Nem: ") + String(h) + String("%")"";
String fireTemp = ""formattedDayTime + String(": Sicaklik: ") + String(t) + String("C")"";
kod bu şekilde mi olacak?
"" koyduğumuzda kod hata veriyor. bence blok diyagramını doğru yapamıyorum. firebasedeki verileri düzgün çekebilmek için blok diyagramını nasıl yapmalıyım?
maalesef uygulamada değişim olmadı.
TIMAI2
April 16, 2024, 11:39am
15
Works OK for me:
I added the extra double quotes in the Firebase console to the NEM value only, to show the difference.
firebase consoledan manuel olarak "" karakteri koyuca veri görünüyor fakat kodda "" karakterini nasıl koyacağız?
TIMAI2
April 16, 2024, 3:28pm
17
If you cannot do it when you store your data to firebase, then you will need to use the web component to interact with firebase.
INTRO
UPDATE (APR 2022)
Google appear to have recently updated the realtime database, can't find any release notes about the changes that affect this guide. Everything should still work, but the returns in responseContent may be slightly different,...
You may lose the option to use dataChanged event that way....