1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FIXED HyperCon SSH does not work with Java 1.7.0_80 (64bit)

Discussion in 'Bug Reports' started by Zac Morris, 2 May 2016.

  1. thebatfink

    thebatfink New Member

    Messages:
    26
    Hardware:
    RPi1/Zero, +Arduino
    So some more tests. I see in your code you are sending 10000 time out. These errors always return after exactly 10 seconds.

    If I change the IP to some random non-used IP on the network, I do see a Timeout prompt suggesting 'Wrong ip?'.

    But if I use the correct IP, either with correct login details, or wrong username, or no password but right username, I always get the exception thrown.
     
  2. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Windows Firewall is enabled by default but since it works with Putty it should work with HyperCon as well unless it specifically blocks the java process, weird issue indeed as I'm using the same setup only with Kaspersky Total Security and with Windows Defender and Windows Firewall both disabled.
     
  3. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Oh, makes this sense? Looks like a incompatiblity between jsch and your target? :eek:
     
  4. thebatfink

    thebatfink New Member

    Messages:
    26
    Hardware:
    RPi1/Zero, +Arduino
    So how to diagnose the specific issue? It's making a connection right, which is why it isn't throwing the timeout.

    Should I try reinstalling something else onto this rPi 1 and see if that helps matters? Whats the preferred software to use?

    And can we please try a version with a longer timeout.. It takes 12 seconds for password prompt to appear in putty ssh window when auto sending username..
     
    Last edited: 15 May 2016
  5. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    That one sounds familiar and might be the root cause, that is normally because it tries to do a reverse DNS lookup or has some sort of external auth but typically it's the DNS one.
    Could you do the following:

    - SSH to Raspberry Pi and execute command "ifconfig" , afterwards best to post output.
    - Disable reverse DNS for ssh, more info here:

    http://raspberrypi.stackexchange.com/questions/15568/raspberry-pi-ssh-login-slow

    but the steps are:

    - sudo nano -w /etc/ssh/sshd_config
    - add UseDNS no to the file and save with F2
    - run "service ssh reload"
     
  6. thebatfink

    thebatfink New Member

    Messages:
    26
    Hardware:
    RPi1/Zero, +Arduino
    Here is the output

    Code:
    OpenELEC (official) Version: 5.0.5
    rPI:~ # ifconfig
    eth0      Link encap:Ethernet  HWaddr B8:27:EB:BD:47:9A
              inet addr:192.168.1.247  Bcast:192.168.1.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:3042 errors:0 dropped:0 overruns:0 frame:0
              TX packets:818 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:247707 (241.9 KiB)  TX bytes:136972 (133.7 KiB)
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:1924 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1924 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:96200 (93.9 KiB)  TX bytes:96200 (93.9 KiB)
    
    rPI:~ #
    Regarding editing the file. sudo nano -w /etc/ssh/sshd_config gives error no sudo. If I try to edit the file with nano it says error writing, read only file. PS, there was a line already UseDNS yes but it was already commented out with #.
     
    • Like Like x 1
  7. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Can try it this way then :)

    Code:
    - Execute command "su" and enter password
    - nano -w /etc/ssh/sshd_config
    - Uncomment the "UseDNS" line and set it to no
    - Reboot or execute command "service ssh reload"
    
     
  8. thebatfink

    thebatfink New Member

    Messages:
    26
    Hardware:
    RPi1/Zero, +Arduino
    su doesn't do anything.

    This is openelec, not raspbian right? it would seem root account doesn't have write permission to the file.

    BTW, do you know how to compile this hypercon java program? I installed jdk and try to use javac on my modified PiSshConnection.java file but I get it to compile into class file?
     
  9. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    Oh nevermind got the 2 swapped, everything is run as root with OpenElec but might be that ssh config is write protect by root as well :)

    Will check if there's a way around that.


    // Update

    With OpenElec you only get write access to /storage so there's a way to change the ssh config but it's not very clean (swapping out config on startup), there's a DNS issue with the router or the Raspberry at least as it shouldn't take that long to do a reverse lookup :)

    In the file "/etc/hostname" does it have the default hostname or one with a FQDN?
    Also in /etc/resolve.config /etc/resolve.conf which DNS server is it using?
     
    Last edited: 15 May 2016
  10. thebatfink

    thebatfink New Member

    Messages:
    26
    Hardware:
    RPi1/Zero, +Arduino
    in /etc/hostname the file is blank except for one entry:

    Code:
    rPI
    I don't have resolve.config but have a resolv.conf. This says:

    Code:
    # Generated by Connection Manager
    search Home
    nameserver 192.168.1.254
    That is my routers address.
     
  11. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    That looks alright, can you comment out the search Home line or is it write protected there as well?
    Once edited best to reboot.
     
  12. Zac Morris

    Zac Morris New Member

    Messages:
    16
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino
    OK, wait, the Java JVM is flagged specifically in the windows firewall, so if the first time you ever launched Java on this machine if you didn't specifically specify YES to firewall access, then no java application will have network access. This has been a common support issue with java apps.

    Just to confirm if this is or is not the issue, go to Control Panel, Windows Firewall, then select the option to "Turn Windows Firewall on or off", then turn it off for Private Network. Then try again.

    This will confirm if the issue is related specifically to the Java JVM firewall settings. If it worked, then you can either choose to leave it off for private networks (this is how I run) or choose "Advanced Settings", deleted any reference to "Java(TM) Platform" (under inbound, outbound, and rules), then try again (which should trigger the prompt to allow).
     
    • Thank you Thank you x 1
  13. thebatfink

    thebatfink New Member

    Messages:
    26
    Hardware:
    RPi1/Zero, +Arduino
    Oh man. So I eventually got eclipse installed and downloaded the source.

    hypercon/ConfigTool/src/org/hyperion/ssh/PiSshConnection.java

    Code:
    public void connect(String pHostName, int pTcpPort, String pUsername, String pPassword) throws JSchException {
    connect( pHostName, pTcpPort, pUsername, pPassword, 10000);
    
    becomes

    Code:
    public void connect(String pHostName, int pTcpPort, String pUsername, String pPassword) throws JSchException {
    connect( pHostName, pTcpPort, pUsername, pPassword, 20000);
    and it now connects (although it takes around 14 seconds).. Can you please make the timeout configurable or increase the timeout as above.
     
    • Like Like x 1
  14. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    I just wanted to upload a 20seconds bin right now. That´s okay! I changed it.
    Thank you for your investigation
     
  15. thebatfink

    thebatfink New Member

    Messages:
    26
    Hardware:
    RPi1/Zero, +Arduino
    Can you compile it? Today is my first day looking at java before :) I can't figure out how to build the project to a jar, only run it from inside eclipse..

    Also, surely there is some exception or condition not being captured here. If it does not establish connection before timeout then we trigger timeout error, but if connection is established but not completed within the timeout, it shouldn't just bail out right..

    Rick,

    I commented out the search line but it hasn't improved login time. Its weird, launching putty I see username prompt in like 1 second, but after entering username, its then a further 12 seconds or so until the password prompt is displayed.
     
  16. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
  17. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    During login it will do a reverse DNS check against the connecting client, not sure if OE5 enabled this as with OE4 it used to be instant login :)
    Either the DNS server is non-compliant or it tries to do a remote lookup which depending on outside DNS server (ISP / Google) can vary.
     
  18. Zac Morris

    Zac Morris New Member

    Messages:
    16
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino
    I still believe the Windows Firewall is the root cause here. It is probably blocking the reverse lookup packets. I too am using OpenELEC, and my resolv.conf is configured to use my primary router, and I don't get the 12 second delay that is mentioned, but then I have Firewall turned off for Private network.

    Can you try to turn off the Firewall for private network, just to remove this as a possible root cause?
     
    • Like Like x 1
  19. thebatfink

    thebatfink New Member

    Messages:
    26
    Hardware:
    RPi1/Zero, +Arduino
    So need to find a way of editing the non-editable file :)

    BTW as a bug report, if you maintain a 'Bottom Gap' in Hypercon, it is impossible to navigate back to zero gap. Even if setting to 0, it maintains a gap.

    How to turn off for private network? Java is already maintained in the firewall with no restrictions and I can't create a rule against a non .exe like Hypercon.
     
  20. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    For testing only the easiest way is via control panel:

    "


    Other option is to stop the service completely:

    - Open command prompt
    - type "services.msc"
    - Find the service "Windows Firewall" and right click and select "Stop"