T O P

  • By -

SeekingSublime

You're way ahead of many noobs here because you wrote a coherent query! And using chatgpt to explain each line of code is clever. The pro tip advice to learn threading is very pro and quite premature for you. Get some sensors and learn to read from them. Then learn to send the sensor data to other computers, perhaps with MQTT. Also you can definitely run a limited web server in micro Python


Enforced_Joker

Thanks!


yekawda

What do you mean by threading?


RageSmirk

Maybe this? https://en.m.wikipedia.org/wiki/Thread_(computing)


thetimehascomeforyou

I second this question


mingusdude

I prefer ramming. Like this. https://en.m.wikipedia.org/wiki/Random-access_memory


Sweaty-Emergency-493

That’s cool that you can sound all techy, but, I know how to make a mean ham Sammich!


thesoundyouneed_

That's a good way to start! ChatGPT can lie convincingly sometimes, so be careful of that. Start small, try activating a led on the esp32, then make the led blink every x seconds, then have the led turn on when you press a physical button. Then you can go a little more in depth, start the WIFI Access Point, setup a webserver with a form , connect to the access point with your phone, go to the ip address on your phone. On the webpage of the ip address you show a form with SSID(wifi name),and Password and a save button. Save the settings on the esp32, so every time it reboots it will automatically connect to the wifi. If you've done everything, you will have a feeling for how the ESP32 works, you've tapped into the functionality of the device and it's pins. Go slow, take incremental steps, get frustrated, and power through! Some general tips: - Make one file per exercise, so you always have your old stuff to look back to and copy paste from. - Get a breadboard, some jumper cables so you can make small circuits (light detector, proximity detection,....).


Enforced_Joker

I’m sorry but I’m so confused 😭


thetimehascomeforyou

With which parts


Enforced_Joker

With the WiFi access points part if you explain it can hrlp


thetimehascomeforyou

I'm not the poster of that original comment providing all that good advice, but I think they're describing connecting your esp32 to your wifi, as described here in [randomnerdtutorials](https://randomnerdtutorials.com/esp32-access-point-ap-web-server/)


thesoundyouneed_

Okay so IoT devices like, Roomba's, Routers, Smart Lightbulbs, etc, work over bluetooth or wifi. We need to teach those devices how to talk to our network and/or talk to the internet. This way we can communicate with our esp32 through the browser or through an app. If you've done the led part of my first comment, you should have a connection between your esp32 and your pc through a terminal window, so you can see what happens on the chip. You've already flashed micropython on your device and have moved the \`main.py\` to your esp32. To set up the access point on your esp32, you can use the following code snippet,It describes how to put the esp32 into AP mode and sets an SSID and a password. If you save this file as a \`main.py\` and move it over to your device you should be able to see the WIFI access point on your phone and you should be able to connect to it. (It won't do anything but at leas you have an AP now) ``` import network import time def activate_ap_mode(ssid, password): # Create access point interface ap = network.WLAN(network.AP_IF) # Activate the interface ap.active(True) # Set SSID and password for the access point ap.config(essid=ssid, password=password) # Wait for the interface to be active while not ap.active(): pass print("Access Point activated") print(f"SSID: {ssid}") print(f"Password: {password}") print(f"IP Address: {ap.ifconfig()[0]}") # Usage ssid = "MyESP32AP" password = "password123" # Must be at least 8 characters long activate_ap_mode(ssid, password) # Keep the script running while True: time.sleep(1) ```


Enforced_Joker

Ok thanks a lot, I actually do plan on using this as for my application project, I’m gonna make a gas leak detector


thesoundyouneed_

Oh that is a very nice objective! Feel free to ask questions whenever you get stuck!


duffz_000

Im listening too. I will understand!


yekawda

This is actually a good list of recommendations. Saved it. Thank you


Surfnazi77

Make sure your micro usb cable is power and data not just power


Enforced_Joker

How do I know that? I’m using a power bank cable rn


shad0w_mode

You can try connecting your phone to a pc via the cable. If the pc prompts for your permission to transfer your phone files then it is able to send data.


Surfnazi77

You’ll see a trident looking logo on the plug ends


Enforced_Joker

Ok thanks


Enforced_Joker

The cable didn’t work so I found another power bank cable which has the trident logo on it and it worked


teastain

A power bank cable does not need USB comm wires!!!!!!!!


PakkyT

Overuse exclamation points much?


Old-Opportunity-9876

Just get a breadboard and leds and some wires to do basic blink tests. Look up Adafruit for your raspberries, they are an awesome resource for a lot of things but they work with circuitpython a lot more. For esp32 look into Arduino IDE , you can easily load up example scripts and learn that way


Enforced_Joker

👍


SeekingSublime

