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

App freeze on connecting to Thymio on some devices #98

Open
stephanemagnenat opened this issue Jun 28, 2017 · 19 comments
Open

App freeze on connecting to Thymio on some devices #98

stephanemagnenat opened this issue Jun 28, 2017 · 19 comments

Comments

@stephanemagnenat
Copy link
Member

stephanemagnenat commented Jun 28, 2017

On some devices, once the Thymio is plugged and the connection accepted on the tablet, the app freeze.

Cause

This problem might be triggered because of three causes:

  1. Also on some Android device, as Thymio tries to recharge when it is connected by a cable, the system shutdowns the USB connection. In that case, the solution is to use a powered USB hub. Another solution is to use a Wireless Thymio and connect the dongle to your Android device, which alleviates the power problem.
  2. It seems the problem also happens with a Wireless Thymio. I suspect that the problem is somewhat related to our "fake" rfcomm driver. Indeed, while most Android distributions provide the standard Linux kernel rfcomm driver, it is not usable without a rooted phone. To work around this problem, we re-implemented the rfcomm driver with a combination of Java-based low-level Android USB functions and C++ code, providing the Dashel android: target. However, it does not work on some devices, for a currently-unknown error.
  3. It might also be, on Wireless Thymio with a phone/tablet having a USB3 port, that the USB3 has radio-frequency interferences with the Thymio dongle.

How to help

Please list your devices having problems here: https://github.com/aseba-community/thymio-vpl2/wiki Tell us what connection method you use. If possible, add the Android version, kernel version, build number, and android security patch level (see Settings -> About -> Software information -> More). Tell us whether your devices has a USB3 port. If you have a similar device and it works, please also list these informations, it will help us to narrow down the problem.

Work-around

If your device has this problem, and you want to test this app nonetheless, you can make a bridge on a computer, and connect to the computer from the app. Assuming your computer's IP or hostname is MYCOMPUTER, first connect your robot to your computer (by plugging it to USB or using the USB dongle) and launch a switch:

asebaswitch -v "ser:name=Thymio"

On the tablet in the VPL Mobile app, click on the robot icon on top left to change the connection configuration. Change the Dashel target to tcp:MYCOMPUTER;33333.

@motib
Copy link

motib commented Jun 28, 2017

Having problems with
Samsung Galaxy Tab S, model SM-T800.
Android version 6.0.1.
Security patch 1/1/17.
Build MMB29K.T800XXU1CQA2
Kernel 3.4.39-9086385

@motib
Copy link

motib commented Jun 29, 2017

Hi Stephane,
Please give a bit more detail:
By "connect your robot to the computer": do you mean with the usb cable or wireless?
After running asebaswitch, do I detach the robot or leave it connected
(so it is connected both to the computer and the tablet)?
What is the "robot icon" on the tablet?
There is the Thymio VPL icon but no setting of "Dashel" (whatever that is).
Sorry ... but not all of us have experience in these things!
Moti

@mbonani
Copy link
Member

mbonani commented Jun 29, 2017

For the workaround:

  • connect the robot to the computer (dongle or cable), then let it connect. In this case it is simpler to have a wireless one
  • the robot icon is the small Thymio on top left in VPL. It let you change the connection configuration.

Also on some android device, because Thymio try to recharge when is connect by cable, the system cut the USB. The solution is to use a powered USB hub. The simplest solution is to connect by Wireless Thymio using the dongle so that you haven't problem of power. The freezing App could also perhaps come from there.

@motib
Copy link

motib commented Jun 29, 2017

Thanks, Michael.
The app no longer crashes but I can't run the program.
(I assume that is done by touching the > icon in the lower right corner.
It seems to be disabled.)

Here are the results of running asebaswitch and ipconfig.
I tried with both ip4 and ip6 addresses.

C:\Program Files (x86)\AsebaStudio>asebaswitch -v "ser:name=Thymio"
Found Thymio on port \.\COM9
[Thu Mar 09 14:20:38 1978 534] Incoming connection from ser:name=Thymio;baud=115
200;stop=1;parity=none;fc=none;bits=8;dtr=true

Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix . : Home
Link-local IPv6 Address . . . . . : fe80::ad35:56f7:9b:e14b%16
IPv4 Address. . . . . . . . . . . : 10.0.0.3
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.138

@stephanemagnenat
Copy link
Member Author

@motib your computer is on a local network (i.e. behind a NAT/router). You must have the tablet on the same network (so also an IP in the form of 10.0.0.x).

@motib
Copy link

motib commented Jun 29, 2017

Yes, the tablet is connected to the same router. But ... it has a slightly different ip address: the computer has 10.0.0.3 and the tablet has 10.0.0.5. I don't know how to "force" one or the other to have a specific address. Would they both still work with the same address??

@stephanemagnenat
Copy link
Member Author

stephanemagnenat commented Jun 29, 2017

@motib you need to use "tcp:10.0.0.3;33333" as Dashel target on the tablet.

@motib
Copy link

motib commented Jun 29, 2017

Didn't work

@stephanemagnenat
Copy link
Member Author

Do you see any information on the terminal in which you launched asebaswitch on the computer? If not, maybe there is a firewall blocking incoming connections on your computer.

@motib
Copy link

motib commented Jun 29, 2017

There was a warning message when I first ran it,
but I allowed access to private networks.
I tried closing the programs on both the tablet and computer,
and running again and didn't get any message aside from what I wrote above.

@ghost
Copy link

ghost commented Jul 1, 2017

Works very well with my Samsung galaxy s6 android, except with thymio wireless (freeze, crash, nothing is possible). The USB port of my smartphone is an USB Host which only accept USB key formatted in FAT. It is connected with Thymio by micro-usb (phone) /usb (thymio wire).

@mbonani
Copy link
Member

mbonani commented Feb 1, 2018

It seems that there is regression with this issue. On device where it was working it seems that the dongle is disconnect after a while and reconnect. It makes that even if you say that the default program to use is VPL it reopen continuously the windows. The robot begin to send its description but it never ends.
Is there something different?`

@stephanemagnenat
Copy link
Member Author

Regression with respect to what? A previous commit of vpl2?

@mbonani
Copy link
Member

mbonani commented Feb 5, 2018

It seems but I am not sure that the connection was working on some device and now not. So difficult to me if it is coming from a android or VPL2.
We should make a table with device number and android version.

@stephanemagnenat
Copy link
Member Author

Agreed, note that there was no change on the connection code for the last 6 months.

@mbonani
Copy link
Member

mbonani commented Feb 5, 2018

A table of tested device can be updated here:
https://github.com/aseba-community/thymio-vpl2/wiki

@mbonani
Copy link
Member

mbonani commented Feb 20, 2018

image
Several device are now working with the USB cable but not the dongle, there is perhaps a powering issue, it seems that the dongle is reset somehow when it is receiving the Thymio description. None of the option here helps.

@cor3ntin
Copy link
Contributor

cor3ntin commented Mar 4, 2018

There are actually 2 issues here

  • A connection failure that may not be solvable if it turns out it is a hardware issue
  • The handling of that failure leading to a freeze/crash. that should not happen. We should display an error instead

@mbonani
Copy link
Member

mbonani commented Mar 11, 2018

Actually the freeze/crash do not appears anymore, it is just not connecting

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

No branches or pull requests

4 participants