07-21-2021 02:47 AM - edited 07-21-2021 02:48 AM
where does this image come from? A file on your filesystem?
If so you just use Read File (Binary).
07-21-2021 03:46 AM
OK. I try to use Read File (Binary) and Write File (Binary). On other PC, I also receive a file. but I can't open this file, note: The original data format is not recognized.
07-21-2021 04:22 AM
The binary read and write file make sure no line ending conversion or other text transformations are done. If the data is not byte for byte the same on both sides, something else in the transfer chain is corrupting/transforming the data stream.
07-21-2021 08:43 AM
If you use the Binary Read and Binary Write nodes, it should do the job:
07-21-2021 09:04 PM
Great! I success receive the image file by this way on one PC. But on two PCs and USRPs, the situation is different. At the transmitter, I converted data and sent them by modulation signal , then we called these data 'data1'. At the receiver, I received the data from modulation signal and demodula them . In the end , I got the data called 'data2'.
Actually, the 'data1' is exactly the same as the 'data2'. So I think the way on two PCs and USRPs should be the same as the first way on one PC.
But I can't open this file, note: The original data format is not recognized.
07-21-2021 09:21 PM
The whole idea of "binary files" and "binary file transfer" is that the two files are byte-for-byte identical. So if "File 1" is the "original" file (in whatever format -- I recall you mentioned ".jpeg"), and "File 2" is the "copy" somewhere else,
One thing you might consider (since you seem fixated more on transferring data over USRP than with "image type file") is to try to transfer, say, a small Word document, or a small Text document whose content you know. Do these simpler transfers work?
If you've got a complicated, difficult problem to solve, sometimes it helps to break it down in simpler pieces that you can test one at a time.
Bob Schor
07-21-2021 10:29 PM
File1 and File2 . Their sizes are different. But on one PC transport, their sizes also different. I can open this file. On two PC , it can't do that.
I also try to transfer a '.txt' file. It can be transmitted without problems. Now the problem is just the transfer of image files.
07-22-2021 01:56 AM
@akjoker wrote:
Now the problem is just the transfer of image files.
No! Your problem is transferring any binary data. Image or not doesn’t matter. Somewhere after reading in the file your conversions you perform are NOT maintaining the binary consistency of the data. Reasons could be many:
1) Use of some functions meant to work on text data.
2) Bad attempt at compressing the data further.
3) Bug in your code.
07-22-2021 04:20 AM
I have to admit, in the example I showed above, point 1 and 3 are describing a likely problem.
@rolfk wrote:
1) Use of some functions meant to work on text data.
if NOT using file functions working with text data, per default the size of arrays is preceded. Since I didn't wire the boolean input "Prepend Array Size" with a FALSE- constant, the size of the saved data will be increased by four bytes, holding the size of the array.
2) Bad attempt at compressing the data further.
3) Bug in your code.
This should be considered a bug.
The funny thing is, that my Image- Viewer (Irfanview) had no problem, showing the newly saved jpg- image.
08-31-2021 10:16 PM
I find the problem. The data type changed during processing. U8 becomes I8. If you change I8 back to U8, an error will occur.
So can I specify I8 type when reading the file?