Skip to content

Instantly share code, notes, and snippets.

@flaki
Created February 11, 2016 15:19
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flaki/a1efdb438292dd8c56c3 to your computer and use it in GitHub Desktop.
Save flaki/a1efdb438292dd8c56c3 to your computer and use it in GitHub Desktop.
Helpful commands for the OpenWRT system used on the Tessel 2

OpenWRT for Dummies - Tessel 2 Edition

A kind-of-FAQ for operating the Tessel 2 from the commandline (via SSH, serial console or tessel root).

How to find out what commands are executed by the CLI?

Prefix your commands with "DEBUG=commands:usb" to learn about the commands sent to the device:

$ DEBUG=commands:usb t2 wifi -l

INFO Looking for your Tessel...
  commands:usb [ 'uci', 'get', 'system.@system[0].hostname' ] +0ms
INFO Connected to tessel2.
INFO Scanning for available networks...
  commands:usb [ 'iwinfo', 'wlan0', 'scan' ] +25ms
INFO Currently visible networks (25):
INFO 	 Wireless (57/70)
INFO 	 Wi-Free (19/70)
...

The above command only lists commands sent via an USB connection - for LAN (be that wireless or ethernet) connections, use DEBUG=commands:lan:

$ DEBUG=commands:lan t2 push index.js --full
INFO Looking for your Tessel...
  commands:lan [ 'uci', 'get', 'system.@system[0].hostname' ] +0ms
INFO Connected to tessel2.
  commands:lan [ '/etc/init.d/tessel-app', 'stop' ] +3s
  commands:lan [ 'rm', '-rf', '/tmp/remote-script/' ] +81ms
  commands:lan [ 'mkdir', '-p', '/tmp/remote-script/' ] +20ms
  commands:lan [ 'rm', '-rf', '/app/' ] +23ms
  commands:lan [ 'mkdir', '-p', '/app/' ] +402ms
  commands:lan [ 'tar', '-x', '-C', '/tmp/remote-script/' ] +86ms
INFO Building project.
INFO Writing project to Flash on tessel2 (133.12 kB)...
INFO Deployed.
  commands:lan [ 'dd', 'of=/app/start' ] +376ms
  commands:lan [ 'chmod', '+x', '/app/start' ] +39ms
INFO You may now disconnect from the Tessel. Your code will be run whenever Tessel boots up. To remove this code, use `tessel erase`.
  commands:lan [ 'mv', '/tmp/remote-script/', '/app/' ] +24ms
  commands:lan [ '/etc/init.d/tessel-app', 'start' ] +1s
INFO Running index.js...

Handy commands

You can use the commands below by opening a serial or SSH connection to your Tessel and typing them in the resulting command line.

Soft-reboot

reboot -f

Restore factory settings

firstboot

Then, power-cycle or soft-reboot. Note, this disables wireless functionality (as that's the default setting). You may have to turn this back on manually.

Show current wireless configuration

uci show wireless

Turn on the wireless radio

uci set wireless.@wifi-device[0].disabled=0; uci commit wireless; wifi

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment