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

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

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

Link