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

How to configure DDS and DevTools for special target device #251

Open
nguyenlkdn opened this issue Apr 4, 2024 · 15 comments
Open

How to configure DDS and DevTools for special target device #251

nguyenlkdn opened this issue Apr 4, 2024 · 15 comments
Labels
question Further information is requested

Comments

@nguyenlkdn
Copy link

When attempting to connect to the VM service URI output by the Flutter engine in the context of a custom embedder, users may encounter the following error:

This VM does not have a registered Dart Development Service (DDS) instance and is not currently serving Dart DevTools.

Platform:

  • IMX8QXP
  • IMX-WAYLAND

Flutter elinux release 3.13.0

Flutter target devices:

flutter-elinux devices
4 connected devices:

Linux (desktop) • linux • linux-x64 • Ubuntu 20.04.6 LTS 5.15.0-101-generic
eLinux (desktop) • elinux-wayland • flutter-tester • Ubuntu 20.04.6 LTS 5.15.0-101-generic
eLinux (desktop) • elinux-x11 • flutter-tester • Ubuntu 20.04.6 LTS 5.15.0-101-generic
> eLinux (mobile) • gridania-pvt1 • flutter-tester • ion-imx-wayland

Step to Reproduce:

  1. flutter-elinux create sample
  2. cd sample
  3. flutter-elinux pub get
  4. flutter-elinux run -d gridania-pvt1 --profile -v

[ +32 ms] Unable to locate an Android SDK.
[ +10 ms] executing: uname -m
[ +2 ms] Exit code 0 from: uname -m
[ ] x86_64
[ +89 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +5 ms] Artifact Instance of 'ELinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ +5 ms] executing: ping -w 500 -c 1 192.168.7.1
[ +11 ms] PING 192.168.7.1 (192.168.7.1) 56(84) bytes of data.
64 bytes from 192.168.7.1: icmp_seq=1 ttl=64 time=0.309 ms
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.309/0.309/0.309/0.000 ms
[ +3 ms] Skipping pub get: version match.
[ +36 ms] Generating
/home/saydi/workdir/00_Sources/community/flutter/sample/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +19 ms] Launching lib/main.dart on eLinux in profile mode...
[ +1 ms] Uninstall sample from gridania-pvt1.
[ ] executing: ssh [email protected] rm -rf "/tmp/sample"
[ +229 ms] Uninstallation Success
[ +2 ms] Install sample (build/elinux/arm64/profile/bundle) to gridania-pvt1
[ ] executing: scp -r build/elinux/arm64/profile/bundle [email protected]:/tmp/sample
[+2970 ms] Installation Success
[ +1 ms] Launch sample.name on gridania-pvt1
[ +317 ms] VM Service URL on device: http://127.0.0.1:43621/d4EXYYZKy2c=/
[ ] executing: ssh -o ExitOnForwardFailure=yes -L 127.0.0.1:43621:127.0.0.1:43621 [email protected]

Result on Web-browser: debug and profile modes are the same result

image

@nguyenlkdn
Copy link
Author

Already tried start VM Dart on Host PC to connecting VM Server URL
img_v3_029l_734746e7-4b1b-457f-9e6b-b2a3ac865beh

@HidenoriMatsubayashi
Copy link
Collaborator

Please ensure that you have set forwardPort and disable all proxy settings.

See https://github.com/sony/flutter-elinux/wiki/Remote-target-devices#flutter_custom_devicesjson-example

@HidenoriMatsubayashi HidenoriMatsubayashi added the question Further information is requested label Apr 9, 2024
@nguyenlkdn
Copy link
Author

nguyenlkdn commented Apr 10, 2024

Please ensure that you have set forwardPort and disable all proxy settings.

See https://github.com/sony/flutter-elinux/wiki/Remote-target-devices#flutter_custom_devicesjson-example

