# UDP port number

**URL:** <https://www.ruby-forum.com/t/udp-port-number/108353>\
**Category:** GNU Radio\
**Created:** [July 2, 2007, 5:17pm UTC](https://www.ruby-forum.com/t/udp-port-number/108353 "2007-07-02T17:17:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bellzii](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e19adc/32.png) [@bellzii](https://www.ruby-forum.com/u/bellzii)\
**Post date:** [July 2, 2007, 5:17pm UTC](https://www.ruby-forum.com/t/udp-port-number/108353/1 "2007-07-02T17:17:06Z")

</div>

Ive been trying to run a code that reads a UDP connection and transmits  
the  
data using the USRP.  
I got some error

Traceback (most recent call last):  
File “./prefinal4.py”, line 46, in ?  
app = stdgui.stdapp (my\_rx\_graph, “My RX”)  
File  
“/usr/local/lib/python2.4/site-packages/gnuradio/wxgui/stdgui.py”,  
line 36, in **init**  
wx.App. **init** (self, redirect=False)  
File  
“/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/\_core.py”,  
line 7700, in **init**  
self.\_BootstrapApp()  
File  
“/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/\_core.py”,  
line 7352, in \_BootstrapApp  
return _core_.PyApp\_\_BootstrapApp(\*args, \*\*kwargs)  
File  
“/usr/local/lib/python2.4/site-packages/gnuradio/wxgui/stdgui.py”,  
line 39, in OnInit  
frame = stdframe (self.flow\_graph\_maker, self.title, self.\_nstatus)  
File  
“/usr/local/lib/python2.4/site-packages/gnuradio/wxgui/stdgui.py”,  
line 60, in **init**  
self.panel = stdpanel (self, self, flow\_graph\_maker)  
File  
“/usr/local/lib/python2.4/site-packages/gnuradio/wxgui/stdgui.py”,  
line 81, in **init**  
self.fg = flow\_graph\_maker (frame, self, vbox, sys.argv)  
File “./prefinal4.py”, line 32, in **init**  
self.connect (dst,self.scope)  
File  
“/usr/local/lib/python2.4/site-packages/gnuradio/gr/basic\_flow\_graph.py”,  
line 115, in connect  
self.\_connect (points[i-1], points[i])  
File  
“/usr/local/lib/python2.4/site-packages/gnuradio/gr/basic\_flow\_graph.py”,  
line 120, in \_connect  
self.\_connect\_prim (s, d)  
File  
“/usr/local/lib/python2.4/site-packages/gnuradio/gr/basic\_flow\_graph.py”,  
line 125, in \_connect\_prim  
self.\_check\_valid\_src\_port (src\_endpoint)  
File  
“/usr/local/lib/python2.4/site-packages/gnuradio/gr/basic\_flow\_graph.py”,  
line 222, in \_check\_valid\_src\_port  
self.\_check\_port (src\_endpoint.block.output\_signature(),  
src\_endpoint.port)  
File  
“/usr/local/lib/python2.4/site-packages/gnuradio/gr/basic\_flow\_graph.py”,  
line 233, in \_check\_port  
raise ValueError, ‘port number out of range.’  
ValueError: port number out of range.

## i uploaded my code [http://www.nabble.com/file/p11395825/prefinal4.py](http://www.nabble.com/file/p11395825/prefinal4.py) prefinal4.py

View this message in context:  
[http://www.nabble.com/UDP-port-number-tf4012851.html#a11395825](http://www.nabble.com/UDP-port-number-tf4012851.html#a11395825)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![bellzii](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e19adc/32.png) [@bellzii](https://www.ruby-forum.com/u/bellzii)\
**Post date:** [July 3, 2007, 4:23pm UTC](https://www.ruby-forum.com/t/udp-port-number/108353/2 "2007-07-03T16:23:39Z")

</div>

Anyone feel free to correct me, but it seems like your problem isn’t  
with the UDP port, but rather the internal “ports” that Gnuradio uses to  
connect blocks in a flowgraph. Looking at your traceback, your problem  
starts on line 32, where you’re trying to connect a usrp.sink\_c to a  
scopesink. I believe that sinks only have input ports and no output  
ports, so there’s nothing available for gnuradio to connect from the  
usrp sink to the scopesink. The port error you’re receiving is from the  
\_check\_port function in basic\_flow\_graph, which is trying to connect  
these two blocks.

To fix this, you need to send the output from “conv” to the sink and to  
the scope. I’m not quite sure what exactly you’d use to accomplish this,  
I imagine you need something with two output ports(?). Can someone else  
provide a suggestion?

---

<div class="post-metadata">

**Author:** ![bellzii](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e19adc/32.png) [@bellzii](https://www.ruby-forum.com/u/bellzii)\
**Post date:** [July 3, 2007, 8:47pm UTC](https://www.ruby-forum.com/t/udp-port-number/108353/3 "2007-07-03T20:47:14Z")

</div>

thanks Dev for your help, i tried removing the oscope and the fft and  
its  
working fine .

I think now i need to connect the output of conv = gr.float\_to\_complex()  
,  
does anyone have a clue how can i do that with the self.connect

Dev R. wrote:

> > File  
> > line 81, in **init**  
> > self.\_connect\_prim (s, d)  
> > “/usr/local/lib/python2.4/site-packages/gnuradio/gr/basic\_flow\_graph.py”,
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> removed\_email\_address@domain.invalid  
> [Discuss-gnuradio Info Page](http://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

–  
View this message in context:  
[http://www.nabble.com/UDP-port-number-tf4012851.html#a11418382](http://www.nabble.com/UDP-port-number-tf4012851.html#a11418382)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![bellzii](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e19adc/32.png) [@bellzii](https://www.ruby-forum.com/u/bellzii)\
**Post date:** [July 3, 2007, 8:48pm UTC](https://www.ruby-forum.com/t/udp-port-number/108353/4 "2007-07-03T20:48:14Z")

</div>

thanks Dev for your help, i tried removing the oscope and the fft and  
its  
working fine .

I think now i need to connect the output of conv = gr.float\_to\_complex()  
to the scope , does anyone have a clue how can i do that with the  
self.connect

Dev R. wrote:

> > File  
> > line 81, in **init**  
> > self.\_connect\_prim (s, d)  
> > “/usr/local/lib/python2.4/site-packages/gnuradio/gr/basic\_flow\_graph.py”,
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> removed\_email\_address@domain.invalid  
> [Discuss-gnuradio Info Page](http://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

–  
View this message in context:  
[http://www.nabble.com/UDP-port-number-tf4012851.html#a11418386](http://www.nabble.com/UDP-port-number-tf4012851.html#a11418386)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).
