Create your own App! Control an ESP32 (Arduino) via Bluetooth - Part 2

  Рет қаралды 46,508

MoThunderz

MoThunderz

Күн бұрын

Пікірлер: 64
@MyTawat
@MyTawat 5 ай бұрын
I’m new to hardware. You videos is very helpful. Help reducing my learning curve.
@stever3886
@stever3886 Жыл бұрын
I watched part 1 and it was amazing. Thank you for the detailed instruction, I’m a new user of the Esp32. I would have never thought I could do this. This will take my projects to the next level. I subscribed.
@mothunderz
@mothunderz Жыл бұрын
Thank you very much for your feedback. Well appreciated!
@MrPanrob
@MrPanrob Жыл бұрын
finalmente dopo tanto cercare ho trovato lei che mi ha incoraggiato ad evolvermi in questo mio "gioco" nonostante il problema di comunicazione e grazie al traduttore sono riuscito a far funzionare esp32 con mit inventor. grazie per l'impegno e il suo modo di spiegare , saluti Roberto
@mothunderz
@mothunderz Жыл бұрын
I am glad you were able to translate my video in Italian and that you were able to make it work! Thank you for your feedback :-)
@armancodeq3642
@armancodeq3642 2 жыл бұрын
U know some people r angles....bro ur the one.
@mothunderz
@mothunderz 2 жыл бұрын
Thank you very much Arman! I wish you all the best with your project. Cheers, Sander
@bobdurk5180
@bobdurk5180 3 жыл бұрын
So far so good, your tutorials and explanations are really helping to reduce the learning curve. I now want to take a control sketch I have working and see if I can use the BT App to control my audio system. Just a baby step, but it should work as proof of concept.
@mothunderz
@mothunderz 3 жыл бұрын
Great to hear, good luck with your project!
@qzorn4440
@qzorn4440 2 жыл бұрын
wonderful video. i have been watching several MIT-inventor videos in comparison to the RemoteXY, which shows the remotexy-Arduino code to download to the Arduino-IDE. 🤥This video part-2 makes it clearer where to Arduino IDE code is located. Most MIT videos go in detail on the fun programming stuff. now, i can starting using MIT and the Arduino-IDE. thanks you.
@mothunderz
@mothunderz 2 жыл бұрын
Glad to hear it worked out for you! Thank you for the feedback 👍
@mobileiotapps967
@mobileiotapps967 2 жыл бұрын
Hey, thank you so much for the tutorial it really helps, I was just looking for other ways to create an ESP32 app by using MIT App inventor.
@mothunderz
@mothunderz 2 жыл бұрын
Glad it helped! Thank you for your feedback :-)
@srikirthikandala1305
@srikirthikandala1305 3 жыл бұрын
Thank you so much for the tutorials. They have greatly reduced the learning time and gave me a head start. I was wondering if you could make small video on plotting graphs in the app
@mothunderz
@mothunderz 3 жыл бұрын
Thank you very much for your feedback. Will look into plotting graphs, though at the moment I first need to find time to make the next part on how to add more controls to the webserver. Will try to get that online next week and look into plotting afterwards.
@srikirthikandala1305
@srikirthikandala1305 3 жыл бұрын
@@mothunderz thank you so much
@joebotics8761
@joebotics8761 2 жыл бұрын
thanks for the great tutorials!. I just had the apps working on a Samsung S10+ and ESP32.. WINNING !!!
@mothunderz
@mothunderz 2 жыл бұрын
Dear Joe, great to hear you were able to solve the problem you had and that it is working even before I got to answer you :-) Do check out the Wifi capabilities of the ESP32 as well, I just uploaded some videos on how to connect the ESP32 to Wifi and host a webserver on it. That way you can control the ESP32 without even needing Bluetooth or an app, you can just navigate to the IP of the ESP32 with a browser on any device. Good luck with your project!
@joebotics8761
@joebotics8761 2 жыл бұрын
@@mothunderz Dear Mo.. thanks for your prompt reply... I will look into the other tutorials you posted ... I have not looked into the WIFI alternative yet... if that is a simpler alternative then I am so interested!.. I imagine you can obtain bidirectional communication also... perhaps even faster than Bluetooth ? Thanks again!
@mothunderz
@mothunderz 2 жыл бұрын
Yes, WiFi communication is a lot faster than Bluetooth (also more power hungry, but ok). Bidirectional communication is easy to realize with Websockets. With "webSocket.broadcastTXT(jsonString);" you send information from the ESP32 to the clients and with "Socket.send(JSON.stringify(msg));" you send information from the clients back to the ESP32. See kzbin.info/www/bejne/Z2a7YYqsfMaJnZo for more info on that :-)
@DavidSunshine
@DavidSunshine 2 жыл бұрын
Thank you you for making an easy to follow video! Really appreciate your hard work in sharing your knowledge with the world! Very helpful for us who are brand new to Arduino programming. I'm trying to create an APP that can control an ESP32 to turn on fans based on temperature sensors, so this is perfect for sending and receiving temperature settings and readings back and forth!
@mothunderz
@mothunderz 2 жыл бұрын
Thank you for your kind feedback. Sounds like a fun project!
@DavidSunshine
@DavidSunshine 2 жыл бұрын
@@mothunderz Ya it's pretty fun! Anything Arduino is fun I'd say. I've been playing around with sending 4 temperature readings over using your method shown, but the processor is really fast, 240Mhz I think, and the phone app only captures the last ID and Value, even though my timer is set up 1ms. I had to put a 60-70ms delay between bt sends to make it work, and capture all 4 temperatures, maybe this happens because the bt sending module has a limitation. My question to you, would be, what do you think is the best way to address this? I've just though of using Millis to check the time of last send and only send if it's been 70ms, this allows the code to keep processing and not lock it up for 70ms at a time. I know it's not a big deal to lock it up, but like you said, it's good to not use delay(#) anywhere if you want to keep the code optimised and not have lags. What do you think? I was also thinking of confirming data before sending the next piece, but then you need to introduce a retry delay, not ideal. Cheers! David.
@DWM864
@DWM864 3 жыл бұрын
man, your videos are awesome, thank you!!
@mothunderz
@mothunderz 3 жыл бұрын
I really appreciate your feedback, thank you!
@ibendiben
@ibendiben 2 жыл бұрын
Dank voor je tijd en uitleg. Spreek je Nederlands? En kom je wel eens in de buurt van Den Haag?
@mothunderz
@mothunderz 2 жыл бұрын
Yep, ik spreek Nederlands. Ik woon echter sinds geruime tijd in Munchen. Den Haag vind ik een mooie stad, maar helaas een beetje ver weg voor me. Groet, Sander
@ibendiben
@ibendiben 2 жыл бұрын
@@mothunderz haha. Das een end idd
@protoTYPElab44
@protoTYPElab44 2 жыл бұрын
Learning a lot from this 2 video tutorial, btw i am making an app for power monitoring system where the user can view the kwh, and some other features, i a sending data back to app using esp32
@mothunderz
@mothunderz 2 жыл бұрын
Thanks for sharing. Sounds like a very useful application. Good luck!
@banchasaoraso8591
@banchasaoraso8591 2 жыл бұрын
Very goog. After I do with your project. It can operate. Thankyou.
@mothunderz
@mothunderz 2 жыл бұрын
Glad to hear that!
@hidayat9547
@hidayat9547 2 жыл бұрын
Thanks for the video. Actually I always get "bluetooth permission" problem when trying MIT inventor test. So finally I used kodular and didn't have the same problem.
@mothunderz
@mothunderz 2 жыл бұрын
Thank you very much for notifying me. I just checked and MIT App Inventor updated the BluetoothClient just now. It is not backward compliant and the module simply has to be deleted and added again to work. I will update my example code on GitHub
@filtermindmusic4208
@filtermindmusic4208 2 жыл бұрын
best tutorials!
@mothunderz
@mothunderz 2 жыл бұрын
Thank you for your feedback :-)
@rizvanrazi4698
@rizvanrazi4698 2 жыл бұрын
awesome buddy
@mothunderz
@mothunderz 2 жыл бұрын
Thank you! Cheers!
@sridevipindi1547
@sridevipindi1547 11 ай бұрын
hi could u guide me how to send adc values to mit app... // variables to store measure data and sensor states int BitsA0 = 0; float VoltsA0 = 0; void loop() { BitsA0 = analogRead(PIN_A0); // standard converion to go from 12 bit resolution reads to volts on an ESP VoltsA0 =BitsA0 * 3.3 / 4096; String adcValue = String(VoltsA0); Serial.println(adcValue); if (ESP_BT.available()) { ESP_BT.println(adcValue); if i write ESP_BT.write(adcvalue)....it is throwing an error // otherwise if i write ESP_BT.write(VoltsA0) when i press any button the numerical value gets displayed //on the mobile screen...and everytime the number get increased by 1.....but i have to press any button } my doubt is that automatically the adc value should be displayed...without pressing the button when we rotate the pot in the serial monitor the adc value updates automaticlly....similarly as long as the bluetooth is connected , when we rotate the pot the value should be updated on the moblie screen too...without pressing any button....could u guide me pls }
@mothunderz
@mothunderz 11 ай бұрын
So if I understand it correctly you do have the program working with write ESP_BT.write(VoltsA0), but it just does not update automatically, right? You should check in your ESP that upon initialization you do send out the current value to MIT App Inventor. Then you should make sure that in MIT App Inventor the value is updated in the Clock1.Timer() function.
@ZedusUA
@ZedusUA 3 жыл бұрын
thx, was interesting
@mothunderz
@mothunderz 3 жыл бұрын
You're welcome! And thanks for the feedback
@Amraoui_Essaid
@Amraoui_Essaid 2 жыл бұрын
thanks a lot
@mothunderz
@mothunderz 2 жыл бұрын
You are most welcome!
@boultifnidhal2600
@boultifnidhal2600 2 жыл бұрын
Hey, thank you so much for the tutorial. I'm just having a little problem. the screen that I connect to the ESP is not the same screen that I work with. So, how can I distribute the bluetouth connexion to the whole application
@mothunderz
@mothunderz 2 жыл бұрын
Hi, sorry, but I dont know what you mean. I show here how you can make an android app and exchange information between the ESP32 and the app. Do you mean that the app will run on different devices (such as a tables and a mobile phone)? In that case you need to detect in the app what kind of device it is and adapt the layout for that (or have a manual switch). Good luck with your project!
@boultifnidhal2600
@boultifnidhal2600 2 жыл бұрын
@@mothunderz Thank you so much for the reply Sander, You're amazing. So What I meant is; basically my app consist of two screens. Screen1 to establish the connection with the Bluetooth of the ESP. and screen2 is used for controlling the LEDs and stuff. The problem is; when I connect to the ESP in Screen1 and switch to Screen2 I lose the connection with the ESP32. So how can I pass the establish connection with ESP to different Screens in the same App. In other words; how can I connect to the ESP via Bluetooth once and for all. Once again thank you so much for your time and consideration.
@Chillandrelax2475
@Chillandrelax2475 2 жыл бұрын
Hi, how do we enter two numbers in two separate textboxes and that would be sent to the Arduino? But only one or both textboxes can be used at any time to change the corresponding values of the variables in Arduino, with a single "Send" button in app for both textboxes. Thanks in advance...
@mothunderz
@mothunderz 2 жыл бұрын
Please see "Part 3" of the video series. I explain it there: kzbin.info/www/bejne/m4GWZq2dj9OEj5Y
@shihminglin229
@shihminglin229 2 жыл бұрын
amazing
@mothunderz
@mothunderz 2 жыл бұрын
Thank you! Cheers!
@abishek8432
@abishek8432 2 жыл бұрын
Hey , apart from trial and error how do get precise delays , say for 10 seconds?
@mothunderz
@mothunderz 2 жыл бұрын
there are two locations where you can set delays. If you want to time a delay in MIT app inventor you can do that with the clock module. In the Designer window you can set the TimerInterval to 10 seconds. In the Arduino you can time a delay with the delay(ms) function. This is in milliseconds, so delay(10000) would give you a 10s delay. However, this is not a smart way to go about because your ESP/Arduino will not do anything those 10 seconds but waiting. A better way to realize this is to use the millis() function. Just do the following -> Define a global variable first for the interval with which you want to run the code (in milliseconds): int interval = 10000; // Then define a global variable to record the last time the code was run: unsigned long previousMillis = 0; // Then in "void loop() {" do: unsigned long now = millis(); // record current time if ((unsigned long)(now - previousMillis) > interval) { // here you add the code you want to run every 10 seconds // dont forget to update the code was run: previousMillis = now; }
@sisekelocele303
@sisekelocele303 2 жыл бұрын
Help...how do you display ultrasonic sensor readings to ur mit app
@mothunderz
@mothunderz 2 жыл бұрын
On your Arduino/ESP you periodically read the sensor value. Lets say the sensor value varies between 0.0 and 100.0. The Bluetooth channel only allows you to send integers, so you need to convert this number to an integer. You can do this by multiplying the sensor value with 10. If you want to send over 34.5, then you send over 345 with a new ID number you have not used yet, so for instance 14. In MIT app inventor, the function that periodically checks for incoming Bluetooth messages is the section that starts with "when Clock1.Timer". In this section received messages are just written to a text field. Instead of writing it to the text field you can check the ID to make sure that ID == 14 so that you know it is a sensor value. Then you combine the two received data bytes with 128*val_byte1 + val_byte2 (is already there in the blue section). Before displaying this number you now have to divide it with 10 and you are done. Good luck! NOTE: I just noticed that there was an update in the Bluetooth library of MIT app inventor. If you build everything up from scratch you have no problem, but if you use my github pages you will need to replace the BluetoothClient module. I will fix this in the coming days.
@sisekelocele303
@sisekelocele303 2 жыл бұрын
@@mothunderz thank you so much
@navindujayawardhane285
@navindujayawardhane285 2 жыл бұрын
hello please can you give new video this project how to make android app in android studio
@mothunderz
@mothunderz 2 жыл бұрын
I have not worked with Android studio directly. It is limited to Android only, so I am now looking into Angular and React Native. A steep learning curve, but interesting programming languages. I am not yet at the level where I want to be, so will take some time for me to do a vid about that.
@navindujayawardhane285
@navindujayawardhane285 2 жыл бұрын
@@mothunderz thanks alot
@ananyavgupta2740
@ananyavgupta2740 Жыл бұрын
how to send the recieved data from the esp to speech
@mothunderz
@mothunderz Жыл бұрын
What exactly do you mean with "speech"? Thank you
@ranjithshetty7078
@ranjithshetty7078 2 жыл бұрын
Sir can yoy make physical switch feedback status in mit app. Please ease🙏
@mothunderz
@mothunderz 2 жыл бұрын
If you have a physical switch connected to your ESP32, you can read the status of that switch periodically and write any changes to the state of the switch to the Bluetooth interface. So for instance if your switch is detected between ground and pin 16 you can write in the setup: pinMode(16, INPUT_PULLUP); and then in the main code you can read the state with: int switchVal = digitalRead(16); That should do the trick. Good luck with your project!
@ranjithshetty7078
@ranjithshetty7078 2 жыл бұрын
Thank you sir
Bluetooth Classic & BLE with ESP32
38:00
DroneBot Workshop
Рет қаралды 34 М.
Кәсіпқой бокс | Жәнібек Әлімханұлы - Андрей Михайлович
48:57
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 2,7 МЛН
ESP32: Webserver, Websockets and JSON (WiFi Part 2) - Arduino
35:17
BLE with ESP32 tutorial part 1: the Server
25:23
MoThunderz
Рет қаралды 91 М.
Intro to Hardware Reversing: Finding a UART and getting a shell
12:07
Tony Gambacorta
Рет қаралды 897 М.
12 Brilliant Cyberdecks to try using Raspberry Pi!
8:53
ToP Projects Compilation
Рет қаралды 591 М.
ESP32 WebSocket Server
10:25
Anas Kuzechie
Рет қаралды 56 М.
Кәсіпқой бокс | Жәнібек Әлімханұлы - Андрей Михайлович
48:57