본문 바로가기
AndroidOverLinux

AoL IOT build 사용 방법 (for ATV8)

by ㅋㅋ잠자 2020. 11. 15.
반응형

안녕하세요? 


ATV8 버전에 맞는 AoL IOT 빌드 사용법을 기재합니다.


이 빌드는 다른 기능 일체 들어가지 않았고, IOT를 위한 기능만 들어가 있습니다. 


한편, docker 이미지 기준으로 프로그램들을 올리다 보니, 용량이 조금 큰 부분이 있습니다. 이 프로젝트가 조금 진척이 된다면 필수적으로 필요한 파일만 내장을 하는 방법으로 용량을 줄이겠습니다.


1. 이미지


이미지 링크는 하기와 같습니다.


http://aol.djjproject.com/aol-iot/linux.tar-20201115-085541 (raw rootfs 이미지)

http://aol.djjproject.com/aol-iot/%5b8.x%5dlinux_image_iot_201116.zip (update.zip 파일)


업데이트에 많은 시간이 소요됩니다.


직비를 사용하려면, U5TEAM 에서 CDC_ACM 모듈을 커널에 바인딩한 버전을 배포해 주셔야 직비 모듈 인식이 됩니다.

(순정 상태에서는 모듈 인식 안됨)


2. 설치 후 첫 로그인


root@debian10:~# ssh root@192.168.0.9

The authenticity of host '192.168.0.9 (192.168.0.9)' can't be established.

ECDSA key fingerprint is SHA256:NWVaEYwNyn7dIuKQG4sMdpAhAqW8oMGN8EH++F/W+aw.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.0.9' (ECDSA) to the list of known hosts.

root@192.168.0.9's password:

Linux AOL-Debian 4.9.44_hi3798cv2x #7 SMP PREEMPT Thu Nov 12 15:40:36 KST 2020 armv7l

