Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

send video file over TCP(PIC32MX795f512L) and SIM7600CE

Status
Not open for further replies.

akshaybhavsar

Full Member level 2
Joined
May 5, 2016
Messages
135
Helped
2
Reputation
4
Reaction score
2
Trophy points
18
Activity points
898
hi,

I have to send a file to server using SIM7600CE.I am using TCP transparent mode.In have my server application which will take TCP packets and store it into file.I have a doubt with video file encoding.For testing what i did is.
0.Got MP4 file
1.Open video file as text file.
2.copy the content.
3.make another txt file.
4.paste
5.rename new file as .mp4

Newly created file doesn't run:-(
Same thing i have to make.read fil from SD card and send it to server.and server will store data into mp4 fil:-(

Do i need to make encoding and decoding?
 

Video files are not text files they can only be opened as binary files.
 

How can i send it to server over TCP.How can i open it?.If i open it by file system command(fopen) and send byte by byte to server and at server side i will create mp4 file and store this data into that file...Will it work?

- - - Updated - - -

Or need to adopt some decoding,encoding?
 

TCP doesn't care what format the data is in so send it as binary.
The problem with converting to text is you probably added a line feed character every time it encountered the byte for a carriage return or the other way around. You could MIME encode the video then send it as text but that would make it considerably bigger.

Brian.
 

TCP doesn't care what format the data is in so send it as binary.
True

You could MIME encode the video then send it as text but that would make it considerably bigger.

I don't get it. I diseagree. OP didn't say anything about HTML / HTTP and MIME is related to that. There are no MIME things in the TCP, or are there?

I'd do it simply:
- read file as binary
- send file as binary by TCP
- save file as binary
 

MIME is used to pre-code binary (8-bit) into text (7-bit) so it can be sent over text links, for example in email. Basically, the last bit is rolled in to the following character and the next two bits of that into the next character and so in the end the original binary is there but divided into smaller chunks.

TCP can carry 8-bit so if you are sending binary there is no need to do anything to encode it or decode it (unless you want to). It is only when passing the data as email you have to MIME encode it so it looks like jumbled text but the mail servers are happy. Some, but not all HTML systems also use MIME to carry images, video and music . These are all to condition the data though, the actual transfer is still done using TCP.

Brian.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top