Raspberry Pi Pico W LESSON 29: Simple Client Server Project to Control RGB LED

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 มิ.ย. 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. We will control the color of an RGB LED on the Raspberry Pi Pico W from commands sent from the client program on the PC. Communication is completely wireless, and the pico is powered by a rechargeable LiPo battery. 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
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    We learn so much more doing the projects with you even when there are errors.

  • @justmc62
    @justmc62 9 หลายเดือนก่อน +3

    Was having a similar issue as Paul by having to unplug the USB cable from the Pico for a reset. To remedy this going forward I placed a N.O. Push Button on my breadboard wired from Pin # 30 to Ground for a Reset . Works great and takes away the chance of damaging the USB connector. Hope this helps someone ... Thanks Paul for all you do !

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

    This was a very satisfying and rewarding lesson! Thank you!

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

      Glad you enjoyed it!

  • @shawnlowe1392
    @shawnlowe1392 10 หลายเดือนก่อน +1

    Paul, you make learning through these lessons so much fun! Thanks for all your hard work!

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

    Yes my G. U r a bad man. Respect. U hit it right out of the park.

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

    Wow, what sophisticated WIFI project. The sky is the limit. 🥳 Thank you.

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

    Thanks Paul. My troubleshooting skills have greatly improved.

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

    Thanks Paul! The program worked as advertised. I would like to fold but the culprit was the breadboard falling apart and the sockets not holding the connection. Anyway, I was able to reroute the connections to make it work! I even when to the other end of the house and it worked in the most excellent way! No wires, no tape, none needed...
    : ) Looking forward to the next lesson!!!!!!!!!!!

  • @larryplatzek9017
    @larryplatzek9017 10 หลายเดือนก่อน +1

    this was yet ANOTHER GREAT LESSON!

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

    Paul is a superman, if you think about it.😮

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

    Thank you. really interesting and useful. Love the way you fault find the code on the fly.

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

    Thanks for the great lesson!

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

    Thanks Paul!

  • @patrickfox-roberts7528
    @patrickfox-roberts7528 10 หลายเดือนก่อน

    Thanks Paul.

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

    Thank you paul

  • @SuperDagia
    @SuperDagia 8 วันที่ผ่านมา

    I like your videos.❤

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

    Thanks!

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

      Thanks! Really appreciate the support.

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

    Good day. The instruction is wonderful. I'm having a bit of a conumdrum. The server program as taught in lesson 28 is working fine. However a portion of the sketch that is fine there is not happy in the lesson 29 program with the oled and RGB.
    I have imported the following libraries which are different from the previous lesson. (from what I read on line, that could be a problem sometimes because the program only reads the most recent imports so some people import library modules within functions_ from what I read). These are the libraries in the second server program (with OLED)
    from time import sleep
    import network
    import machine
    from machine import Pin,I2C
    from ssd1306 import SSD1306_I2C
    import socket
    The following line is not a problem in the server program lesson 28 but is in this lesson 29 server program.Both identical in every way.
    wifi =network.WLAN(network.Sta_IF)
    The resultant error is:
    MPY: soft reboot
    [61]
    Traceback (most recent call last):
    File "", line 69, in
    AttributeError: 'module' object has no attribute 'Sta_IF'
    I've tried importing the entire machine module with the attendant changes in the code but no success. Any thoughts.

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

    I AM LEGEND! Thanks for this most-excellent lesson. My solution to the homework was very similar to Paul's. I think the Pico W is vastly superior to the Arduinos in many ways, especially in bang-for-the -buck. The wireless Wifi capability makes it a great candidate for remote control projects. I would like to learn to control projects from my smartphone. Since Bluetooth communication is now available with the Pico W, I would like to learn how to use it.

  • @larryplatzek9017
    @larryplatzek9017 10 หลายเดือนก่อน +1

    I think Paul has wrong time for today currently showing 8:30AM.

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

    I couldn't download ssd1306 library via tools/manage Packages etc so I copied ssd1306 from git hub but get error message when I try to use OLED.
    The LED pin part works OK.

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

    Just a tidy-up, Paul! In yellow on 1306, you have the server's IP as 192.168.88.10. When in actual fact, the IP address is 192.168.88.100. The problem is that there are not enough pixels to fit the whole IP address. But no problem, as you correctly recorded the server IP as 192.168.88.100 because you defined it straight from ServerIP=wifiInfo[0]. So, No real problem! It's just a bit untidy!!!
    This is a beautiful lesson!!! Can we somehow package it up so we can drop it into our future coding efforts?

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

      Yes, must be careful with the tiny screen.

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

    I did a read of temperature and humidity. It worked with the read done in the loop with the blocking recvfrom() call but an attempt to use _thread to allow the read loop to run on a separate thread and set the global temperature and humidity that would be returned in the separate server loop failed. The thread would start and take measurements but did not appear to allow the main loop to run. I did not attempt to use select() to get around blocking on recvfrom()

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

    Wow.. Great lesson Paul ... I like the idea of using the "secrets" file for network info. Not sure if I'm implimenting it correctly. If anybody can pass on some info it would be greatly appreciated.. Thanks everyone !!

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

      Secrets file is easy. Just set your varialbes, like:
      SSID='myWifi'
      PASSWORD='buffy1212'
      save program as secrets.py
      Then in your main program:
      import secrets
      print(secrets.SSID)
      print(secrets.PASSWORD)
      Play around with that and see if it makes sense

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

      Thanks Paul for your follow up...Will get it going...👍@@paulmcwhorter

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

    I am legend!

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

    Hello paul, can you please advise a physics Msc student on what to do with raspberry pi for his thesis?

  • @charlotteswift
    @charlotteswift 10 หลายเดือนก่อน +3

    Here's my solution to lesson 28: th-cam.com/video/xUUd3Khn1ug/w-d-xo.html

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

    Here's an update to my initial Lesson 28 homework assignment, this time using TKinter to make a GUI front-end for the client program that generates commands to control the RGB LED on the Pico W-hosted server program: th-cam.com/video/NMp9hco1ZoQ/w-d-xo.html

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

    Hello Paul,
    It's a great lesson again!
    I've a little Problem with the display in row 1 from the server IP-Address. My IP-Address (IP:192.168.200.54) is cut to (IP:192.168.200.5), because there isn't enough space for all Characters in one row. The font uses 8 pixels per character, that means 17 characters each 8 pixel are 132 pixel in a row. But the display only has 128 pixel in the row.
    Is it possible to change the fontsize only for row 1?
    Any other hints?
    Thanks
    Helmut

  • @jyvben1520
    @jyvben1520 20 วันที่ผ่านมา

    could replace the color checks (12 lines) with just 3 lines
    ledred.value( 1 if cmdDecoded.lower() == "red" else 0 )
    ledgreen.value( 1 if cmdDecoded.lower() == "green" else 0 )
    ledblue.value( 1 if cmdDecoded.lower() == "blue" else 0 )

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

    How about add GPS and google earth in Python to this list of Lessons

  • @user-ky7fs9td3k
    @user-ky7fs9td3k 4 หลายเดือนก่อน

    I am getting this error on line 19 = AttributeError: 'tuple' object has no attribute 'value'
    import socket
    import time
    import network
    #import secrets
    import machine
    from machine import Pin,I2C
    from ssd1306 import SSD1306_I2C
    #redLEDPin=16
    #greenLEDPin=17
    #blueLEDPin=18
    #redLED=(redLEDPin,Pin.OUT)
    #greenLED=(greenLEDPin,Pin.OUT)
    #blueLED=(blueLEDPin,Pin.OUT)
    #redLED.value(1)
    I know i have the commands remarked out...i was moving on to the other sections of the experiment...
    I am running Micropython on a Pico W.
    Any help??

    • @user-ky7fs9td3k
      @user-ky7fs9td3k 4 หลายเดือนก่อน

      I got it figured out

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

    Sorry to trouble you, for some reason all now working