Cannot link between watch emulator and smartphone physical device

Hi everyone,

I am newbie here. I intend to develop a companion project with 2 parts:

  • Gear app with Tizen Web sdk 5.5 (Provider).
  • Android app to send data to the gear app (Consomer).

I’ve read so many documentations about companion app from Samsung community as well as Samsung official documentation but I could not connect my gear emulator with my real smartphone device as the documentation mentioned.

I already downloaded the accessory sdk 2.6.1 which includes samples of companion apps. I can run successfully the sample Provider watch app on the tizen emulator, I can also run successfully the Consumer android app on my real device. No errors, no bugs. But they cannot connected to each other. When I click connect button on the Consumer android app, it shows the error:

Code

FINDPEER_DEVICE_NOT_CONNECTED

I’ve followed the documentation about a tool called:

Code

Emulator for Samsung Accessory

Step 1: Install the apk file provided in sdk 2.6.1 Samsung accessory servcie v3.1.82.80406_Emul. On package manager: All 5.5 SDKs are installed. SDK is installed. Samsung wearable extension is also installed.

Step 2: Connect my smartphone with my PC via USB cable. Developer mode turned on.

Step 3: Run adb -d forward tcp:8230 tcp:8230.

It shows no error so I resume that it’s OK .

Step 4: Run the Samsung accessory service app on my smartphone. It shows “disconnected”

Step 5: Open Tizen emulator manager on my PC, create a new 5.5 virtual machine (all default settings) and launch it.

Step 6: Samsung accessory service app still shows: “Disconnected”. In fact, It always shows disconnected.

Step 7: Clear the app storage on my smartphone and retry the above steps many many times without success.

Step 8: OK I ignore that tool. I still try to run my Consumer android app (sample app) and my Provider watch app (sample app). They show up perfectly on my watch emulator and my real smartphone device. But when I click on connect button, it shows:

Code

FINDPEER_DEVICE_NOT_CONNECTED

Step 9: I check my Watch emulator and see a strange thing (not sure):

As you can see that it shows " Standalone SDK ". Meanwhile what I want to work on is " Companion SDK ", why is it Standalone SDK here? How to change it?

Step 10: Check accessoryservices.xml on android and watch they match the ID, name,… Surely they match because they are sample apps from Samsung.

As far as I understand, the Emulator for Accessory Service app doesn’t require any tizen or android project to be run. It only requires a connected smartphone and a tizen emulator. Is it correct?

Sorry for a long explanation. I’ve spent 3 days to make the watch emulator connect with real smartphone device but no luck. I really appreciate your help.

Thank you!

I follow this instruction:

Code

https://developer.samsung.com/galaxy-watch/develop/creating-your-first-app/web-companion/galaxy-watch-emulator

Which mentions about the Emulator accessory apk file to help a real smartphone device connect to a wearable emulator. That tool is also mentioned in Programing Guide of accessory SDK 2.6.1 (please check my attached file page 97).

Regarding the bluetooth, my wearable device is an emulator (my PC doesn’t have bluetooth connection), my real smartphone device has bluetooth working normally but I don’t see in the documentation the bluetooth connection is required, only wifi connection in smartphone device is required. I think the purpose of the apk tool is to help the wearable emulator recognize the smartphone device, am I correct?

Is it normal if my wearable emulator display “Standalone SDK” as the screenshot I mentioned in the first post?

Thanks in advance!

I noticed some things.

Connecting to Phone from PC
Developer Options On
Scroll down USB Debugging has to be on to connect
When you first connect you will probably be required to allow and RSA Encryption Key if you don’t do that you can’t connect.

Connecting to Smart Watch from PC
Smart Watches are Tizen 4 you need to build for that to run on watch.
Go to Settings -> Gear info -> About device.
Tap on Software version 5 times. Then a confirmation pop up displayed once the Developer options is enabled.
Also make sure Debugging is on in About Watch settings
Restart your watch
Be sure WiFi is always on
After connecting tap on the network and scroll to the IP address and write it down.
On the PC
Launch Device Manger
Open the Remote Device manager (icon looks like phone to computer link)
click on the + add your IP address and give it a name OK
Now watch your watch carefully
Click to turn that watch connection on
an RSA Encryption notification will show up on your phone. allow that if you don’t it doesn’t show up again unless you reboot.
you should be connected to the phone at that time data will show up in the device manager.

I hope this is the problems you sound like you have read the documentation very well.

Ron
Samsung Developer Program

2 Likes

Thank you very much!

Phone (real device):

When you first connect you will probably be required to allow and RSA Encryption Key if you don’t do that you can’t connect.

Yes, I always press “accept” when the RSA encryption key alert shows up.

Connecting to Smart Watch from PC

My watch device is an emulator, it’s not a real device so I just open the Emulator Manager => Launch.

2020-01-18_01h53_23

Also make sure Debugging is on in About Watch settings
Restart your watch
Be sure WiFi is always on
After connecting tap on the network and scroll to the IP address and write it down.

Because it’s a watch emulator (not physical device), I am not sure where the IP address in the watch is. I turn on wifi and it shows like this:

And I could not connect to any of those networks. So I don’t know how to see the IP. Therefore, at this step, I am stuck.

Open the Remote Device manager (icon looks like phone to computer link)
click on the + add your IP address and give it a name OK

I cannot get the IP in the above step so this step cannot be done. Is the port 26101 correct? And because it’s an emulator which is run in my PC, is it necessary to connect to wifi?

The network (wifi) on my phone, and the network on my PC are in the same network.

In an attempt to find out the IP address on the emulator, I right click on the emulator and select “Control Panel” where I see this:

So I tried the IP 10.2.0.15 but it shows the error:

2020-01-18_02h09_25

Can you please help?
Thanks in advance.

Because it’s an emulator, developer options and USB debugging are turned on as default.

My mistake I thought you were trying to run it in a real watch because you were having emulator problems.

Try this by building a Tizen 3 or Tizen 4 version. Tizen 5.5 is so new it may have flaws especially the emulator. The newest Tizen Wearable is 4.0.0.7 so it isn’t like you are developing anything that can run on a device if you select 5.5

Ron
Samsung Developer Program

1 Like

Thank you! I’ve solved it! Thanks to your advice.

I tried Tizen 4 but the emulator shows the error when it starts up: “cannot install extras… try to install manually.”.

So I’ve tried Tizen 3 and it works perfectly! The apk tool mentioned in the documentation finally shows “Connected”.

2020-01-18_14h01_53

After that, I tried running Samsung sample app Provider on my watch emulator and Samsung sample app Consumer on my smartphone. I works like a charm!

My conclusion:

  • The apk tool “Emulator for SS accessory” only works with Tizen 3 (or even with tizen 4 if there is no error as I mentioned above). The documentation for accessory sdk v2.6.1 (latest) does not work with Tizen 5.5.

  • All of the the steps I did in post #1 are correct.

@r.liechty_SDR: I really appreciate your help. Thank you so much. It would be nice if you inform my issue on Tizen 5.5 with the development team so that in the future, apk tool can work with the latest version of Tizen. :wink: