-
Notifications
You must be signed in to change notification settings - Fork 3
Raspberry PI
This readme explains the installation of Raspberry PI, Node.js and the Streembit Zigbee Gateway.
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 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-
Enable SSH: select Interfacing Options. Navigate to and select SSH, and select "Yes".
-
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 /devttyS0 should be listed in dev directory.
To take advantage of the latest Node.js framework we suggest you install Node.js with either of listed options.
Install Node.js with APT package manager
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -sudo apt-get install -y nodejsInstall Node.js from source.
sudo apt-get updatesudo apt-get install build-essential checkinstallcd /usr/local/srcDownload 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.gzsudo tar -xvzf node-v9.10.0.tar.gzcd node-v9.10.0sudo ./configuresudo make installwhen the system completes the downloading and installation procedures, make sure you have nodejs installed
node -vThe 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 npmsudo npm install -g pm2 Install git.
sudo apt-get install gitMove to a folder where you want to install Streembit app
and next
git clone https://github.com/streembit/streembit-clithis will create a new folder streembit-cli
move there
cd streembit-cliand then refer to streembit-cli README.md to complete the app installation procedure
List the available WiFi networks
sudo iwlist wlan0 scanEdit the WiFi configuration file
sudo nano /etc/wpa_supplicant/wpa_supplicant.confSet the SSID and WPA-PSK password
network={
ssid="YOUR_WIFI_NETWORK"
psk="WIFI_NETWORK_PASSWORD"
}
ifconfig wlan0If 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)