๐Ÿ“ 14

AWS ๊ธฐ๋ฐ˜ ์ฃผ์ฐจ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ (3) ์ฝ”๋“œ

https://sssbin.tistory.com/188 ์„ค์ • ์— ์žˆ๋‹ค. S3 ๋ฒ„ํ‚ท์— ์‚ฌ์ง„์„ ์—…๋กœ๋“œํ•˜๊ณ  carRecog/request ํ† ํ”ฝ์— message๋ฅผ publish 2. index.js (๋žŒ๋‹ค์ฝ”๋“œ) var AWS = require('aws-sdk'); var iotdata = new AWS.IotData({ endpoint: '์—”๋“œํฌ์ธํŠธ', }); var client = new AWS.Rekognition(); var bucket = '๋ฒ„ํ‚ท ์ด๋ฆ„'; exports.handler = async function (event) { var photo_target = event.image + '.jpg'; const params = { Image: { S3Object: { Bucket: bucket, Nam..

๐Ÿ“/cloudIOT 2022.06.16

AWS ๊ธฐ๋ฐ˜ ์ฃผ์ฐจ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ (2) Lambda ์„ค์ •

https://sssbin.tistory.com/187 AWS ๊ธฐ๋ฐ˜ ์ฃผ์ฐจ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ (1) AWS IoT Core mqtt๋ฅผ ์ด์šฉํ•˜์—ฌ ๊ฐ„๋‹จํ•œ AWS ๊ธฐ๋ฐ˜ ์ฃผ์ฐจ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ์„ ๋งŒ๋“ค์–ด๋ณด๊ณ ์ž ํ•œ๋‹ค. camera.js -> ๋ฒˆํ˜ธํŒ ์ด๋ฏธ์ง€๋ฅผ S3์— ์—…๋กœ๋“œํ•˜๊ณ  request ํ† ํ”ฝ์— publish ํ•˜๊ณ  ์ด๋•Œ ๋žŒ๋‹คํ•จ์ˆ˜๊ฐ€ ํ˜ธ์ถœ๋˜์–ด rekognition ์ง„ํ–‰ ํ›„ detect ํ†  sssbin.tistory.com 1. IAM ๊ณ„์ •์—์„œ ์—ญํ•  ๋งŒ๋“ค๊ธฐ 2. ๋žŒ๋‹ค ํ•จ์ˆ˜ ๋งŒ๋“ค๊ธฐ 3. AWS IoT > ๋ฉ”์‹œ์ง€ ๋ผ์šฐํŒ… > ๊ทœ์น™ > ๊ทœ์น™ ์ƒ์„ฑ 4. ๋žŒ๋‹คํ•จ์ˆ˜์— ํŠธ๋ฆฌ๊ฑฐ ์ถ”๊ฐ€ camera.js -> carRecog/request ํ† ํ”ฝ์— publish ํ•˜๋ฉด ๋žŒ๋‹ค์—์„œ ์ด ๋ฉ”์‹œ์ง€๋ฅผ ์ฝ๊ธฐ ์œ„ํ•ด ๊ทœ์น™ ์ฟผ๋ฆฌ๋ฅผ SELECT * FROM 'carRecog..

๐Ÿ“/cloudIOT 2022.06.16

AWS ๊ธฐ๋ฐ˜ ์ฃผ์ฐจ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ (1) AWS IoT Core

mqtt๋ฅผ ์ด์šฉํ•˜์—ฌ ๊ฐ„๋‹จํ•œ AWS ๊ธฐ๋ฐ˜ ์ฃผ์ฐจ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ์„ ๋งŒ๋“ค์–ด๋ณด๊ณ ์ž ํ•œ๋‹ค. camera.js -> ๋ฒˆํ˜ธํŒ ์ด๋ฏธ์ง€๋ฅผ S3์— ์—…๋กœ๋“œํ•˜๊ณ  request ํ† ํ”ฝ์— publish ํ•˜๊ณ  ์ด๋•Œ ๋žŒ๋‹คํ•จ์ˆ˜๊ฐ€ ํ˜ธ์ถœ๋˜์–ด rekognition ์ง„ํ–‰ ํ›„ detect ํ† ํ”ฝ์— publish ํ•˜๋ฉด manage.js -> detect ํ† ํ”ฝ์— subscribe ํ•˜๊ณ  ๋ฐ›์€ ๋ฉ”์‹œ์ง€๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. ์‹œ์Šคํ…œ์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด AWS IoT Core์„ ์ด์šฉํ–ˆ๋‹ค. 1. AWS IoT > ๊ด€๋ฆฌ > ์‚ฌ๋ฌผ > ์‚ฌ๋ฌผ ์ƒ์„ฑ ์ •์ฑ… ์„ค์ •์€ ์ผ๋‹จ ๊ฑด๋„ˆ๋›ฐ๊ณ  ์‚ฌ๋ฌผ ์ƒ์„ฑํ•˜๋ฉด ์ธ์ฆ์„œ ํ‚ค ๋‹ค์šด๋กœ๋“œ ์ฐฝ ๋‚˜์˜ค๋Š”๋ฐ ๋ชจ๋‘ ๋‹ค์šด ๋ฐ›๊ธฐ ์ด๋•Œ ๋ฌด์กฐ๊ฑด ๋‹ค์šด๋ฐ›์•„์•ผ ํ•จ!!!!!!!! โญ๏ธโญ๏ธโญ๏ธ ๋งŒ๋“  ์‚ฌ๋ฌผ ARN ๋ณต์‚ฌ 2. AWS IoT > ๋ณด์•ˆ > ์ •์ฑ… > ์ •์ฑ… ์ƒ์„ฑ ์ •์ฑ… ํšจ๊ณผ์— iot:C..

