OpenWrt Forum Archive

Topic: Not used to Linux .. wget doesent work

The content of this topic has been archived on 14 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

The install of openwrt rc3 on the wrt54g 3.1 was straight forward, no problems.
But when i try to "play around" i miss some basic linux knowledge.

i do not use the router capabilities.
how to make the "internet port" equal to the 4 lan ports?

wget doesent work (timeout). Is it possible that wget searches
the internet on the "internet port" only?
the internet access trough wireless works flawlessly.

i would like to have some files in the www directory. wget doesent work.
is there another way to store files on the wrt54g (ftp server) ?

the feature i used in the original firmware is MAC filtering.
How do i set the filter-list in openwrt?

Is there a decent intuitive text editor in openwrt?  (NOT vid)

So many questions - a few answers:

> how to make the "internet port" equal to the 4 lan ports?

assuming v2 hw or later:
unset vlan1 nvram variables
add "0" to vlan0ports nvram variable
set vlan0_gateway and vlan0_dns if needed

> Is there a decent intuitive text editor in openwrt?  (NOT vid)

Because of openwrt I've finally learned to live with vi. Basics to get by:
- be aware of command vs edit mode
- cursor keys work
- 'x' to delete char under cursor (while in command mode)
- 'i' to enter edit mode and insert to LEFT of cursor
- 'a' to enter edit mode insert to RIGHT of cursor
- 'esc' to return to command mode
- ':wq<return>' to save and exit
- ':q!<return>' to discard and exit

that's all you need. I've been so exasperated with vi at times that I've considered porting my own editor to openwrt. It's only 10k but even it is based on vi style (old 'see' editor) but isn't nearly as insane as vi. I wonder if jed wouldn't work straight off, although it can be frustrating also?

to think that I used to edit all day long with line editors on the mf that make vi look like cat's meow :-) seriously, these editors are much more efficient when you use them day in and day out - they're only a disaster for light use.

Oh, and forget about the backspace key, linux doesn't know about ^h^h^h it, just left arrow and delete (x). but you probably already know this. It's a leftover from teletype days (rubout) I assume.

- DL

(Last edited by dl on 18 Sep 2005, 09:50)

paco_2345 wrote:

Is there a decent intuitive text editor in openwrt?  (NOT vid)

Not yet. I ported and packaged the latest Nano Editor for OpenWrt. It'll be included in further versions of OpenWrt (in CVS HEAD).

Nico said, he first needs to update ncurses.

(Last edited by olli_04 on 18 Sep 2005, 09:48)

vi is not needed if have windows machine and winscp.
Works excellent!

olli_04 wrote:
paco_2345 wrote:

Is there a decent intuitive text editor in openwrt?  (NOT vid)

Not yet. I ported and packaged the latest Nano Editor for OpenWrt. It'll be included in further versions of OpenWrt (in CVS HEAD).

Nico said, he first needs to update ncurses.

What's wrong with vi? Please don't wast the space including other editors. They can add them via ipkg if they need them. Just my 2 cents.

THANKS !

it works.
wget works, the ports are ok,
i was able to install wl and check my mac filter.

the short vi introduction was helpful to modify www/index.html.
check at http://212.254.198.33 ,i did add "hello world".

i could not figure out the account/password for winscp.  any clue?

WOW !  IM SATISFIED with OPENWRT !

dl wrote:

Oh, and forget about the backspace key, linux doesn't know about ^h^h^h it, just left arrow and delete (x). but you probably already know this. It's a leftover from teletype days (rubout) I assume.

No, it does, it's a terminal emulation issue with the ssh client you're using.

mjb wrote:
dl wrote:

... linux doesn't know about ^h^h^h it, just left arrow and delete (x)...

No, it does, it's a terminal emulation issue with the ssh client you're using.

Actually, I just overstated. BS works fine with my telnet/ssh at the command prompt, it's just that vi inserts ^h's. Or is that still an emulation issue? I tried saving assuming it was just a display issue but they remained when catting or going back to vi.

- DL

(Last edited by dl on 24 Sep 2005, 07:41)

dl wrote:

Actually, I just overstated. BS works fine with my telnet/ssh at the command prompt, it's just that vi inserts ^h's. Or is that still an emulation issue? I tried saving assuming it was just a display issue but they remained when catting or going back to vi.

It's likely that ash/busybox supports ^h as a backspace char too, but vi doesn't - it's a lovely termcap issue, and I don't fully understand it myself. Probably the easiest way to fix it is to look for the option in your ssh client that mentions something about backspace - I know putty does.

I don't get any of that anywhere. Backspace and arrows work fine on command line and in vi in both RC2 and RC3. Of course I use OpenSSH on Linux but the Windows clients should work just as good. There definitely must be something wrong with your terminal emulation. The rare times I have to use Windows at work putty has always worked fine too. What clients are you using? As far as WinSCP not working, does it have a choice of using scp or sftp? If so, choose scp. I have never had a problem transferring files with scp (again on Linux). I've seen that on Windows using pscp you have to tell it to use "scp" rather than "sftp" because sftp isn't included in dropbear. See this thread:

http://forum.openwrt.org/viewtopic.php?id=2458

Void Main wrote:

What clients are you using?

I'm using W2K telnet client and putty, both in default config. Here's what I found:

telnet
- commandline BS works fine
- commandline DEL functions as BS
- vi BS generates "^h"
- vi DEL functions as BS

putty
- commandline BS and DEL both function as expected
- vi BS works fine
- vi DEL uppercases three characters starting under cursor

My comment above "linux doesn't know about BS" was meant to be "linux doesn't know about DEL". I was pleasantly surprised to find that DEL functions as expected with putty (but not in vi). Because of unpredictible behaviour I long ago learned to avoid the DEL key in linux using -> and BS instead. I understand the historical reasons for these issues but you'd think by now default configs would work as expected with standard keyboards.

