Thanks a lot for the update, can you annotate this in the video inline at the moment of programming. I programmed the wrong address then I had to figure out what happened
@@LuciferGloria Yes, the RPI has plenty of power (600mA on the USB Bus by default, can be increased to 1.2A, the esp 8266 uses about 200-300mA peak); however, if your power supply for the Pi isn't big enough you could have a brown out. If your esp8266 and wiring is ok, you shouldn't damage your Pi, even if there is a brownout but you may corrupt the filesystem.
I appreciate your videos. the pace is great, clear and concise!!! And, keep it up with the ESP32, etc. Well done from a newbie in all the micro stuff. Glad to see Python making headway in this space.
Just finished I actually was one of the Kickstarters for MicroPython. I think this is awesome please do more as I work my way through your tutorial's Thank you
This is the first one of yours I have watched. It went by fast, so thank goodness for rewind and pause! You certainly crammed a lot of useful information in this short video. Thank you.
What a great video. I really liked the commentary, explaining what you were doing. This is just what I was after. I've just subscribed and will be looking for more :)
Thank you. This video came up in my TH-cam feed. It is very good. Yes, more vids with the esp32 would be nice. especially controlling a string of neopixels.
Thanks for a great video! I'd like to see more on the motion detection+sound playing setup. I'd also like to see more on selecting which ESP32 board to choose - there are a lot to pick from, and how would I know if it's better to buy a Wemos Pro ESP32, than a Wemos Lolin for example? A basic selection-howto would be great. And then something on powering the ESP32 - which batteries to choose. And finally: Controlling motors with ESP32 - Servos, stepper and DC gear motors, and which motor controllers to use.
This was a great tutorial !! i am new to the micro stuffs and your videos helped me alot to understand the things. i would like to see how to read UART data from sensor using esp32 and micropython. Thank you.
Thanks for the feedback! I suggest you look at my Micropython JQ6500 repo. It uses the Micropython UART library to read and write from an ESP32 to an MP3 module. github.com/rdagger/micropython-jq6500
Sweet this tutorial was clear and easy to understand. Can you do more videos of micro python with esp32 using the esp now protocol and sending analog values between two esp32s? Thanks again
I might be wrong, but I don't think espnow has been implemented yet in MicroPython. I am looking into solutions for mesh networks and low energy communication.
I would love to learn to use a ESP32 Cam to send video to a Raspberry Pi Zero W over a local WiFi network. I am a newbie to MicroPython and need to progress my skills for a project I am planning for myself and a duplicate for a friend. Your help would be greatly appreciated. Maybe even a link to existing code if you have it please.
Mr Cheung, I noticed you have hydronics videos. Can these arduinos be applied to an automated setup, and if so what would be a brief example of this. Many thanks.
I think a video using the TTGO T-Dispay board would be goid. It has both a battery connector and a small color LCD on it. Working code for Arudino is out but getting a version of that in python would be nice. I have a few I just got for under $7 each.
nice video I would like to see the ESP32 being used to receive readings from analog sensors (like the pressure sensor where you used the ADS1115) and send it to the pi or to google sheets. thanks
Fantstic video. Excellent presentation. Keep them coming! ESP32 seems like the new Arduino. Any thoughts on the uPyCraft IDE? A video on that would be great if you think that that IDE is the way to go.
Thanks for the feedback! I think uPyCraft IDE is a great tool to get started. However, the IDE is very rudimentary. I prefer to use Atom or VS Code for writing software because of the linters and abundant extensions. Both provide FTP extensions to upload your code directly to a device such as an ESP32. The LoBo build of MicroPython comes with built-in FTP. uPyCraft IDE provides a handy GUI to manage files although the last time I checked it had some trouble with folders. When working with a large volume of files or folders I prefer FileZilla.
..very nice video well done, micropython is really cool, thanks for sharing man, much appreciated. Any videos you could cover with micropython and the esp32 would be great, would encourage people to start using this language, the C based esp32 IDF environment seems daunting for the average person, thanks again :)
Best practices would be to connect everything with the power off. If you have to connect a device such as a NeoPixel to a live circuit then I recommend hooking up the grounds first to avoid the possibility of exposing a signal line to a higher voltage. In general it is a good practice to hook up grounds first except when jump starting a car.
Just obtained an espwroom32 board and watched your micropython video. Excellent, thank you very much! Will this board interface with Cayenne and how safe is it?
Sorry I don't know if the ESP32 will work with Cayenne. It's not on their list of supported microcontrollers so I would guess no. By safe are you referring to security? If so the MicroPython firmware is still relatively new. I don't think SSL is supported yet.
Please make a video on programming esp32 using micropython in PC and webserver explaining all the various ways to code such as using subdirectories like modules and scripts
That was a cool video. I haven't used mycrophython yet, but I have the pi and several esps at doing nothing at the moment. Can you do a video using using ADA fruits micro python, command line interface arduino implemented with you current video. To see if they all can be tied together.
The ESP32's I bought are no longer sold. I haven't purchased one in over a year. I don't want to recommend something that I have not purchased. Just make sure you get an ESP32 Wrover with at least 4MB RAM of PSRAM. Loboris has a list of board vendor links on his wiki: github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki
The gc and micropython libraries have methods to get memory usage: docs.micropython.org/en/latest/library/micropython.html#micropython.mem_info docs.micropython.org/en/latest/library/gc.html#gc.mem_alloc I'm not aware of any CPU usage methods nor do I think they would be very meaningful because it's running on a microprocessor. I recommend you ask your question to the MicroPython forum for a more detailed response: forum.micropython.org/
@@ScenicJourneysHub I haven't used blynk but you probably don't have enough memory on your board. Check out this post on the MicroPython forum: forum.micropython.org/viewtopic.php?t=7545
I like your MicroPython videos. I'm following along and have a question. I'm using an Adafruit Huzzah ESP32 board which doesn't have a 5v pin to attach the neopixel. Is there another way to do this? The Huzzah32 learn guide said something about using the USB or BAT pin along with an additional regulator. What do they mean? Any help would be appreciated. Thanks.
@@rdagger Thanks for the reply and info. I tried the USB pin, but got some weird results. The neopixel flickers really fast as it's cycling through the colors. So, I tried the BAT pin, and that smoothed out the color change to like what's in your video.
No, NeoPixel libraries are built into both the MicroPython and the LoBo builds: docs.micropython.org/en/latest/esp8266/tutorial/neopixel.html github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/neopixel
Hello. I just saw this video this week. I followed all the instructions in the video with the ESP-WROOM-32 board(s) the erase worked, the loading of the code (.bin) on the webpage appeared to work. But, when I got to the repl part to connect to USB0 it said 'No MicroPython boards connected - use the connect command to add on'. I tried two different codes from the page. i get the same thing on the repl.
Thanks so much for this video! My first experience with MicroPython! I've worked through it to the point of creating the Neopixel script, I don't have a Neopixel ;) Side note - I run my Pi headless, so I wonder if there is a nice command to download the ESP32 firmware via command line? I'm sure there is - I used scp to transfer it over from my Mac. I have an ESP32 with built in OLED so I am definitely going to that tutorial after getting to grips with the basics :)
Thanks for the awesome Tutorial! Don't forget to do a "sudo usermod -a -G dialout $USER" then log off and relogin. Otherwise rshell will not be able to connect to the Board...
Not sure what you mean by ESP probes. Are you asking about exhaust sensing probes? If you are looking for help getting started with the MicroPython language then any Python 3 tutorial would be a great start. Here's a link: th-cam.com/video/oVp1vrfL_w4/w-d-xo.html
I don't understand your question, but if you are trying to emulate a USB keyboard or a Bluetooth mouse then I recommend you take a look at CircuitPython because it offers excellent Bluetooth support and USB HID. Here are 2 tutorials: learn.adafruit.com/circuitpython-essentials/circuitpython-hid-keyboard-and-mouse learn.adafruit.com/ble-hid-keyboard-buttons-with-circuitpython
Excellent tutorial but I do not know what I'm doing wrong. but when I disconnect the pc cable, the communication between the devices is lost. I'm not supposed to have connected the two devices. the communication would not be done by wifi?
When the USB cable is connected to the ESP32 it provides power. How are you providing power when the USB cable is disconnected? Are you using a battery or power supply? What is the voltage and current? Which pins on the ESP32 are you using for power?
Hi, thank you very much for this video. I'm using Windows Subsystem For Linux with Ubuntu 18.04, but when I connect the ESP32 in the USB port and type the dmesg | grepp ttyUSB nothing is happening. I have searched a lot on google and can't find any help. Thank you very much.
I have never used WSL and I don’t know how it handles USB devices. I’d guess that a USB to serial device would be mapped to a serial port. Check the Windows Device Manager for the com port of your ESP32 and then see if there is a corresponding WSL serial port. For example, if the ESP32 is mapped to COM3, check WSL for ttyS3.
@@rdagger I discivered that WSL doesn't support USB serial device. Thanks. Now I'm trying to compile micropython with Microlad module but without success.
I don't have any experience working with cameras on the ESP32. The OpenMV camera looks promising: openmv.io Adafruit also has a couple of TTL serial cameras that might work. A Raspberry Pi might afford better camera options.
This is a real great start in micro python and ESP32. I am totally new to this and tried this a few weeks ago and it worked well. I wonder if the python upgrade has broken it tho as I am now getting no output from dmesg | grep ttyUSB and esptool.py --port /dev/ttyUSB0 flash_id says No such file or directory: /dev/ttyUSB0 looking in /dev there is indeed no ttyUSB files at all.
Sorry for the slow response. Your reply was flagged as spam. TH-cam thinks .py is a hyperlink. Were you able to resolve USB issue? If so, what was the problem?
Hi mate. Great vid. ive been following it. However I get a hang up when using rshell into the esp board (it just says connection and then does nothing). I am 8266 version is there something different?
Did you build the firmware yourself or are you using a daily build from MicroPython.org (if so which version)? Did you specify address 0x0 when writing the flash? Which ESP8266 board are you using?
I have the same problem. Using an ESP12S. First time I worked through your tutorial everything worked perfectly, I tried updating the uPython and now nothing works anymore. Any resolve yet?
i tried using both the esp32 and esp8266 build and all versions. Erased flash before writing. Not getting any errors, as soon as I try connecting with rshell it just hangs
I'm desperate to find a tutorial of how to use the Sparkfun ESP32 Thing with Mozilla IOT to do some home automation. I would be eternally grateful if you could do a video on this.
I taught myself programming at a young age. My parents had a very primitive computer. The paper instructions included basic code for several simple games. I typed in the code and experimented by making modifications. I wanted to make my own games which I did and shared with my friends. This was before the Internet.
@@rdagger oh that's nice.. so that's why you are very good at it.. I like this mircropython series.. I just learned about it a couple weeks ago python on microcontrollers and just started to study programming , studying python currently everything is so overwhelming but it's very cool .. Do you have a video of creating a mobile app to read the sensor and maybe turn on and of the LED?
Great tutorial. Finally got it working.. Now trying to tweak code to allow a full 8 LED NeoPixel Strip to light up. Not getting much success thus far.. I tried changing your code by amending and adding the following lines - # Amount of Pixels np = NeoPixel(Pin(13), 8) # In the middle np[0] = hsv_to_rgb(hue, 1, .15) # all the way to - np[7] = hsv_to_rgb(hue, 1, .15) # and at the end np[0] = (0, 0, 0) # Turn off NeoPixel # all the way to np[7] = (0, 0, 0) # Turn off NeoPixel Will keep plugging away :)
Are you getting an error message or just nothing? I recommend you also try the LoBo MicroPython build. LoBo has more robust support for NeoPixels: github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/neopixel I found that occasionally it's necessary to adjust the _timings_ property with some NeoPixels. Also make sure you have an adequate power supply and good quality short USB cables.
Great Video! it would be great to see how you would transfer sensor information from the ESP to central Rpi through WiFi. is it possible to write own Python module and import it and use it in micro python?
Yes, you can write your own MicroPython modules and copy them to the ESP32. Other MicroPython programs on the ESP32 can import and use them. The 2 examples at the beginning of the video use separate MicroPython libraries that I created (LCD display library and a JQ6500 sound module library). Both are available on my GitHub site: github.com/rdagger There is also a large collection of core Python libraries ported to MicroPython available at github.com/micropython/micropython-lib/
I’d ask the experts over at forum.micropython.org because I have not tried setting up web server authentication on an ESP32 using MicroPython. Please post a link because I'd be interested in the responses. I’d probably go with a VPN solution or possibly a password protected Ngrok tunnel. Seems like a Raspberry Pi would be an easier platform with respect to web security.
rdagger68 Thanks for the quick reply. I have SHT10 sensor that works fine with sht1x python library on the raspberry pi. However, it u can't make it work on the ESP32 using micro python, so it would be great if could show some guidance on that :-)....
There's a MicroPython code snippet for an SHT10 posted on the Pycom forum: forum.pycom.io/post/4618 Basically you convert all RPi.GPIO references to machine.Pin
I've only done cursory tests, but I was to able get MQTT working on my generic ESP32 running MicroPython. Both publishing and subscribing worked. On the ESP32, I used the umqtt.simple: github.com/micropython/micropython-lib/tree/master/umqtt.simple I tested it using a Raspberry Pi running Mosquitto.
well great then. gonna try it soon. I make my own video too regarding micropython for the esp8266, but it's in Bahasa Indonesia. This tutorial could be the next content for my Indonesian viewer. Thank you very much
Thank you very much great tutorial! Everything works fine! ...except I get this error from the python code MduleNotFoundError:No module 'machine' ? ...the led stays still to green. and by the way what means the c in the while loop : for c in spectrum : hue = c/2048.0 ? thanks for your time.
@@rdagger Thank you for your quick answer it is really appreciated! Chip is ESP32D0WDQ6 (revision 1) | esptool.py v2.8. I realised that I had python 2.7. I did install python 3.7 that way : installvirtual.com/install-python-3-7-on-raspberry-pi/ Then tried to install micropython machine that way : pip install micropython-machine But I still get : IOError: [Errno 2] No such file or directory: '/tmp/pip-install-yjBxCU/micropython-machine/setup.py'
Sounds like you are trying to install MicroPython on your computer instead of the ESP32. The MicroPython machine library is built in to MicroPython. If you install MicroPython on your ESP32, the machine library will automatically work. Please follow the steps on my website: www.rototron.info/raspberry-pi-esp32-micropython-tutorial/ The only tools that will require pip install are esptool and rshell. If you need to use libraries that are not included with MicroPython, then you just need to copy the python libraries to the flash storage on the ESP32.
If your program uses a 3rd party library module file, how do you put that file onto the ESP32/MicroPython filesystem so that it will be found when you run/(compile) the program? For example, my program which imports the "max7219" library module gives me this error message: ImportError: no module named 'max7219.py' I have tried to copy this file onto the filesystem, and can see it on the filesystem, but everytime I try to run it I get the above error message. If I embed the driver in my program instead of importing it, the program runs fine. I'm using the "Thonny" IDE and "rshell" utility. Any tips?
There are some differences and I don’t use the ESP8266 because of the limited memory. Please refer to the official MicroPython tutorial for the ESP8266: docs.micropython.org/en/latest/esp8266/tutorial/intro.html
The latest version of Raspberry Pi OS should come with pip. If you are using the lite version or some other version, then you can install pip using the following: sudo apt-get update sudo apt-get upgrade sudo apt-get install python3-pip
If dmesg | grep ttyUSB returns nothing then you may have a bad USB cable or a bad ESP32. You can test the board using a serial connection. See my ESP32 repair video: th-cam.com/video/OrQWos9VcgM/w-d-xo.html
It is not fully supported but new features are being regularly added. Unfortunately I'm not aware of any road map and the development is currently fragmented between MicroPython, Loboris and Pycomm. I recommend you ask your question on the MicroPython forum. Damian could probably give you a better answer. forum.micropython.org
@@rdagger Thanks for the quick reply! i discovered what was wrong... all 4 of my cables are cheap china power only cables. Had to rig a data cable from one of my sons toys... works now. Thanks for the great walk through.
If you're referring to NeoPixels, the WS2812B datasheet shows a supply voltage range of 3.5V - 5.3V. Running at 3.3V would be out of spec. It might work with some LED's but your mileage may vary.
You can use the rm command with rshell to delete files. For example: rm /pyboard/test.py You can also use delete files from the REPL by importing os and then using: os.remove('test.py')
What was the exact command that caused the error? Was there more to the error message? What ESP32 board are you using? Which Raspberry Pi are you using? Which version of Raspbian are you running?
This command: esptool.py --port/dev/ttyUSB0 flash_id I won't say its an error it is unable to connect... it starts to connect waits for some time and the above message which I showed is displayed, I am using raspberry pi 3b and nodemcu esp32 exacly the same one which you are using. raspbian version is 9 stretch. Before error message it showed connecting same as yours but it kept on connecting and after it failed to connect it showed the above message.
Sorry for the slow response. Your reply was flagged as spam. TH-cam thinks .py is a hyperlink. Were you able to get esptool working? If so, what was the problem?
Yes, I tested the code from the video and it works on an ESP8266. Use 0x0 for the ESPTool write address. You probably need to use a different GPIO pin for the DHT22. You might need to use a hardware pull-up instead of a software pull-up. I found GPIO 16 with a 10K ohm pull-up resistor works for the DHT22 on my generic ESP8266.
UPDATE: The starting address now needs to be 0x1000 instead of zero when you write the firmware to the ESP32.
Thanks a lot for the update, can you annotate this in the video inline at the moment of programming. I programmed the wrong address then I had to figure out what happened
Done. Thanks for the feedback.
@@LuciferGloria Yes, the RPI has plenty of power (600mA on the USB Bus by default, can be increased to 1.2A, the esp 8266 uses about 200-300mA peak); however, if your power supply for the Pi isn't big enough you could have a brown out. If your esp8266 and wiring is ok, you shouldn't damage your Pi, even if there is a brownout but you may corrupt the filesystem.
I appreciate your videos. the pace is great, clear and concise!!! And, keep it up with the ESP32, etc. Well done from a newbie in all the micro stuff. Glad to see Python making headway in this space.
Just finished I actually was one of the Kickstarters for MicroPython. I think this is awesome please do more as I work my way through your tutorial's
Thank you
This is the first one of yours I have watched. It went by fast, so thank goodness for rewind and pause! You certainly crammed a lot of useful information in this short video. Thank you.
Best and to the point tutorial video on TH-cam. Keep up the good work :)
Man this is a godsend
What a great video. I really liked the commentary, explaining what you were doing.
This is just what I was after.
I've just subscribed and will be looking for more :)
Outstanding video. Answers so many questions I had since I started playing with Pi and components, trying to get into IOT. ✔
just discovered this series, loving it. I hope there is more! checking now.
This tutorial has helped me immensely, I have installed rshell and this is just what I needed to get code onto my ESP32 board.
I have subscribed.
Excellent video and well done!
Dude, that was awesome!
It went so smooth just by copying and pasting from your site. No surprises. No drama.
Thanks man. Sub +1
you deserve a medal sir. Thanks
I like your way to simplify usage of esp32
Excellent tutorial. I can only mirror the other comments, YES, please continue to make these and I am just going to check out your whole play list :)
Very good and funny videos bring a great sense of entertainment!
Excellent tutorial! It helped me learn about the ESP32 and MicroPython. Thanks!
Thank you. This video came up in my TH-cam feed. It is very good. Yes, more vids with the esp32 would be nice. especially controlling a string of neopixels.
Very nice! worked here using OrangePi PC Plus (running Ubuntu) as developer PC and Lolin32 Board. Keep with the tutorials, you have good stuff.
Great presentation. Please continue.
Love your esp32 videos!
Great video. Any more micropython on an esp32 would be appreciated.
Please create the series you mentioned. I am very interested in learning how to connect sensors to the ESP32.
There is a part 2: th-cam.com/video/_vcQTyLU1WY/w-d-xo.html
and I will probably make more.
Fantastic, please continue making videos
love your videos, would love to see an update on the ESP32 . Thank you
Thanks for a great video!
I'd like to see more on the motion detection+sound playing setup.
I'd also like to see more on selecting which ESP32 board to choose - there are a lot to pick from, and how would I know if it's better to buy a Wemos Pro ESP32, than a Wemos Lolin for example? A basic selection-howto would be great.
And then something on powering the ESP32 - which batteries to choose.
And finally: Controlling motors with ESP32 - Servos, stepper and DC gear motors, and which motor controllers to use.
Martin Bøgelund ...is that all, come on you can do better than that ...
I learned at lot in this video, thanks for sharing
This was a great tutorial !! i am new to the micro stuffs and your videos helped me alot to understand the things.
i would like to see how to read UART data from sensor using esp32 and micropython.
Thank you.
Thanks for the feedback! I suggest you look at my Micropython JQ6500 repo. It uses the Micropython UART library to read and write from an ESP32 to an MP3 module.
github.com/rdagger/micropython-jq6500
Awesome vid man. I need to learn micro python, well python for that matter. :-)
That was very well done. I would like to see roatry encoder and i2c LCD.
thank you, excellent tut
Sweet this tutorial was clear and easy to understand. Can you do more videos of micro python with esp32 using the esp now protocol and sending analog values between two esp32s? Thanks again
I might be wrong, but I don't think espnow has been implemented yet in MicroPython. I am looking into solutions for mesh networks and low energy communication.
I would like to see how to use multiple cores of esp32 using micropython . Thankyou
excellent tutorial, what about one showing how to read and display data from a DHT22 sensor back into the raspberry
That's the next video in this series: th-cam.com/video/_vcQTyLU1WY/w-d-xo.html
thanks a lot, very useful video, appreciated.
Very nice tutorial
I would love to learn to use a ESP32 Cam to send video to a Raspberry Pi Zero W over a local WiFi network. I am a newbie to MicroPython and need to progress my skills for a project I am planning for myself and a duplicate for a friend. Your help would be greatly appreciated. Maybe even a link to existing code if you have it please.
Mr Cheung, I noticed you have hydronics videos. Can these arduinos be applied to an automated setup, and if so what would be a brief example of this. Many thanks.
Hi! Nice one. Can you post some OTA examples? ... Thanks
I think a video using the TTGO T-Dispay board would be goid. It has both a battery connector and a small color LCD on it. Working code for Arudino is out but getting a version of that in python would be nice. I have a few I just got for under $7 each.
I would like to see using a module for MAX31855KASA for reading a thermocouple sensor thanks good job
useful stuff. Thanks!
nice video
I would like to see the ESP32 being used to receive readings from analog sensors (like the pressure sensor where you used the ADS1115) and send it to the pi or to google sheets.
thanks
In part 4 of this series I demonstrate how to read a SoftPot using the ESP32 ADC: th-cam.com/video/a7DrFqqu-78/w-d-xo.html
exelent... i like it. thank you. absoutely i will try it soon
Fantstic video. Excellent presentation. Keep them coming! ESP32 seems like the new Arduino. Any thoughts on the uPyCraft IDE? A video on that would be great if you think that that IDE is the way to go.
Thanks for the feedback! I think uPyCraft IDE is a great tool to get started. However, the IDE is very rudimentary. I prefer to use Atom or VS Code for writing software because of the linters and abundant extensions. Both provide FTP extensions to upload your code directly to a device such as an ESP32. The LoBo build of MicroPython comes with built-in FTP. uPyCraft IDE provides a handy GUI to manage files although the last time I checked it had some trouble with folders. When working with a large volume of files or folders I prefer FileZilla.
@@rdagger Thanks for this too. I just installed Atom.
very good to watch. but sir can i bluetooth 4 esp 32 simultaneously to one rasberry pi ? or any way that make it possible?
The LoBo build of MicroPython for the ESP32 supports Bluetooth. Unfortunately, BLE has not been implemented yet.
..very nice video well done, micropython is really cool, thanks for sharing man, much appreciated. Any videos you could cover with micropython and the esp32 would be great, would encourage people to start using this language, the C based esp32 IDF environment seems daunting for the average person, thanks again :)
Could you elaborate on the best practice of connecting ground first when connecting a device and disconnecting ground last when removing. Thanks.
Best practices would be to connect everything with the power off. If you have to connect a device such as a NeoPixel to a live circuit then I recommend hooking up the grounds first to avoid the possibility of exposing a signal line to a higher voltage. In general it is a good practice to hook up grounds first except when jump starting a car.
Great ! Thank You!
Just obtained an espwroom32 board and watched your micropython video. Excellent, thank you very much! Will this board interface with Cayenne and how safe is it?
Sorry I don't know if the ESP32 will work with Cayenne. It's not on their list of supported microcontrollers so I would guess no.
By safe are you referring to security? If so the MicroPython firmware is still relatively new. I don't think SSL is supported yet.
Please make a video on programming esp32 using micropython in PC and webserver explaining all the various ways to code such as using subdirectories like modules and scripts
Thanks for sharing
That was a cool video. I haven't used mycrophython yet, but I have the pi and several esps at doing nothing at the moment.
Can you do a video using using ADA fruits micro python, command line interface arduino implemented with you current video. To see if they all can be tied together.
can you please provide us any link where to buy the esp32 board you used in this video and I belong to India.
I bought it on eBay 2 years ago. Make sure you get an ESP32 that has PSRAM (at least 4MB).
@@rdagger I am much confused to buy online so can you please help me with a link to buy .
# I am new in using microcontroller so need your help.
The ESP32's I bought are no longer sold. I haven't purchased one in over a year. I don't want to recommend something that I have not purchased. Just make sure you get an ESP32 Wrover with at least 4MB RAM of PSRAM. Loboris has a list of board vendor links on his wiki: github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki
@@rdagger Thank you! That is what I was looking for!
Hi,
great tutorial. I would like to see more tutorials especial on bluetooth.
Bernd
I wouldn't worry about your camera skills - just about everyone has issues trying to record LEDs of any color.
Hi, it's great video, I have a question need your help: how to get CPU usage and Memory idle in ESP32 running that using micropython ?
The gc and micropython libraries have methods to get memory usage:
docs.micropython.org/en/latest/library/micropython.html#micropython.mem_info
docs.micropython.org/en/latest/library/gc.html#gc.mem_alloc
I'm not aware of any CPU usage methods nor do I think they would be very meaningful because it's running on a microprocessor. I recommend you ask your question to the MicroPython forum for a more detailed response:
forum.micropython.org/
Hello,
While using "Thonny Ide", I get memory error when I include library. Can you help?
which library? what's the exact error message?
@@rdagger blynk library , example MemoryError: Memory allocation failed, allocating 136 bytes.
@@ScenicJourneysHub I haven't used blynk but you probably don't have enough memory on your board. Check out this post on the MicroPython forum: forum.micropython.org/viewtopic.php?t=7545
I like your MicroPython videos. I'm following along and have a question. I'm using an Adafruit Huzzah ESP32 board which doesn't have a 5v pin to attach the neopixel. Is there another way to do this? The Huzzah32 learn guide said something about using the USB or BAT pin along with an additional regulator. What do they mean? Any help would be appreciated. Thanks.
The USB pin should be 5V.
@@rdagger Thanks for the reply and info. I tried the USB pin, but got some weird results. The neopixel flickers really fast as it's cycling through the colors. So, I tried the BAT pin, and that smoothed out the color change to like what's in your video.
Where du you get the neopixel library from? I need a neopixel.py on my board right?
No, NeoPixel libraries are built into both the MicroPython and the LoBo builds:
docs.micropython.org/en/latest/esp8266/tutorial/neopixel.html
github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/neopixel
i have a problem. when i started rshel, this not recognized my esp32.
Can we use python to program this ESP32?
Hello. I just saw this video this week. I followed all the instructions in the video with the ESP-WROOM-32 board(s) the erase worked, the loading of the code (.bin) on the webpage appeared to work. But, when I got to the repl part to connect to USB0 it said 'No MicroPython boards connected - use the connect command to add on'. I tried two different codes from the page. i get the same thing on the repl.
@rdagger68 Ignore that msg, I saw the other reply you had mentioning that starting address to be 0x1000. It worked. Thanks.
Thanks so much for this video! My first experience with MicroPython! I've worked through it to the point of creating the Neopixel script, I don't have a Neopixel ;) Side note - I run my Pi headless, so I wonder if there is a nice command to download the ESP32 firmware via command line? I'm sure there is - I used scp to transfer it over from my Mac. I have an ESP32 with built in OLED so I am definitely going to that tutorial after getting to grips with the basics :)
You can use wget to download the firmware.
Great thanks, I tried this tonight, much better :)
Thanks for the awesome Tutorial!
Don't forget to do a "sudo usermod -a -G dialout $USER" then log off and relogin.
Otherwise rshell will not be able to connect to the Board...
Thanks. The usermod command is not necessary assuming you are using the latest version of Raspbian.
Ah ok. I was using Ubuntu 16.04 on a VM
Could you give links for good documentation for ESP probes phyton programming?
Not sure what you mean by ESP probes. Are you asking about exhaust sensing probes? If you are looking for help getting started with the MicroPython language then any Python 3 tutorial would be a great start. Here's a link: th-cam.com/video/oVp1vrfL_w4/w-d-xo.html
what it the other device in the usb. Like a bluethooth mouse and keyboard device?
I don't understand your question, but if you are trying to emulate a USB keyboard or a Bluetooth mouse then I recommend you take a look at CircuitPython because it offers excellent Bluetooth support and USB HID. Here are 2 tutorials:
learn.adafruit.com/circuitpython-essentials/circuitpython-hid-keyboard-and-mouse
learn.adafruit.com/ble-hid-keyboard-buttons-with-circuitpython
Excellent tutorial but I do not know what I'm doing wrong. but when I disconnect the pc cable, the communication between the devices is lost. I'm not supposed to have connected the two devices. the communication would not be done by wifi?
When the USB cable is connected to the ESP32 it provides power. How are you providing power when the USB cable is disconnected? Are you using a battery or power supply? What is the voltage and current? Which pins on the ESP32 are you using for power?
Hi, thank you very much for this video. I'm using Windows Subsystem For Linux with Ubuntu 18.04, but when I connect the ESP32 in the USB port and type the dmesg | grepp ttyUSB nothing is happening. I have searched a lot on google and can't find any help. Thank you very much.
I have never used WSL and I don’t know how it handles USB devices. I’d guess that a USB to serial device would be mapped to a serial port. Check the Windows Device Manager for the com port of your ESP32 and then see if there is a corresponding WSL serial port. For example, if the ESP32 is mapped to COM3, check WSL for ttyS3.
@@rdagger I discivered that WSL doesn't support USB serial device. Thanks. Now I'm trying to compile micropython with Microlad module but without success.
Hello, I need to monitor my aquarium from remote location. Need to know what kind of interface needed for camera HW/SW. Thanks.
I don't have any experience working with cameras on the ESP32. The OpenMV camera looks promising:
openmv.io
Adafruit also has a couple of TTL serial cameras that might work. A Raspberry Pi might afford better camera options.
Here's another possibility: github.com/namato/micropython-ov2640
This is a real great start in micro python and ESP32. I am totally new to this and tried this a few weeks ago and it worked well. I wonder if the python upgrade has broken it tho as I am now getting no output from
dmesg | grep ttyUSB
and
esptool.py --port /dev/ttyUSB0 flash_id
says
No such file or directory: /dev/ttyUSB0
looking in /dev there is indeed no ttyUSB files at all.
Sorry for the slow response. Your reply was flagged as spam. TH-cam thinks .py is a hyperlink. Were you able to resolve USB issue? If so, what was the problem?
Hi mate. Great vid. ive been following it. However
I get a hang up when using rshell into the esp board (it just says connection and then does nothing). I am 8266 version is there something different?
Did you build the firmware yourself or are you using a daily build from MicroPython.org (if so which version)? Did you specify address 0x0 when writing the flash? Which ESP8266 board are you using?
I have the same problem. Using an ESP12S. First time I worked through your tutorial everything worked perfectly, I tried updating the uPython and now nothing works anymore. Any resolve yet?
Using uPython for esp8266, tried most versions in combination with adress 0x0 and 0x1000 no luck
What build are you using? Did you erase the previous firmware prior to writing the new firmware? What error message are you getting?
i tried using both the esp32 and esp8266 build and all versions. Erased flash before writing. Not getting any errors, as soon as I try connecting with rshell it just hangs
I'm desperate to find a tutorial of how to use the Sparkfun ESP32 Thing with Mozilla IOT to do some home automation. I would be eternally grateful if you could do a video on this.
how did you learn to code?
I taught myself programming at a young age. My parents had a very primitive computer. The paper instructions included basic code for several simple games. I typed in the code and experimented by making modifications. I wanted to make my own games which I did and shared with my friends. This was before the Internet.
@@rdagger oh that's nice.. so that's why you are very good at it.. I like this mircropython series.. I just learned about it a couple weeks ago python on microcontrollers and just started to study programming , studying python currently everything is so overwhelming but it's very cool .. Do you have a video of creating a mobile app to read the sensor and maybe turn on and of the LED?
I created a mobile app using React Native and Expo for a solar powered project: github.com/rdagger/Expo-Solar-Tracker
Try to make video Arduino vs ESP32
ESP32 can be program by pc?
Please make a video for pm2.5 air quality sensor + dht22 +tft display + send data to UART using miropython. Thanks
I'm trying to setup an ESP8266 with Micropython, and everything works as on the video but it keep saying 'Trying to connect to REPL". Any idea why?
For the ESP8266 check out docs.micropython.org/en/latest/esp8266/tutorial/intro.html
Great tutorial. Finally got it working..
Now trying to tweak code to allow a full 8 LED NeoPixel Strip to light up. Not getting much success thus far..
I tried changing your code by amending and adding the following lines -
# Amount of Pixels
np = NeoPixel(Pin(13), 8)
# In the middle
np[0] = hsv_to_rgb(hue, 1, .15)
# all the way to -
np[7] = hsv_to_rgb(hue, 1, .15)
# and at the end
np[0] = (0, 0, 0) # Turn off NeoPixel
# all the way to
np[7] = (0, 0, 0) # Turn off NeoPixel
Will keep plugging away :)
Are you getting an error message or just nothing? I recommend you also try the LoBo MicroPython build. LoBo has more robust support for NeoPixels: github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/neopixel
I found that occasionally it's necessary to adjust the _timings_ property with some NeoPixels. Also make sure you have an adequate power supply and good quality short USB cables.
@@rdagger It was my code - will post error messages next time. Enjoying your tutorials. Keep up the good work!
the ESP has a compatible library for hosting a simple web server how can i add a password to it to secure it a little?
Great Video! it would be great to see how you would transfer sensor information from the ESP to central Rpi through WiFi. is it possible to write own Python module and import it and use it in micro python?
Yes, you can write your own MicroPython modules and copy them to the ESP32. Other MicroPython programs on the ESP32 can import and use them. The 2 examples at the beginning of the video use separate MicroPython libraries that I created (LCD display library and a JQ6500 sound module library). Both are available on my GitHub site: github.com/rdagger
There is also a large collection of core Python libraries ported to MicroPython available at github.com/micropython/micropython-lib/
I’d ask the experts over at forum.micropython.org because I have not tried setting up web server authentication on an ESP32 using MicroPython. Please post a link because I'd be interested in the responses. I’d probably go with a VPN solution or possibly a password protected Ngrok tunnel. Seems like a Raspberry Pi would be an easier platform with respect to web security.
rdagger68
Thanks for the quick reply. I have SHT10 sensor that works fine with sht1x python library on the raspberry pi. However, it u can't make it work on the ESP32 using micro python, so it would be great if could show some guidance on that :-)....
There's a MicroPython code snippet for an SHT10 posted on the Pycom forum: forum.pycom.io/post/4618
Basically you convert all RPi.GPIO references to machine.Pin
Like to see more video on esp32 RPI interfaceing using MQTT CoAP protocols
What is the name of usb you use btw pi and esp32. what kind
Micro-USB
Is it already support mqtt? tried mine last week. But it only support http protocol for IoT so far
I've only done cursory tests, but I was to able get MQTT working on my generic ESP32 running MicroPython. Both publishing and subscribing worked. On the ESP32, I used the umqtt.simple: github.com/micropython/micropython-lib/tree/master/umqtt.simple
I tested it using a Raspberry Pi running Mosquitto.
well great then. gonna try it soon. I make my own video too regarding micropython for the esp8266, but it's in Bahasa Indonesia. This tutorial could be the next content for my Indonesian viewer. Thank you very much
the same library worked for publishing temperatures from a DS18B20 using Feather HUZZAH ESP8266 to a Mosquitto broker (mqtt) running on an RPi 3
How about the Photon. That is a better/new device.
Thank you very much great tutorial! Everything works fine! ...except I get this error from the python code MduleNotFoundError:No module 'machine' ? ...the led stays still to green. and by the way what means the c in the while loop : for c in spectrum : hue = c/2048.0 ? thanks for your time.
What version of MicroPython are you running? Which ESP32 board are you using?
c is for color (loop through every color in spectrum)
@@rdagger Thank you for your quick answer it is really appreciated! Chip is ESP32D0WDQ6 (revision 1) | esptool.py v2.8. I realised that I had python 2.7. I did install python 3.7 that way : installvirtual.com/install-python-3-7-on-raspberry-pi/ Then tried to install micropython machine that way : pip install micropython-machine But I still get : IOError: [Errno 2] No such file or directory: '/tmp/pip-install-yjBxCU/micropython-machine/setup.py'
Sounds like you are trying to install MicroPython on your computer instead of the ESP32. The MicroPython machine library is built in to MicroPython. If you install MicroPython on your ESP32, the machine library will automatically work. Please follow the steps on my website: www.rototron.info/raspberry-pi-esp32-micropython-tutorial/
The only tools that will require pip install are esptool and rshell. If you need to use libraries that are not included with MicroPython, then you just need to copy the python libraries to the flash storage on the ESP32.
If your program uses a 3rd party library module file, how do you put that file onto the ESP32/MicroPython filesystem so that it will be found when you run/(compile) the program? For example, my program which imports the "max7219" library module gives me this error message:
ImportError: no module named 'max7219.py'
I have tried to copy this file onto the filesystem, and can see it on the filesystem, but everytime I try to run it I get the above error message. If I embed the driver in my program instead of importing it, the program runs fine. I'm using the "Thonny" IDE and "rshell" utility. Any tips?
I haven’t tried Thonny. Generally speaking you just have to put the Python library in the same folder as your program.
This worked
can I implement this tutorial with esp8266?
There are some differences and I don’t use the ESP8266 because of the limited memory. Please refer to the official MicroPython tutorial for the ESP8266: docs.micropython.org/en/latest/esp8266/tutorial/intro.html
Sorry man, what's Raspberry Pi? What are you using it for?
www.raspberrypi.org/help/what-%20is-a-raspberry-pi/
FYI, in 2021, when flashing an ESP32 board, I had to use the flash address as 0x1000 instead of 0x0. If I used 0x0 the board was in a crash loop.
Sudo : pip3 : command not found, any help ?
The latest version of Raspberry Pi OS should come with pip. If you are using the lite version or some other version, then you can install pip using the following:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3-pip
right now.. i cannot get the dmesg | grep ttyUSB to output
If dmesg | grep ttyUSB returns nothing then you may have a bad USB cable or a bad ESP32. You can test the board using a serial connection. See my ESP32 repair video: th-cam.com/video/OrQWos9VcgM/w-d-xo.html
@@rdagger correct.. it runs nothing
@@rdagger watching it as of now
@@rdagger what type of wires are those?
@@rdagger do you think the wires will do or do i need to buy an extra chip?. will this all depend after wires in and a reboot on the vid?
Does anybody know the status of micro-Python and the esp32, does it fully support the esp32 ? Can't seem to find the status update for this...
It is not fully supported but new features are being regularly added. Unfortunately I'm not aware of any road map and the development is currently fragmented between MicroPython, Loboris and Pycomm. I recommend you ask your question on the MicroPython forum. Damian could probably give you a better answer.
forum.micropython.org
Thank,s
How can I replace esp32 to esp8266 for this poject ?
I have not tested it. The ESP8266 has less memory than the ESP32 but it is probably enough to run this simple project.
When i try to run dmesg | grep ttyUSB nothing happens...
That would indicate that the Pi doesn’t see any USB devices. It could be a bad USB cable or a bad ESP32 board.
@@rdagger Thanks for the quick reply! i discovered what was wrong... all 4 of my cables are cheap china power only cables. Had to rig a data cable from one of my sons toys... works now. Thanks for the great walk through.
Why not to use 3.3v pin ?
If you're referring to NeoPixels, the WS2812B datasheet shows a supply voltage range of 3.5V - 5.3V. Running at 3.3V would be out of spec. It might work with some LED's but your mileage may vary.
can someone let me know how to delete a file from the esp32?
You can use the rm command with rshell to delete files. For example: rm /pyboard/test.py
You can also use delete files from the REPL by importing os and then using: os.remove('test.py')
It shows A fatal error occured failed to connect to espressif device
What was the exact command that caused the error? Was there more to the error message? What ESP32 board are you using? Which Raspberry Pi are you using? Which version of Raspbian are you running?
This command: esptool.py --port/dev/ttyUSB0 flash_id
I won't say its an error it is unable to connect... it starts to connect waits for some time and the above message which I showed is displayed, I am using raspberry pi 3b and nodemcu esp32 exacly the same one which you are using. raspbian version is 9 stretch.
Before error message it showed connecting same as yours but it kept on connecting and after it failed to connect it showed the above message.
Sorry for the slow response. Your reply was flagged as spam. TH-cam thinks .py is a hyperlink. Were you able to get esptool working? If so, what was the problem?
No actually its not getting connected.
Some ESP32 boards need to be put into flash mode in order to use ESPTool.
nodemcu.readthedocs.io/en/dev-esp32/en/flash/#putting-device-into-flash-mode
Module RPI.GPIO please
Do you ESP8266 ? Same procedure, I guess...
Yes, I tested the code from the video and it works on an ESP8266. Use 0x0 for the ESPTool write address. You probably need to use a different GPIO pin for the DHT22. You might need to use a hardware pull-up instead of a software pull-up. I found GPIO 16 with a 10K ohm pull-up resistor works for the DHT22 on my generic ESP8266.
@@rdagger thx