상세 컨텐츠

본문 제목

036. Raspberry Pi 라즈베리 파이 - Open source iot platform Thingsboard

raspberrypi/raspbian

by ZelKun 2018. 11. 7. 00:21

본문

반응형




출처: https://thingsboard.io

 

오픈소스기반 Iot platform thingsboard 설치해봤습니다

공식홈페이지: https://thingsboard.io

 


출처: https://thingsboard.io

 

설치가이드를 따라 진행해봅니다

# Download the package
$ wget https://github.com/thingsboard/thingsboard/releases/download/v2.1/thingsboard-2.1.deb
# Install ThingsBoard as a service
$ sudo dpkg -i thingsboard-2.1.deb
# Update ThingsBoard memory usage and restrict it to 150MB in /etc/thingsboard/conf/thingsboard.conf
export JAVA_OPTS="$JAVA_OPTS -Dplatform=rpi -Xms256M -Xmx256M"

# Run installation script

sudo /usr/share/thingsboard/bin/install/install.sh --loadDemo

# Run Thingsboard Service

sudo service thingsboard start

# Connect the Web Ui  in 2 minutes

http://localhost:8080/

출처: https://thingsboard.io

 

option은 선택사항이니 기본옵션으로 진행합니다

 

java기반으로 자바설치가 안되있으면 설치해줍니다

이미 설치되있으니 패스

 

설치를 위해 패키지를 다운받습니다

https://github.com/thingsboard/thingsboard/releases/download/v2.1/thingsboard-2.1.deb

pi@rasp-dev:~/utils $ pwd

/home/pi/utils

pi@rasp-dev:~/utils $ wget https://github.com/thingsboard/thingsboard/releases/download/v2.1/thingsboard-2.1.deb

--2018-10-17 09:32:27--  https://github.com/thingsboard/thingsboard/releases/download/v2.1/thingsboard-2.1.deb

Resolving github.com (github.com)... 192.30.255.113, 192.30.255.112

Connecting to github.com (github.com)|192.30.255.113|:443... connected.

HTTP request sent, awaiting response... 302 Found

Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/75277003/24376c90-8b6e-11e8-9a3a-b31b8f14e359?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20181017%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20181017T003228Z&X-Amz-Expires=300&X-Amz-Signature=7e011a100380493a739bd12308e0e4f6baf721cb80c14947276ff609dc85114c&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dthingsboard-2.1.deb&response-content-type=application%2Foctet-stream [following]

--2018-10-17 09:32:28--  https://github-production-release-asset-2e65be.s3.amazonaws.com/75277003/24376c90-8b6e-11e8-9a3a-b31b8f14e359?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20181017%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20181017T003228Z&X-Amz-Expires=300&X-Amz-Signature=7e011a100380493a739bd12308e0e4f6baf721cb80c14947276ff609dc85114c&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dthingsboard-2.1.deb&response-content-type=application%2Foctet-stream

Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.169.219

Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.169.219|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 100872524 (96M) [application/octet-stream]

Saving to: ‘thingsboard-2.1.deb.1’

 

thingsboard-2.1.deb 100%[===================>]  96.20M   317KB/s    in 85s     

 

2018-10-17 09:33:54 (1.14 MB/s) - ‘thingsboard-2.1.deb’ saved [100872524/100872524]

 

pi@rasp-dev:~/utils $ 

편의상 utils 디렉토리에서 진행했습니다

 

다운받은 패키지를 설치합니다

sudo dpkg -i thingsboard-2.1.deb

pi@rasp-dev:~/utils $ pwd

/home/pi/utils

pi@rasp-dev:~/utils $ ls

logmein-hamachi_2.1.0.198-1_armhf.deb  thingsboard-windows-2.1.zip

thingsboard-2.1.deb

pi@rasp-dev:~/utils $ sudo dpkg -i thingsboard-2.1.deb 

Selecting previously unselected package thingsboard.

(Reading database ... 126011 files and directories currently installed.)

Preparing to unpack thingsboard-2.1.deb ...