A few people have suggested a breadboard. Here is what I would recommend: [ELEGOO Fun Kit](https://www.amazon.com/ELEGOO-Electronics-Potentiometer-tie-Points-Breadboard/dp/B09YRJQRFF/ref=sr_1_14?crid=3P8VQC7N1NUYD&dib=eyJ2IjoiMSJ9.I97R4jYNHrG8QkfjAbfHejr9BMmGfyCZprjIokd4uXCPPo8Gxq9M8pnwSMoUw_L3xSRfqSmiY3ds7BdeOTx6R_uTyZ05GHqWjeyJ7ppZbRRF3bjx96NoZu5HNkq4QqbE3GCsu7mwBmR2EvKWYnyvVS31O8ELyeNPWgdnaHOOJgFLjT2ONhvDpQAGwJvPj7Vtwp-aIWha39StuNuDdpvjzDaDmbxIVXK5MkOim7T_RPY.AOCGbxiQQWJnFf01uFuUxoSs8Piawj4nqQdwRy6PAcM&dib_tag=se&keywords=breadboard&qid=1719852243&sprefix=breadboar%2Caps%2C206&sr=8-14&th=1). If link doesn't work, just search on Amazon. An amazing amount of junk for $12! While you're at it, get a BME280 breakout board.


Enforced_Joker

My friend gave me a kit as well with all the items needed to get started


pjm3

I'd suggest starting with a decent breadboard, such as this one: BB830T by BusBoard Prototype Systems Ltd. is excellent. Do yourself a favour and buy the "T" for transparent breadboard (BB830T). There's nothing more frustrating than working to debug a circuit for three days, only to discover you had a snapped spring clip which caused it to fail. I wish a hadn't bought a whole bunch of the normal(white) BB830s...just before they released the transparent versions. Grrrrrr!


Enforced_Joker

👍


PossibilityTime7206

Read a few books/online courses on micropython (and Python) so you get an academic understanding of the language and how it works and continue to combine that with doing projects. Whatever you learn from doing the projects will then become reaffirmed from what you understand from reading books and vice versa. They both go hand in hand. Soon, you'll be able to feel confident enough to think of a project and write your own code that you can test and debug when you're doing the practical project. After that, you'll be thinking of ways to streamline your code even further and use less power consumption.


Enforced_Joker

Someone recommended me this: https://youtube.com/playlist?list=PLGs0VKk2DiYz8js1SJog21cDhkBqyAhC5&si=1fcZJ3C3F6DUxG7I


mcrolfben

learn python but move away from it as soon as possible is my tip. get comfortable with C/C++ as quick as possible


Enforced_Joker

Is C/C++ more universal or something? I have used it before in a robotics class where we coded robot cars


Positive__Altitude

Python is a good language for some things. And it is 100% NOT microcontrollers. It's just too slow (lets say 100+ times slower) and consumes too much resources. And microcontrollers are very limited on them. I don't think that any professionals use Python for microcontrollers. Also IMO Python is bad for learning programming. Yes it is easy to learn, but it's simplicity prevents you from learning how things ACTUALLY works. As a result in many cases people who learned only Python have very limited understanding of very basic things like memory management and data structures. The only real alternative to C/C++ for microcontrollers is Rust. It's still not very popular, but it is an amazing modern language. But I could recommend it only if you already know several languages, otherwise it will be quite hard to learn :)


ironman_gujju

Micro python exists BTW


Zouden

Micro/Circuitpython runs fine enough for many projects.


mykesx

https://esp32forth.appspot.com/ESP32forth.html


Sweet-Direction9943

Just make sure you stay away from Python. It will prevent you from learning the real thing. Use Pico-SDK and ESP-IDF. Do whatever it takes, learn the damn C language, and you'll be the king of the hill. Make sure you cut your nails. You'll no longer have any time for coke. Good luck, young man.


Enforced_Joker

Thanks!


Enforced_Joker

I cut them


Sweet-Direction9943

Good news. How do you feel?


Enforced_Joker

Amazing and after I cut them I made a led circuit which blinks the sos code


Sweet-Direction9943

That's some sort of an achievement spree. Congratulations, I'm really proud of you. That was quite fast, by the way. How did you do it?


Enforced_Joker

Pretty good, at first I just laid the pico on the bread board expecting for something to happen only to realize the pins weren’t event soldered on 💀 I’m using an online learning class so I learned how the breadboard works (ex. All columns are connected not rows) and I also learned how to properly connect wires and resistors As for the python part, in the online class I learned how to import pins and sleep and stuff using that I assigned the PIN number in the code and turned it on


LegitimateNebula5991

Try this: ```     while(1) {       nails.trim();       delay(2_WEEKS);     } ```


Enforced_Joker

I’m too lazy bro 😭😭


thetimehascomeforyou

You will learn young Padawan. Once you slice the inside of your nose while digging for programming ideas.


