[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Using a named fifo with a file source (was: Re: Discu
From: |
CEL |
Subject: |
[Discuss-gnuradio] Using a named fifo with a file source (was: Re: Discuss-gnuradio Digest, Vol 204, Issue 6) |
Date: |
Wed, 9 Oct 2019 11:05:33 +0000 |
Hi Ali,
as requested by the first line of email that you replied to: please
change the title of your emails to something useful, and don't reply to
digests.
Anyway, the answer really is, as I said: Don't use `cat` to write to a
fifo.
There's enough terminal emulators (minicom, screen, …) that you could
use. `dd` with a byte-sized block size and the `sync` CONV option might
work too. Alternatively, write your own program (reading a line from
keyboard and writing it to a file isn't really hard if you know how to
use `scanf` or `std::cin`, or Python's `input`).
Best regards,
Marcus
On Tue, 2019-10-08 at 09:07 +0300, ali mokdad wrote:
> Dear all
>
> Moreover,
>
> as I mentioned before no data is transmitted in the following case
> 1- $ mkfifo in
> 2-: $ cat > in
> 3- gnuradio : file source (in) --> stream to tagged stream --> throttle -->
> tagged stream to pdu --> message debug
> till I press ctrl c, where in file source repeat in no.
>
> if repeat is yes then I have the following error
> [/build/gnuradio-BBYmSv/gnuradio-3.7.11/gr-blocks/lib/file_source_impl.cc]
> fseek failed
>
> can anyone inform me what is the problem?
>
> Best regards
>
> On Tue, Oct 8, 2019 at 8:00 AM ali mokdad <address@hidden> wrote:
> > Dear
> >
> > thx for your reply
> >
> > even by using stdbuf the problem remains the same
> > $ stdbuf -i 0 -o 0 cat > in
> >
> > I think the problem must be solved from gnuradio because if I run two
> > terminals in
> > first terminal: $ cat > in
> > second terminal: $ cat in
> > then whatever I write in the first terminal is sent to the second terminal
> > after pressing enter.
> >
> > while
> > if instead of the second terminal I used gnuradio with the following
> > flowgraph
> > in gnuradio : file source (in) --> stream to tagged stream --> throttle -->
> > tagged stream to pdu --> message debug
> >
> > the data are not sent till I press ctrl c.
> >
> > thanks again for your help, but my problem is not solved if there is any
> > one can help me
> >
> > Best regards
> >
> >
> > Virus-free. www.avast.com
> >
> > On Mon, Oct 7, 2019 at 7:06 PM <address@hidden> wrote:
> > > Send Discuss-gnuradio mailing list submissions to
> > > address@hidden
> > >
> > > To subscribe or unsubscribe via the World Wide Web, visit
> > > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> > > or, via email, send a message with subject or body 'help' to
> > > address@hidden
> > >
> > > You can reach the person managing the list at
> > > address@hidden
> > >
> > > When replying, please edit your Subject line so it is more specific
> > > than "Re: Contents of Discuss-gnuradio digest..."
> > >
> > >
> > > Today's Topics:
> > >
> > > 1. fifo / file source (ali mokdad)
> > > 2. Re: fifo / file source (Müller)
> > > 3. Re: fifo / file source (ali mokdad)
> > > 4. Re: fifo / file source (N. Benes)
> > >
> > >
> > > ----------------------------------------------------------------------
> > >
> > > Message: 1
> > > Date: Mon, 7 Oct 2019 13:41:47 +0300
> > > From: ali mokdad <address@hidden>
> > > To: address@hidden
> > > Subject: [Discuss-gnuradio] fifo / file source
> > > Message-ID:
> > > <address@hidden>
> > > Content-Type: text/plain; charset="utf-8"
> > >
> > > Dear all
> > >
> > > I tested the following
> > >
> > > 1- in terminal, I created a fifo file by: mkfifo in
> > > 2- in terminal, I run: cat > in
> > > 3- in gnuradio i run : file source (in) --> stream to tagged stream -->
> > > tagged stream to pdu --> message debug
> > > 4- in terminal, I write and press enter nothing is sent, only if I press
> > > ctrl c the all the data written in the terminal are sent to the message
> > > debug.
> > >
> > > How can I solve this problem?
> > > -------------- next part --------------
> > > An HTML attachment was scrubbed...
> > > URL:
> > > <https://lists.gnu.org/archive/html/discuss-gnuradio/attachments/20191007/c17ad733/attachment.html>
> > >
> > > ------------------------------
> > >
> > > Message: 2
> > > Date: Mon, 7 Oct 2019 11:11:52 +0000
> > > From: Müller, Marcus (CEL) <address@hidden>
> > > To: "address@hidden" <address@hidden>,
> > > "address@hidden" <address@hidden>
> > > Subject: Re: [Discuss-gnuradio] fifo / file source
> > > Message-ID: <address@hidden>
> > > Content-Type: text/plain; charset="utf-8"
> > >
> > > Hi Ali,
> > >
> > > it's not quite certain which program you run in that terminal, but:
> > > File I/O is usually buffered, and this sounds like the data is never
> > > written to your FIFO before you exit your terminal program.
> > >
> > > Solution: Use a terminal program that doesn't buffer or flushes
> > > regularly.
> > >
> > > Best regards,
> > > Marcus
> > >
> > > On Mon, 2019-10-07 at 13:41 +0300, ali mokdad wrote:
> > > > Dear all
> > > >
> > > > I tested the following
> > > >
> > > > 1- in terminal, I created a fifo file by: mkfifo in
> > > > 2- in terminal, I run: cat > in
> > > > 3- in gnuradio i run : file source (in) --> stream to tagged stream
> > > > --> tagged stream to pdu --> message debug
> > > > 4- in terminal, I write and press enter nothing is sent, only if I
> > > > press ctrl c the all the data written in the terminal are sent to the
> > > > message debug.
> > > >
> > > > How can I solve this problem?
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > Discuss-gnuradio mailing list
> > > > address@hidden
> > > > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> > > -------------- next part --------------
> > > A non-text attachment was scrubbed...
> > > Name: smime.p7s
> > > Type: application/x-pkcs7-signature
> > > Size: 6582 bytes
> > > Desc: not available
> > > URL:
> > > <https://lists.gnu.org/archive/html/discuss-gnuradio/attachments/20191007/5f1b0f0b/attachment.bin>
> > >
> > > ------------------------------
> > >
> > > Message: 3
> > > Date: Mon, 7 Oct 2019 14:34:49 +0300
> > > From: ali mokdad <address@hidden>
> > > To: Müller, Marcus (CEL) <address@hidden>, address@hidden
> > > Subject: Re: [Discuss-gnuradio] fifo / file source
> > > Message-ID:
> > > <CACn2bH=address@hidden>
> > > Content-Type: text/plain; charset="utf-8"
> > >
> > > Thx for your reply
> > >
> > > "it's not quite certain which program you run in that terminal"
> > > I just wrote cat > in
> > > even I run a .c file in the .c file I opened a file and the data are not
> > > sent only when I close the file.
> > > do you know a special program I can test?
> > >
> > >
> > > On Mon, Oct 7, 2019 at 2:11 PM Müller, Marcus (CEL) <address@hidden>
> > > wrote:
> > >
> > > > Hi Ali,
> > > >
> > > > it's not quite certain which program you run in that terminal, but:
> > > > File I/O is usually buffered, and this sounds like the data is never
> > > > written to your FIFO before you exit your terminal program.
> > > >
> > > > Solution: Use a terminal program that doesn't buffer or flushes
> > > > regularly.
> > > >
> > > > Best regards,
> > > > Marcus
> > > >
> > > > On Mon, 2019-10-07 at 13:41 +0300, ali mokdad wrote:
> > > > > Dear all
> > > > >
> > > > > I tested the following
> > > > >
> > > > > 1- in terminal, I created a fifo file by: mkfifo in
> > > > > 2- in terminal, I run: cat > in
> > > > > 3- in gnuradio i run : file source (in) --> stream to tagged stream
> > > > > -->
> > > > tagged stream to pdu --> message debug
> > > > > 4- in terminal, I write and press enter nothing is sent, only if I
> > > > > press
> > > > ctrl c the all the data written in the terminal are sent to the message
> > > > debug.
> > > > >
> > > > > How can I solve this problem?
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Discuss-gnuradio mailing list
> > > > > address@hidden
> > > > > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> > > >
> > > -------------- next part --------------
> > > An HTML attachment was scrubbed...
> > > URL:
> > > <https://lists.gnu.org/archive/html/discuss-gnuradio/attachments/20191007/52fa06fc/attachment.html>
> > >
> > > ------------------------------
> > >
> > > Message: 4
> > > Date: Mon, 07 Oct 2019 13:18:00 +0000
> > > From: "N. Benes" <address@hidden>
> > > To: address@hidden
> > > Subject: Re: [Discuss-gnuradio] fifo / file source
> > > Message-ID: <address@hidden>
> > > Content-Type: text/plain; charset=utf-8
> > >
> > > ali mokdad:
> > > > do you know a special program I can test?
> > >
> > > "stdbuf" could be of help here. But beware that the input stream into
> > > "cat" may still be (line) buffered because of bash.
> > >
> > > Example:
> > > $ stdbuf -i 0 -o 0 cat > in
> > >
> > > Cheers!
> > >
> > >
> > >
> > > ------------------------------
> > >
> > > Subject: Digest Footer
> > >
> > > _______________________________________________
> > > Discuss-gnuradio mailing list
> > > address@hidden
> > > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> > >
> > >
> > > ------------------------------
> > >
> > > End of Discuss-gnuradio Digest, Vol 204, Issue 6
> > > ************************************************
> >
> > Virus-free. www.avast.com
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
smime.p7s
Description: S/MIME cryptographic signature