Raspberry Pi LESSON 41: How to Send Data to the PC over WiFi or Ethernet Using UDP

preview_player
Показать описание
Announcing the Most Awesome Raspberry Pi Lessons of All Times! This time we RUMBLE!

In this class series, we will be using the most excellent Sunfounder Ultimate Raspberry Pi kit, available here: (Affiliate Link)

In this video lesson I will show you how to exchange data between the Raspberry Pi and your PC over ethernet or wifi using UDP. This will work for devices connected to the same home network. This allows a simple way to control the raspberry pi remotely, and to set up a simple client server relationship.

If you want to grab those cool little straight jumper wires I am using to keep my breadboard builds neat and clean you can snag a box of them here:

If you guys are interested in the oscilloscope I am using, you can pick one up here (affiliate link):

You guys get your hardware ordered so you can follow along at home!

You will also need a Raspberry Pi. I suggest the Raspberry Pi 4. If you do not already have one, this is the most suitable gear I could find:

The Raspberry Pi's are sort of pricy right now, so you can look on ebay or elsewhere to see if there are any deals. You will need a SD card. If you do not already have one, this is a good one:

I like using a wireless keyboard and mouse to have fewer wires. You can certainly use your USB keyboard and mouse, but if you want a nice wireless one, this one works on the pi. We demonstrate this by using a button switch to control a LED.

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:

#UDP
#CLIENTSERVER
#RASPBERRYPI
Рекомендации по теме
Комментарии
Автор

Jolly good lesson, Paul. All this is new to me although I did a project at university using Corba and Java. All details are now lost in the mists of time.
Obviously the classic view camera is better because we can see boats, fishermen and island boy and girl. I did like the view with the cow as well. #WHERE'STHECOW?

charlotteswift
Автор

Good starter lesson on sockets! Hope to knock out homework assignment tonight. Love the river view! Very relaxing. Hopefully, not a burden to maintain.

markbooco
Автор

You had me at "I think computers should be polite to each other". love this channel

paperslice
Автор

Another most excellent tutorial, enhanced with non-trivial homework, thanks!

quaternion-pi
Автор

Thanks for the knowledge you are sharing. Great lesson as always. Will you be making a lesson for Modbus RTU ? PLEASE MAKE A VIDEO FOR MODBUS RTU, I NEED YOUR HELP PAUL

kubilayakman
Автор

Hi: Paul McWhorter,
Thank you, it was a good experience when I was connecting and exchanging data with RPi through WLAN and PC (Laptop) with WLAN also.
But when I connect my RPi to the GSM module it cannot send message to the PC and hangs up...
Do we need Port-Forwarding here?
If yes then how we can do Port-Forwarding in the case RPi is connected to GSM module as server and PC as Client?
make a brief tutorial on it please

NadeemUllah-fpcn
Автор

I wonder if anyone can help me with this unexpected behavior that I am getting:
This video is showing a problem I am having with my UDP Client server, if anyone can tell me why am I getting that annoying 'b' character getting sent to the server, which, I believe, messes with the if statements:

DrDave
Автор

Hi Paul, I want to know either this is good approcah if I want my PC to do image processing .I want pi to send live streaming to computer, computer do processing and send back the result such as pan tilt movement or some output on GPIOs. UDP is good for such application?

sahrishmemmon
Автор

What a great lesson this one was, thank you Paul for all your hard work, love the river view. Both cameras view are wonderful.

arguedas
Автор

I'm new but I would have thought that Paul's 'client' code would have required a 'bind' statement too? I'm attempting to debug why I received no response on the client side after sending message to server (pi)

stacksof
Автор

Hi Paul, thank you for putting on these great lessons. I do have a question, What app did you use when you started programing the PC client?

cadmanofs
Автор

I AM LEGEND! I am back in North Carolina after 2 months of Florida sunshine. I bought the Pico W kit there and kept up with the Pico lessons, but could not take my Pi 4. I am excited about wireless networking on both platforms! I still have not taken the bold step of learning to post my homework on YouTube. Thanks for all these most-excellent lessons, Paul.

cbrombaugh
Автор

How would one go about sending data from the pi 5 to a quest 2 over bluetooth. Without using an internet connection(if that's even possible).

shapesofpixels
Автор

Nice lesson. Will you be making a lesson for TCP as well or do you think that TCP will be too complex?

aleksanderklimczyk
Автор

thank you very much! a very nice lesson!

ZakiZhang
Автор

Question: Should this be able to work for example between my RPI and my linux desktop ??

noweare
Автор

Thank you so much for this tutorial! I have been having issues with various network communication protocols and could never get any of them to work until now. Loved how you managed to simplify some complex ideas in simple, digestible terms.

And I agree, Paul. Nothing is better than black iced coffee while I'm working with my Raspberry Pi!!

KellieGlasgow
Автор

Learned something new today! Thanks Paul for all you do. Merry Christmas everyone.

keithlohmeyer
Автор

fantastic serie learn raspberry pi, i like, but need understand how imske PREEM RT raspberry pi linuxcnc too hard understand all how make, lot need know but no understand. what distro need different CPU, how install, how clean raspberry no other have, what max jitter have and what need do, how make jitter down smallesta..etc, etc,

mattivirta
Автор

Here is my solution. I never know whether to leave a comment on the lesson which sets the homework or on the solution, so I've done both.

charlotteswift