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