# Pad block in ieee802\_15\_4\_mac block

**URL:** <https://www.ruby-forum.com/t/pad-block-in-ieee802-15-4-mac-block/240018>\
**Category:** GNU Radio\
**Created:** [March 24, 2014, 10:21pm UTC](https://www.ruby-forum.com/t/pad-block-in-ieee802-15-4-mac-block/240018 "2014-03-24T22:21:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [March 24, 2014, 10:21pm UTC](https://www.ruby-forum.com/t/pad-block-in-ieee802-15-4-mac-block/240018/1 "2014-03-24T22:21:06Z")

</div>

Hello GR,

How can I have a file source connected as a pad source to an  
hierarchical  
block ?  
More precisely, I have for example the hierarchical block  
ieee802\_15\_4\_mac,  
and instead of feeding the block in input with a socket pdu block I want  
to  
connect it to a file source and broadcast a word,

#self.msg\_connect(self.gr\_socket\_pdu\_0, “pdus”, self.ieee802\_15\_4\_mac\_0,  
“app in”) # this is OK  
self.msg\_connect(self.blocks\_file\_source\_0, “source” ,  
self.ieee802\_15\_4\_mac\_0, “app in”) ?? #this is not OK

And the same in the receive path, I would like to connect a file sink to  
dump to. self.msg\_connect(self.ieee802\_15\_4\_mac\_0, “app out”,  
self.blocks\_file\_sink\_0, “sink”) ??

Regards,

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/Pad-block-in-ieee802-15-4-mac-block-tp47167.html](http://gnuradio.4.n7.nabble.com/Pad-block-in-ieee802-15-4-mac-block-tp47167.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![naeo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@naeo](https://www.ruby-forum.com/u/naeo)\
**Post date:** [March 25, 2014, 12:30am UTC](https://www.ruby-forum.com/t/pad-block-in-ieee802-15-4-mac-block/240018/2 "2014-03-25T00:30:58Z")

</div>

Hi,

On 24 Mar 2014, at 22:20, Ruecan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> And the same in the receive path, I would like to connect a file sink to  
> dump to. self.msg\_connect(self.ieee802\_15\_4\_mac\_0, “app out”,  
> self.blocks\_file\_sink\_0, “sink”) ??

Im not really sure if I get what you are trying to do, but you will  
receive PDUs from the MAC block so you can not just connect a file sink.  
The example pipes the PDUs to a socket and you can listen to that socket  
with netcat and pipe the output to a file with something like

nc -u localhost 52001 \> foo.txt

I guess this is what you want.

Best,  
Bastian

---

<div class="post-metadata">

**Author:** ![naeo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@naeo](https://www.ruby-forum.com/u/naeo)\
**Post date:** [March 25, 2014, 5:00pm UTC](https://www.ruby-forum.com/t/pad-block-in-ieee802-15-4-mac-block/240018/3 "2014-03-25T17:00:47Z")

</div>

Thank you Bastian,

I was about to try the transceiver example provided but I got an error  
from  
the message strobe block in grc.

Param - Message PMT(msg):  
Value “pmt.intern(“Hello World!\n”)” cannot be evaluated:  
‘module’ object has no attribute ‘intern’

that message is in utils/udp.py so how can I redirect that message to  
the  
message strobe (if my understanding is correct)

Regards,  
Ruecan

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/Pad-block-in-ieee802-15-4-mac-block-tp47167p47190.html](http://gnuradio.4.n7.nabble.com/Pad-block-in-ieee802-15-4-mac-block-tp47167p47190.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![naeo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@naeo](https://www.ruby-forum.com/u/naeo)\
**Post date:** [March 25, 2014, 7:00pm UTC](https://www.ruby-forum.com/t/pad-block-in-ieee802-15-4-mac-block/240018/4 "2014-03-25T19:00:07Z")

</div>

On 25 Mar 2014, at 16:51, Ruecan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Param - Message PMT(msg):  
> Value “pmt.intern(“Hello World!\n”)” cannot be evaluated:  
> ‘module’ object has no attribute intern’

I never got that error, but it looks like a problem of your GNU Radio  
installation. What version do you have installed and how did you install  
it?

> that message is in utils/udp.py so how can I redirect that message to the  
> message strobe (if my understanding is correct)

I dont get that, but it doesnt sound right. The udp.py script is an  
example how you can interface the flow graph from python. So if you want  
to send a message (or packet) with the transceiver you can

- use a message strobe block
- use netcat and send something to the socket PDU block of the flow  
graph
- use the python script and send something to the socket PDU block of  
the flow graph

Bastian

---

<div class="post-metadata">

**Author:** ![naeo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@naeo](https://www.ruby-forum.com/u/naeo)\
**Post date:** [March 25, 2014, 7:31pm UTC](https://www.ruby-forum.com/t/pad-block-in-ieee802-15-4-mac-block/240018/5 "2014-03-25T19:31:43Z")

</div>

Bastian B.-2 wrote

> I never got that error, but it looks like a problem of your GNU Radio  
> installation. What version do you have installed and how did you install  
> it?

I am running GNU Radio 3.65, may be that block is not yet in the  
release.

Bastian B.-2 wrote

> flow graph  
> Still related to pmt.intern issue: I was looking for where that message  
> comes from so I find it in utils/udp.py But I may be wrong, means the  
> message strobe block does the job, and the text inside of it is the text  
> to  
> be broadcasted.

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/Pad-block-in-ieee802-15-4-mac-block-tp47167p47194.html](http://gnuradio.4.n7.nabble.com/Pad-block-in-ieee802-15-4-mac-block-tp47167p47194.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![naeo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@naeo](https://www.ruby-forum.com/u/naeo)\
**Post date:** [March 25, 2014, 9:14pm UTC](https://www.ruby-forum.com/t/pad-block-in-ieee802-15-4-mac-block/240018/6 "2014-03-25T21:14:41Z")

</div>

On 25 Mar 2014, at 19:30, Ruecan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Bastian B.-2 wrote
> 
> > I never got that error, but it looks like a problem of your GNU Radio  
> > installation. What version do you have installed and how did you install  
> > it?
> 
> I am running GNU Radio 3.65, may be that block is not yet in the release.

You need at least v3.7
