# Introduction to Pre-Cog

**URL:** <https://www.ruby-forum.com/t/introduction-to-pre-cog/223527>\
**Category:** GNU Radio\
**Created:** [October 8, 2012, 6:16pm UTC](https://www.ruby-forum.com/t/introduction-to-pre-cog/223527 "2012-10-08T18:16:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [October 8, 2012, 6:16pm UTC](https://www.ruby-forum.com/t/introduction-to-pre-cog/223527/1 "2012-10-08T18:16:15Z")

</div>

Hi everyone,

After a few requests, I have cleaned up my pre-cog library a bit for  
general use. For those who are not familiar, this is a library of  
rudimentary MAC layer functions that uses Josh B.'s gr-extras  
[https://github.com/guruofquality/grextras](https://github.com/guruofquality/grextras). Here are the current  
features:

```
* Uses python block writing capability of gr-extras
* Uses "blobs" from gr-extras
* simple_mac with ARQ and radio addressing
* TDMA, FHSS and other blocks
* A couple of blocks that are useful for debugging

```

Currently, I have provided a simple example called “simple\_trx”. This  
implements a full-duplex or half-duplex, random access link with ARQ  
between one or more radios. You can transfer data to and from the  
appliction through a TCP/IP interface. If you replace the socket\_msg  
block with the gr-extras tun/tap block, you can mirror the functionality  
of tunnel.py. Or you can put any other arbitrary data sink/source.

Examples that use the TDMA and FHSS will be coming soon…

Youtube Video (sorry audio is pretty low):

[![](https://img.youtube.com/vi/f8emQ-TvD90/maxresdefault.jpg "Introduction to Precog - Building Your First Radio") ](https://www.youtube.com/watch?v=f8emQ-TvD90)

Github Repo: [https://github.com/buoyboy/pre-cog](https://github.com/buoyboy/pre-cog)  
Wiki: [https://github.com/buoyboy/pre-cog/wiki](https://github.com/buoyboy/pre-cog/wiki)

Looking for thoughts, feedback, and ideas. [and of course, bug reports]

Best Regards,  
John M.

PS - It’s called _pre_-cog, because I think this is an experimental. My  
expectation is that we’ll apply lessons learned with this to a more  
permanent solution.

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [October 8, 2012, 7:22pm UTC](https://www.ruby-forum.com/t/introduction-to-pre-cog/223527/2 "2012-10-08T19:22:52Z")

</div>

Hi John,

You Wrote:

> Looking for thoughts, feedback, and ideas. [and of course, bug reports]

I just very quickly installed gr-precog under gnuradio-3.6.2. Installed  
fine, but when starting grc, I noticed the following:

It seems that after installation, quite a lot of the sinks and  
sources are missing. In some case there are equivalents in gr-extras,  
so no biggie (Noise, Signal etc), but some others def disappear  
entirely, null comes to mind. An uninstall and re-install of 3.6.2,  
and they all appear again.

Unfortunately, I don’t have time this evening to play further this  
evening as I have a prior engagement, but will certainly be  
experimenting later in the week.

Also very much looking forward to FEC and CSMA developments in  
the future. Just ebing able to get arbitary data in and out of  
a flow graph, and have gnuradio handle the MAC and PHY bits is  
really useful and powerful, so Thanks to both you and Josh

Iain

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [October 8, 2012, 7:39pm UTC](https://www.ruby-forum.com/t/introduction-to-pre-cog/223527/3 "2012-10-08T19:39:49Z")

</div>

Iain,

Thanks. I’ll look into this.

-John