๐Ÿ“/cloudIOT 2022.06.16

AWS EC2 - MQTT ์ด์šฉํ•˜๊ธฐ

โ˜… MQTT Message Broker ๋งŒ๋“ค๊ธฐ 1. EC2 ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ (์šฐ๋ถ„ํˆฌ๋กœ ํ•จ) ํ›„ ์ ‘์† - ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™ ์ถ”๊ฐ€: ์‚ฌ์šฉ์ž์ง€์ • TCP, TCP, 1883, 0.0.0.0/0 2. mosquitto ์„ค์น˜ $ sudo apt install mosquitto $ sudo apt install mosquitto-clients 3. mosquitto ์‹คํ–‰ $ sudo systemctl start mosquitto $ sudo systemctl enable mosquitto 4. pub & sub $ mosquitto_sub -d -t ํ† ํ”ฝ์ด๋ฆ„ $ mosquitto_pub -d -t ํ† ํ”ฝ์ด๋ฆ„ -m "๋ฉ”์‹œ์ง€" -> ์ฐฝ ๋‘๊ฐœ ๋„์›Œ์„œ ํ•œ์ชฝ์—์„œ sub ๋จผ์ € ํ•˜๊ณ  ๋‹ค๋ฅธ์ชฝ์—์„œ pub โ˜… MQTT ์‚ฌ์šฉํ•ด์„œ File Co..

๐Ÿ“/cloudIOT 2022.05.17

Amazon Rekognition ์ด๋ฏธ์ง€์—์„œ ํ…์ŠคํŠธ ๊ฐ์ง€ (nodejs)

https://docs.aws.amazon.com/ko_kr/rekognition/latest/dg/text-detecting-text-procedure.html ์ด๋ฏธ์ง€์—์„œ ํ…์ŠคํŠธ ๊ฐ์ง€ - Amazon Rekognition ์ด ํŽ˜์ด์ง€์— ์ž‘์—…์ด ํ•„์š”ํ•˜๋‹ค๋Š” ์ ์„ ์•Œ๋ ค ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ์‹ค๋ง์‹œ์ผœ ๋“œ๋ ค ์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค. ์ž ๊น ์‹œ๊ฐ„์„ ๋‚ด์–ด ์„ค๋ช…์„œ๋ฅผ ํ–ฅ์ƒ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ๋ง์”€ํ•ด ์ฃผ์‹ญ์‹œ์˜ค. docs.aws.amazon.com 1. AWS์—์„œ IAM ์‚ฌ์šฉ์ž ๋งŒ๋“ค๊ธฐ - AWS ์ž๊ฒฉ ์ฆ๋ช… ์œ ํ˜• ์„ ํƒ: ์•ก์„ธ์Šค ํ‚ค, ์•”ํ˜ธ - ์ฝ˜์†” ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •ํ•˜๊ธฐ - ์ •์ฑ… ์ถ”๊ฐ€: AdministerAccess, AmazonRekognitionFullAccess, AmazonS3ReadOnlyAccess *** ๋งˆ์ง€๋ง‰์— new_user_..

๐Ÿ“/cloudIOT 2022.05.16

Python/ํŒŒ์ด์ฌ - Google TTS(Text to Speech) ์‚ฌ์šฉํ•˜๊ธฐ

