Raspberry Pi - JackieWSC/Onepiece GitHub Wiki
Raspberry Pi
- small single board computers
- latest version is Raspberry Pi 3 Model B
- CPU:1.2 GHz 64-bit quad-core ARM Cortex-A53
- Architecture:ARMv8-A (64/32-bit)
- Memory:1 GB
Installation
- Install the NOOBS (New Out Of Box Software)
- Follow the guide below to install Raspberry Pi https://www.raspberrypi.org/learning/software-guide/
- Download the NOOBS from https://www.raspberrypi.org/downloads/noobs/
- Format the SD class from https://www.raspberrypi.org/learning/software-guide/quickstart/
- Unzip the NOOBS_v2_4_4.zip and copy the files inside the NOOBS_v2_4_4 folder to SD card
- NOOBS is not an OS. It is an OS installer that allow you to install
- Raspbian
- Pidora
- Windows 10
Start the box
- Connect the HDMI, Keyboard, Mouse, LAN and Power Adapter
- Install the Raspbian as OS
- Enable the ssh
Update the Raspbian
- sudo apt-get -y update
- sudo apt-get -y upgrade
- sudo apt-get -y install tightvncserver
Check the version
pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
tightvncserver
- start the tightvncserver
-
tightvncserver
-
- Stop the tightvncserver
-
tightvncserver -kill :1
-
- Set the vnc server password
-
vncpasswd
-
- Connect form mac
- command+k
- vnc://192.168.31.168:5901
Node JS on Raspberry Pi
- nodejs is installed on raspbian
pi@raspberrypi:~ $ node -v
v6.12.0
Blynk an LED on Raspberry Pi
Node.js
- We don't support BLE of Raspberry Pi 3 >.<
- Step to install node.js on Raspberry Pi
-
sudo apt-get purge node nodejs node.js -y
-
sudo apt-get autoremove
-
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash
-
sudo apt-get update && sudo apt-get upgrade
-
sudo apt-get install build-essential nodejs -y
-
- Check the npm version
-
node --version
-
npm -v
-
sudo npm install blynk-library -g
-
sudo npm install onoff -g
-
- Run default Blynk client (replace YourAuthToken):
-
export PATH=$PATH:/opt/nodejs/bin/
-
unset NODE_PATH
-
blynk-client YourAuthToken
-
- Reference
C++
- Download the Blynk_Release_v0.4.10.zip from github
- unzip the file and found two folders libraries and tools
- create blynk0.4.10 folder under ~
- move two folders libraries and tools to blynk0.4.10
- To check that wiringPi is installed, you can use "gpio -v" to check
-
cd blynk-library/linux
-
make clean all target=raspberry
-
sudo ./blynk --token=YourAuthToken
- It able to connect with Blynk Apps
- Edit the main.cpp to play with Blynk
Install Blynk library on RPi
- It is used to control arduino uno (as there is no BLE and ETH access) via RPi
- Download the latest release .zip file.
- Unzip the file
- Check the location of your_sketchbook_folder, by checking "File>Preferences"
- /root/sketchbook/libraries
- /home/pi/sketchbook
-
sudo cp -r libraries/ /root/sketchbook/
-
sudo cp -r tools/ /root/sketchbook/
- Build Blynk
-
cd blynk-library/linux
-
make clean all target=raspberry
- Run Blynk
- sudo ./blynk --token=YourAuthToken
- Link