aseba-community / thymio-vpl2

Next generation VPL for Thymio using Qt Quick from Qt 5.x
GNU Lesser General Public License v3.0
2 stars 5 forks source link

App freeze on connecting to Thymio on some devices #98

Open stephanemagnenat opened 7 years ago

stephanemagnenat commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

For the workaround:

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

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

motib commented 7 years ago

Didn't work

stephanemagnenat commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 6 years ago

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 commented 6 years ago

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

mbonani commented 6 years ago

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 commented 6 years ago

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

mbonani commented 6 years ago

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

mbonani commented 6 years ago

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 commented 6 years ago

There are actually 2 issues here

mbonani commented 6 years ago

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