From 8b4edbbfe6d9b9c62e0ad5f8b649d6c27133b557 Mon Sep 17 00:00:00 2001 From: "sh.kim" Date: Mon, 12 Jan 2026 07:15:46 +0000 Subject: [PATCH] docs : add README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 시간 순서별 실행 명령어 정리 --- README.md | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a0a3e58 --- /dev/null +++ b/README.md @@ -0,0 +1,162 @@ +# Start Guide - LoadCell Measure + +새로운 Raspberry Pi 5 환경에서 rapimeasure.py 실행을 위한 빠른 시작 가이드 + +작성일: 2026-01-12 + +--- + +## 구성 + +| 항목 | 요구사항 | +|------|----------| +| 하드웨어 | Raspberry Pi 5 | +| OS | Raspberry Pi OS (64-bit) | +| 연결 | SSH 접속 가능 (Putty 등) | +| HX711 | 로드셀 + HX711 앰프 모듈 | + +--- + +## 하드웨어 연결 + +**먼저 HX711 모듈을 Raspberry Pi에 연결하세요:** + +``` +HX711 Raspberry Pi 5 +───── ────────────── +VCC → Pin 1 (3.3V) +GND → Pin 6 (GND) +DT → Pin 29 (GPIO5) +SCK → Pin 31 (GPIO6) +``` + +--- + +## 실행 순서 + +```bash +#1단계: root 입장 + +su - + +> 비밀번호 입력 (GPIO 접근에 root 권한 필요) + +------------------------------- +#2단계: 시스템 패키지 업데이트 + +apt update + +------------------------------- +#3단계: lgpio 개발 라이브러리 설치 (처음 1회 수행) + +apt install -y liblgpio-dev + +------------------------------- +#4단계: HX711 C++ 라이브러리 설치 (처음 1회 수행) + +cd /tmp +git clone https://github.com/endail/hx711 +cd hx711 +make +make install +ldconfig + +------------------------------- +#5단계: 프로젝트 폴더 이동 + +cd /home/shkim/rnd2/rapi + +------------------------------- +#6단계: Python 가상환경 입장 + +source venv/bin/activate + +> 프롬프트에 `(venv)`가 표시되면 성공 + +------------------------------- +#7단계: Python HX711 라이브러리 설치 (처음 1회 수행) + +pip install hx711-rpi-py + +------------------------------- +#8단계: 설치 확인 + +python3 -c "from HX711 import SimpleHX711; print('OK')" + +> `OK` 출력되면 설치 완료 + +------------------------------- +#9단계: measure.py 실행 + +python3 rapimeasure.py +``` + +--- + +## 처음 SD카드 사용 시, 전체 명령어 + +```bash +# SSH 접속 후 실행 +su - + +# 시스템 패키지 +apt update +apt install -y liblgpio-dev + +# HX711 C++ 라이브러리 +cd /tmp +git clone https://github.com/endail/hx711 +cd hx711 +make && make install && ldconfig + +# 프로젝트 폴더 +mkdir -p /home/shkim/rnd2/rapi +cd /home/shkim/rnd2/rapi + +# Python 환경 +python3 -m venv venv +source venv/bin/activate +pip install hx711-rpi-py + +# 실행 +python3 measure.py +``` + +--- + +## 재접속 시 실행 방법 + +이미 설치가 완료된 환경에서 재접속 후: + +```bash +su - +cd /home/shkim/rnd2/rapi +source venv/bin/activate +python3 rapimeasure.py +``` + +--- + +## 키보드 명령어 + +| 키 | 기능 | +|----|------| +| `c` | 영점 조절 (tare) | +| `p` | 일시정지 | +| `r` | 재시작 | +| `h` | 도움말 | +| `q` | 종료 | + +--- + + + +## 설치 확인 체크리스트 + +| 단계 | 확인 명령어 | 예상 결과 | +|------|------------|----------| +| lgpio | `ls /usr/include/lgpio.h` | 파일 존재 | +| HX711 C++ | `ls /usr/local/lib/libhx711*` | .so 파일 존재 | +| Python lib | `pip list \| grep hx711` | hx711-rpi-py 표시 | +| 전체 확인 | `python3 -c "from HX711 import SimpleHX711; print('OK')"` | OK | +