Visual Studio Code support for Omega development
-
Hi all.
New here. We at Wattworker, a startup company in Norway are working on developing a awesome new product to optimize water heater power usage by the use on machine learning. We have chosen Omega2S+ to be the brain in our PCB.
http://wattworker.com/I use Visual Studio Code for my workflow. It has a awesome official extension called "Remote SSH", that enables remote development with many advanced features. When successfully connected, all files and folders appear in the left panel, while ssh terminal appear in bottom panel. It makes it super easy and efficient to develop with.
Config file:
I tried to enter Onion as host, however vscode gives a error: Bash not found. The whole log in below. It does however work with raspberry pi and all other linux distros.
Can anyone help us here?
------------------------------ Full Error Log -----------------------------
[17:15:32.863] Log Level: 2
[17:15:32.872] remote-ssh@0.56.0
[17:15:32.872] win32 x64
[17:15:32.874] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a2257617474776f726b6572227d", attempt 1
[17:15:32.874] SSH Resolver called for host: Wattworker
[17:15:32.874] Setting up SSH remote "Wattworker"
[17:15:32.919] Using commit id "e5a624b788d92b8d34d1392e4c4d9789406efe8f" and quality "stable" for server
[17:15:32.923] Install and start server if needed
[17:15:34.633] Checking ssh with "ssh -V"
[17:15:34.682] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5[17:15:34.691] Running script with connection command: ssh -T -D 57404 Wattworker bash
[17:15:34.695] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[17:15:35.574] > root@192.168.3.1's password:]0;C:\WINDOWS\System32\cmd.exe
[17:15:35.574] Got some output, clearing connection timeout
[17:15:35.575] Showing password prompt
[17:15:38.354] Got password response
[17:15:38.354] "install" wrote data to terminal: "********"
[17:15:38.369] >
[17:15:38.393] > ash: bash: not found
[17:15:38.692] "install" terminal command done
[17:15:38.694] Install terminal quit with output: ash: bash: not found
[17:15:38.694] Received install output: ash: bash: not found
[17:15:38.706] Resolver error: Error: bash not found
at Function.Create (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:94424)
at c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:90746
at Object.t.handleInstallOutput (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:90947)
at I (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:106975)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:104974
at async Object.t.withShowDetailsEvent (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:110096)
at async Object.t.resolve (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:108158)
at async c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:143767
[17:15:38.713] ------
-
@Waqas The default shell is actually
ash
- a lightweight version of the unix shell - in order to conserve space.root@Omega-F195:/# echo $0 /bin/ash
It looks like Visual Studio depends on having bash available. You can install it using the package manager:
opkg update opkg install bash
-
Okay, i successfully installed bash, and it went further.
However this time the error says, "Unsupported architecture".
I don't know if you can do anything about it, or if it is up to vscode developers to add support for it.-------------------------- Full log -------------------------------------
[19:45:44.048] Log Level: 2
[19:45:44.055] remote-ssh@0.56.0
[19:45:44.055] win32 x64
[19:45:44.058] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a2257617474776f726b6572227d", attempt 1
[19:45:44.058] SSH Resolver called for host: Wattworker
[19:45:44.058] Setting up SSH remote "Wattworker"
[19:45:44.116] Using commit id "e5a624b788d92b8d34d1392e4c4d9789406efe8f" and quality "stable" for server
[19:45:44.119] Install and start server if needed
[19:45:45.411] Checking ssh with "ssh -V"
[19:45:45.462] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5[19:45:45.469] Running script with connection command: ssh -T -D 59128 Wattworker bash
[19:45:45.474] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[19:45:46.388] > root@192.168.3.1's password:]0;C:\WINDOWS\System32\cmd.exe
[19:45:46.388] Got some output, clearing connection timeout
[19:45:46.389] Showing password prompt
[19:45:50.773] Got password response
[19:45:50.774] "install" wrote data to terminal: "********"
[19:45:50.788] >
[19:45:51.136] > b478c40a8081: running
[19:45:51.226] > Unsupported architecture: mips
[19:45:51.250] > b478c40a8081: startexitCode==27==
sshAuthSock====
listeningOn====
osReleaseId==openwrt==
arch==mips==
webUiAccessToken====
tmpDir==/tmp==
platform==linux==
b478c40a8081: end
[19:45:51.250] Received install output:
exitCode==27==
sshAuthSock====
listeningOn====
osReleaseId==openwrt==
arch==mips==
webUiAccessToken====
tmpDir==/tmp==
platform==linux==[19:45:51.252] Unsupported architecture
[19:45:51.258] Resolver error: Error: The remote host's architecture is not supported
at Function.ServerInstallError (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:94355)
at c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:92085
at Object.t.handleInstallOutput (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:1:93073)
at I (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:106975)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:104974
at async Object.t.withShowDetailsEvent (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:110096)
at async Object.t.resolve (c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:108158)
at async c:\Users\Mohammad Waqas.vscode\extensions\ms-vscode-remote.remote-ssh-0.56.0\out\extension.js:127:143767
[19:45:51.263] ------
-
@Waqas yeah it looks like vscode is trying compile on the Omega2 and its compiler doesn't have support for MIPS processors and/or OpenWRT
I assume this is C or C++ code?
Here are a some resources for working with C/C++:
- Cross compiling C/C++ code: https://docs.onion.io/omega2-docs/cross-compiling.html
- Pointers on making your own software packages: https://github.com/OnionIoT/source#making-your-own-software-packages
- Using the OpenWRT SDK: https://openwrt.org/docs/guide-developer/using_the_sdk
-
@Waqas if you check the details of the extension it explains why this won't work on an Omega2:
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh
Look under "Host Requirements"
-
@crispyoz yeah, you are right. It looks like there is no support for omega board, that's to bad. It would have been a awesome way to develop.
-
@Waqas IoT development is often a challenge of finding the right tools and configuration. The more you learn, the easier it gets as you get your tools and configurations in order.
-
hello, can you tell me how to solve this problem on the vscode side, without downloading bash?
-
@Kate That is not really possible unless you want to develop your own extension. If you refer to the documentation: "..... since the extension runs commands and other extensions directly on the remote machine....."
If those "extensions" are not compatible with the Omega architecture, then you'd need to develop one that is.
-
@crispyoz okay, thanks.
-
@Kate
Pls try the sshfs extension, to see if that works for you.
MS always makes it "awesome"..A:
Onion side
# onion os version (just FYI)
=== Version Info ===
Omega firmware: v0.3.2 b242
onion-os - 1.0.6-11: Set a passwd for the omega user to connect from your workstation over ssh, passwd is the easiest way.
# passwdB:
Workstation side1:
Install SSH FS extension for VSCode in the VS
https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs$ ext install Kelvin.vscode-sshfs
or DL the vsix & add to VSCode
https://open-vsx.org/api/Kelvin/vscode-sshfs/1.25.0/file/Kelvin.vscode-sshfs-1.25.0.vsix2:
SSH-FS shall create its own icon in the left panel, under "Soucre-Control","Extensions" etc. Click on it to setup the new ssh connection/credentials (IP, username, remote folder etc), pointing to omega.3:
Click on the "Folder+:" icon under the new connection entry.
This will effectively add the remote folder to the current workspace. You will be
prompted for the passwd, if that was left blank in #2.The connection also gives a shell prompt.
Any file that is created under the newly added "remote" folder shall be created physically under the remote folder. "Save" to apply code changes.
The plugins (C/++, Python etc) that you have installed in your WS works as usual,
while you code.My workstation is Linux, so there was no need to install any ssh client. If you
are on Windows, putty might work. I have not tried it.. but I guess it would work,
since I see "putty" mentioned in the configuration page of #2.Thanks..