Skip to content

Raspberry PI

T Z Pardi edited this page Apr 11, 2018 · 12 revisions

Install Streembit on Raspberry PI

This readme explains the installation of Raspberry PI, Node.js and the Streembit Zigbee Gateway.

Install the Raspberry PI

Burn the latest Raspbian OS to a micro SD card.

https://www.raspberrypi.org/documentation/installation/installing-images/

Add an ssh file to the Raspbian boot image at the SD card. Step 3 in this tutorial: https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0

Login via SSH and configure the device

Login to the Raspberry PI via SSH using your Linux/MAC SSH client or PUTTY on Windows. If you don't have access to the router to lookup the IP address, use the Advanced IP Scanner application to find your Raspberry PI device http://www.advanced-ip-scanner.com.

The default user name: pi, password: raspberry. Once you logged in via SSH:

sudo raspi-config
  1. Enable SSH: select Interfacing Options. Navigate to and select SSH, and select "Yes".

  2. Enable serial port: select "Interfacing Options". Navigate to "Advanced" and select "Options/Serial". You will be prompted with the “Would you like a login shell to be accessible over serial?” question. Select "No". Then you will be prompted "Would you like the serial port hardware to be enabled?". Select "Yes". Select "Finish" and reboot the device.
    Refer to the "For latest Jessie version" section at https://hallard.me/enable-serial-port-on-raspberry-pi/

Check the available serial ports and serial port aliases.

ls -l /dev

ttyS0 should be listed in dev directory.

Install the latest Nodejs from source

To take advantage of the latest Node.js framework we suggest you install Node.js with either of listed options.


Option 1

Install Node.js with APT package manager

curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs

Option 2

Install Node.js from source.

sudo apt-get update
sudo apt-get install build-essential checkinstall
cd /usr/local/src

Download the latest Node.js source. Substitute 9.10.0 with the latest Node.js version number.

sudo wget https://nodejs.org/dist/v9.10.0/node-v9.10.0.tar.gz
sudo tar -xvzf node-v9.10.0.tar.gz
cd node-v9.10.0
sudo ./configure
sudo make install

when the system completes the downloading and installation procedures, make sure you have nodejs installed

node -v

The version should be at minimum 9.10.0

One another optional step here is to update npm to the latest version. You can do it with

sudo npm install -g npm

Install PM2 process manager

sudo npm install -g pm2 

Install Streembit

Install git.

sudo apt-get install git

Move to a folder where you want to install Streembit app

and next

git clone https://github.com/streembit/streembit-cli

this will create a new folder streembit-cli

move there

cd streembit-cli

and then refer to streembit-cli README.md to complete the app installation procedure

Connect to a WiFi network

List the available WiFi networks

sudo iwlist wlan0 scan

Edit the WiFi configuration file

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Set the SSID and WPA-PSK password

network={
    ssid="YOUR_WIFI_NETWORK"
    psk="WIFI_NETWORK_PASSWORD"
}
ifconfig wlan0

If you are connected the "inet addr" should be a 192.168.xxx.xxx IP address

wlan0   Link encap:Ethernet HWaddr 74:da:38:2b:1c:3d
        inet addr:192.168.1.216 Bcast:192.168.1.255 Mask:255.255.255.0
        inet6 addr: fe80::8727:5526:a190:b339/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        RX packets:6917 errors:0 dropped:229 overruns:0 frame:0
        TX packets:2931 errors:0 dropped:1 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:10001000 (9.5 MiB) TX bytes:295067 (288.1 KiB)

Clone this wiki locally