Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to Tizen Device/emulator failed. Error: Agent connection #60

Open
tusharsharma04 opened this issue Mar 16, 2017 · 3 comments

Comments

@tusharsharma04
Copy link

Hi Antti,

I am trying to run python script on Tizen Z3 mobile device but facing some connection issue. I am posting the details below. Kindly guide and share your opinion.
$sdb root on
$which sdb
/usr/bin/sdb
$sdb version
Smart Development Bridge version 2.2.80
$python -c 'import fmbttizen; print fmbttizen.Device(pythonCommand="/opt/python/bin/python")'


// The above command gives a traceback with following error:
fmbttizen.TizenConnectionError: Connecting to a Tizen device/emulator failed. Error : Agent connection

sh-3.2# /opt/python/bin/python /tmp/fmbttizen-agent.py ; exit
sh: /opt/python/bin/python" No such file or directory
exit
Try "sdb -s 0000c24f00007200 shell /opt/python/bin/python /tmp/fmbttizen-agent.py --debug".


$ sdb -s 0000c24f00007200 shell
closed
sh-3.2# python -c 'print "hello"
hello
sh-3.2# /opt/python/bin/python -c 'print "hello"

$
$

I have already followed the discussion at:
#27

Could you please check what is getting wrong. thank you~!

@askervin
Copy link
Contributor

Maybe Python is installed in some other directory than /opt/python/bin/python on the device?

Does this give you an error:
$ python -c 'import fmbttizen; print fmbttizen.Device()'

If it does, please let me know what this says:
$ sdb -s 0000c24f00007200 shell
sh-3.2# which python

@tusharsharma04
Copy link
Author

$ python -c 'import fmbttizen; print fmbttizen.Device()'
Answer: <fmbttizen.Device object at 0x7f8bb9d83310>
$ sdb -s 0000c24f00007200 shell
Answer: closed
sh-3.2$ which python
Answer: /usr/bin/python

Note: Somehow it did not show earlier connection error.
Moreover when i run fmbt-scripter, it shows the tizen mobile screen also....after File---> New Tizen

@askervin
Copy link
Contributor

It sounds like the connection is established and things work fine as you are able to get the screenshot. Just use fmbttizen.Device() to create a device object through which you can communicate with the real device. (Forget the pythonCommand - it is a workaround for the case if python is not in PATH on the device.)

For instance, in fmbt-scripter, click down the Control button and click the screenshot that you are see on the left. It should synthesize a touch screen tap even to corresponding location on the real device.

You can get started with the scripting by clicking down the Rec button. Now fmbt-scripter should write you script as you click on the screenshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants