서버컴퓨터는 우분투 리눅스 14.04 LTS 운영체제이며 Apache2, Mysql이 설치되어 있습니다.
wifi는 아래 Arduino-wifi 소스를 참조하여 작성했습니다.(일부분 입니다.)
void loop()
{
if(state==0)
{
Serial.println(“Start Wifi Setting”);
Serial1.print("AT\r\n");
delay(10);
Serial1.print("AT+WAUTO=0,iptime_mini\r\n");
delay(10);
Serial1.print("AT+NDHCP=0\r\n");
delay(10);
Serial1.print("AT+NSET=192.168.1.5,255.255.255.0,192.168.1.1\r\n");
delay(10);
Serial1.print("AT+NAUTO=0,1, 192.168.1.2 ,80\r\n"); //Client, TCP, destination IP address, Port
//port change!!!!!!!!!!!!!!
delay(10);
Serial1.print("ATA\r\n");
state=1;
Serial.println("Wifi Setting Finish");
}
컴파일을 하고 실행을 시키니 서버쪽으로 부터 수신받은 결과가 아래와 같습니다.(시리얼 모니터상에서)
Start Wifi Setting
Wifi Setting Finish
Not Implemented
AT to/index.html not supported.
Apache/2.4.7(Ubuntu) Server at 127.0.1.1 Port
501 에러는 제가 찾아보기로 서버가 클라이언트로 부터 받은 데이터를 처리할 수 없을때 발생하는 것으로 알고 있습니다.
그리고 그 밑의 빨간줄로 그은 AT to /index.html not supported 라는 메시지로 보아 아마 wifi 소스코드의 AT 명령어를 인식하지 못하는 것으로 보입니다.
공유기를 통한 wifi 설정을 하고 싶을때는 Serial1(AT+NAUTO … )등과 같이 해야하는 걸로 알고 있는데 이 소스코드는 wifi를 설정 해 줌과 동시에 서버쪽으로 신호를 보내는 것 같은데
그냥 wifi 설정만 맞춰주고 서버쪽으로 신호를 안가게 할 수 없을까요…?
아마 AT 명령어 때문에 저런 오류가 뜬거 같아서요.
저는 단순히 wifi와 서버컴퓨터간의 echo 가 되길 원합니다.
서로가 주고 받을 수 있도록 하게요 …