sid20
Posts: 14
Joined: Wed May 22, 2019 8:36 am

UDP in Rpi

Fri Jun 14, 2019 12:27 pm

HOw to find udp port no and udp ip address of my rpi?

I want this to happen

https://wiki.python.org/moin/UdpCommunication
see the code in link

i am not able to recieve msg that i sent?

User avatar
B.Goode
Posts: 7868
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: UDP in Rpi

Fri Jun 14, 2019 2:01 pm

sid20 wrote:
Fri Jun 14, 2019 12:27 pm
HOw to find udp port no and udp ip address of my rpi?

I want this to happen

https://wiki.python.org/moin/UdpCommunication
see the code in link

i am not able to recieve msg that i sent?


If you are using the two code samples in the first two highlighted panels then your UDP port # is 5005. There is no separate "UDP IP Address" - the IP addresses are those of the Sending and Receiving workstations: in these examples both are implemented on the same device and thus use 127.0.0.1 (localhost) which is a universal shorthand for "the system this code is running on."

sid20
Posts: 14
Joined: Wed May 22, 2019 8:36 am

Re: UDP in Rpi

Tue Jun 18, 2019 6:06 am

i want it to work on different systems?
how to proceed now?

User avatar
B.Goode
Posts: 7868
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: UDP in Rpi

Tue Jun 18, 2019 7:16 am

sid20 wrote:
Tue Jun 18, 2019 6:06 am
i want it to work on different systems?
how to proceed now?


First step - prove that the code as published works when run with Sender and Receiver colocated on the same system. (ie. as published)

Second step - prove that the code works when run on two discrete systems sharing the same Local Area Network. You will probably need to change the specification of the Target IP address in Line 3 of the Sender code to be that of the Receiver.

sid20
Posts: 14
Joined: Wed May 22, 2019 8:36 am

Re: UDP in Rpi

Tue Jun 18, 2019 8:17 am

yeah thanks its working fine now.

Thank you for your help!

Return to “Advanced users”