ESP32 | FLUTTER | FIREBASE - Temperature & Humidity Check App
HTML-код
- Опубликовано: 6 окт 2024
- Flutter is Google's mobile app SDK for crafting high-quality native interfaces on iOS and Android in record time.
In this video, I show you how to make Flutter application with ESP32 to get the sensor data through Firebase realtime DB.
I hope you like this video.
[Firebase Realtime Database Arduino Library for ESP32]
github.com/mob...
[HTTPClientESP32Ex]
github.com/mob...
[Get SHA1 fingerprint certificate in Android Studio]
stackoverflow....
[Flutter]
flutter.dev/
[Flutter Package]
pub.dev/flutter
[Fix: Google Sign-in 12500 Error]
stackoverflow....
[Project Github Link]
github.com/001...
Music:
Music provided by NoCopyRightSounds from RUclips.
#ESP32 #Arduino #Flutter #FIREBASE #DHT11 #SSD1351 #temperature #humidity #iOS #Android #tech #esp8266 #app
Subscribe - ruclips.net/user/ThatProject
Amazing!! I wasted all my day trying to do that work and nothing!! So, I found this video! Congratulations guy!!
awesome work man .. this is gonna be so helpful in my project .. thanks man !
awesome, the quality of the video is really good, great job keep it up
Thank you for your videos!
Tai Nguyen Thanh You’re welcome 😊
Very informative video.Thank you.
Can you please do a video on relay control using esp32 with flutter
VINEETH KINDIYAN Thank. I’ll make one if I have a good chance.
I loved your project, congratulations; you should make one with Rele :)
Thanks, man!
Great job mate...
I love you, thenks💜
Hello Sir, really loved your work. I need some idea how to design app for measuring distance with HCSR-04 and displaying it in Flutter app. Can you please suggest some idea.
Step 1. Connect ESP32 to HC - SR04, test for reading of values
Step 2. Select what communication ESP32 and smartphone will have
Wireless - BT, BLE, WIFI, Wired - Serial USB
Step 3. Make Simple Test Flutter App, check for reading the values which are from ESP32
Step 4. App Layout Design. You can add some animation or showing text only.
Hi, I really like your videos they're great
I'm making an app for Android devices and another one for iOS devices, and I need to send and receive a little bit of data between the devices without internet(mobile data,WiFi) , Is there any way to do this probably through Bluetooth or ble or other way? can I use Flutter blue for this?
or what other any library, extension, plugin or communication protocol
Hello. Thanks for liking my videos. In your case, I strongly recommend using BLE with Flutter blue library. One thing you need to know about BLE is this is not a file protocol so it's hard to send a big size of data like an image file. Other than this, you can handle it easily. Fingers crossed!
Great WORK
can you guide me on how to control the ESP32 OR ESP8266 BY FLUTTER APP to capture the images of the farms?
Well, it has lots of ways to do it. First, to capture images by Flutter App you need to prepare the camera with ESP32 or ESP8266. I think you can find the helpful one from this playlist. ruclips.net/p/PLnq7JUnBumAxB6SH2-7QnqtmmFM3J8bUy
This tutorial was extremely helpful, and I appreciate all the other videos that you have made as well. Could you aid me in a small endeavor. When I run the code on my phone, it only displays loading, rather than show the circles that detect humidity and temp. What do you think the issue is?
Hi.
databaseReference
.child('ESP32_Device')
.once()
.then((DataSnapshot snapshot) {
double temp = snapshot.value['Temperature']['Data'];
double humidity = snapshot.value['Humidity']['Data'];
setState(() {
isLoading = true;
});
_DashboardInit(temp, humidity);
});
Would you wrap the isLoading with setState{} like above?
If it's not working, then you need to take a look at the firebase part again.
@@ThatProject Thank you very much. It appears that i need to fix some things in my firebase.
Hay đóa!!!
@ThatProject will you please share the programs of the temp& humidity check app for a help in my project
Thank you so much for your videos they helped me a lot :).. but can you please make a tutorial of how to set the wifi credentials on the ESP32 from a flutter app via BLE so we can then have a right wifi connection every time and so we can use Firebase with the esp without hard coding the wifi credentials :(..
That's a good idea. I'll make a video about it soon.
Please check out this video - ruclips.net/video/-N52wL8xQzM/видео.html
Awesome!
Thanks for the tutorial! Do I have to use JSON with this library?? Can I just use arduino C??
tavobachi Yes, you can do it without the JSON library but you need to make your own parser to get values from String type of JSON. I don't recommend this way though.
Hi , thanks for such a great effort !
I am currently using esp32 devkit v1 , but I am not sure if it is competable with the one you are using ! can you recommend any suggestion ?
I don't think it's a problem at all.
Hi, this is a great project....Can the same ESP32 library be used to control digital pins by using Firebase RealTime Database? Any specific functions that you can throw light on?
Winner George You can use the Firebase RealTime DB very extensively. Instead, each part of the function should be made according to your project. If you're simply controlling the LED, you can do it without a big problem. Also, I have a couple of videos for using Firebase DB so I hope it'd be helpful.
Hey.! Can you make a video on a flutter app with USB Serial + flutter and firebase for temperature data and graph for trends. If you have any similar ref pls share.
Wouldn't it be possible to combine the projects I've created so far?
Great Tutorial - I got the basic example working - but where can I find the source code for the demo that pushes Temp / Humidity to Firebase?
Thanks. You can find the GitHub link in the video description.
Are you looking for this one?
github.com/0015/IdeasNProjects/tree/master/Esp32_Flutter_firebase_DHT
@@ThatProject Perfect - Thank you!
[core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
Can you help with this error?
The fix for the above error is ....
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
The Firebase library that I used at the time, worked well without those. It helps lots of people who have the same issue. Thanks for your info.
thank you!
Congratulations! Please what to do for the app to update Firebase data in real time? Thank you!
Yes, I'm looking for a new project based on the Firebase. You can see how to use realtime DB in the Flutter.
May you please make a video about flutter and sim800
Maybe I'll have a chance to use SIM7000 series instead of SIM800.
How can fix this error :
A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
pub get failed
I’ve been following your tutorial and I get a connection refused on the terminal in Arduino ide and I’m using the updated version of the library
paulineosikoyapo As the FIREBASE-ESP32 library is updated, it may be slightly different from this video. Please take a look at this github.com/mobizt/Firebase-ESP32/issues/35#issuecomment-546497914
good job , please make project for OBD || esp32 and application android
Abdullah Malkawi Using the OBD gonna be a kind of the fun project.
Hey, could you please share a picture of how you connected the hardware?
It was in the previous one of this project. ruclips.net/video/TF4Dm8Lq7Pc/видео.html
Thanks. Is it not update on android/ios in real time, right? How often it updates? What do you think about reliability arduinoesp32 library?
Полезный контент This version of app doesn’t have a function to get a data from DB but you can simply implement that with an interval you want. I’ll make another video for this soon. Also, the arduinoesp32 library is good enough. Any problems with it??
Hi friend, in this connection, its possible to make in shield W5500 (lan), I've trying to connect to firibase through of lan ...is there any tutorial about that ?
Rafael na Web Hello. Sorry, I don't have any experience with the W5500 Ethernet Shield.
can you update the flutter app i'm stuck with my school project for 2 weeks now i just want to fetch data from ESP8266 and dht11 sensor to mobile app the Arduino code is done but i can't seem to make a working mobile app that just fetch the data live and displays it i've used MIT app inventor and flutter but both of them just crashes when opening watched like 20 youtube videos by now for just the mobile app
i don't need fancy signin or anything i just need to display the data i've got in my data base to show it's working
Hi. I have try this code but my screen just appeared “Loading…” for such a long time. Can you help me?
This project is too old. I recommend a project based on firestore. ruclips.net/video/KV0D8nrsBLg/видео.html
a question, what is the material you used.
I'd be really grateful :)
MIGUEL ALEJANDRO AGUILAR AGUILERA Well, it's a basic material component for the Flutter application. Nothing special.🤞
@@ThatProject I meant what did you use. I think it would be a good thing to expose in class.
but in Github the hadwere does not appear.
excellent videos.
greetings from Mexico : )
MIGUEL ALEJANDRO AGUILAR AGUILERA oh, I'm using the 2017 Macbook Pro. I hope this video is helpful for your class. gracias!
Do you have the schematic of this tutorial to how to connect the esp32?
Yes, it's the series video. You can start from here ruclips.net/video/TF4Dm8Lq7Pc/видео.html
I have only a trouble... where exactly does temperature update each second in the flutter code? It seems to update only when you open the app right?
It updates every time when it has new data.
Line# 30 at the Dashboard.dart, the databaseReference is invoked when it has new data.
@@ThatProject its not updating
@@ThatProject I am facing a similar issue, the database is updating constantly but there is no such reflection in the app
@@trend_tutorials For real? This project was about two years ago, and the workflow of the firebase seems to have changed. I'll prepare the latest version of the tutorial soon. Thank you, guys.
@@ThatProject hello buddy pls make video for latest update
Hello sir. His videos are great ...
I apologize for my english ..
I am writing because I have an error Do you know what could be the cause?
E (1498) SPIFFS: mount error, -10025
Tavo Olea Oh, I see the problem you have. Please try it again with the following code. Line #129
if(!SPIFFS.begin(true)){
while(1) yield();
}
very very good VDO but my realtime database not update pls help.., thank you
KalaMinute Hi. Firebase Realtime DB is described in more detail in this video. ruclips.net/video/-iKCn9lTD2Q/видео.html
Hey mate ,
Hope you are doing well .
I'm stuck on 25:15 minute where the first loading had done .
Mine is LOADING but isn't giving any particular output like yours , so how can i get over it and complete the whole project .
Thanks in advance .
Jahid hasan Hi. This source code can be downloaded from Github. Have you compared it with yours?
@@ThatProject yes i already have but its still giving me nothing though i'm working on it
Jahid hasan
databaseReference
.child('ESP32_Device')
.once()
.then((DataSnapshot snapshot) {
double temp = snapshot.value['Temperature']['Data'];
double humidity = snapshot.value['Humidity']['Data'];
setState(() {
isLoading = true;
});
_DashboardInit(temp, humidity);
});
Would you wrap the isLoading with setState{} like above?
If it's not working, then you need to take a look at the firebase part again.
Hey, do we have library that collect data from raspberry pi to android app?? I mean temperature and humidity data same as this but not by Adriano but by using raspberry pi...
Need help..
I don't deal with the RPI projects yet. Good luck.
how can we do the same purpose of this project but instead use cloudMQTT? Can you guide me to do that? Thank you.
Hello. In terms of MQTT, I don't have a project in my channel yet. Sorry about that. I'll try to do it in the near future. Thanks for understanding.
What are some other alternatives to firebase for connecting esp32 with flutter?
Well, to replace Firebase, you can create your own APIs for DB and communication, or you can use the DB of major cloud providers such as AWS.
@@ThatProject Well I know how to configure my custom database at the flutter end. But how do I use it at the esp 32 end? Is there some library which I could use?
@@dhruvajindal4932 Simply put, you can create an API for connecting with your DB first, and then call it with curl from ESP32. I'm not sure about the library.
How to use bluetooth classic device . becouse classic devices does not showed by this plugin
Vijay Shiva Hi. I’m using BLE instead of Bluetooth classic in this video. If you want to use classic one, this plugin pub.dev/packages/flutter_bluetooth_serial is helpful for your Flutter app.
Did they change something? This project used to work some months ago... FAILED
REASON: connection refused :(
Flutter and Firebase also have a lot of updates, so I don't know exactly where the problem occurred. I'll try if I have time.
can you answer me on this question pleas? in my project i connect the embedde system with my flutter app via bluetooth HC05 and i able to turn on and off the lite but i want to KNOW how to read the tempreture and Humidty with HC05 ? Can aswer please.
Unfortunately, there are no projects featuring the HC05 on my channel. If you google it, I think you can find other projects that read temperature and humidity through it.
@@ThatProject how can i read text from Arduino via hc05? And show it in my application?
i used same example basic but data not show in firebase plz guide me
What kind of problem do you have while fetching the data from Firebase??
it show Firebase : The method 'getCredential' isn't defined for the type 'GoogleAuthProvider' , can you help me out ? and it show lib/main.dart:64:11: Error: 'FirebaseuUser' isn't a type.
Sorry for the late reply. Please look this way.
firebase.flutter.dev/docs/auth/social/
so for the silly question but do need to connect the wifi to transfer the data??
Tirth Gajera There is no silly question. Yes, it must have a wifi connection to transfer data in this project. If you run into any trouble, let me know.
@@ThatProject can I transfer data to the phone from two different modules? If yes, how??
Tirth Gajera Yes, but you need to know all two different modules. It's very hard to answer your question here. It's not that simple. Check my videos and understand the flows.
please can you send to me a flutter code to this project i am a bginner in android programing and this will help me alot in my project and i searched on your github account but i didn't find any thing ,thanks very much
Hatem elsayed massoud حاتم السيد مسعود خليفه Oh sorry. I added the link for the source code. Also, here you are. github.com/0015/IdeasNProjects/tree/master/Esp32_Flutter_firebase_DHT/esp32_firebase
@@ThatProject thank you very much 😍❤❤can you have som time to help me on my project ?🏵
So awesome project...
I have a little problem over here... when i run the code, it says
[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: type 'int' is not a subtype of type 'double'
and then, it only displays loading. I also already wrap the isLoading with setState{} like you've said.
What do you think about this?
Thanks
Brian Armando if you got the type casting error, try it like below.
'${tempAnimation.value.toInt()}', -> '${tempAnimation.value}',
'${humidityAnimation.value.toInt()}', -> '${humidityAnimation.value}',
@@ThatProject thanks for your reply....
but after i changed it, the problem is still persists...
are packages version must same as your video?
Thanks
Brian Armando ummm- Have you printed the values from the Firebase DB directly? You should get the data correctly.
@@ThatProject Yes i get the data from firebase...
when i used the code like this:
databaseReference
.child('ESP32_Device')
.once()
.then((DataSnapshot snapshot) {
dynamic temp = snapshot.value['Temperature']['Data'];
dynamic humd = snapshot.value['Humidity']['Data'];
so i change the type from double to dynamic, but somebody says that was not recommended at all...
Brian Armando Your problem is this part???
I thought it happens when converting double to int?? If this part is your problem then try this way.
dynamic temp_1 = snapshot.value['Temperature']['Data'];
double temp = toDouble(temp_1);
double toDouble(dynamic value) {
if (value is String) {
return double.parse(value);
} else if (value is int) {
return 0.0 + value;
} else {
return value;
}
}
can you please tell me how to fix this error i encoutered it in the arduino ide
no matching function for call to 'HardwareSerial::println(FirebaseJsonData&)'
Seems like the Firebase library is updated so this method is no longer used. Please check it directly from the author's GitHub Page.
same code with NPK bro in arduino IDE ?
No, you need to acquire the data in the way the NPK sensor provides.
Can't we just continuously upload data to database and show real values in real time????
Of course it's possible. Check out my latest video for Firebase project.
ruclips.net/video/aAUIlCWs_bc/видео.html
How to turn on and off led and button status useing esp32 with firebase any idea
balaji mani Of course, you can make do that based on the Firebase easily. I'll make videos for beginners after finishing a few projects.
@@ThatProject thank for replaying
Hi, Iloved your tutorial, but now i'm having a problem qith my project. Basically this E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE. You think you can give me a hand with it?
Mariano Franceschetti Are you using Emulator?? Then You need to update the emulator to the latest version that includes Google Play services.
@@ThatProject Hello again, thank you very much for your response. I solved the issue, actually I was mistaken with my package name. But now I'm having the following error "Unhandled Exception: type 'int' is not a subtype of type 'double'". It's triggered by this line in Dashboard.dart "double temp = snapshot.value['Temperature']['Data'];"
You think you can help me?,. Also, maybe RUclips is not the best platform to discuss this, would you like me to move the discussion somewhere else?
Mariano Franceschetti You can simply cast from int to double with .toDouble(). e.g) double temp = snapshot.value['Temperature']['Data'].toDouble();
I'd like to talk here about issues in this project because other people can have the same problem. Thanks.
@@ThatProject Great, thanks a lot.
why it show like this -
libraries\Firebase_ESP32_Client\src/FirebaseESP32.h:47:16: fatal error: FS.h: No such file or directory
kamini Sambeth Hello! Are you sure that you've installed the arduino-esp32 on your side?
If not, please install the Arduino core for the ESP32, github.com/espressif/arduino-esp32
The Arduino-esp32 already has FS.h. Please Take a look at this.
github.com/espressif/arduino-esp32/blob/master/libraries/FS/src/FS.h
@@ThatProject i'm just followed u. but it still show like it
kamini Sambeth This video doesn't show the installation of arduino-esp32. please follow this way github.com/espressif/arduino-esp32#installation-instructions
Hie ... I am doing a project of Auto irrigation from Android app...I want to add login system for particular ESP like user 1 has its own esp1 which sends data to firebase and in return which sends it to Android app of user 1 .... So every user has own distinguished dashboard....
Could u please help me regarding this
hello! i've tried using the example sketch from the firebase esp32 client library, however i keep getting connection refused. Do you have any idea why?
Sandy Ling Hi. Would you let me know more specifically? Where did you get this error? while wifi connection or firebase connection or realtime db connection?
@@ThatProject Hi, it should be during the firebase connection. I'm actually trying to upload sensor values to firebase but keep having troubles uploading the code itself.
Sandy Ling Would you have a double-check that your host string has "/" end of it? Also, The rules of Firebase Realtime DB should be like ".read": true, ".write": true. I hope this one is good for you.
@@ThatProject Okay! thank you i managed to upload the code, but still cant manage to send the sensor value over to firebase. Can i just ask what code do we need to include in the arduino to send the sensor values from esp32 to firebase?
S Ling
//This part is a connection for Firebase
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.reconnectWiFi(true);
Firebase.setReadTimeout(firebaseData, 1000 * 60);
Firebase.setwriteSizeLimit(firebaseData, "tiny");
//This part is sending humidity value from ESP32 to Firebase
Firebase.setDouble(firebaseData, path + "/Humidity/Data", humidity);
I think you'd better try the Firebase-ESP32 example(github.com/mobizt/Firebase-ESP32) first then you can understand how it works.
Hi, Where can I find the source code of your example in the video please
You can find the link for this project below the video description. But it’s the old project.
@@ThatProject Hi, I see you posted this link on another comment ruclips.net/video/aAUIlCWs_bc/видео.html , but its not the full playlist. maybe you can post the correct playlist here on in the video description
@@CompanyBusinessCards I think this is the playlist you're looking for. ruclips.net/video/aAUIlCWs_bc/видео.html
Please let me know if you need further info.
@@ThatProject yes this is very helpful, thanks
wifi. keep looping........can not connect to firebase.......how can i solve?
payloan Please check the wifi connection before connecting to Firebase. FYI, ESP32 can only be connected to the 2.4Ghz band on Wi-Fi routers or access points (AP).
@@ThatProject i believe that 2.5 and ap...because my device used already..is there any checking issue?.
Thansk
payloan You said that the WIFI keeps looping. But your ESP32 can access the AP and get the local IP and ping to external IP to check internet connection. Is that right?
@@ThatProject never....just uproal completing...and wifi connection......................
There is no ip.....nothing show.....only ...............................................
@@ThatProject because i keep pushong boot button during writing.....
hello, share your libraries?
libraries\Firebase_ESP32_Client\src/FirebaseESP32.h:47:16: fatal error: FS.h: No such file or directory
MS Sistemas Hi. What libraries? You can install the libraries I used in this video by yourself.
The Arduino-esp32 already has FS.h. Please Take a look at this.
github.com/espressif/arduino-esp32/blob/master/libraries/FS/src/FS.h
Also, the code I wrote is sharing through the Github repository. github.com/0015/IdeasNProjects/tree/master/Esp32_temperature_humidity_ble_FLUTTER
this is used it android studio?
It was developed using the Android studio.
U can used it MIT app inventor?
@@fannsrw2037 I've never tried it.
How about flutter and thinkspeak?
I've never tried ThingSpeak, so I'm not sure.
Could u please update this guide. Flutter and firebase has went thru many updates and cant able to make this work
I'm planning a new video of the latest version of the Firebase. I'll let you know when it's released.
@@ThatProject thank u very much.