- DL

(Last edited by dl on 24 Sep 2005, 19:18)

I have been using vi/vim for 15 years and never once have I used the DEL key in it. DEL is not a vi command which is why you are having that trouble. Putty is working properly. Microsoft's telnet client is likely broken (normal). In command mode (ESC) if you want to delete one character you use "x" if you want to delete a line you use "dd". If you want to delete 10 characters you use "10x" if you want to delete 10 lines you use "10dd". Here's a vi reference:

http://drumlin.thehutt.org/vi/

Mind you this is not a full version of vi and is very limited to the full version and extremely limited to vim (by far the best editor on the planet) but there is a reason for that, it has the basic editing functionality and it is very small which is important on a limited resource device like the WRT. But it's amazing how much functionality they do get into it along with all the other commands that are built in to the busybox binary. I mean one 500k binary contains all of these commands:

ash -> busybox
cat -> busybox
chgrp -> busybox
chmod -> busybox
chown -> busybox
cp -> busybox
date -> busybox
dd -> busybox
df -> busybox
dmesg -> busybox
echo -> busybox
egrep -> busybox
false -> busybox
fgrep -> busybox
grep -> busybox
gunzip -> busybox
gzip -> busybox
ipcalc -> busybox
kill -> busybox
ln -> busybox
ls -> busybox
mkdir -> busybox
mktemp -> busybox
more -> busybox
mount -> busybox
mv -> busybox
netstat -> busybox
pidof -> busybox
ping -> busybox
ping6 -> busybox
ps -> busybox
pwd -> busybox
rm -> busybox
rmdir -> busybox
sed -> busybox
sh -> busybox
sleep -> busybox
sync -> busybox
tar -> busybox
touch -> busybox
true -> busybox
umount -> busybox
uname -> busybox
vi -> busybox
zcat -> busybox

If you put the full real version of all of those commands it would never fit on the WRT. The bash shell alone is bigger than all of the above commands combined with busybox.

I tried telnetting from a fedora (fc4) box and although both BS and DEL work fine on the cl, BS still gives a ^h in vi. Tried the same thing from a suse box (SLES9) and BS works fine in vi.

ps: just tried ssh from fc4 and BS works fine in vi.

- DL

(Last edited by dl on 24 Sep 2005, 22:12)

I guess the BS key is another one I never use in vi (I use 'h').  I am also on FC4 but only tested SSH since that's the first thing I turn on after installing WRT. What's the TERM variable set to when logging in? Mine is set to 'xterm' in SSH. It might not be detecting your terminal when using telnet. If you are in an xterm (or gnome-termain/konsole/etc) set try setting your TERM variable to xterm after logging in:

export TERM=xterm

On Windows you might try:

export TERM=vt100

Just a thought. Like I said though, it is an extremely limited version of vi and has just the very basic command set. The only thing I really miss in it is undo (u). But then it's not like you are going to be doing word processing on your WRT. Or are you? smile

Void Main wrote:

If you are in an xterm (or gnome-termain/konsole/etc) set try setting your TERM variable to xterm

I am in xterm (Konsole) but setting TERM to xterm didn't fix the BS in vi. In windows I had already previously tried all the term settings (VT100, Ansi, etc) to no avail. Odd that it works in Suse (xterm Konsole) but nowhere else.

I only set passwd as last step as telnet is more expedient (in windows anyway, as telnet doesn't open a separate window like putty does) while working out a config.

Void Main wrote:

But then it's not like you are going to be doing word processing on your WRT. Or are you? smile

Actually I'm a basic sort of guy and was contemplating replacing my desktop with WRT/jtag but I think I threw out my last VT100 about 10 years ago big_smile

- DL

(Last edited by dl on 24 Sep 2005, 22:51)

How can I ssh and telnet daemons both to work or revert back to telnet? I know when you set a password it disables telnet which is fine but for this kind of testing it would be nice to have both. I am sure I could figure it out pretty quickly. On another note, it looks like recognition of the DEL key was added to busybox about 10 days ago:

http://www.busybox.net/cgi-bin/viewcvs. … p;view=rev

Not sure how long it will be before it makes it into OpenWRT (I'm using RC2 and RC3 and BS works via SSH for me coming from FC4, will test telnet as soon as I figure out how to reenable it).

Nano for RC3 would be awesome i have a problem with my wrt54g locking up on high volume wireless
connections in client mode looking at the vi refrences i found online vi should not be a default editor for this platform there a to many commands
a simple editor like nano would be a better choice. maybe even something with less fucntions all you really need if a search string function and the standard open close save.....

that vim refrence quick start should be in the documentation section under new to openwrt.....
thanks to the developers however remeber your working with an embedded system so the tighter you keep your code the higher the performance..

botzkilla wrote:

Nano for RC3 would be awesome i have a problem with my wrt54g locking up on high volume wireless
connections in client mode looking at the vi refrences i found online vi should not be a default editor for this platform there a to many commands
a simple editor like nano would be a better choice. maybe even something with less fucntions all you really need if a search string function and the standard open close save...

nano is already packaged, look here : http://openwrt.org/downloads/people/nic … /packages/

thanx after installing nano i had a chance to finally look around inside my .conf files then got openssh-sftp-server and started using winscp should have done that one a while ago... still having a problem with the router freezing it's a wrtg54g v3.1 should i try the linksys-fixup script i cleared out the nvram before i  did a fresh install of rc3 then set it to client mode using the documenatation seems to work find get burst of 200k whcih quickly diminish or freeze the router running continious downloads the max speed i can get overall is 15k anything higher for a sustained period forces me to unplug it

The discussion might have continued from here.