Skip to content

Frequently Asked Questions

Hyojin Kim edited this page Oct 29, 2020 · 27 revisions

Question 1

Our app does not load packaged HTML/JS but instead goes directly to a URL in the config XML. Does this work with Wits? How would the refresh cycle work in this case?

Answer

  • It will be work with Wits but does not refreshed when your URL is modify. Wits watch baseAppPath in connectionIfon.json file and if In this path has change, send to TV. Wits can't watch your URL. but if you change something in baseAppPath after you changed code in URL. (ex. save config.xml file(ctrl+s)) Even if config.xml doesn't change but Wits send this modify to TV and will refresh.

Question 2

When starting Wits, does it also open a Web Inspector as well or does it just load and refresh the app on the TV?

Answer

Starting Wits, you can choose an option to launch with chrome DevTools(inspector). Then you can use it during your develop. If you set isDebugMode to true in .witsconfig.json, It means wits will open a chrome devtool automatically.

  • A Google Chrome window should have opened after your app installs on the TV.
  • Click the address link on the page.
  • This opens a DevTools window.
  • In console tab, change the value of Execution Context Selector top to ContentHTML.

change-to-iframe


Question 3

Sometimes, Failed to run Wits with follow error message.

events.js:183
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE :::8888
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at ChildProcess.exithandler (child_process.js:268:7)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 

Answer

  • When nodeJS server is already running in your PC this error message is occur. Sometimes Wits run on git bash, thie error is occur because git bash didn't destroy nodeJS server. please check your run TaskManager in PC. If you find nodeJS process, close it.

Question 4

In case you get a 'Disconnected' error

If you installed docker or something make another ethernet, it effect to server url. We use the ip npm package and it return just one ip address even ethernet have two more. And the ip package doesn't recognize virtual ethernet or not. Sometimes the tv client try to connect wrong ip address. It make the disconnected.

Answer

  1. Open 'main.js' which is located '{your_project}/tizen/js/'.
  2. Check the IP address in line 31. 3-1. If the address is correct, please write a issue. 3-2. If the address is not matched your installed machine's ip address, remove ethernet in your pc temporarily.
  3. Run again the wits.

Question 5

In case of the following error,

$ npm start

...

'sdb' is not recognized as an internal or external command,
operable program or batch file.
exec: 'sdb' is not recognized as an internal or external command,
operable program or batch file.

Answer

The reason why you've got this error, It means you didn't set the sdb path to environment variable. Since Wits use the sdb commands internally, you need to set the sdb path to your environment variable.

  1. System Properties > Advanced > Open the system environment variables
  2. System variables > 'Open "Path" of the variable field' > Add the path which has sdb.exe "ex) C:\tizen-studio\tools"
  3. restart command line program
  4. TA-DA, It works

For using Wits, Tizen Studio CLI binaries should be added to your $PATH for accessing to tizen and sdb command-line utilities.

  • For bash:

        $ echo 'export PATH="$HOME/tizen-studio/tools/ide/bin:$PATH"' >> ~/.bash_profile
        $ echo 'export PATH="$HOME/tizen-studio/tools:$PATH"' >> ~/.bash_profile
  • For Ubuntu Desktop:

        $ echo 'export PATH="$HOME/tizen-studio/tools/ide/bin:$PATH"' >> ~/.bashrc
        $ echo 'export PATH="$HOME/tizen-studio/tools:$PATH"' >> ~/.bashrc
  • For Zsh:

        $ echo 'export PATH="$HOME/tizen-studio/tools/ide/bin:$PATH"' >> ~/.zshrc
        $ echo 'export PATH="$HOME/tizen-studio/tools:$PATH"' >> ~/.zshrc
  • For Fish shell:

        $ set -Ux fish_user_paths $HOME/tizen-studio/tools/ide/bin $fish_user_paths
        $ set -Ux fish_user_paths $HOME/tizen-studio/tools $fish_user_paths

Question 6

In case you are behind a proxy, so if you can't proceed a wits -i option. You can add your proxy Server at the .witsconfig.json

Answer

  1. Open .witsconfig.json file on your tizen web application. (The file is created when you run wits -i)
  2. Add optionalInfo with your proxy Server
"optionalInfo": {
    "proxyServer": "http://168.219.61.252:8080"
}
  1. Retype wits -i
  2. TA-DA, It works well

Question 7

You need to know your TV IP Address for connection TV with Wits. But If you don't know your TV IP Address? There is a way to get to know.

Answer

  1. Turn on your TV
  2. Go Settings > General > Network > Network Status > IP settings on your TV with your remote controller
  3. TA-DA, now you can see your IP Address

Question 8

In case you've got an error like below,

$ wits
bash: wits: command not found

OR

$ wits
bash: /c/Users/{Users}/AppData/Roaming/npm/wits: No such file or directory

Answer

You need to install wits globally.

$ npm install -g @tizentv/wits

Question 9

Is it available to use WITs on multiple projects?

Answer

Yes, Of course. You can just run WITs on your every single project. For example,

$ pwd
/e/dev/workspace/WitsTest
$ wits -i
$ wits -s

// After using live reload feature on WitsTest

$ pwd
/e/dev/Local/WitsTest2
$ wits -s

// After using live reload feature on WitsTest2

$ pwd
/e/dev/workspace/WitsTest
$ wits -w

// Once you run wits -i, wits -s on your project,
// After then you can use live reload feature as running just "wits -w" respectively.

Question 10

If I get a permission denied when I run WITs on Mac, How to resolve it?

connect to....192.168.0.0
/bin/sh: /Users/toast/Documents/github/Wits/tools/sdb/mac/sdb: Permission denied
(node:21313) UnhandledPromiseRejectionWarning: Error: Command failed: /Users/toast/Documents/github/Wits/tools/sdb/mac/sdb connect 192.168.0.0:26101
/bin/sh: /Users/toast/Documents/github/Wits/tools/sdb/mac/sdb: Permission denied

Answer

You can give a grant with chmod to sdb.


Question 11

If I get a permission denied, when you try installing npm globally on Mac, How to resolve it?

Error: EACCES: permission denied

Answer

You can install with these options

sudo npm install -g @tizentv/wits --unsafe-perm=true --allow-root