Raspberry Pi Pico W LESSON 28: Connecting the Raspberry Pi Pico W to WiFi

Поділитися
Вставка
  • Опубліковано 27 сер 2024
  • This is the OLED display we will be using in future lessons. Please go ahead and order it so you will have it for next week's lesson:
    amzn.to/3nq8l4Z
    You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
    / paulmcwhorter
    In this class we will be using the Sunfounder Raspberry Pi Pico W Keppler Kit. It will make things a lot easier if we are working on identical hardware. the link below is to amazon, and is for the identical hardware I will be using in this entire class.
    amzn.to/3ubMRs1
    In this introductory video, I will show you how to set up a simple client server relationship over wifi for the Raspberry Pi Pico W. The Pico W acts as a server, and your pc will act at the client. We will communicate wirelessly over wifi between your pc and pico pi using a UDP socket. Enjoy!
    [Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. ]
    #raspberrypipicoW
    #oled
    #wifi

КОМЕНТАРІ • 114

  • @bigbogeyface
    @bigbogeyface Рік тому +26

    Hey guys 👋
    You maybe experiencing difficulty running two instances of Thonny.
    Here's the solution:
    Click Tools > Options > Uncheck "Allow only single Thonny instance"
    Then close Thonny completely and re-open it again.
    Now you can have two Thonny side by side 👍

    • @charlotteswift
      @charlotteswift Рік тому +1

      Thanks, Mr Burger

    • @bigbogeyface
      @bigbogeyface Рік тому +1

      @@charlotteswift You welcome 😊🙏

    • @alistaircook1997
      @alistaircook1997 Рік тому +1

      Thank you very much for this, great info

    • @Ed-fv9rl
      @Ed-fv9rl Рік тому +1

      It does work, however, it only connects to Raspberry on one instance not both

    • @snowman58able
      @snowman58able Рік тому +1

      Thanks I struggled trying to figure out how to get a split screen

  • @timefactortheoryofgravitya7578
    @timefactortheoryofgravitya7578 9 місяців тому +3

    I bet most of us would love you to walk us through creating our own "secret" library to import. Maybe think about this for upcoming videos? Everything you can teach us is worth the time!

  • @cbrombaugh
    @cbrombaugh Рік тому +2

    I AM LEGEND! This is a most-excellent lesson Paul. Freedom from wires is great! A couple things I would like to see in this series is how to run an asynchronous web server on the Pico W and how to load new programs onto the Pico W without wires. It is such a cool, little and inexpensive machine (running Python) that I think it is in a totally higher class than the Arduinos.

  • @robakers6127
    @robakers6127 Рік тому +1

    I like how the lessons tie to gether... good homework assignment

  • @stephenlightkep1621
    @stephenlightkep1621 Рік тому +1

    Thanks Paul. Starting to understand the whole server and client thing.

  • @melc.a.2841
    @melc.a.2841 2 місяці тому

    Very good lesson. Using an IP address and server, everything is understandable. As an added bonus, it turned out that Python 3 and Micropython can run in separate Thonny windows.

  • @VK5AV
    @VK5AV Рік тому +1

    Love your passion for Maths Paul. My kit turned up today so looking forward to getting started.

  • @qzorn4440
    @qzorn4440 10 місяців тому

    Wow, a very amazing set-by-step WIFI Server/Client example. Thank you.

  • @ToniHayek
    @ToniHayek Рік тому +3

    Thank You Paul, it was a very helpful lesson. I run your code on esp32 (i don't have PICO W) and it run very well❤

  • @ParshvaPatel-ib9lm
    @ParshvaPatel-ib9lm Рік тому +1

    Thank you Paul for this very important lesson, I needed it .I am planning to build an ornithopter for my project which powered by dc geared motor .I have already learned how to do pwm now this is the next thing i need to learn to make it rc .

    • @bigbogeyface
      @bigbogeyface Рік тому

      That sounds well interesting 😮👍

  • @captaindunsell8568
    @captaindunsell8568 Рік тому +5

    Is udp the only option? Udp doesn’t guarantee order of packets/frames … TCP does keep order… this will be needed when you ship volume of data…

    • @bigbogeyface
      @bigbogeyface Рік тому +2

      Thanks Captain 🤔👍
      Most interesting.

  • @TheUnofficialMaker
    @TheUnofficialMaker Рік тому +1

    well done, as usual. I will try this.

  • @pralaymajumdar1206
    @pralaymajumdar1206 5 місяців тому

    O my god😮 ... What a lesson I am learning from you.. Really enjoying sir❤.. Thanks from India.

  • @Ed-fv9rl
    @Ed-fv9rl Рік тому +1

    Thanks Paul! Working on my lesson. I got it go wireless but need to integrate the oled screen...and the RGB lesson...

  • @charlotteswift
    @charlotteswift Рік тому +3

    Hi Paul & Guys
    Here is the link to a video that I made about six months ago when Paul first started his Pico W lessons. I know that some of you have already seen it as it's had over 100 views but it might (or might not) make more sense now. I will check whether the latest version of Thonny can cope with .mpy files and, if it can, then maybe I'll make another short video to show my last solution working using Thonny otherwise I'll try using VSCode but I'm not used to using VSCode. Anyway here's the link: ua-cam.com/video/VAypGS_jDZo/v-deo.html

  • @rickbonari4493
    @rickbonari4493 Рік тому +2

    Very good lesson Paul. Simply amazing. Would love to see more math in future lessons if possible.
    Also will we be having a live shop talk soon? Really miss them.

  • @timefactortheoryofgravitya7578
    @timefactortheoryofgravitya7578 9 місяців тому

    Thank You for repeatedly identifying what are the Methods, objects, libraries etc. Repetition helps it sink in. I learned coding over a decade ago ago using basic / C++ with variables, subroutines and data files instead.

  • @captaindunsell8568
    @captaindunsell8568 Рік тому +2

    Use numbers greater than 1024 and less than 65536 … to keep out if the WellKnown ports and less than the maximum allowed values

  • @user-sk5oy7ti5x
    @user-sk5oy7ti5x Місяць тому

    Great video!

  • @rizakhan2938
    @rizakhan2938 Рік тому +2

    It woul be great if you could combine all your tutorials like 3d printing,raspberry pi, ai to make a full project.e.g drone running on ai. every thing from scratch

  • @charlotteswift
    @charlotteswift Рік тому +2

    Here's my solution: ua-cam.com/video/xUUd3Khn1ug/v-deo.html which includes a couple of things that people might find useful. Sorry that it's so long and for the coughing at the end.

    • @paulmcwhorter
      @paulmcwhorter  Рік тому

      LEGEND!

    • @charlotteswift
      @charlotteswift Рік тому

      @@paulmcwhorter Thanks, Paul. I didn't mean to criticise the way that you did it.

  • @Bob-zg2zf
    @Bob-zg2zf Рік тому +1

    You look healthier and healthier. And less coughing.

  • @therazma
    @therazma 8 місяців тому

    Great video as always. Thanks

  • @charlotteswift
    @charlotteswift Рік тому +4

    Here is a video of an idea that I got from Lesson 27. I am rather pleased with it (the program, not the video😁) ua-cam.com/video/0GbsFADnEDk/v-deo.html

    • @marioalbers887
      @marioalbers887 Рік тому

      Is this the link charlotte

    • @charlotteswift
      @charlotteswift Рік тому

      @@marioalbers887 No. This is the link for my non-homework for lesson 27. I've left another comment on this video to highlight some problems with using wifi on a Pico W.

  • @mcwhor1
    @mcwhor1 Рік тому +1

    When will you be visiting Texas again? Asking for a friend~

  • @DavidHaynesosteopath
    @DavidHaynesosteopath 7 місяців тому

    Paul, I am really enjoying your lessons. Many thanks. Please could you do a lesson that expands on the secrets.py facility in micro python? I think that I am missing something.

  • @jameslewellen150
    @jameslewellen150 Рік тому +2

    Here is my homework for Lesson 28 ua-cam.com/video/iyCCkqj8f74/v-deo.html

  • @todd3c
    @todd3c 6 місяців тому

    Link to my homework assignment. ua-cam.com/video/s4EjQiyJMjw/v-deo.html Server running two OLED(s). Left OLED is the response from the client, right OLED is the reply sent back to the client from the server. Sorry for the jittery video but it's hard holding phone in 1 hand and operating the client with the other....

  • @jeraldgooch6438
    @jeraldgooch6438 Рік тому +1

    Hey Paul,
    Thanks for another useful and thorough video.
    Question - would it be possible on the pico to run a process that regularly polls terms/ humidity info from a DHT11/22 on one processor, and another process on the other core that responds to client requests for temp/ humidity?

    • @paulmcwhorter
      @paulmcwhorter  Рік тому

      The way I would do it is simply have the pico sit and wait for a command from a client. If a client asks for temp, then go out and measure temp, and return temp. If a client asks for humidity, go out and measure humidity and return it.

    • @keithlohmeyer
      @keithlohmeyer Рік тому

      I did an extra credit homework video that does just that a few weeks back. ua-cam.com/video/BFGIoa_NDHY/v-deo.html
      Look at the last 2 minutes to see issues I had with resetting the battery powered Pico.

  • @peterbush3972
    @peterbush3972 Рік тому +1

    How do I open pi and Pico W in two different Thonny. How can I open two different Thonny one for Python and Micopython

    • @paulmcwhorter
      @paulmcwhorter  Рік тому

      There is a preference setting that will allow you to have more than one thonny serrion. Tools>Options> Uncheck the box that says allow singe thonny instance.

  • @polkcountymike6274
    @polkcountymike6274 Рік тому +1

    Here is my solution to the homework. i used the Raspberry Pi Pico w as a server with the DHT 11 to provide temperature and humidity data for recording on the computer. Here is the link: ua-cam.com/video/NWY-PObUb0I/v-deo.html

  • @timefactortheoryofgravitya7578
    @timefactortheoryofgravitya7578 9 місяців тому

    The kit I have did not come with the battery, holder and module. Anyone know how I can order it separate? I already have duplicates of many components (Raphael kit, Arduino kit etc.) so I don't want to order another whole kit.

  • @user-fp1sx3qn4x
    @user-fp1sx3qn4x 5 місяців тому

    OSError: [Errno 1] EPERM i getting this error what i need to do

  • @scottpettygrove7821
    @scottpettygrove7821 Рік тому +1

    Hi folks. Here's my homework solution to Paul's assignment from episode 28. ua-cam.com/video/AJ_-SrlwJN4/v-deo.html

    • @paulmcwhorter
      @paulmcwhorter  Рік тому +1

      LEGEND!

    • @scottpettygrove7821
      @scottpettygrove7821 Рік тому

      I should have waited a bit before posting. Just added 2 new things that make this a better program: 1.) On the server side I wrapped the .split() commands with "Try - Except" to take care of cases where the LED blink commands were not properly configured (errors in command format were taking down the server - uh oh); and 2.) On the client side, instead of reading my commands from a list, I converted it to read the commands from a text file. Much more satisfying!

  • @zeeshanakram8751
    @zeeshanakram8751 Рік тому +1

    can we make walkie talkie using raspberry pi pico w on both ends?

    • @paulmcwhorter
      @paulmcwhorter  Рік тому

      Not sure, but bet we could make a two way texter/pager

    • @zeeshanakram8751
      @zeeshanakram8751 Рік тому

      @@paulmcwhorter can you please make a tutorial on it.

  • @robakers6127
    @robakers6127 Рік тому +1

    hey friends, having a little trouble. The operating system got currupt, and I had to nuke it, and reload micropyhton. During the problem solving part, I reloaded thonny to the latest release. now when I try to run local, I get an error message "cannot find the library machine". So I re-watched class 1, and didn't see anything I was missing. Any pointers on how to resovle would be great. At this time I have the homework coded, but cannot test. I guess I could bring up another Pico W and test that way, but starlink does not allow me to declare a static IP. Anyway any pointer on how to resolve would be great.

    • @charlotteswift
      @charlotteswift Рік тому +1

      @robakers6127
      Hi Rob. I hope I can help. When you're running local, you're actually using Python 3 which doesn't have machine. I believe that you haven't done any of Paul's Python and Raspberry Pi classes yet which is why you're getting confused. I don't know what libraries you want to use but 'from RPi.GPIO import GPIO' is a good start. If you want to program on the Pico, you need to go down to the bottom right and change to micropython. If you watch my solution then you'll see that you don't need to use static IP addresses. I've also pinned a comment to the video.

    • @keithlohmeyer
      @keithlohmeyer Рік тому

      Machine is not available on local python. No pins to interact with. Maybe I did not read your question right.

    • @robakers6127
      @robakers6127 Рік тому

      @@charlotteswift yeah I am taking the RPI classes, just not finished, but I didn't think Paul was changing his code while in local mode. That mader me think there was something wrong with my setup. I did consider looking for like libraries in Python 3 but didn't think I had to. Thanks for the reply. That is what I will to. I will finf like libraries in Python 3

  • @alldaypancakes7058
    @alldaypancakes7058 Рік тому +1

    do you think to retiring any time soon i hope not you are the best teacher out there without you i dont think there is any one that can teach me programing you made me love robatics and i am not saying this because to right a nice comment i am serious my teachers teach worst than you do you all the other people in youtube are like robats they are like dead insade so i hpe you dont retiring

  • @rupadarshisamanta3288
    @rupadarshisamanta3288 8 місяців тому

    Hello, I faced a problem....
    When i first write the code and run that then at first no data / command sent to server from client.
    But when i restart the thonny then it beautifully got the command from client. But after 3 successful attempts it stopped getting command.
    Can you(Paul/ anybody) help me to figure out the problem? Please 🙏

  • @Guestie808
    @Guestie808 10 місяців тому

    When trying to connect to my wifi, it seems to be stuck in an infinite loop of "Waiting for connection...". It has worked before on my schools wifi, but doesnt seem to work on my home network. Any help would be GREATLY appreciated.

    • @paulmcwhorter
      @paulmcwhorter  10 місяців тому

      Make sure your credentials are exactly right for logging onto your router. SSID name and password have to be exact.

    • @Guestie808
      @Guestie808 10 місяців тому

      @@paulmcwhorter I have made sure of that and it still doesnt seem to work. I think its something to do with my wifi really rather than my code. Thank you for your help and such a great series.

  • @fablapp
    @fablapp 7 місяців тому

    Hope people are still practising this... still not happy to run programs as main in the pico.... i do not manage to exit and start again to program from PC and need to restart form zero... any tip in this respect? not nbeen able to find any satisfactory solution in the forums online.

  • @G0LUBI
    @G0LUBI 9 місяців тому

    nice do bra, thanks for teaching !!!

  • @Fbarrett
    @Fbarrett Рік тому +1

    Anybody else get this? ImportError: no module named 'socket' ?

    • @charlotteswift
      @charlotteswift Рік тому

      @Fbarrett I assume that you're not using an ordinary Pico instead of a Pico W. That would definitely cause the problem.

    • @charlotteswift
      @charlotteswift Рік тому +1

      @Fbarrett And of course you need to be running the right version of Micropython. First make sure that you've installed the latest version of Thonny and then you will be able to update the version of Micropython that you're using. There are different versions for a Pico and a Pico W.

    • @Fbarrett
      @Fbarrett Рік тому +1

      @@charlotteswift Ok thanks.

    • @Fbarrett
      @Fbarrett Рік тому +2

      @@charlotteswift Thanks. I was using pico download not Pico W. It is working now.

  • @TheTechRancher
    @TheTechRancher 11 місяців тому

    Homework Solution for Lesson #28 Link: ua-cam.com/video/1W57z2X8WSY/v-deo.html I had fun with the wireless ability that the pico W gives you. I just wish it has more memory space to host your own website including database.

  • @LorisHW
    @LorisHW Рік тому

    A bit late to the game - here is my homework: ua-cam.com/video/9mWVAfx19u0/v-deo.html. For those using a Mac, you can get a second instance of Thonny (once you change the option in the Tool ... Options). I found I had to run Thonny from the command line in the terminal window to get a second instance.

  • @keithlohmeyer
    @keithlohmeyer Рік тому +2

    Another homework tangent ua-cam.com/video/OCiwRvME5qY/v-deo.html
    I show how I use a mobile hotspot so I can demo my projects where you only have public internet access.
    Thanks Paul for all you do.

  • @snowman58able
    @snowman58able Рік тому +1

    ua-cam.com/video/PN0PBpDqCZA/v-deo.html
    My home work for lesson 28. I had to review the lesson on batteries to realize I had to name the server file “main “ to get the Pico W to operate on battery.

  • @jimworden9021
    @jimworden9021 6 місяців тому

    Here's my homework for Lesson 28. ua-cam.com/video/UFNHfv9k724/v-deo.html
    A couple of odd things are happening that I hope someone can explain for me. Both are shown in the video. The first occurs when both programs are launched after having been previously run (previous run not shown, trust me I did it.) Once both programs are running the client fails to transmit it's data to the server. I finally figured out how to fix it by terminating the client, selecting the Pico for Thonny's interpreter (which of course generates an error), then switching back to the Local Python. Everything works perfectly after that. Nothing else seems to help including rebooting the whole shebang. Any insights would be greatly appreciated.
    The second oddity occurs when I enter BYE to terminate both processes. Thonny the generates a warning in the client that "secrets.py" is a "Possible bad file name". Secrets.py is imported in the server (in the other incarnation of Thonny) but NOT in the client. Does anyone have any clue about what Thonny is trying to tell me? I'm soooo confused.
    Thanks

  • @thomass8871
    @thomass8871 6 місяців тому

    I didn't understand a single word. I couldn't do this by myself after watching this video. Too much prior knowledge is assumed by the teacher.

    • @paulmcwhorter
      @paulmcwhorter  6 місяців тому

      Did you do the first 27 lessons in the class?

    • @thomass8871
      @thomass8871 6 місяців тому

      @@paulmcwhorter Thank you for your response. Yes, I have indeed watched all the previous 27 lessons in the class. However, upon reaching this particular lesson, I found myself struggling to fully grasp the intricacies of the code and concepts being presented. While I followed along with the instructions provided, I felt a gap in understanding the rationale behind certain actions and the underlying principles behind them.
      Specifically, when attempting to connect the Raspberry Pi Pico to WiFi as demonstrated in Lesson 28, I encountered difficulties due to the assumption of prior knowledge. While the preceding lessons provided a foundation, I realized that they might not have covered all the necessary information for me to confidently proceed with the tasks presented in this lesson.
      In essence, while I did watch the preceding videos, I believe there may be additional foundational knowledge or explanations that would have better prepared me for the content of Lesson 28. It seems that a deeper understanding of networking concepts or the specific workings of the Raspberry Pi Pico's WiFi capabilities might be necessary to fully benefit from this lesson.
      I appreciate your dedication to providing educational resources, and I'm eager to continue learning. If there are supplemental materials or resources you could recommend to bridge this knowledge gap, I would be grateful for your guidance.
      Thank you for your understanding and assistance.

  • @drdentin3215
    @drdentin3215 Рік тому +1

    My homework, posted just under the wire, after most have gone to bed. ua-cam.com/video/OUc5a2aW96E/v-deo.html

    • @drdentin3215
      @drdentin3215 Рік тому

      You make it all possible, thank you.

  • @freddyveza
    @freddyveza 6 місяців тому

    I've had a hard time posting my homework link ua-cam.com/video/tx7KOyE-1gI/v-deo.html
    Don't know if it was Firefox or if UA-cam is glitching

    • @paulmcwhorter
      @paulmcwhorter  6 місяців тому +1

      Use google chrome, make sure you dont have an adblocker running.

  • @briankelly4095
    @briankelly4095 11 місяців тому

    Putting the Pico on WiFi is very exciting. Thanks for another great lesson Paul. I imagine this will open the door to all kinds of topics.
    You can find my homework at ua-cam.com/video/9pvD1_lWjSw/v-deo.html

  • @adammcquade7026
    @adammcquade7026 Місяць тому

    This my homework. ua-cam.com/video/t6uIVB1Ebk4/v-deo.htmlfeature=shared Paul I really hope you show a solution to the problem of displayed text as it gave me a headache lol

  • @karliskide2460
    @karliskide2460 Рік тому

    Thank you for the lesson! This was a huge step, so here is my homework assignment: ua-cam.com/video/3rr8JFe8Wr4/v-deo.html

  • @davidwalton6308
    @davidwalton6308 4 місяці тому

    Can you explain this line of code more. The message, address separated by a comma on the left of the equals sign confused me. message, address=UDPServer.recvfrom(…….

  • @peterbrylka7877
    @peterbrylka7877 Рік тому

    Hello Paul,
    how is it done with the WLAN connect.
    import secrets
    wifi.connect(secrets.SSID,secrets.PASSWORD)
    What a file "secrets"
    Peter

    • @paulmcwhorter
      @paulmcwhorter  Рік тому +1

      just create a program called secrets.py
      save it in the same folder as your main program, or in the lib folder
      note that while the file is called secrets.py, you simply import is with"
      import secrets
      Now the secrets file is very simple, something like"
      SSID='My Wifi'
      PASSWORD='buffyBoo12'
      Now, in the main program you access those value with something like
      mySSID=secretes.SSID

    • @peterbrylka7877
      @peterbrylka7877 Рік тому

      Thanks Paul,
      worked wonderfully!
      Peter@@paulmcwhorter