스마트팜
http://www.cdxxdz.com/
http://www.appsforfarming.com
https://www.isip.de
https://www.worldhorticenter.nl/
IT 기술
스마트팜
http://www.cdxxdz.com/
http://www.appsforfarming.com
https://www.isip.de
https://www.worldhorticenter.nl/
https://www.media.mit.edu/posts/build-a-food-computer/
190308
v4.0 파일을 디바이스마트 SMT 실장 서비스에 넘겼더니, 거버 파일이 안 열린다고 함.
v3.0 거버 파일을 넘기고 대기 중.
단위가 인치기반. mm 단위로 변경 필요.
Data | |||||
Part Name | Translated Name | Quantity | Parent Assembly | Material | Material Thickness |
BBFB | Bottom Box, Front/Back | 2 | Bottom Box | Komatex | 1/4″ |
BBI | Bottom Box, Inside | 1 | Bottom Box | Komatex | 1/4″ |
BBO | Bottom Box, Outside | 1 | Bottom Box | Komatex | 1/4″ |
BBLR | Bottom Box, Left/Right | 2 | Bottom Box | Komatex | 1/4″ |
TR | Tray | 1 | Bottom Box | Komatex | 1/8″ |
TBI | Top Box, Inside | 1 | Top Box | Komatex | 1/4″ |
TBFB | Top Box, Front/Back | 1 | Top Box | Komatex | 1/4″ |
TBFBH | Top Box, Front/Back w/Hole | 1 | Top Box | Komatex | 1/4″ |
TBLR | Top Box, Left/Right | 1 | Top Box | Komatex | 1/4″ |
TBLRH | Top Box, Left/Right w/Hole | 1 | Top Box | Komatex | 1/4″ |
TBS | Top Box Support | 2 | Top Box | Komatex | 1/4″ |
TBO | Top Box, Outside | 1 | Top Box | polycarbonate | 1/8″ |
WDS | Window Short | 3 | Side Panel | polycarbonate | 1/8″ |
WT | Window Tall | 1 | Side Panel | polycarbonate | 1/8″ |
SP | Side Panel | 4 | Side Panel | Komatex | 1/8″ |
NEO | Neoprene | 4 | Side Panel | neoprene | 3/8″ |
CDGR | Column Diagonal, Right | 4 | Column | Komatex | 1/4″ |
CDGL | Column Diagonal, Left | 4 | Column | Komatex | 1/4″ |
CF | Column Face | 4 | Column | Komatex | 1/4″ |
CFC | Column Face | 4 | Column | Komatex | 1/4″ |
CSR | Column Side, Right | 4 | Column | Komatex | 1/4″ |
CSL | Column Side, Left | 4 | Column | Komatex | 1/4 |
두께 단위 변경 두께 변경하면 장부맞춤 안됨. 두께 수정 없이 진행
1/4인치 > 5mm
1/8인치 > 3mm
3/8인치 > 8mm
재질 변경
Komatex > 포맥스 (어차피 둘다 발포 PVC, 제품명이 다를 뿐)
polycarbonate > 폴리카보네이트 혹은 아크릴
neoprene > 포맥스
SP와 NEO를 합쳐서 1/2인치로 가공
https://github.com/OpenAgInitiative/openag-device-software
첨부파일
라즈베리파이에 위의 깃허브 소프트웨어 설치
Raspi-config 에서 다음 설정
pip3 install pyModbusTCP
from pyModbusTCP.client import ModbusClient
import sys
c = ModbusClient(host="localhost",port=502) #set host and port
if not c.is_open():
c.open()
if not c.is_open():
print("연결실패. 프로그램 종료")
sys.exit()
addr = 0 # 주소 할당 ( 0 to 65533 )
c.write_single_coil(addr,True) #코일 입력
c.write_single_register(addr,12345) #레지스트리 입력
c.write_multiple_coils(addr,[True,True,True]) # addr주소부터 주소값을 하나씩 늘려 리스트에 입력된값을 차례대로 할당
c.write_multiple_registers(addr,[11,222,333]) # addr주소부터 주소값을 하나씩 늘려 리스트에 입력된값을 차례대로 할당
n_read = 3 #읽어들일 값의 갯수
c.read_coils(addr,n_read)
c.read_holding_registers(addr,n_read)
c.close() #종료
from pyModbusTCP.server import ModbusServer
server = ModbusServer(host="192.168.aa.bb", port=502) #서버정보와 포트정보 입력. 서버는 localhost라고 쓰면 안되고, 아이피주소를 명시해야하는 듯
server.start()
sudo apt-get install apache2
sudo apt-get install libapache2-mod-wsgi
sudo apt-get install libapache2-mod-wsgi-py3
/etc/apache2/sites-available/flask_wsgi.conf
<VirtualHost *>
ServerName {앱이름}
WSGIDaemonProcess {앱이름} user={사용자이름} threads=5
WSGIScriptAlias / {앱경로}/app.wsgi
<Directory {앱경로}>
WSGIProcessGroup {앱이름}
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *>
ServerName example.jhin.kr
WSGIDaemonProcess hello_world user=philomoral threads=5 #실행할 앱 이름 helloworld, user는 philomoral
WSGIScriptAlias / /home/philomoral/web_test/flask_test/app.wsgi
<Directory /home/philomoral/web_test/flask_test>
WSGIProcessGroup hello_world #앱 이름 helloworld
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Require all granted
</Directory>
</VirtualHost>
사이트 비활성화/활성화
sudo a2dissite 000-default
sudo a2ensite flask_wsgi
SSL 페이지 정리 참고하여 작성한 후 사이트 설정을 다음과 같이 바꾼다.
일반 사이트 설정과 비슷하나 주요 차이점으로는 다음과 같다.
<IfModule mod_ssl.c>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
ServerName tero.example.com:443
WSGIDaemonProcess hello_world_ssl user=philomoral threads=5
WSGIScriptAlias / /home/philomoral/web_test/flask_test/app.wsgi
<Directory /home/philomoral/web_test/flask_test>
WSGIProcessGroup hello_world_ssl
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Require all granted
</Directory>
</VirtualHost>
</IfModule>
앱생성경로: /home/philomoral/web_test/flask_test
Virtualenv 경로: /home/philomoral/web_test/venv
/home/philomoral/web_test/app.wsgi
#가상환경 활성화
activate_this = '/home/philomoral/web_test/venv/bin/activate_this.py'
with open(activate_this) as file_:
exec(file_.read(), dict(file=activate_this))
#가상환경 활성화 완료
import sys
sys.path.insert(0,"/home/philomoral/web_test/flask_test") #앱 경로
from hello_world import app as application #hello_world.py 앱 실행
가상환경에서는 psycopg2 라이브러리가 잘 작동되지 않는 문제가 있음. 로컬환경에서는 적용 가능
hello_world.py
from flask import Flask app = Flask(__name__) @app.route('/')def home(): return 'Hello World!' if __name__ == '__main__': app.run(host="0.0.0.0",port=5050)
/etc/apache2/envvars 파일의 해당부분을 다음과 같이 변경한다.
#export LANG=C
export LANG=ko_KR.utf8