๋ชจ๋“ˆ ์„ค์น˜ pip install gtts "์•ˆ๋…•ํ•˜์„ธ์š”" ๋ผ๊ณ  ๋งํ•˜๋Š” ์Œ์„ฑ ํŒŒ์ผ์ด tts.save('path') ์•ˆ์˜ ๊ฒฝ๋กœ์— ์ €์žฅ๋œ๋‹ค. from gtts import gTTS def speak(text): tts = gTTS(text=text, lang='ko') tts.save('./hello.mp3') speak("์•ˆ๋…•ํ•˜์„ธ์š”.") ์ด๋ฏธ ์ €์žฅ๋˜์–ด ์žˆ๋Š” ํ…์ŠคํŠธ ํŒŒ์ผ์„ ์ฝ์–ด์„œ ์Œ์„ฑ ํŒŒ์ผ๋กœ ์ €์žฅํ•œ๋‹ค. from gtts import gTTS # ํŒŒ์ผ ๊ฒฝ๋กœ textpath = './test.txt' # ํŒŒ์ผ ์ฝ๊ธฐ with open(textpath, mode='r', encoding='UTF-8') as text: script = text.read() # ๊ฐœํ–‰ ๋ฌธ์ž ์ œ๊ฑฐ script.replace('\n', '')..

๐Ÿ“/capstone1 2022.05.02

YOLO ํ•™์Šต ์ฃผ์˜ํ•  ์ !!!

๊ทธ๋ƒฅ ์ฃผ์ ˆ์ฃผ์ ˆ ํ•™์Šต ๊ธฐ๋ก.... 1) ์ฝ”๋žฉ ๋ฐค์— ๋Œ๋ฆฌ์ง€ ์•Š๊ธฐ -> ๋งค์šฐ ๋†’์€ ํ™•๋ฅ ๋กœ ๋Š๊น€ & ์˜ค๋ž˜ ๊ฑธ๋ฆผ 2) ์ค‘๊ฐ„์ค‘๊ฐ„ ํ™•์ธํ•ด์ค˜์•ผ ํ•จ -> ๋กœ๋ด‡์ด ์•„๋‹™๋‹ˆ๋‹ค ๋ฉ”์„ธ์ง€ ๋œธ / ์ง€ ํ˜ผ์ž ๊บผ์ง 3) ํ•˜๋ฉด์„œ last.pt ํŒŒ์ผ ๋ฐฑ์—…ํ•ด๋†“๊ธฐ -> ์ด์–ด์„œ ๋Œ๋ฆด ์ˆ˜ ์žˆ์Œ ํœด...... ๊ณ„์† ์‹คํŒจํ•˜๋‹ค๊ฐ€ ๋“œ๋””์–ด ํ•™์Šต ์™„๋ฃŒํ–ˆ๋‹ค ์ฝ”์นด/ํŽฉ์‹œ/์น ์„ฑ/์Šคํ”„๋ผ์ดํŠธ/ํฌ์นด๋ฆฌ/๋ฐ€ํ‚ค์Šค/์›ฐ์น˜์Šค/ํ™˜ํƒ€ ๊ฒฐ๊ณผ๋Š”....... ์ˆœ์กฐ๋กœ์šด ์‹œ์ž‘ ์™€ ์ž˜๋œ๋‹ค~~~~!!ํ•˜๊ณ  ์ข‹์•„ํ•˜๊ณ  ์žˆ์—ˆ๋‹ค ๊ทผ๋ฐ ์–ด? ์™œ ๋‘˜๋‹ค ์Šคํ”„๋ผ์ดํŠธ๊ฐ€ ์•ˆ๋˜์ง€?๋ผ๋Š” ์ƒ๊ฐ์ด ๋“ค์–ด์„œ ์Šคํ”„๋ผ์ดํŠธ ๋Œ๋ฆฌ๊ธฐ ์‹œ์ž‘ ์ฐฉ๊ฐํ•ด์„œ ์น ์„ฑ ๋Œ๋ฆผใ…‹ใ…‹ใ…‹ใ…‹ ์ˆซ์ž๊ฐ€ ๋‚ฎ์ง€๋งŒ ์ž˜ ๋œ๋‹ค๊ณ  ์•ˆ์‹ฌํ•˜๊ณ  ์žˆ์—ˆ๋‹ค ใ…Ž ๊ทธ๋Ÿฌ๋‹ค๊ฐ€ ์•„ ์Šคํ”„๋ผ์ดํŠธ๊ตฌ๋‚˜..?ํ•˜๊ณ  ๋‹ค์‹œ ๋Œ๋ฆฌ๊ธฐ ์‹œ์ž‘ ์žฅ๋‚œํ•ด...? ํ•™์Šต ๋” ์‹œ์ผœ์•ผ๊ฒ ๋„ค.. ํŽฉ์‹œ๋„ ์•ฝ๊ฐ„ ๋ถˆ์•ˆ๋ถˆ์•ˆ ์ง„์งœ ๊ด‘๊ธฐ ์งœ..

๐Ÿ“/capstone1 2022.04.24

์ฝ”๋žฉ ์—ฐ๊ฒฐ ์œ ์ง€ (colab ๋Ÿฐํƒ€์ž„ ์œ ์ง€)

