2019 May IoT project

As I previously posted, I made a WiFi AC remote controller project. see telegram bot for HVAC

Today, I begin a new project to go further.

I purchased another Raspberry Pi 3 Model B, AND Raspberry Pi Sensor Kit. (http://m.eleparts.co.kr/goods/view?no=3730500 and http://m.eleparts.co.kr/goods/view?no=3030452)

(I just wanted to purchase sensor only, but I can’t sure, I could attach these sensors to my existing RPi, so I posted a question to a forum https://www.cooking-hacks.com/forum/viewtopic.php?f=43&t=19434&sid=d89e064868d4a0dce0c58ea7a6490bde)

And, I tested DHT11 as https://github.com/deokgonkim/rpi_sensor

 

My next step will be,

1. set up a messaging queue, like Rabbit MQ

2. set up a web/api server for gathering the data and the controll center.

3. my existing bot code shoud be migrated to a new server, and these two RPi should listen to MQ for commands, and should send data to MQ.

 

To be continued…

Continue reading 2019 May IoT project

telegram bot 제 2탄

텔레그램 봇을 만들어 보았었지요.

이번엔 그 두 번째 이야기.

HVAC IR Remote라는 라즈베리파이에 올릴 수 있는 IR Transceiver를 구매하고,
원격에서 집에 있는 장치를 리모콘 조작하듯이 켜고 끌 수 있는 것을 만들어 보았습니다.

Github : https://github.com/deokgonkim/lirc-telegram-bot


# hvac-telegram-bot

## My Hardware

* Raspberry Pi Model B. (old one)
* HVAC IR Remote for arduino / Raspberry Pi
* https://www.cooking-hacks.com/hvac-ir-remote-shield-for-raspberry-pi
* https://www.cooking-hacks.com/documentation/tutorials/control-hvac-infrared-devices-from-the-internet-with-ir-remote/

## Setting up HVAC IR Remote for LIRC

* Instructions

> https://www.hackster.io/austin-stanton/creating-a-raspberry-pi-universal-remote-with-lirc-2fd581

* Install lirc package

```
sudo apt-get install lirc
```

* Configure kernel module

```
vi /etc/modules
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=23
```
> note I/O port is different than above documentation.
> You can find GPIO port for HVAC IR Remote in arduPi.cpp

```
vi /etc/lirc/hardware.conf
```
> see above document

```
vi /etc/lirc/lirc_options.conf
```
> https://raspberrypi.stackexchange.com/questions/50873/lirc-wont-transmit-irsend-hardware-does-not-support-sending
> set driver to 'default'

* Record IR signal or obtain configuration file.
> http://lirc.sourceforge.net/remotes/

> My testing board didn't work as expected.
> I can only control IR LED, two buttons, two indication LEDs. but can't read IR signal. I don't know board is broken or something.

## Preparations

following my own blog https://www.dgkim.net/wordpress/2017/08/24/telegram-bot-%ed%85%8c%ec%8a%a4%ed%8a%b8-%eb%85%b8%ed%8a%b8/

### python-telegram-bot
> I tried
```
git clone https://github.com/python-telegram-bot/python-telegram-bot

cd python-telegram-bot
git submodule update
```

> But, today I changed plan.
> https://pypi.org/project/python-telegram-bot/

## programming part

> I referenced https://github.com/python-telegram-bot/python-telegram-bot/tree/master/examples

> quickly created firstbot.py