Connection refused on Kivy Remote Shell

231 views
Skip to first unread message

lakeside

unread,
Aug 8, 2016, 4:49:58 PM8/8/16
to Kivy users support
I'm getting a connection refused message when trying to SSH into my Android tablet. Any thoughts on what I'm missing?

Setup steps:
  1. Install Kivy and Buildozer
  2. Create a Kivy app (i.e., testapp) and make sure it runs 
  3. $ cd ~/testapp/.buildozer/android/platform
  4. $ git clone git://github.com/kivy/kivy-remote-shell
  5. Set environment variables
    1. export ANDROIDSDK=/home/[user]/.buildozer/android/platform/android-sdk-20
    2. export ANDROIDNDK=/home/[user]/.buildozer/android/platform/android-ndk-r9c
    3. export ANDROIDNDKVER=r9
  6. cd python-for-android
  7. $ ./distribute.sh -m 'openssl pycrypto pyasn1 pyjnius twisted kivy'
  8. Create a local project.properties file with the value "target=android-19" (no quotes
    1. nano ~/testapp/.buildozer/android/platform/python-for-android/dist/default/project.properties
  9. $ ./build.py --package org.kivy.sshshell --name "Kivy Remote Shell"   --version 1.0.4 --private ../../../kivy-remote-shell/   --icon ../../../kivy-remote-shell/icon.png --permission INTERNET debug installd
  10. VPN in to work network
  11. Disconnect from computer USB
  12. $ ssh -v -p8000 ad...@172.16.0.29
OpenSSH_7.2p2 Ubuntu-4, OpenSSL 1.0.2g-fips  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 172.16.0.29 [172.16.0.29] port 8000.
debug1: connect to address 172.16.0.29 port 8000: Connection refused
ssh: connect to host 172.16.0.29 port 8000: Connection refused


lakeside

unread,
Aug 9, 2016, 8:31:52 AM8/9/16
to Kivy users support
This is on an Ubuntu 16.04 VM. I've tried SSH'ing via Putty on a Windows 7 desktop as well. The information on troubleshooting this issue is sparse:

http://stackoverflow.com/questions/25419510/how-to-connect-to-kivy-remote-shell
https://groups.google.com/forum/#!topic/kivy-users/HtmEydy7sAI

lakeside

unread,
Aug 10, 2016, 9:19:27 AM8/10/16
to Kivy users support
Apparently, my build of the Kivy Remote Shell APK was faulty. I found an pre-built APK and got the shell working:

https://in.pycon.org/cfp/2016/proposals/plyer-platform-independent-python-wrapper-for-platform-dependent-apis~dG8Qe/

See /bin folder for the APK.

Raja Ramesh

unread,
Apr 12, 2020, 2:54:06 AM4/12/20
to Kivy users support
Hi ,

i am trying to access my andriod phone using my windows laptop. i have downloaded the app from https://github.com/kivy/kivy-remote-shell and installed the .apk on my mobile. when i open the app on my mobile it gave me ssh -p8000 admin@ip address . i tried to  connect mobile using ssh -p8000 admin@ip address on command prompt  of my windows laptop. but it gave an error saying   

ssh_dispatch_run_fatal: Connection to ip-address  port 8000: Invalid key length. 
could you please help me with the steps how to access mobile with kivy remote shell.

Thanks,
Raja

Robert Flatt

unread,
Apr 12, 2020, 1:51:24 PM4/12/20
to Kivy users support
Debug with ssh -v     or if you want really verbose   ssh -vvvv

More generally nobody has done any work on this project for almost 4 years.
The build instructions are obsolete, it is possible the app has bit rot.

There are several apps that run Python on Android (or build an apk with Kivy/Buildozer) , this would be a lot easier than a remote Python shell  (unless you are trying to use some package that does not have an Android wheel)

Raja Ramesh

unread,
Apr 13, 2020, 8:23:21 AM4/13/20
to kivy-...@googlegroups.com
Thank you Robert for sharing the details. i have created an simple kivy app on laptop and  build ' .apk ' file with  Buildozer... uploaded the file to my android phone for testing and it worked.
is there any other way to test the code directly on android phone before building .apk file? please share any links where i can go through.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/7db90063-1b54-48fb-bc09-fccb8d2a536e%40googlegroups.com.

Robert Flatt

unread,
Apr 13, 2020, 1:05:49 PM4/13/20
to Kivy users support
is there any other way to test the code directly on android phone before building .apk file?

The best answer is 'no'.

1) The approach previously taken (if it worked) does not test if compiled components build for ARM
2) You could use one of the several Python apps for Android, but these have no Kivy install instructions, so dependencies may be an issue; as well as compiled components. There is a recent thread here with dependency issues in this case.
3) You could try using an emulator, by building an .apk using x86. I have never seen this work but in theory it could. Again would not test ARM compiled components.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages