BPI-W2: ubuntu 16.04 Install and run Node.js and http-server

  • insltall Node.js

After running Ubuntu 16.04, it’s easy to install packages on the W2. Please follow below steps to install node.js:

1.  apt-get install nodejs
2.  apt-get install npm
3.  npm install -g http-server
4. make a link to nodejs:  cd /usr/bin/; ln -sf nodejs node

then Node.js is ready on your system.

As a demonstration, I copied a 3D model to the W2 and displayed it with http-server. It runs very smoothly. Please refer to the video link below.

BPI-W2 new image : How to make and run the 64-bit ubuntu 16.04 on SD card

1 Like

Hi, Did you have any problems making and running the 64-bit ubuntu on SD card? I followed all the instructions, but when I restart the BPI-W2 with the SD card, the HDMI monitor displays a green screen and freezes. With a serial session of Putty connected via a UART/USB cable, the Putty client displays the entire boot procedure, for which I have uploaded the Putty client session output. BootBPI-W2WithUbuntuSDCard.txt (145.7 KB)

Notice how the program, dmesg, continually outputs the following issue:

[ 100.794889] I/DC: [dc_wait_vsync_timeout 884] wait vsync timeout! vo_vsync_flag:0x00000101

Did you have this issue, or know what is causing it?

Thanks for any insights, Ed

Yes, HDMI can’t work on 64-bit ubuntu, we are working on this now.

Thanks for the update. How did you get ethernet to work? I can’t get that to work either.

I followed all the steps in section 5, and live ethernet cable is connected to WAN port, but I don’t seem to have internet connectivity

root@localhost:~# apt-get update
Err:1 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports xenial-backports InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:4 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Reading package lists... Done
W: Can't drop privileges for downloading as file '/var/lib/apt/lists/partial/ports.ubuntu.com_ubuntu-ports_dists_xenial_InRelease' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-updates/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-backports/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-security/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@localhost:~# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:10:20:30:40:51
          inet addr:192.168.2.231  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::210:20ff:fe30:4051/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:42 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:21339 (21.3 KB)  TX bytes:1256 (1.2 KB)
          Interrupt:9

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:87 errors:0 dropped:0 overruns:0 frame:0
          TX packets:87 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:8560 (8.5 KB)  TX bytes:8560 (8.5 KB)

root@localhost:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
root@localhost:~#

Network works fine, please ping 8.8.8.8 to make sure your link is ready, then check the DNS next.

In order to establish network connection, I had to use the LAN port, not the WAN port, and modify the instructions as follows:

2. Ifconfig eth0 or eth1:
ifconfig eth1 192.168.1.231
3. Add default gateway to let the board can reach internet:
route add default gw 192.168.1.1
4. Add a DNS:
echo 'nameserver 192.168.1.1'>>/etc/resolv.conf
echo 'nameserver 8.8.8.8' >> /etc/resolv.conf`

’ ping 8.8.8.8 works now, but when I execute step 5, ‘apt-get update’, it reports the following:

root@localhost:~# apt-get update
Hit:1 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports xenial-backports InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease
Reading package lists... Done
W: Can't drop privileges for downloading as file '/var/lib/apt/lists/partial/ports.ubuntu.com_ubuntu-ports_dists_xenial_InRelease' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
root@localhost:~#

The process creates directory /var/lib/apt/lists/partial with user _apt and group root. There doesn’t appear to be a way to override this.

请问,这个问题咋解决?我现在也遇到了。屏幕是绿的,串口打印不停这些