OpenWrt Forum Archive

Topic: java program to change wrt54g/gs OpenWRT settings

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

hey all,

im developing a little GUI that will login to a openwrt router, and so far ive got it working somewhat. Its using Appgate's mindterm java ssh terminal (http://www.appgate.com/products/5_MindTerm/ --- the BasicClient example file to connect), and it opens a terminal with the GUI. In the end, i will get rid of the terminal so that you dont need to see the command lines, but for the time being i need to make sure commands are reaching the router and being executed.

I ran into my first problem today - i have made a method to execute commands (using RunRemoteCommand2 example file), but when i try to use the method to send a command to the router, the ssh connection is dropped and i get an error message saying so. Can anyone take a look at the Mindterm library and  try to help me out here?

basically i have a button in my gui mapped to run a "ls -l" command and print it to the terminal.

If you need code or anything, let me know or instant message me.

the error i get is:

"SSH2Transport.disconnectInternal() : 'disconnect: Server closed connection'

I have a feeling that the problem has to do with interfacing with dropbear ssh or the ash shell. The program works fine when i login to my slackware linux machine using sshd, and it executes the "ls -l" command with no error.

can anyone help? i think this tool in the end can really help simplify the openwrt interface without needing to make a web interface.

can anyone help? i think this tool in the end can really help simplify the openwrt interface without needing to make a web interface.

I don't know if sending raw ssh commands is such a good idea. Some RPC over SSL protocol (maybe using some ash CGI script or summat) might be more appropriate.

Anyway, the disconnection problem can be caused by various things. Does your sshd log to syslog? If so, have it dump its output to a syslog server to see why it disconnects. Maybe it misses a valid terminal, or something. Can be anything. Without code and logging output, it's like walking in the dark on this, so please do post a tarball or somthing on the web (not that I'd be any good at solving the problem, but still...)

thx polarwolf

how can i get the sshd log to output to a syslog server, and how do i read the log?

problem solved... ill get this program up and running soon

The discussion might have continued from here.