# 2022.08.11

## 할일 및 한일

* [x] Nest.js 세미나 참석
* [ ] 이것은 자바다 5장 공부 및 notion 정리(50%)
* [x] smart-green-campus mqtt 부분 파악하

## 경험 및 배움

이번에 다학제간 캡스톤 디자인 (smart-green-campus) 라는 캡스톤 디자인 프로젝트에 참여하게 되면서, 나의 역할인 broker역할에 대해 조금이나마 이해할 수 있었다. 아두이노를 이용하여 온도를 체크하고 그것을 **출판-구독 패턴**을 이용해서 **출판(publish)**, **구독(subscriber)**&#xACFC; 그 중간 매개체인 **broker**의 역할을 알게 되고 어떻게 진행되는지 이해 해보았다.

실제 프로젝트에서는 컴퓨터공학과 학생들이 온도를 체크해서 보내주지만 지금 준비 기간에 다 모여서 할 수 없기 때문에, 아두이노를 연결하여 실습해보았다.

![출판(발행)-구독 ](/files/f1en5TWLXsFUWNAlcj9d)

{% hint style="info" %}
***출판 구독 패턴(Publisher-Subscriber Pattern)***\
\
메시지의 수신자가 정해져 있지 않다.\
Topic을 구독한 구독자가 메시지 수신할 수 있다.\
수신자와 발신자는 브로커를 통해 서로 누구인지에 대한 정보 없이 메시지를 전달하고, 받는다.
{% endhint %}

아두이노로 온도를 측정하고, broker 역할을 하는 [hivemq](https://www.hivemq.com/) 접속하여 intellij에 있는 subscriber 코드와 topic을 맞춘후, publish를 하여 온도가 전달되는지 확인하였다. 온도는 정상적으로 측정하여 전달이 되었으나, 교수님이 원하시는 출력형태에 맞지 않아서 수정을 하려고 해보았지만 정확하게 수정을 하진 못하였다.

![hive mq를 사용한 출판-구독](/files/vzk24TkBFFraleG3nV5H)

## 개선 및 목표

* 오늘은 Nest.js 세미나를 참석하여 이해해보고 정리해보려 했으나 아직 프로그래밍 문법도 헷갈리는 나에겐 조금 힘들었다. 이번주 주말까지 시간을 갖고 천천히 공부하고, 영상을 돌려보고 notion 정리까지 할 계획이다.
* 이것은 자바다 5장을 공부하고 notion 정리를 50%하고 마치려했으나 아직 다하지 못하여 회고를 마치고 마무리 할 생각이다.
* 늦게 시작한만큼 아직 모르는 것들이 많으나 천천히 꾸준하게 하면 된다고 생각한다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jinwon-yoon.gitbook.io/jinonys-blog/daily-log/2022.08.11.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