{
  "custom-devices": [
    {
      "id": "gridania-pvt1",
      "label": "Gridania Pvt 1",
      "sdkNameAndVersion": "ion-imx-wayland",
      "enabled": true,
      "platform": "arm64",
      "backend": "wayland",
      "ping": [
        "ping", "-w", "500", "-c", "1", "192.168.7.1"
      ],
      "pingSuccessRegex": "ttl=",
      "install": [
        "scp", "-r", "${localPath}", "[email protected]:/tmp/${appName}"
      ],
      "uninstall": [
        "ssh", "[email protected]", "rm -rf \"/tmp/${appName}\""
      ],
      "runDebug": [
        "ssh", "[email protected]", "XDG_RUNTIME_DIR=/run/user/0 /tmp/${appName}/${appName} -b ."
      ],
      "stopApp": [
        "ssh", "[email protected]",
        "ps aux | grep \"/tmp/${appName}\" | grep -v grep | awk '{print $2}' | xargs kill"
      ],
      "forwardPort": [
        "ssh", "-o", "ExitOnForwardFailure=yes",
        "-L", "127.0.0.1:${hostPort}:127.0.0.1:${devicePort}", "[email protected]"
      ],
      "forwardPortSuccessRegex": "Linux"
    }
  ]
}

I have no any proxy configured now.

saydi@Precision-3571:~$ echo "$http_proxy"

saydi@Precision-3571:~$ echo "$https_proxy"

saydi@Precision-3571:~$ env | grep proxy
saydi@Precision-3571:~$ 

I connect with my target board over Ethernet Port

Target: 192.168.7.1
Host: 192.168.7.2

Look at my logs:

trant.java
[ +19 ms] Launching lib/main.dart on eLinux in profile mode...
[ +1 ms] Uninstall sample from gridania-pvt1.
[ ] executing: ssh [email protected] rm -rf "/tmp/sample"
[ +229 ms] Uninstallation Success
[ +2 ms] Install sample (build/elinux/arm64/profile/bundle) to gridania-pvt1
[ ] executing: scp -r build/elinux/arm64/profile/bundle [email protected]:/tmp/sample
[+2970 ms] Installation Success
[ +1 ms] Launch sample.name on gridania-pvt1
[ +317 ms] VM Service URL on device: http://127.0.0.1:43621/d4EXYYZKy2c=/
[ ] executing: ssh -o ExitOnForwardFailure=yes -L 127.0.0.1:43621:127.0.0.1:43621 [email protected]

PortForward already corrected.

@nguyenlkdn
Copy link
Author

nguyenlkdn commented Apr 10, 2024

$ flutter-elinux run -d raspberry-pi4
Launching lib/main.dart on eLinux in debug mode...
Uninstall sample from raspberry-pi4.
[email protected]'s password: 
Uninstallation Success
Install sample (build/elinux/arm64/debug/bundle) to raspberry-pi4
[email protected]'s password: 
Installation Success
Launch sample.name on raspberry-pi4
[email protected]'s password: 
[email protected]'s password: 
Syncing files to device eLinux...                                  202ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on eLinux is available at: http://127.0.0.1:43237/xd6sW5hdEoE=/
Activating Dart DevTools...                                      1,830ms
The Flutter DevTools debugger and profiler on eLinux is available at:
http://127.0.0.1:9100?uri=http://127.0.0.1:43237/xd6sW5hdEoE=/

Regarding to your trial on Rpi, i just confused about why did your target board already installed "Dart DevTools" and it will be activated automatically while executing flutter app.

or after "💪 Running with sound null safety 💪"

It is being executed on Host???

@nguyenlkdn
Copy link
Author

nguyenlkdn commented Apr 10, 2024

Practice done already, with below notes:

I need to attach "--debug-url" manually after application started

Target Device:

LD_LIBRARY_PATH=/usr/share/flutter/3.19.3/profile/lib/ flutter-client --bundle=/usr/share/flutter/ion-hmi/3.19.3/profile/
flutter: The Dart VM service is listening on http://127.0.0.1:38867/LdVG8OhkIx8=/

Host PC:

  1. Need to go into the project folder
  2. Need to be sure PortForward already started before starting Host Dart Devtool

Ex: in my case is ssh -o ExitOnForwardFailure=yes -L 127.0.0.1:38867:127.0.0.1:38867 [email protected]

flutter-elinux attach --debug-url=http://127.0.0.1:38867/LdVG8OhkIx8=/
Syncing files to device eLinux...                                   6.2s

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on eLinux is available at: http://127.0.0.1:43373/-fXmCK4fbG0=/
The Flutter DevTools debugger and profiler on eLinux is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:43373/-fXmCK4fbG0=/

Results on Web Browser
image

Practice on Flutter-eLinux release 3.9.13. Thank you!

