LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   send file with FTP from small Linux version (http://www.linuxquestions.org/questions/programming-9/send-file-with-ftp-from-small-linux-version-861613/)

thosecars82 02-09-2011 09:55 AM

send file with FTP from small Linux version
 
Hello
I have this problem.
I need to do this:
I got a small version of Linux installed in some small devices. These devices come from the provider with this small version of Linux installed.

This devices should send data to some other machine in the internet. I have tested wput for this purpose with a PC which has an Ubuntu version 10 and it works fine. However, when I try wput in the small device, I get an error. It seems that the wput might need some libraries to work with the small version of Linux installed in the small device.

The fact of using wput or not is optional. I just need being able to send files through ftp with this small version of Linux.

The thing is that to be able to run wput in this small version of Linux, it seems that many of the needed libraries were missing. So what I did was just install all the needed libraries. But still the wput program fails in its first line.

Could please anyone help me with any idea?

Thanks

theNbomr 02-09-2011 04:54 PM

It would be a lot more helpful if you posted a copy of the exact error message(s), as well as a copy of the command(s) you used to generate the error(s). Without at least that much information, we could really only guess at what the problem might be.

--- rod.

thosecars82 02-11-2011 03:15 AM

Quote:

Originally Posted by theNbomr (Post 4253459)
It would be a lot more helpful if you posted a copy of the exact error message(s), as well as a copy of the command(s) you used to generate the error(s). Without at least that much information, we could really only guess at what the problem might be.

--- rod.

$ wput h

/usr/bin/wput: line 1: syntax error: "(" unexpected

thosecars82 02-11-2011 03:18 AM

Quote:

Originally Posted by theNbomr (Post 4253459)
It would be a lot more helpful if you posted a copy of the exact error message(s), as well as a copy of the command(s) you used to generate the error(s). Without at least that much information, we could really only guess at what the problem might be.

--- rod.


The error get is this:

$ wput h

/usr/bin/wput: line 1: syntax error: "(" unexpected


According to the proc/vesion, the installed Linux is:
Linux version 2.6.27 (build@buffy.sorcerers.fi) (gcc version 4.2.4) #1 Thu Apr 16 23:21:06 EEST 2009)

Thanks

orgcandman 02-11-2011 09:36 AM

what hardware device is this ?

what does /etc/motd say?
is there an /etc/*-release file?

That's a pretty old kernel, and vulnerable to quite a few issues (remote and local). If the distribution has similar age issues, I think my first order of business would be to upgrade it.

Regardless, if ftp is on the box, most versions can be scripted (heck, cat some-ftp-command-file | ftp host would probably work fine).

But please see my first concerns on distribution age.

theNbomr 02-11-2011 10:24 AM

You haven't said what CPU your 'small devices' use, but the error message you displayed is not atypical of binaries created for other CPUs. Are you sure the runtime binaries and and libraries were built for the CPU your small devices are using? What exactly did you do to install the libraries that you think are required? How did you conclude from the error message that there is a problem with any libraries?

--- rod.

thosecars82 02-11-2011 11:08 AM

Quote:

Originally Posted by orgcandman (Post 4255116)
what hardware device is this ?

what does /etc/motd say?
is there an /etc/*-release file?

That's a pretty old kernel, and vulnerable to quite a few issues (remote and local). If the distribution has similar age issues, I think my first order of business would be to upgrade it.

Regardless, if ftp is on the box, most versions can be scripted (heck, cat some-ftp-command-file | ftp host would probably work fine).

But please see my first concerns on distribution age.

(Linux version 2.6.27 (build@buffy.sorcerers.fi) (gcc version 4.2.4) #1 Thu Apr 16 23:21:06 EEST 2009)

As for upgrading there is this problem. This device has only 60MB of storage available. Moreover, I still do not know how to make a reliable backup of this device that I could recover reliably in case I broke it when messing around with it.

I know that the device has a usb port so may be that port might be used to insert a pen drive and do a backup.
The manufacturer of this device is Bluegiga
The device has 21 connections without external antennas (its antennas are internal antennas)
Thanks

thosecars82 02-11-2011 11:35 AM

Quote:

Originally Posted by theNbomr (Post 4255168)
You haven't said what CPU your 'small devices' use, but the error message you displayed is not atypical of binaries created for other CPUs. Are you sure the runtime binaries and and libraries were built for the CPU your small devices are using? What exactly did you do to install the libraries that you think are required? How did you conclude from the error message that there is a problem with any libraries?

--- rod.

I do not know whether there is a problem is the libraries, this is just a guess. I installed these libraries because this wput did not work properly. It asked for some library and when I tried to install that library then it said that I needed another library to be able to install the first library and so on. That way, I started by installing the last library, that is to say, the library that had no dependencies whatsoever.

Is this information I just said any useful for giving any hint about this problem?
Thanks

orgcandman 02-11-2011 12:12 PM

what would be far more helpful:

uname -a
file wput

I'm guessing you're using the bluegiga access server, but I've never used one of them. Regardless, BlueGiga's software vendor seems to be sorcerers.fi and you may need to contact them for more information.

thosecars82 02-11-2011 12:15 PM

Quote:

Originally Posted by orgcandman (Post 4255277)
what would be far more helpful:

uname -a
file wput

I'm guessing you're using the bluegiga access server, but I've never used one of them. Regardless, BlueGiga's software vendor seems to be sorcerers.fi and you may need to contact them for more information.

Sorry, what did you mean with
"uname -a
file wput
"?

Should I type "uname -a
file wput
" anywhere?
Thanks

orgcandman 02-11-2011 12:29 PM

Most definitely you are in way over your head. I'm hoping you're not being paid to develop whatever it is you're developing. Regardless, there is no quick solution for what you're trying to do.

I've looked into wput, and you'll need to cross-compile this to whatever architecture the bluegiga access server is (I'm guessing either mips or arm). Regardless, there's a whole slough of information that you need to become familiar with, including not only linux basics, but the basics of computers as well (ie: why you can't take a binary from your PC and run it on random hardware X).

I'm hoping that you'll get the following books and read and understand them:

Structured Computer Organization (4th ed. or later) by Andrew S. Tanenbaum
Building Embedded Linux Systems by Yahgmour
Unix Shell Programming

theNbomr 02-11-2011 12:57 PM

It doesn't sound like you understand that different CPU types require different types of binaries and libraries. Are you certain that the libraries and binaries you are trying to run on the Bluegiga boxen are built for that CPU/kernel/device? What is the origin of them? Did you build them? Copy them (from...)?

To help us understand more about your system, you need to run the shell commands (on the Bluegiga box)
Code:

uname -a
# ...and...
file wput

Report the results here.

The former will tell us about the host system, and the latter will tell us about the nature of the wput runtime binary.

--- rod.

thosecars82 02-15-2011 04:50 AM

Quote:

Originally Posted by theNbomr (Post 4255346)
It doesn't sound like you understand that different CPU types require different types of binaries and libraries. Are you certain that the libraries and binaries you are trying to run on the Bluegiga boxen are built for that CPU/kernel/device? What is the origin of them? Did you build them? Copy them (from...)?

To help us understand more about your system, you need to run the shell commands (on the Bluegiga box)
Code:

uname -a
# ...and...
file wput

Report the results here.

The former will tell us about the host system, and the latter will tell us about the nature of the wput runtime binary.

--- rod.

The putty client returns this:

login as: root
root@172.26.0.55's password:
[root@wrap /root]$ uname -a
Linux wrap.localdomain 2.6.27 #1 Thu Apr 16 23:21:06 EEST 2009 armv4tl unknown
[root@wrap /root]$ file wput
-ash: file: not found

Why the file wput command is not recognized?

What could I do now?


How can I show the current local path in ssh?
When I try lpwd, I get this error:
-ash: lpwd: not found

How can I upload with put in ssh? When I try to use put I get this error:
-ash: put: not found


Thanks

Guttorm 02-15-2011 08:20 AM

How did you install wput? From the error message you got, it doesn't look like it's simply missing a library. It looks more like it's for a different platform or something. The error message "-ash: file: not found" means that the computer does not have the file command installed.

I would first try to check if there are some options for ftp installed on the computer. Have you tried the command "ftp"? If it's not installed, maybe it has "curl"? "wput" is not very common because commands like curl do the same and more. If you have curl, you can read this guide on how to use it for ftp uploads.

http://www.hyperorg.com/blogger/2008...-ftp-via-curl/

thosecars82 02-15-2011 08:33 AM

Quote:

Originally Posted by Guttorm (Post 4259036)
How did you install wput? From the error message you got, it doesn't look like it's simply missing a library. It looks more like it's for a different platform or something. The error message "-ash: file: not found" means that the computer does not have the file command installed.

I would first try to check if there are some options for ftp installed on the computer. Have you tried the command "ftp"? If it's not installed, maybe it has "curl"? "wput" is not very common because commands like curl do the same and more. If you have curl, you can read this guide on how to use it for ftp uploads.

http://www.hyperorg.com/blogger/2008...-ftp-via-curl/

I just checked that I have no ftp or curl available because I get

-ash: curl: not found
-ash: ftp: not found

I tried to use wget to install vsftpd-2.3.3.tar.gz in the device but I got this error message:
wget: bad response to RETR: 501 Syntax error

Any idea?

Thanks


All times are GMT -5. The time now is 09:44 AM.