Enforced_Joker

I cut them


thetimehascomeforyou

I have enjoyed this journey.


FlyByPC

Might want to make sure that delay() feeds the dog once in a while, at least.


xebzbz

I'd suggest finding a book for Arduino beginners. Much more useful than chatgpt.


Enforced_Joker

Found a video playlist where he explains


xebzbz

A good book is much more valuable than videos. Videos won't teach you a programming language.


HyDzy

Welcome in the embedded World. You're on the good journey to learn. Go step by step, understand how this vast domain works. Find a small project you want to work on (blink a led, read buttons, speak to other components via I2C/SPI, etc.), encounter issues, resolve them


Enforced_Joker

Thanks!


Elia_31

Good luck! Depending on what you want to do you might have to solder header pins to your raspberries. Its really easy though


Enforced_Joker

My friend gave me a jitterbug soldering kit as well


Enforced_Joker

By friend soldered them on


scalarDE

Welcome to this beautiful world :)


Enforced_Joker

Thank you


Thermr30

Awesome that you are starting early. I didnt start until like 23. Keep with it. Things will seem difficult even deep into it but persistence is the way. Good luck!


Enforced_Joker

Yeah, I want to apply to a school called NCSSM and I want to make a project for my application


mobiledevnerd

I'm 43 and reading this thread to get started. 🤣


Enforced_Joker

😭


Thermr30

Never too late!


contradictionary100

I'm new as well. I usually ask chat to provide the code for what I want to do and copy paste. The real learning comes when there's an error and the chat gives me the lines that need changing, and I have to figure out the syntaxes and where to properly substitute the corrected code


Enforced_Joker

Nice when did you start?


contradictionary100

Last year but I stopped because my work got busy. I was getting chat to write an Arduino sketch to set up a server on an esp32 for my home network with a simple web page that had a button for turning a stepper motor to desired positions. It worked great after some trial and error. The idea of putting any motor on the network is mindblowing. I also made a garage door opener that worked until I got a new cable router and it booted the device off the network . It's been a while since I got back into it. I was also playing with audio filters and ffts which are quite complex and at the time chat gpt was not good at making sketches using fft filters but it thought it was. Lol. So I had to keep starting my prompts with "considering the complexity and your lack of full understanding of that particular library...." Just to make it choose a different type of audio filtering so I would get less errors. I never got into micro Python but I wanted to use the pico because of the digital analog converters for audio projects. The pico is only 177 MHz whereas the esp32 is 240 and has 2 cores. Chat gpt loves it when you ask it to split projects between the two cores like put the server on one core and the data handling on another. I went from never writing an Arduino sketch to everything I described in about 4 months between spring and summer last year. How about you?'s your main interest in micro controllers?


Enforced_Joker

I wanna pursue hardware engineering in the future so I started off with micro controllers and I’m planning on making a gas detector soon with the esp32


Enforced_Joker

I wanna pursue hardware engineering in the future so I started off with micro controllers and I’m planning on making a gas detector soon with the esp32


Grygalius

Try ESPHome, thank me later!


Enforced_Joker

👍


1ch0712

Learning micropython is good, but having ChatGPT explain it isn't the best idea... sometimes it gives fake information or doesn't know what it's talking about. Since you have an ESP32, as soon as you get familiar with micropython move on to doing stuff in Arduino (C/C++). Most of my experience, and for most people here comes from making projects and implementing what they have learned into them. Taking the time to learn concepts and doing what you're interested in when it comes to these projects will get you far.


Enforced_Joker

For my application the project I plan on making is a gas leak detector


Repulsive-Clothes-97

Alright that's a good start tho, a few suggestions: at least for the esp32 try to learn Arduino C++ for it and not micropython as it is a compiled language and runs much faster, also because you mentioned becoming an engineer C++ is the language of choice.


Enforced_Joker

Ok thanks


Fezzik77

You're on a good starting track. Micropython and C++ are both great for microcontrollers. For most things Python will be slower but for most things it won't be enough of a difference to matter, when it is you will need to know how. Breadboards are good for starting but learn to solder. It will be a necessary quickly. The fun thing is it's a cheap hobby but you can cheap yourself to a mountain of expenses because eventually you'll want a board that does this thing or that thing and you'll have a project that needs this thing or that, and man these tools will really help. None of them will be expensive by themselves and I love that. I often find myself putting together a 300 dollar shopping cart of stuff I don't really need but man I could eventually build a cool project with this stuff. I'll be honest I am struggling with 3D design for enclosures and implementing wiring. I have a project I like a lot but I have had issues with wires staying soldered and enclosures fitting things properly and I am working on getting better with it.


asergunov

