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.

C Code to send image from PC on ftp server using USB Modem

Status
Not open for further replies.

yousafzai82

Member level 4
Joined
Jan 20, 2010
Messages
77
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Pakistan
Activity points
1,844
Hi all

I need to write a c code to send an image from PC to the ftp server on using USB Modem. I am really stuck from where to start??

Is it like this i will have to print AT commands followed by the data image on the usb port.

Someone please help me in this regards.

Zahoor Ahmad
 

Re: C Code to send image from PC on ftp server using USB Mod

The solution can be from very simple to fairly complicated depending upon the environment available and restrictions imposed.

In its simplest form, let's assume that you are going to write the program for
1)Windows or Linux OS (not an embedded standalone app)
and
2)The modem is a standard commerical modem (Already detected by your OS and driver installed)
3) And you have ftp client available on your system

Then
all you need to do is to call that from your program with appropriate paramaters.
 
Re: C Code to send image from PC on ftp server using USB Mod

1)Windows or Linux OS (not an embedded standalone app)
and
2)The modem is a standard commerical modem (Already detected by your OS and driver installed)
3) And you have ftp client available on your system


I am sure about these points. I am able to connect through hyperterminal using commands

at
OK
at+cgatt=1
OK
at+cgdcont=1,"ip","internet","58.181.105.95",0,0
OK
at+cgdata="ppp",1
CONNECT

But when i select "send file" from hyperterminal window, the window is closed after giving the message "connection time out", i would like to mention that i am using teltonika E12 Modem..

Another problem is that how i can send these at commands on USB Port using C coding, please give me some idea?????
 

Re: C Code to send image from PC on ftp server using USB Mod

It's good that your setup is functional. And the hint is already there

"all you need to do is to call that from your program with appropriate paramaters. "

You are using hyperterminal so you'll probably be on a windows system. You will just need to learn how to run an executable from a C program.

Hint: ShellExecute

From your description, you want to work on application layer so you don't need to bother to USB at bus level. If that's the only active modem on your system, commands will automatically go through that.
 

Re: C Code to send image from PC on ftp server using USB Mod

One problem i am facing is where should i define the port number. Like i have defined target ip but i don't know how to define port number??????????
 

Re: C Code to send image from PC on ftp server using USB Mod

FTP uses port 21 and you shouldn't need to explicity set it for client if the server is listening ont the default port.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top