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

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ก.ค. 2023
  • 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 111

  • @bigbogeyface
    @bigbogeyface 9 หลายเดือนก่อน +24

    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 9 หลายเดือนก่อน +1

      Thanks, Mr Burger

    • @bigbogeyface
      @bigbogeyface 9 หลายเดือนก่อน +1

      @@charlotteswift You welcome 😊🙏

    • @alistaircook1997
      @alistaircook1997 9 หลายเดือนก่อน +1

      Thank you very much for this, great info

    • @Ed-fv9rl
      @Ed-fv9rl 9 หลายเดือนก่อน +1

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

    • @snowman58able
      @snowman58able 9 หลายเดือนก่อน +1

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

  • @pralaymajumdar1206
    @pralaymajumdar1206 2 หลายเดือนก่อน

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

  • @cbrombaugh
    @cbrombaugh 9 หลายเดือนก่อน +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.

  • @timefactortheoryofgravitya7578
    @timefactortheoryofgravitya7578 6 หลายเดือนก่อน +2

    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!

  • @stephenlightkep1621
    @stephenlightkep1621 9 หลายเดือนก่อน +1

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

  • @robakers6127
    @robakers6127 9 หลายเดือนก่อน +1

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

  • @rickbonari4493
    @rickbonari4493 9 หลายเดือนก่อน +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.

  • @VK5AV
    @VK5AV 9 หลายเดือนก่อน +1

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

    • @paulmcwhorter
      @paulmcwhorter  9 หลายเดือนก่อน +1

      Welcome Aboard!

  • @TheUnofficialMaker
    @TheUnofficialMaker 9 หลายเดือนก่อน +1

    well done, as usual. I will try this.

  • @qzorn4440
    @qzorn4440 7 หลายเดือนก่อน

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

  • @ToniHayek
    @ToniHayek 9 หลายเดือนก่อน +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❤

  • @captaindunsell8568
    @captaindunsell8568 9 หลายเดือนก่อน +2

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

  • @captaindunsell8568
    @captaindunsell8568 9 หลายเดือนก่อน +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 9 หลายเดือนก่อน +2

      Thanks Captain 🤔👍
      Most interesting.

  • @Bob-zg2zf
    @Bob-zg2zf 9 หลายเดือนก่อน +1

    You look healthier and healthier. And less coughing.

  • @Ed-fv9rl
    @Ed-fv9rl 9 หลายเดือนก่อน +1

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

  • @therazma
    @therazma 5 หลายเดือนก่อน

    Great video as always. Thanks

  • @jeraldgooch6438
    @jeraldgooch6438 9 หลายเดือนก่อน +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  9 หลายเดือนก่อน

      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 9 หลายเดือนก่อน

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

  • @rizakhan2938
    @rizakhan2938 9 หลายเดือนก่อน +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

  • @ParshvaPatel-ib9lm
    @ParshvaPatel-ib9lm 10 หลายเดือนก่อน +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 9 หลายเดือนก่อน

      That sounds well interesting 😮👍

  • @timefactortheoryofgravitya7578
    @timefactortheoryofgravitya7578 6 หลายเดือนก่อน

    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.

  • @charlotteswift
    @charlotteswift 9 หลายเดือนก่อน +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: th-cam.com/video/VAypGS_jDZo/w-d-xo.html

    • @bigbogeyface
      @bigbogeyface 9 หลายเดือนก่อน +1

      Thanks Charlie 🙂👍

  • @mcwhor1
    @mcwhor1 9 หลายเดือนก่อน +1

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

  • @charlotteswift
    @charlotteswift 9 หลายเดือนก่อน +2

    Here's my solution: th-cam.com/video/xUUd3Khn1ug/w-d-xo.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  9 หลายเดือนก่อน

      LEGEND!

    • @charlotteswift
      @charlotteswift 9 หลายเดือนก่อน

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

  • @jameslewellen150
    @jameslewellen150 9 หลายเดือนก่อน +2

    Here is my homework for Lesson 28 th-cam.com/video/iyCCkqj8f74/w-d-xo.html

  • @DavidHaynesosteopath
    @DavidHaynesosteopath 3 หลายเดือนก่อน

    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.

  • @charlotteswift
    @charlotteswift 9 หลายเดือนก่อน +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😁) th-cam.com/video/0GbsFADnEDk/w-d-xo.html

    • @marioalbers887
      @marioalbers887 9 หลายเดือนก่อน

      Is this the link charlotte

    • @charlotteswift
      @charlotteswift 9 หลายเดือนก่อน

      @@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.

  • @timefactortheoryofgravitya7578
    @timefactortheoryofgravitya7578 6 หลายเดือนก่อน

    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.

  • @robakers6127
    @robakers6127 9 หลายเดือนก่อน +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 9 หลายเดือนก่อน +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 9 หลายเดือนก่อน

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

    • @robakers6127
      @robakers6127 9 หลายเดือนก่อน

      @@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

  • @scottpettygrove7821
    @scottpettygrove7821 9 หลายเดือนก่อน +1

    Hi folks. Here's my homework solution to Paul's assignment from episode 28. th-cam.com/video/AJ_-SrlwJN4/w-d-xo.html

    • @paulmcwhorter
      @paulmcwhorter  9 หลายเดือนก่อน +1

      LEGEND!

    • @scottpettygrove7821
      @scottpettygrove7821 9 หลายเดือนก่อน

      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!

  • @G0LUBI
    @G0LUBI 6 หลายเดือนก่อน

    nice do bra, thanks for teaching !!!

  • @rupadarshisamanta3288
    @rupadarshisamanta3288 4 หลายเดือนก่อน

    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 🙏

  • @peterbush3972
    @peterbush3972 9 หลายเดือนก่อน +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  9 หลายเดือนก่อน

      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.

  • @user-fp1sx3qn4x
    @user-fp1sx3qn4x 2 หลายเดือนก่อน

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

  • @alldaypancakes7058
    @alldaypancakes7058 9 หลายเดือนก่อน +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

  • @fablapp
    @fablapp 4 หลายเดือนก่อน

    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.

  • @zeeshanakram8751
    @zeeshanakram8751 9 หลายเดือนก่อน +1

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

    • @paulmcwhorter
      @paulmcwhorter  9 หลายเดือนก่อน

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

    • @zeeshanakram8751
      @zeeshanakram8751 9 หลายเดือนก่อน

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

  • @polkcountymike6274
    @polkcountymike6274 9 หลายเดือนก่อน +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: th-cam.com/video/NWY-PObUb0I/w-d-xo.html

  • @TheTechRancher
    @TheTechRancher 8 หลายเดือนก่อน

    Homework Solution for Lesson #28 Link: th-cam.com/video/1W57z2X8WSY/w-d-xo.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.

  • @keithlohmeyer
    @keithlohmeyer 9 หลายเดือนก่อน +2

    Another homework tangent th-cam.com/video/OCiwRvME5qY/w-d-xo.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.

  • @Guestie808
    @Guestie808 6 หลายเดือนก่อน

    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  6 หลายเดือนก่อน

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

    • @Guestie808
      @Guestie808 6 หลายเดือนก่อน

      @@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.

  • @snowman58able
    @snowman58able 9 หลายเดือนก่อน +1

    th-cam.com/video/PN0PBpDqCZA/w-d-xo.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.

  • @LorisHW
    @LorisHW 9 หลายเดือนก่อน

    A bit late to the game - here is my homework: th-cam.com/video/9mWVAfx19u0/w-d-xo.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.

  • @briankelly4095
    @briankelly4095 8 หลายเดือนก่อน

    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 th-cam.com/video/9pvD1_lWjSw/w-d-xo.html

  • @user-jv9cu2kc9c
    @user-jv9cu2kc9c 2 หลายเดือนก่อน

    Link to my homework assignment. th-cam.com/video/s4EjQiyJMjw/w-d-xo.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....

  • @karliskide2460
    @karliskide2460 8 หลายเดือนก่อน

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

  • @Fbarrett
    @Fbarrett 9 หลายเดือนก่อน +1

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

    • @charlotteswift
      @charlotteswift 9 หลายเดือนก่อน

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

    • @charlotteswift
      @charlotteswift 9 หลายเดือนก่อน +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 9 หลายเดือนก่อน +1

      @@charlotteswift Ok thanks.

    • @Fbarrett
      @Fbarrett 9 หลายเดือนก่อน +2

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

  • @jimworden9021
    @jimworden9021 3 หลายเดือนก่อน

    Here's my homework for Lesson 28. th-cam.com/video/UFNHfv9k724/w-d-xo.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

  • @freddyveza
    @freddyveza 2 หลายเดือนก่อน

    I've had a hard time posting my homework link th-cam.com/video/tx7KOyE-1gI/w-d-xo.html
    Don't know if it was Firefox or if TH-cam is glitching

    • @paulmcwhorter
      @paulmcwhorter  2 หลายเดือนก่อน +1

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

  • @drdentin3215
    @drdentin3215 9 หลายเดือนก่อน +1

    My homework, posted just under the wire, after most have gone to bed. th-cam.com/video/OUc5a2aW96E/w-d-xo.html

    • @drdentin3215
      @drdentin3215 9 หลายเดือนก่อน

      You make it all possible, thank you.

  • @thomass8871
    @thomass8871 3 หลายเดือนก่อน

    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  2 หลายเดือนก่อน

      Did you do the first 27 lessons in the class?

    • @thomass8871
      @thomass8871 2 หลายเดือนก่อน

      @@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.

  • @davidwalton6308
    @davidwalton6308 หลายเดือนก่อน

    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 9 หลายเดือนก่อน

    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  9 หลายเดือนก่อน +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 9 หลายเดือนก่อน

      Thanks Paul,
      worked wonderfully!
      Peter@@paulmcwhorter