아직도 제가 만든 라디오 프로그램을 많이 찾으시는 것 같은데 실망하고 돌아가실 것 같아,
각 방송사의 라디오를 PC나 스마트폰으로 듣는 방법을 알려드리려고 합니다.

KBS

KBS 라디오를 많이들으시는 분들은 KBS 라디오 사이트 (http://radio.kbs.co.kr/) 우측 상단 메뉴 중에서 "듣기"를 클릭하시면 이런 화면이 나옵니다.

이 화면에서 콩 다운로드 부분에서 PC및 스마트폰용 프로그램을 다운받으시면 편리하게 들으실 수 있습니다.
팟캐스팅으로 지난 방송을 다시 들으실 수  있고 실시간 듣기를 누르시면 채널별로 브라우저를 통해 바로 들으실 수 있습니다.
(자주 들으시면 프로그램을 설치하시는 것을 추천합니다.)

SBS

SBS 라디오(http://w3.sbs.co.kr/radio/main.do)를 많이 들으시는 분들은 고릴라 라는 프로그램(http://w3.sbs.co.kr/radio/gorealraMain.do)을 다운받으시면 됩니다. PC및 스마튼폰 앱이 준비되어 있습니다.

문자메세지는 유료지만, 앱에서 사연 보내고 참여하는 것은 무료입니다.


MBC

MBC 라디오(http://www.imbc.com/broad/radio/index.html)를 많이 들으시는 분들은 미니 웹(http://mini.imbc.com/v2/index.html)에서 바로 들으실 수도 있구요. PC및 스마트폰 앱으로도 미니라는 청취 앱(http://www.imbc.com/mobileapp/mini/)이 준비되어 있습니다.


들으시는 채널만 들으시는 분들이 많기 때문에 거의 대부분은 해당 방송사의 청취 프로그램이나 앱만 설치하시면 들으시는 데 불편함 없으실거라 생각합니다.


즐거운 라디오 생활 되세요~!


리눅스상에서 웹 호출 문제를 디버깅 하고 싶을 때 mysql 서버 로그를 봐도 부족하고 그럴 때는 패킷을 캡쳐해서 분석할 수 있다.

If you want to debug web call problems on Linux, you may not be able to view the mysql server logs, and you can capture and analyze the packets in such cases.


tpcdump는 기본으로 설치가 안되어 있으니 설치를 해야 한다.

tcpdump can not be installed by default.


그리고 루트 계정으로 실행해야 한다.

and, should run it as root.



tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | perl -e '

while(<>) { chomp; next if /^[^ ]+[ ]*$/;

    if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER|CALL)/i)

    {

        if (defined $q) { print "$q\n"; }

        $q=$_;

    } else {

        $_ =~ s/^[ \t]+//; $q.=" $_";

    }

}'



리눅스상에서 웹 호출 문제를 디버깅 하고 싶을 때 웹서버 로그를 봐도 부족하고 그럴 때는 패킷을 캡쳐해서 분석할 수 있다.

If you want to debug web call problems on Linux, you may not be able to view the web server logs, and you can capture and analyze the packets in such cases.


tpcdump는 기본으로 설치가 안되어 있으니 설치를 해야 한다.

tcpdump can not be installed by default.


그리고 루트 계정으로 실행해야 한다.

and, should run it as root.



tcpdump -A -s 10240 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r "s/^........(GET |HTTP\/|POST |HEAD )/\n\1/g"


기본적으로 CentOS는 패키지관리자(yum)으로 프로그램을 설치하면 오래된 버전의 프로그램들이 설치되고,
When CentOS installs the program as a package manager (yum), older versions of the programs are installed.

최신 프로그램은 없는 경우가 있습니다. 그런 경우 EPEL, IUS, Remi 등의 저장소를 추가해주면 신버전의 프로그램을 설치할 수 있습니다.
And there is no latest program. In that case, you can install new versions of programs by adding repositories such as EPEL, IUS, and Remi.

하지만 별도로 설치하는 저장소의 패키지는 기존 시스템과 맞지 않을 수 있습니다. 제 경우엔 그런 문제는 없었지만.
However, the package of the repository that you install separately may not match the existing system. I did not have that problem in my case.

EPEL 저장소 설치 (Install the EPEL repository)


일반적으로 아래 명령을 실행하면 EPEL저장소를 사용하게 됩니다.

Generally, the following command will use the EPEL repository.

sudo yum install epel-release


하지만 설치가 안되는 경우 아래 명령을 참고하세요.
But if you can not install it please refer to the following command.


- CentOS and Red Hat Enterprise Linux 5.x

sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm

- CentOS and Red Hat Enterprise Linux 6.x

sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

- CentOS and Red Hat Enterprise Linux 7.x

sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm



IUS 저장소 설치 (Install the IUS repository)


- CentOS 5.x

sudo rpm -Uvh https://centos5.iuscommunity.org/ius-release.rpm

- CentOS 6.x

sudo rpm -Uvh https://centos6.iuscommunity.org/ius-release.rpm

- CentOS 7.x

sudo rpm -Uvh https://centos7.iuscommunity.org/ius-release.rpm

- Redhat 5.x

sudo rpm -Uvh https://rhel5.iuscommunity.org/ius-release.rpm

- Redhat 6.x

sudo rpm -Uvh https://rhel6.iuscommunity.org/ius-release.rpm

- Redhat 7.x

sudo rpm -Uvh https://rhel7.iuscommunity.org/ius-release.rpm


Remi 저장소 추가 (Install the Remi repository)


- CentOS and Red Hat Enterprise Linux 5.x

sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

- CentOS and Red Hat Enterprise Linux 6.x

sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

- CentOS and Red Hat Enterprise Linux 7.x

sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm


Remi 저장소 활성화 (Enable the Remi repository)

# 패키지 설치시 파라메터로 임시로 활성화
# Temporarily activate as a parameter when installing packages

sudo yum --enablerepo=remi install [패키지명]


# 저장소 파일을 수정하여 영구적으로 활성화
# Modify the repository file to permanently activate it

vi /etc/yum.repos.d/remi.repo

enabled 값을 1로 설정.
Set the enabled value to 1




Wi-Fi로 제어 가능한 LED 전광판을 만들었습니다. 

I created a controllable LED display with Wifi.


HTTP기반 API로 제어됩니다. 내부 EEPROM에 화면을 저장하여 보여줄 수 있습니다.

It is controlled by the HTTP-based API. You can show your screen to save an internal EEPROM.


동작 영상은 위를 참조 하시고 따라서 만드시려면 아래를 참고해 주세요~!

Please refer below to get motion video, see above, and therefore To create!




1. 준비물 (Materials)


- 전광판 모듈 (LED Matrix Module / 국내쇼핑몰 기준 1개 30,000원 * 3개 / 외국은 더 싸요)



Adafruit - 16x24 Red LED Matrix Panel - Chainable HT1632C Driver

https://www.adafruit.com/products/555


국내 전자부품 쇼핑몰에서 둘러보던 중 적당한 제품을 대충 골라서 구입하였습니다.

(I bought the product in the domestic electronic components mall.)


- 박스케이블 (2x5pin) - 짧은 것으로 4개 구매 추천 (국내 쇼핑몰 기준 2개에 2,500원)

10-Pin IDC Connector - I recommend that you purchase four short.



국내 전자부품 쇼핑몰에서 2개 세트에 2천원대에 판매하는 것 같습니다. 전광판 모듈당 하나씩을 주던데 만들다 보면 부족합니다. (그리고 너무 길어요)

모듈과 모듈을 체인식으로 연결하는데 저는 있던것으로 대충 했는데 모듈간 연결에 짧은거 4개 구입 추천합니다.

그리고 저는 두개를 와이파이 모듈과의 연결에 사용하려고 저렇게 개조를... 했습니다.

적당히 응용해서 개조해 주세요. (박스헤더라고 저 케이블을 꽂을수 있는 소켓이 있는데 그것을 두개 사서 쓰는것도 좋을 거 같아요)


- NodeMCU Development Kit (국내 전자부품 쇼핑몰 기준 가격: 9,000원 정도)


http://nodemcu.com/index_en.html



Lua라는 스크립트 언어로 펌웨어를 만들어 돌릴 수 있는 모듈이예요. 하지만 이번에는 아니예요.

Create a firmware module that can run'm in a scripting language called Lua. But this time I'm not using the Lua.


준비물은 여기까지예요. 너무 심플하죠??

Materials are up here. too simple ??


2. 선 연결 (Connecting Wires)


LED모듈과 모듈은 아래 사진처럼 각각 케이블로 연결되어야 해요.

LED modules and each module can be connected to cable like the picture below.



저는 있는 선을 써서 저렇게 모양이 좋지 않지만, 여러분은 짧은 케이블을 사서 쓰셨으면 해요.
Not good view. I hope you are using a short cable.


그리고, 첫번째 모듈의 J5라고 쓰여진 부분을 납땜으로 연결해 줘야 해요.

And, you have to connect the written part of the first module, called J5 soldered.



NodeMCU와 연결을 위해서 이걸 참고했어요. 프로그래밍으로 제어 가능한 GPIO포트들을 이용해 전광판을 제어 할 거예요.

I see it as connected to the NodeMCU. Using the available programmable GPIO ports will be controlled by controlling the led matrix.


일단 제 소스코드에는 이렇게 정의했어요.

I was defined like this.



이 정의를 참고해서 납땜질 했던 첫번째 모듈과 NodeMCU를 연결해요. 

Refer to this definition, I connect the module and NodeMCU.


 전광판 모듈 (LED Module)

 NodeMCU

 VCC

 3.3V

 GND

 GND

 DATA

 GPIO4 (~D2)

 WR

 GPIO5 (~D1)

 CS0

 GPIO0 (~D3)

 CS1

 GPIO2 (~D4)

 CS2

 GPIO14 (~D5)


모두 연결됐어요!

Connected all!




3. 펌웨어 개발 (Firmware programming)


자.. 우리는 펌웨어 개발을 해야 해요.

Now ... we have to do firmware development.


개발 도구는 Arduino를 쓸거예요. 원래 이 개발툴은 Arduino라는 보드를 위해서 만들어진건데 최근에 보니 이것저것 많이 지원하더라구요.

Development tools are going to use the Arduino. Originally developed tools are gonna made for the Arduino board, the board looked at a lot of support recently.


NodeMCU 모듈 포함해서.

Including NodeMCU module.


아두이노 개발툴이 없으시면 여기에서 무료로 다운받으실 수 있어요.

If you do not have an Arduino development tool I can download for free here.


https://www.arduino.cc/


NodeMCU를 Arduino에서 개발하려면 아두이노 설정에서 추가 보드매니저 URL을 입력해야 해요.

To develop NodeMCU in Arduino you need to enter the URL in the Additional Board Manager in Arduino setup.



URL:

http://arduino.esp8266.com/stable/package_esp8266com_index.json


위 설정을 한 후 보드 매니저를 열면 nodemcu 보드 개발키트를 설치할 수 있어요.

After the above settings when you open the manager's board to install nodemcu Board Development Kit.



툴 > 보드 메뉴에서 NodeMCU를 고르고, 시리얼포트가 잘못되었으면 정상적으로 세팅합니다.

Pick NodeMCU in the Tools > Board menu, if the serial port is normally set incorrectly.


소스코드를 열고 왼쪽의 업로드 버튼만 누르면 끝나요!

Open source code just press the upload button, all steps are ended.


아래는 소스코드 설명이예요.

This is a description of the source code.



- NodeMCU모듈을 공유기(AP)모드로 동작시킬거예요. 패스워드도 걸었구요.

  NodeMCU going to operate the module in the router (AP) mode. He also set a password.


- 그리고 아이피 대신 장치 이름을 쓸수 있도록 MDNS를 등록하였습니다. (http://192.168.1.1/clear -> http://led-display.local/clear)

  And, we have registered the MDNS help write the device name instead of the IP.


- 메모리에 화면을 저장할 수 있도록 EEPROM도 초기화 했어요.

  It also initializes EEPROM memory to store the screen.


- 그리고 전광판 모듈을 초기화 해요.

  and initializing the led matrix module.



URL에 따라서 이러저러한 동작을 해요.

It's different actions depending on the URL.


http://led-display.local/clear


예를들어 이런식으로 호출하면 동작하는데요.

For example, I'd like this call operation.


 /clear 

 화면을 지우는 역할 (모든 도트를 OFF시켜요)

 To erase the screen (OFF all the dots)

 

 /fill

 화면을 모두 채워요 (모든 도트를 ON)

 Fill the whole screen (all dots ON)

 

 /draw

 파라메터로 보낸 데이터를 화면에 바로 그려요.

 Draw the data that is sent as a parameter to the screen.

 ?v=03edfx ...  (144 byte binary in 288 byte hexdigest)

 /set

 파라메터로 보낸 데이터를 메모리(EEPROM)에 저장해요.

 Stores the data that is sent as a parameter to memory (EEPROM).

 ?m=0&v=03edfx ...  

 /show

 메모리에 저장되어 있는 화면을 불러와서 보여줘요.

 Show me bring up a screen that is stored in memory.

 ?m=0

 /brightness

 화면 밝기를 조정하는 데 써요.

Adjust the brightness of the screen.

 ?v=10


그리고 다른 URL은...

And another URL is ...


        http://led-display.local/


페이지로 들어갔을 때 전광판에 도트를 찍어볼 수 있는 페이지를 보여주는 데 쓰여요.

When you see an index page, and is used to show a page that allows you to control the led matrix.


이렇게.

like this.




소스코드는 부끄럽지만 github에 공유해 놓을께요.

I put upload the source code to github.


누구든 자유롭게 쓰시고 개발하실 수 있는 분은 더 좋게 만드는데 기여해 주셨으면 해요.

Please if anyone can freely use, I want you to contribute to your development code.


https://github.com/heisice/wifi_led_display



감사합니다!

Thank you!

+ Recent posts