Adding group `thingsboard' (GID 121) ...

Done.

Unpacking thingsboard (2.1.0-1) ...

Setting up thingsboard (2.1.0-1) ...

Processing triggers for systemd (232-25+deb9u4) ...

pi@rasp-dev:~/utils $ 

 

메모리 min/max를 256으로 해줘야 하나봅니다

export JAVA_OPTS="$JAVA_OPTS -Dplatform=rpi -Xms256M -Xmx256M"

 

* 재부팅하면 삭제될테니 bashrc 혹은 profile 에 추가해도 될듯..

pi@rasp-dev:~/utils $ env | grep JAVA

pi@rasp-dev:~/utils $ cd ..

pi@rasp-dev:~ $ vim .profile 

 

  2 # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login

  3 # exists.

  4 # see /usr/share/doc/bash/examples/startup-files for examples.

  5 # the files are located in the bash-doc package.

  6 

  7 # the default umask is set in /etc/profile; for setting the umask

  8 # for ssh logins, install and configure the libpam-umask package.

  9 #umask 022

 10 

 11 # if running bash

 12 if [ -n "$BASH_VERSION" ]; then

 13     # include .bashrc if it exists

 14     if [ -f "$HOME/.bashrc" ]; then

 15     . "$HOME/.bashrc"

 16     fi

 17 fi

 18 

 19 # set PATH so it includes user's private bin if it exists

 20 if [ -d "$HOME/bin" ] ; then

 21     PATH="$HOME/bin:$PATH"

 22 fi

 23 

 24 export JAVA_OPTS="$JAVA_OPTS -Dplatform=rpi -Xms256M -Xmx256M"

                                                              24,62         Bot

 

env | grep JAVA 로 반영확인해줍니다

pi@rasp-dev:~/utils $ export JAVA_OPTS="$JAVA_OPTS -Dplatform=rpi -Xms256M -Xmx256M"

pi@rasp-dev:~/utils $ env | grep JAVA

JAVA_OPTS= -Dplatform=rpi -Xms256M -Xmx256M

pi@rasp-dev:~/utils $ 

 

패키지를 설치하면 서비스만 띄우면 될줄알았더니

install.sh 를 실행해서 설치를 진행해야되네요

옵션으로 데모데이터를 추가하면 데모계정의 데모 데이터를 볼 수 있으니 같이 설치합니다

pi@rasp-dev:~/utils $ env | grep JAVA

JAVA_OPTS= -Dplatform=rpi -Xms256M -Xmx256M

pi@rasp-dev:~/utils $ ls

logmein-hamachi_2.1.0.198-1_armhf.deb  thingsboard-windows-2.1.zip

thingsboard-2.1.deb

pi@rasp-dev:~/utils $ sudo /usr/share/thingsboard/bin/install/install.sh --loadDemo

 ===================================================

 :: ThingsBoard ::       (v2.1.0)

 ===================================================

 

Starting ThingsBoard Installation...

Installing DataBase schema...

Installing SQL DataBase schema...

Loading system data...

Loading demo data...

Installation finished successfully!

ThingsBoard installed successfully!

pi@rasp-dev:~/utils $ 

 

이제 서비스를 시작해주고 Web에서 확인합니다

2분정도 기다리라고 하니 서비스가 뜰때까지 기다렸다가... 접속해줍니다

pi@rasp-dev:~/utils $ sudo service thingsboard start

pi@rasp-dev:~/utils $ ps -ef | grep things

thingsb+ 21650     1 99 13:14 ?        00:00:37 /usr/bin/java -Dsun.misc.URLClassPath.disableJarChecking=true -Dplatform=deb -Dinstall.data_dir=/usr/share/thingsboard/data -Xloggc:/var/log/thingsboard/gc.log -XX:+IgnoreUnrecognizedVMOptions -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M -XX:-UseBiasedLocking -XX:+UseTLAB -XX:+ResizeTLAB -XX:+PerfDisableSharedMem -XX:+UseCondCardMark -XX:CMSWaitDuration=10000 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+CMSParallelInitialMarkEnabled -XX:+CMSEdenChunksRecordAlways -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -jar /usr/share/thingsboard/bin/thingsboard.jar

pi       21683 21236  0 13:15 pts/0    00:00:00 grep --color=auto things

pi@rasp-dev:~/utils $ 

pi@rasp-dev:~/utils $ netstat -anp | grep LISTEN | grep :8080

(Not all processes could be identified, non-owned process info

 will not be shown, you would have to be root to see it all.)

tcp6       0      0 :::8080                 :::*                    LISTEN      -                   

pi@rasp-dev:~/utils $

한참 기다리니 8080포트가 올라옵니다

 

브라우져에서 접속합니다

 


 

사이트에는 localhost라고 되있지만 원격으로 설치한거니 pi ip로 접속합니다.

http://pi_ip:8080

 

  • login - sysadmin@thingsboard.org
  • password - sysadmin



관리자계정으로 로그인하니 한글화까지 되서 나오네요

 

참고:


반응형

관련글 더보기

댓글 영역