Skip to content

Networking

batchku edited this page Dec 24, 2016 · 22 revisions

Connect to CHIP over USB

Use this to connect to your chip for the first time, before networking is setup:

  1. connect chip to computer with USB
  2. open terminal on computer, and run ls /dev/tty*
  3. look for the item that has a name that's different than the others (!), usually tty.usbmodem...
  4. in computer's terminal, type 'screen /dev/tty.usbmodem...', where the 'tty.usbmodem...' is whatever you saw in step 3.

WIFI setup from terminal

Use this to setup wireless networking on your chip with the built-in wifi:
NOTE: don't mess with /etc/network/interfaces like it says here.

Instead use the NetworkManager from command-line:

list all connections:
sudo nmcli co

list all available networks:
nmcli device wifi list

connect to a wifi network; will reconnect to it on reboot:
nmcli device wifi connect '(your wifi network name/SSID)' password '(your wifi password)' ifname wlan0

in our case with network called "Chipchestra" with password "jengajenga", it would be:
nmcli device wifi connect 'Chipchestra' password 'jengajenga' ifname wlan0

Samba setup

Use this to install Samba server on the chip, so that you can connect to it from a computer for file transfers and such.

First: sudo apt-get install samba samba-common-bin

Then:

Create a folder to share; here, a subfolder of the 'root' folder:

sudo mkdir -m 1777 /samba-share

Add a shared folder

  • Edit /etc/samba/smb.conf
  • Find "Share Definitions" near bottom
  • Add:
[samba-share]
  comment = Samba share
  path = /samba-share
  browseable = yes
  read only = no
  • run testparm to see the samba shares
  • restart samba with service smbd restart
  • create a samba user smbpasswd -a root

Finally:

  • on OS X, switch to finder, press Command-K (Connect to Server), and enter: smb://192.168.1.100 (change IP address to the IP address of your chip)
  • login using the samba username and password you created above

TightVNC Setup

Use this to interact with your CHIP's x-windows/GUI, without a dedicated mouse/keyboard attached to the chip

First: Install TightVNC

sudo apt-get update sudo apt-get install tightvncserver

Second: Start Server and Configure Password

/usr/bin/tightvncserver Then enter a password (consider "chipchip")

Third: Configure auto-startup of tightVNC

  • create a new file:
    sudo vi /etc/systemd/system/tightvncserver.service
  • add this to the file:
[Unit]
Description=TightVNC remote desktop server
After=sshd.service
 
[Service]
Type=dbus
ExecStart=/usr/bin/tightvncserver :1
User=chip
Type=forking
 
[Install]
WantedBy=multi-user.target
  • Make file owned by 'root' user, and executable:
sudo chown root:root /etc/systemd/system/tightvncserver.service
sudo chmod 755 /etc/systemd/system/tightvncserver.service
  • Start vnc server and test:
    vncserver

  • Make vncserver startup automattically on boot sudo systemctl enable tightvncserver.service

Other things you may want to do

  • connect from OS X by switching to the finder, press Command-K (Connect to Server), enter: vnc://192.168.1.100:5901 and enter your selected password

  • see what vnc desktops are active: sudo ps -x | grep vnc

  • kill a vnc desktop if you want to