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
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.
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.
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.
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!
@@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!
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 ruclips.net/video/15X0WvGaVg8/видео.html for more info on that :-)
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
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.
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 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.
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
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.
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
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 }
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.
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...
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
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
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!
@@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.
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; }
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.
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!
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.
I’m new to hardware. You videos is very helpful. Help reducing my learning curve.
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
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 :-)
U know some people r angles....bro ur the one.
Thank you very much Arman! I wish you all the best with your project. Cheers, Sander
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.
Thank you very much for your feedback. Well appreciated!
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.
Glad to hear it worked out for you! Thank you for the feedback 👍
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.
Great to hear, good luck with your project!
thanks for the great tutorials!. I just had the apps working on a Samsung S10+ and ESP32.. WINNING !!!
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!
@@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!
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 ruclips.net/video/15X0WvGaVg8/видео.html for more info on that :-)
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.
Glad it helped! Thank you for your feedback :-)
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
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.
@@mothunderz thank you so much
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!
Thank you for your kind feedback. Sounds like a fun project!
@@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.
man, your videos are awesome, thank you!!
I really appreciate your feedback, thank you!
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
Thanks for sharing. Sounds like a very useful application. Good luck!
Very goog. After I do with your project. It can operate. Thankyou.
Glad to hear that!
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.
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
best tutorials!
Thank you for your feedback :-)
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
}
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.
awesome buddy
Thank you! Cheers!
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...
Please see "Part 3" of the video series. I explain it there:
ruclips.net/video/eP35zgZnQY4/видео.html
Dank voor je tijd en uitleg. Spreek je Nederlands? En kom je wel eens in de buurt van Den Haag?
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
@@mothunderz haha. Das een end idd
thanks a lot
You are most welcome!
thx, was interesting
You're welcome! And thanks for the feedback
amazing
Thank you! Cheers!
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
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!
@@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.
Hey , apart from trial and error how do get precise delays , say for 10 seconds?
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;
}
how to send the recieved data from the esp to speech
What exactly do you mean with "speech"? Thank you
Help...how do you display ultrasonic sensor readings to ur mit app
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.
@@mothunderz thank you so much
Sir can yoy make physical switch feedback status in mit app. Please ease🙏
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!
Thank you sir
hello please can you give new video this project how to make android app in android studio
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.
@@mothunderz thanks alot