Unicast message in GNURadio - gnuradio

I have one USRP B210 and E312 and all the message transferred between them are via the broadcast message.
Is there any way to transmit a unicast message (point to point) in GNURadio?
If yes, can you please help me with an example?

You're confusing GNU Radio with something it is not:
GNU Radio is a framework for designing signal processing flow graphs. It is especially useful for processing digital radio signals.
Whether a message is "unicast" or "broadcast" or whatever isn't anything that GNU Radio is concerned with. You'd typically just analyze a packet that you received to determine whether it was meant for you.
GNU Radio isn't something that you typically use to implement a network layer. Mostly, you do physical layer signal processing. As soon as you have packets of bits, you usually leave GNU Radio. Your problem arises from a misunderstanding of what GNU Radio does (and maybe, software defined radio in general).

I found a great library, gr-mac which can handle the broadcast and unicast messaging above the gnuradio.
https://github.com/jmalsbury/gr-mac
I hope it will be helpful to other new gnuradio users like me.

Related

Ways for transmitting data using GNU Radio and soundcards

I am working on a Free-Space-Optics transceiver that uses the soundcard of a computer, a LED, a photodiode and a lens to transmit data over the air. At the moment I am trying to connect two transceivers with the help of GNU Radio. The GNU Radio tutorials and examples that I know of, all cover USB radio devices.
I already experimented with software called Minimodem which uses Audio Frequency Shift Keying for data transmission over the soundcard. GNU Radio offers a lot of useful blocks like Automatic Gain Control (helpful for changing signals due to light and weather conditions) etc., which is the reason I would like to use it for my experiments.
I understand that using the soundcard as the interface is a limiting factor for the achievable data rate.
I would appreciate advice of how to setup a reasonable flow graph in GNU Radio companion that enables a data transmission between the soundcards of two computers. Thank you!
You essentially need two out-of-tree modules for your soundcard in the Gnuradio. one sink(for transmitter) and one source(for receiver). If you already have some code that can send samples to your sound card, just create an oot module and put it in that module. if not, then write a C++ or Python code that can do this.

Implementation of TDMA scheme on GNU radio using USRP

What is the procedure of implementing TDMA scheme on GNU radio using USRP?
I want to implement TDMA scheme using two USRPs as a transmitter and the third one as a receiver. The requirement is that first transmitter sends some data to the receiver for first 10 seconds and then after a delay of two seconds, the second transmitter sends some data to the receiver for another 10 seconds and this process continues to do so. Anyone who can help or provide with some useful links in order to implement this whole process in GNU radio software?
I am in the middle of implementing a TDMA radio. My design relies on GPS sync on the GR host platform. I use its time to sync my USRP using set_time_unknown_pps using an arg that is 2 seconds in the future.
My MAC block is purely message based, acting as a PDU broker between the application and PHY layer. PDU's to be transmitted are tagged with a tx_time command with time set an appropriate amount into the future. I've had to write several OOT blocks to handle tx_[sob,eob] tagging and other PHY details, but in the end packets come out exactly when they need to. The turn on latency for my B200mini appears to be about 1-2 us, which is fine for my timing requirements.
My advice is to start with simple MAC functions and test all the way along until you are confident with a block, then move down the transmit chain.
Anticipating your obvious question, I cannot release any of my code because it's not my code to release :-)
Here is a useful link, explaining how a TDMA system may be implemented in GNU Radio.

Is it possible to do SPI operation using GPIO Pins?

