# Sending data to a server

**URL:** <https://www.ruby-forum.com/t/sending-data-to-a-server/242258>\
**Category:** GNU Radio\
**Created:** [June 9, 2015, 10:44pm UTC](https://www.ruby-forum.com/t/sending-data-to-a-server/242258 "2015-06-09T22:44:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [June 9, 2015, 10:44pm UTC](https://www.ruby-forum.com/t/sending-data-to-a-server/242258/1 "2015-06-09T22:44:37Z")

</div>

I’m trying to send my recordings from a USRP Source(hardware: NI B200)  
to a  
database I set up. I have been searching the internet for hours and I  
have  
come up with nothing. There was one post that mentioned it, but only the  
fact that there is a way to have MySQL and GRC working together. Is  
there a  
way to have the data output from a UHD: USRP Source go to a MySQL  
database?  
I tried using a TCP Sink, mode: Client but nothing happens and mode:  
Server  
gives me an error.

---

<div class="post-metadata">

**Author:** ![Ashraf\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@Ashraf\_Y](https://www.ruby-forum.com/u/Ashraf_Y)\
**Post date:** [June 9, 2015, 11:00pm UTC](https://www.ruby-forum.com/t/sending-data-to-a-server/242258/2 "2015-06-09T23:00:23Z")

</div>

Yeah, write a script to insert it into a database. Start by importing  
gr and pyodbc…

Which is just about as unhelpful as your question. But seriously:

- what do you intend to record? (raw samples, filtered signal, decoded  
messages, …)
- how much data do you plan to record, and how long do you need to store  
it?
- do you need to store any metadata? (frequency, bandwidth, time,  
location, …)
- what does your database schema look like?
- how do you plan on retrieving the recordings from the database?
- what do you plan on doing with the recording after you get it from  
the database?
- are you maybe doing it wrong? would it make more sense to just store  
capture files on disk, and keep metadata (including filename) in the  
database?

On Tue, Jun 9, 2015 at 1:43 PM, Ashraf Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

–  
GDB has a ‘break’ feature; why doesn’t it have ‘fix’ too?

---

<div class="post-metadata">

**Author:** ![Ashraf\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@Ashraf\_Y](https://www.ruby-forum.com/u/Ashraf_Y)\
**Post date:** [June 9, 2015, 11:06pm UTC](https://www.ruby-forum.com/t/sending-data-to-a-server/242258/3 "2015-06-09T23:06:14Z")

</div>

Thank you for responding. I’m new to all of this, including database. I  
am  
recording what you called metadata; time, location, frequency, power for  
about 30 minutes. I think that also answer the question about schema. I  
just started learning how to write functions in python, and I went  
through  
the example tutorials.

---

<div class="post-metadata">

**Author:** ![Ashraf\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@Ashraf\_Y](https://www.ruby-forum.com/u/Ashraf_Y)\
**Post date:** [June 9, 2015, 11:21pm UTC](https://www.ruby-forum.com/t/sending-data-to-a-server/242258/4 "2015-06-09T23:21:25Z")

</div>

That doesn’t necessarily answer the question about schema - you could  
have a whole bunch of columns, one for each frequency bin across a  
band, or a shorter record of power level on a frequency at a  
particular time.

Have a look at uhd\_spectrum\_sense.py for a start. It emits text  
records with many of these measurements - try write a script to parse  
the output and stash it into a database. When you get that working  
you’ll probably understand how to add database logging to  
uhd\_spectrum\_sense.py.

On Tue, Jun 9, 2015 at 2:04 PM, Ashraf Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > the database?
> > 
> > > fact that there is a way to have MySQL and GRC working together. Is  
> > > [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)
> > 
> > –  
> > GDB has a ‘break’ feature; why doesn’t it have ‘fix’ too?

–  
GDB has a ‘break’ feature; why doesn’t it have ‘fix’ too?

---

<div class="post-metadata">

**Author:** ![Ashraf\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@Ashraf\_Y](https://www.ruby-forum.com/u/Ashraf_Y)\
**Post date:** [June 10, 2015, 4:04pm UTC](https://www.ruby-forum.com/t/sending-data-to-a-server/242258/5 "2015-06-10T16:04:51Z")

</div>

Thank you. i ran uhd\_spectrum\_sense.py and it helped alot. I am now in  
the  
process of getting it to also print out the location in longitude,  
latitude, and altitude.

---

<div class="post-metadata">

**Author:** ![Ashraf\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@Ashraf\_Y](https://www.ruby-forum.com/u/Ashraf_Y)\
**Post date:** [June 10, 2015, 4:06pm UTC](https://www.ruby-forum.com/t/sending-data-to-a-server/242258/6 "2015-06-10T16:06:02Z")

</div>

\*usrp\_spectrum\_sense.py

---

<div class="post-metadata">

**Author:** ![Ashraf\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@Ashraf\_Y](https://www.ruby-forum.com/u/Ashraf_Y)\
**Post date:** [June 10, 2015, 7:07pm UTC](https://www.ruby-forum.com/t/sending-data-to-a-server/242258/7 "2015-06-10T19:07:07Z")

</div>

How would uhd\_spectrum\_sense know your location?