Welcome to AOL Debian GNU/Linux 10 buster (eddylab)

                     _           _     _

     /\             | |         (_)   | |

    /  \   _ __   __| |_ __ ___  _  __| |

   / /\ \ | '_ \ / _` | '__/ _ \| |/ _` |

  / ____ \| | | | (_| | | | (_) | | (_| |

 /_____ \_|_| |_|\__,_|_| _\___/|_|\__,_|

  / __ \                 | |    (_)

 | |  | __   _____ _ __  | |     _ _ __  _   ___  __

 | |  | \ \ / / _ | '__| | |    | | '_ \| | | \ \/ /

 | |__| |\ V |  __| |    | |____| | | | | |_| |>  <

  \____/  \_/ \___|_|    |______|_|_| |_|\__,_/_/\_\



Welcome To AndroidOverLinux !!!

You must setup AoL Only once at the beginning


##### configure timezone...

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

        LANGUAGE = (unset),

        LC_ALL = (unset),

        LANG = "en_US.UTF-8"

    are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").

locale: Cannot set LC_CTYPE to default locale: No such file or directory

locale: Cannot set LC_MESSAGES to default locale: No such file or directory

locale: Cannot set LC_ALL to default locale: No such file or directory

/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory

/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory

/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory




Current default time zone: 'Asia/Seoul'

Local time is now:      Sun Nov 15 23:20:39 KST 2020.

Universal Time is now:  Sun Nov 15 14:20:39 UTC 2020.



##### configure locales...

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

        LANGUAGE = (unset),

        LC_ALL = (unset),

        LANG = "en_US.UTF-8"

    are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").

locale: Cannot set LC_CTYPE to default locale: No such file or directory

locale: Cannot set LC_MESSAGES to default locale: No such file or directory

locale: Cannot set LC_ALL to default locale: No such file or directory

/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory

/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory

/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory




Generating locales (this might take a while)...

  en_US.UTF-8... done

Generation complete.


##### configure root password...

New password:

Retype new password:

passwd: password updated successfully


##### fix some errors...

Hit:1 http://deb.debian.org/debian buster InRelease

Hit:2 http://deb.debian.org/debian buster-backports InRelease

Hit:3 http://deb.debian.org/debian buster-updates InRelease

Reading package lists... Done

Building dependency tree

Reading state information... Done

1 package can be upgraded. Run 'apt list --upgradable' to see it.

Reading package lists... Done

Building dependency tree

Reading state information... Done

Package 'ca-certificates' is not installed, so not removed

0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Reading package lists... Done

Building dependency tree

Reading state information... Done

sysv-rc is already the newest version (2.93-8).

The following NEW packages will be installed:

  ca-certificates openssl

0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.

Need to get 975 kB of archives.

After this operation, 1,630 kB of additional disk space will be used.

Get:1 http://deb.debian.org/debian buster/main armhf openssl armhf 1.1.1d-0+deb10u3 [818 kB]

Get:2 http://deb.debian.org/debian buster-updates/main armhf ca-certificates all 20200601~deb10u1 [158

kB]

Fetched 975 kB in 0s (2,470 kB/s)
Preconfiguring packages ...
Selecting previously unselected package openssl.
(Reading database ... 10490 files and directories currently installed.)
Preparing to unpack .../openssl_1.1.1d-0+deb10u3_armhf.deb ...
Unpacking openssl (1.1.1d-0+deb10u3) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../ca-certificates_20200601~deb10u1_all.deb ...
Unpacking ca-certificates (20200601~deb10u1) ...
Setting up openssl (1.1.1d-0+deb10u3) ...
Setting up ca-certificates (20200601~deb10u1) ...
Updating certificates in /etc/ssl/certs...
126 added, 0 removed; done.
Processing triggers for ca-certificates (20200601~deb10u1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.

##### configuration finished...



3. HomeAssistant


홈어시스턴트의 경우 /sdcard/hass 경로에 설정파일들이 모두 들어 있습니다.


root@AOL-Debian:/data/media/0/hass# ls

automations.yaml    deps         home-assistant.log    scenes.yaml   secrets.yaml

configuration.yaml  groups.yaml  home-assistant_v2.db  scripts.yaml  tts


시작과 중지 재시작은 하기 명령으로 합니다.


root@AOL-Debian:/data/media/0/hass# service hass stop

Stopping hass: hass.

root@AOL-Debian:/data/media/0/hass# service hass start

Starting hass: hass.

root@AOL-Debian:/data/media/0/hass# service hass restart

Restarting hass: hass.


웹 URL 로 http://ipaddr:8123 으로 이동하면 웹 UI가 열립니다.



4. Zigbee2Mqtt


Z2M 의 경우 설정파일이 /sdcard/z2m 에 존재합니다.


root@AOL-Debian:/data/media/0/z2m# ls

configuration.yaml  database.db  log  state.json


마찬가지로 시작 중지 재시작은 하기 명령어로 진행합니다.


root@AOL-Debian:/data/media/0/z2m# service z2m start

Starting z2m: z2m.

root@AOL-Debian:/data/media/0/z2m# service z2m stop

Stopping z2m: z2m.

root@AOL-Debian:/data/media/0/z2m# service z2m restart

Restarting z2m: z2m.


일단 직비를 쓰기 위해서 설정을 조금 해야할 게 있습니다. 진해게 된 부분을 추가하시고 재시작 하시면 됩니다.


root@AOL-Debian:/data/media/0/z2m# vi configuration.yaml


homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost'
serial:
  port: /dev/ttyACM0
devices:
advanced:
  availability_blocklist: []
  availability_passlist: []


root@AOL-Debian:/data/media/0/z2m# service z2m restart

Restarting z2m: z2m.


5. Zigbee2Mqtt Assistant


Z2M 을 웹으로 관리하기 위한 UI 입니다.


설정파일은 따로 존재하지 않으며, 웹 포트나 MQTT 아이디 비번이 필요할 경우 하기 init 파일을 수정하셔야합니다.


기본적으로 localhost 라서 아이디 비번 설정을 하지 않았습니다.


root@AOL-Debian:/etc/init.d# vi z2m-assistant



#!/bin/sh

### BEGIN INIT INFO
# Provides:          z2m-assistant
# Required-Start:    $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description:
# Description:
### END INIT INFO


DESC="z2m-assistant"
NAME=z2m-assistant
PIDFILE=/var/run/$NAME.pid
COMMAND="/usr/sbin/chroot"
DAEMON_ARGS=$(echo "/opt/z2m-assistant /bin/bash -c \"cd /app && Z2MA_SETTINGS__MQTTSERVER=127.0.0.1 ASPNETCORE_URLS=http://+:8124 DOTNET_RUNNING_IN_CONTAINER=true dotnet /app/Zigbee2MqttAssistant.dll\"")


마찬가지로 하기 방법으로 재시작 및 중지 가능합니다.


root@AOL-Debian:/etc/init.d# service z2m-assistant start

Starting z2m-assistant: z2m-assistant.

root@AOL-Debian:/etc/init.d# service z2m-assistant stop

Stopping z2m-assistant: z2m-assistantstart-stop-daemon: warning: failed to kill 4750: No such process

.

root@AOL-Debian:/etc/init.d# service z2m-assistant restart

Restarting z2m-assistant: z2m-assistant.


http://ipaddr:8124 로 들어가시면 설정이 가능합니다.


직비 장치를 페어링 할 때에는 Allow Join 을 켜주셔야 정상적으로 페어링이 됩니다. 


다른 장치가 페어링될 수 있음으로 페어링이 끝난 후에는 DISALLOW 해주셔야 합니다.




감사합니다.


반응형

댓글