I want to to execute the SPI protocol operation using GPIO Pins, want to configure to single slave operation, in which way I have to configure that, I am using STM32F100RB Microcontroller and Coocox IDE for this executing in windowsxp.
if any body have example source code regarding the configuration of SPI Protocol operation using GPIO pins, then please send me that.
it very helpful for my project, Thanks in advance.
Regards,
Pavan Neo.
You're asking about Bit banging. This is the process of using an IO (or several) to encode or decode a serial signal. Wikipedia has a good description of this process.
For SPI specifically, you will need two or three outputs (depending on whether or not chip select is needed) and one input. You'll have to ensure that your bits are set or read in the correct order to not violate any setup/hold requirements of your peripheral, and you'll need to pay attention to the polarity needed on the clock signal (to make sure you're reading/writing data on the correct edge).
The Wikipedia link has some example code for bit banging that you may find useful as a starting point.

Moving from Qt to Boost - Networking

I's using Qt to build Udp and Tcp servers/clients. Now in recent project, Qt is not allowed and i'm supposed to use Boost. Having gone through boost::asio, i feel confused since there are so many features and usages are very different from Qt. For Udp (multicast,broadcast etc) i'm more or less clear now. But for Tcp i'm having problems understanding:
(have to do all async)
TCP is stream oriented so there is no way to know the number of bytes that have arrived. So we use asio::ip::tcp::socket::async_read_some(). However in Qt we have readAll() for a socket which can be made to read all data on readyRead() signal and return a QByteArray, the size of which we needn't specify as it can grow. How do i achieve this in Boost? readyRead() signal i think would map roughly to async_read_some(), what about the rest (readAll() and "growable" buffer/array?
disconnected() signal is emitted in Qt if the TCP connection disconnects (server/client off, lan cable unplugged etc). What would be the equivalent check in Boost? Do i need a timer to periodically send and expect heartbeat messages myself?
Use some overload of async_read free function with the appropriate completion-condition.
As you see there, this function accepts asio::streambuf, which is growing automatically.
Yes, the only portable & reliable way is to send some heartbeat. I don't know how Qt does that, but try cutting the network cable and see whether you get any notification from Qt...

How to get started with hardware interface programming?

I have been doing desktop programming for a while but want to get started with interfacing with hardware. Specifically, I would like to learn how to use serial ports to take an external event and alert my application (so for example, I can turn on a camera when motion is detected by an external sensor).
Please tell me how to get started, what type of sensors, what books (or online resources) are available. I tried Bing and Google but I need more pointers.
Serial interfaces are fairly simple to work with. But they do require some sort of a decoder on the other end (such as a UART.) Another option would be using the parellel port. The advantage of using a parallel port is you start with a break out of the I/O pins. You can typically control 8 devices with a very simple to build interface.
Most platforms gave a simple way to gain access to the LPT ports without too much effort and again they are very easy to interface.
Quick results for tutorials...
Parallel Port Programming
Parallel port output circuit
A tutorial on Parallel port interfacing
LPT Port Info...
Parallel Port (PC)
LapLink Cable
Printer Cable
IEEE 1284-B
IEEE 1284-C
Centronics (36 pin)
I would recommend you the book Linux Device Drivers 3rd Edition
Although I haven't programmed any hardware interface yet, I think this book will get you ready to start hacking.
There really aren't a lot of one-size-fits-all tips for this. You're going to need to look at the documentation for your device, it should specify the protocol of what it will send over the serial port and what commands you can send in return.
Make sure you understand things like what means to have a text encoding like ASCII or UTF8. Most any device that sends and expects text will use an ASCII encoding.
I'm not sure what OS or language you're using, but be aware that you're sending raw binary data through a serial port, so for example if you're using C# you would want to wrap your serial port data stream with a StreamWriter or StreamReader with the correct text encoding.
If you can find an old modem online or craigslist that might be a good start. The serial comms specs for those are pretty well documented.
After that I would just start investigating things that you are interested in - your interest in the project will drive the learning and progress more than anything IMO.
I think this site has some fun things to try:
http://blogs.msdn.com/coding4fun/
You should get a data acquisition hardware and interface with that.
http://www.dataq.com/products/hardware/
If you just want to learn how to use the serial port, get another PC with HyperTerminal (included free with Windows), and use it to send and receive data from your development machine over the serial port. This will give you very manual control over what's sent to your development box, so you can get some confidence that what you're reading and writing is correct. Once you've got the basics of serial I/O down, you can move on to your camera/motion sensor/etc.
You don't mention what OS or development environment you're using, but in VS 2005/.NET 2.0, there is actually a SerialPort class. If you're doing raw Windows API, MSDN has an article at http://msdn.microsoft.com/en-us/library/ms810467.aspx which covers the basics. If you're using another OS, sorry I'm not that familiar (I know, boo hiss on me).
The most important thing is just remember to set your communication parameters on both sides of the connection the same. There are four parameters that govern if both sides can understand each other : baud rate, bits-per-byte (usually 8), parity bits (even parity, odd parity, none, or always 1 or 0), and stop bits. HyperTerminal also lists a "Flow Control" option, I recommend setting it to "None" until you get comfortable. Xon/Xoff flow control is a fairly common way of making the other side pause while you process a bufferfull of data.
Buy a microcontroller and build a simple robot, cnc mill or something. Atmel AVR and/or PIC is the most common from what i understand.
Also gives a lot of electronics experience