@HidenoriMatsubayashi I am not sure why did my environment haven't started Devtools automatically as your practiced

@HidenoriMatsubayashi
Copy link
Collaborator

HidenoriMatsubayashi commented Apr 10, 2024

You should use The Flutter DevTools debugger and profiler on eLinux is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:43373/-fXmCK4fbG0=/ one on Host PC.

I'm not sure what your issue is here...
See also: https://github.com/sony/flutter-elinux/wiki/Debugging-with-DevTools

@HidenoriMatsubayashi
Copy link
Collaborator

HidenoriMatsubayashi commented Apr 10, 2024

I've confirmed that flutter-elinux with a remote-device works fine.

flutter-elinux version: 3.19.4
Remote device: Rapsberry-Pi5

$ flutter-elinux run -d raspberry-pi5 --profile
Launching lib/main.dart on eLinux in profile mode...
Uninstall sample from raspberry-pi5.
[email protected]'s password: 
Uninstallation Success
Install sample (build/elinux/arm64/profile/bundle) to raspberry-pi5
[email protected]'s password: 
Installation Success
Launch sample.name on raspberry-pi5
[email protected]'s password: 
[email protected]'s password: 

Flutter run key commands.
h List all available interactive commands.
c Clear the screen
q Quit (terminate the application on the device).
A Dart VM Service on eLinux is available at: http://127.0.0.1:39075/I6EFzjm6EeE=/
The Flutter DevTools debugger and profiler on eLinux is available at:
http://127.0.0.1:9100?uri=http://127.0.0.1:39075/I6EFzjm6EeE=/

Screenshot from 2024-04-11 05-31-26

@nguyenlkdn
Copy link
Author

Ya i mean is we able to connect for debugging on target already after we attach debugger manuallly

flutter-elinux attach --debug-url=<Link to VM Service on target board>

I just concerned is why did it is not started automatically on our environment.
Maybe it is environment issues, thank for your confirmed.

@HidenoriMatsubayashi
Copy link
Collaborator

Please try the followings to break down the issue.

  1. Use the latest version of flutter-elinux
  2. Use other devices such as Raspberry-Pi4/5

@HidenoriMatsubayashi
Copy link
Collaborator

I'll close this issue as there is no additional update/comment.

@HidenoriMatsubayashi
Copy link
Collaborator

Re-opening.

@WDoughty
Copy link

Pasting what i had in the other issue

Looked through a bit of the other issues but haven't been able to resolve what I am seeing.

flutter-elinux run -d v1200
Launching elinux/flutter/main.dart on eLinux in debug mode...
Uninstall vis_vision_app from v1200.
Uninstallation Success
Install vis_vision_app (build/elinux/arm64/debug/bundle) to v1200
Installation Success
Launch vis_vision_app.name on v1200

The discovery uri never shows up in the regular log. But if i run with -v

[+5191 ms] Installation Success
[        ] Launch vis_vision_app.name on v1200
[+1231 ms] VM Service URL on device: http://127.0.0.1:40937/MWJ-2vYYMDg=/
[   +1 ms] executing: ssh -o ExitOnForwardFailure=yes -L
127.0.0.1:40937:127.0.0.1:40937 [email protected]

Going to that url I get this.

This VM does not have a registered Dart Development Service (DDS) instance and is not currently serving Dart DevTools.

Other info, I am cross building from x64 to arm64 using custom sdk and yocto.

@WDoughty
Copy link

I used that url from the verbose log and did the same process with running the flutter-elinux attach from my development machine and I was able to get dev tools. Not sure why its not running the attachment by itself. Here is the forwardPort for this custom device.

"forwardPort": [
        "ssh", "-o", "ExitOnForwardFailure=yes",
        "-L", "127.0.0.1:${hostPort}:127.0.0.1:{$devicePort}", "ccs@<display IP>"
      ],
"forwardPortSuccessRegex": "Linux"

@HidenoriMatsubayashi
Copy link
Collaborator

"-L", "127.0.0.1:${hostPort}:127.0.0.1:{$devicePort}", "ccs@"

Typo: {$devicePort}
=> Correct one is ${devicePort}

@WDoughty
Copy link

Good catch, but that is also how i have it in my custom devices. Working between different devices

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

No branches or pull requests

3 participants