์ฝ”๋žฉ์—์„œ ๋Ÿฐํƒ€์ž„์ด ๊ธด ํ”„๋กœ๊ทธ๋žจ์„ ๋Œ๋ฆฌ๋ฉด ๋Œ๋ฆฌ๋‹ค๊ฐ€ ์—ฐ๊ฒฐ์ด ๋Š๊ธด๋‹ค ๊ทธ๊ฑธ ๋ฐฉ์ง€ํ•˜๊ณ ์ž ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ์ž„์˜์˜ ์ž…๋ ฅ์„ ์ฃผ๋Š” ๊ฒƒ์ด๋‹ค ๊ฐœ๋ฐœ์ž๋„๊ตฌ ์—ด์–ด์„œ ์ฝ˜์†” ์ฐฝ์— ์ž…๋ ฅํ•˜๋ฉด ๋จ function ClickConnect(){ console.log("Working"); document.querySelector("colab-toolbar-button#connect").click() }setInterval(ClickConnect, 1800000) 12์‹œ๊ฐ„ ์œ ์ง€ ๊ฐ€๋Šฅ

๐Ÿ“/capstone1 2022.04.21

Google Colaboratory ์ด์šฉํ•œ YOLOv5 ๋ฐ์ดํ„ฐ ํ•™์Šต

๋งฅ๋ถ m1์œผ๋กœ ๋Œ๋ฆฌ๋‹ค๊ฐ€(CPU) ๋„์ €ํžˆ ์•ˆ ๋Œ์•„๊ฐ€์„œ colab ์ด์šฉํ•จ ๊ฑ ์ฒ˜์Œ๋ถ€ํ„ฐ ์ฝ”๋žฉ์œผ๋กœ ๋Œ๋ฆฌ๋Š” ๊ฑธ ์ถ”์ฒœํ•œ๋‹ค,,,,!! 1. ๊ตฌ๊ธ€ ๋“œ๋ผ์ด๋ธŒ -> Google Colaboratory ํŒŒ์ผ ์ƒ์„ฑ 2. ๋‚ด ๋“œ๋ผ์ด๋ธŒ mount from google.colab import drive drive.mount('/content/drive') - ๋‘˜ ์ค‘ ํŽธํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ํ•˜๋ฉด ๋จ 3. YOLOv5 ์„ค์น˜ 1) !git clone https://github.com/ultralytics/yolov5 2) %cd yolov5 !pip install -r requirements.txt 4. ๊ทธ ํ›„ ๊ณผ์ •์€ ๋˜‘๊ฐ™๋‹ค. ํŒŒ์ผ๋“ค ๋ฐ ์‹คํ–‰ ๊ฒฝ๋กœ ์„ค์ •๋งŒ ๋‚ด ๋“œ๋ผ์ด๋ธŒ๋กœ ๋‹ค์‹œ ํ•ด์ฃผ๋ฉด ๋จ https://sssbin.tistory.com/163 **..

๐Ÿ“/capstone1 2022.04.07

๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด OS ์„ค์น˜ & ๋…ธํŠธ๋ถ ์›๊ฒฉ ์ ‘์†

thanks to. ํ•˜์˜ ๋…ธํŠธ๋ถ ํ”„๋กœ์ ํŠธ์˜ ๋ชจ๋“  ๋‚ด์šฉ์„ ํ•˜์˜ ๋…ธํŠธ๋ถ๊ณผ ํ•จ๊ป˜ ํ•ด์•ผ ํ•จ sd ์นด๋“œ ํฌ๋งท -> ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด ์ด๋ฏธ์ง€ ๊ตฌ์›€ ์‹œํ–‰์ฐฉ์˜ค1. sd์นด๋“œ ๋จนํ†ต,,,, ์ „์— ์“ฐ๋˜ ์‚ฌ๋žŒ๋“ค์ด ๋ง‰ ์ผ๋‚˜๋ด„ ๋‹ค์‹œ ๊ต์ฒดํ•จ ๋ชจ๋ฐ”์ผ ํ•ซ์ŠคํŒŸ ์„ค์ • -> ์•„์ด๋””/๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •ํ•ด์ฃผ๊ธฐ ssh ํŒŒ์ผ(๋นˆ ํŒŒ์ผ) wpa_supplicant.conf ํŒŒ์ผ(์•„๋ž˜ ๋‚ด์šฉ) ์ถ”๊ฐ€ --------------------------------------------------------------------- country=US ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="wifi ์ด๋ฆ„" psk="๋น„๋ฐ€๋ฒˆํ˜ธ" scan=ssid=1 } ----..

๐Ÿ“/cloudIOT 2022.04.04