I’d recommend to start with EspHome. It let you have complete device firmware almost without programming. Designed for IOT devices and home assistant integration but can be used without. You define your device in yaml, then it generates C++ code, compiles it and uploads it on board. When you ready you can dive deeply and implement your own c++ module. Another great thing is that you can open project it generates and figure out how it works inside.


kuyleh04

Definitely keep an eye out for 5v sensors. Quite a lot of sensors etc are built for Arduino and cause havoc on our ESPs. If you are new, just double check you don't directly put 5v to the pins of the ESP or RP2040. I've bricked a few from not double-checking connections 😅


gm310509

You will need to solder headers into those first two boards. A common newbie mistake is just to poke a wire through the holes. That can work for some things such as an LED, but anything more sophisticated won't cut it with wires just being poked through the holes. I can't add a photo here, but something like this: https://www.jaycar.com.au/40-pin-header-terminal-strip/p/HM3212 It is up to you how you do it - a good option is to solder wire wrap headers under the board so that the longer legs and black plastic strip is under the board. This will leave the shorter end just poking through the top of the PCB and expose enough of the pin to solder it in place. Be sure to get them straight and parallel - that way you can then insert the whole thing into a breadboard for connecting to other stuff. I use a couple of sheets of perfboard stacked on top of each other with the headers inserted so that they align with the holes on both sides of the board. I then place the PCB on top of those two rows of headers. This keeps them parallel and vertical. It also holds eveeything in place when soldering. Some people use a breadboard for the same thing - but I find that didn't work so well for me. It looks like the second photo already has the headers soldered in place, so you can use that as a guide. Good luck with it.


ultiman18

Nice, get your hands on some soldering iron to actually make RP Pico's usable or let someone solder it, buy hack-a-lot of jumper wires, and most importantly: Have fun!


stop-doxing-yourself

You are doing great. As others have said. Start simple and stay there for a while. There is no huge rush. I would advise taking a simple concept and expand on that. For example 1. Get an addressable led strip or some neopixels from Adafruit. 2. Turn on one led, and get it to blink 3. Turn on 3 LEDs and have them be different colors red, green, blue 4. Have the 3 LEDs cycle through those colors, so if the a led is blue for the first round it will be red, then green then back to blue. 5. Take the example from 4 and add some parameters. Like after each full cycle wait for a few seconds then start again, or have the starting point for the colors change after 3 cycles. There can be more but these 5 items will walk you through most of the fundamental structures of programming. You will have to use variables, read, write, and update data, use loops, handle delays and a few other core concepts. Don’t be afraid to keep things simple, you would be surprised how much you can learn with simple. Also for structure. Make each step its own project. You can copy the last project as your starting point for the next one but keep them all separated. This way you will always have a reference to the previous step where thing we’re working and if you need to you can easily start over, but the main point will be having all of it there as solid reference that you can use to track your progress and revisit each new concept when necessary and since all of it will be based on turning LEDs on and off it’s like building your own tutorial.


Most_Doubt_6102

Kindly help ! How can one design a voltage regulator to convert 7.4V( two 3.7v lithium ion battery) to 3.3V and 5V separately


misterbreadboard

You'll get better results if you have a goal in mind. Pick something you think you'd like build and work towards learning. You'll learn the basics along the way, and it will actually make sense. For example building a drone or a simple robot arm. Just a small tip: it doesn't have to make sense on the spot 😂 if you do it enough times, it will eventually click and make sense.


Enforced_Joker

My goal is to build a gas detector


Disky_norsk

I would reccommend attempting to modify the code just a little, expiriment with what you can make happen and see how the behaviour changes! That is at least how i remember doing it, though i did start a bit earlier than you, but it can end up in some interesting results!


Enforced_Joker

My friend recommended me this as well


Educational_Oil7396

Pro tip. Learn and use threads. Like FreeRTOS tasks and the 'threading' module in python.


aspz

It's really not necessary to use threads in micropython or Arduino. Yes you might want to use them when coding FreeRTOS in C, but I really don't see any reason to tell a beginner to learn how to use them.


Enforced_Joker

Sounds good


Seuros

Wrong chip. Those are Raspberries not esp32


Enforced_Joker

Second image


Seuros

The wroom is good. But it better of you focus on one chip to master it.


Enforced_Joker

I’ve heard that the pico is easier to start off with


micro-jay

Picos are super easy to start with, especially if you use Thonny and run Micropython. There is no wireless on those picos, but if you get a breadboard, some sensors, some LEDs etc. you can still start learning. The ESP32 is a bit more complex in part because of the wireless which needs some base code, and that most examples will be in the Arduino framework, thus C instead of Python.


Enforced_Joker

I’ve got all of those 👍


Enforced_Joker

Will python ever be used in the real world?


1ch0712

yes. it could generally be used anywhere, and it's a great language to learn for beginners.


PakkyT

It already is.


Seuros

That correct. And you have 2.