Skip to main content

Tutorials(Kor)

Overview#

WIZ550web์˜ I/O ์ œ์–ด๋Š” CGI๋ฅผ ์ด์šฉํ•˜์—ฌ I/O์˜ ์ œ์–ด์™€ ๋ชจ๋‹ˆํ„ฐ๋ง์„ ์ˆ˜ํ–‰ํ•œ๋‹ค. ์›น ํŽ˜์ด์ง€๋Š” ๐ŸŒŽHTTP GET / POST method๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์›น ์„œ๋ฒ„์˜ ์ƒํƒœ ๊ฐ’์„ ์–ป๊ฑฐ๋‚˜(GET) ์›น ํŽ˜์ด์ง€์˜ ๋ณ€๊ฒฝ๋œ ๊ฐ’์„ ์›น ์„œ๋ฒ„๋กœ ์ „๋‹ฌ(POST)ํ•˜๋„๋ก ๊ตฌ์„ฑ๋˜์–ด ์žˆ์œผ๋ฉฐ, ์ด๋Ÿฌํ•œ ๋™์ž‘์„ ์ˆ˜ํ–‰ํ•˜๊ธฐ ์œ„ํ•˜์—ฌ ์›น ํŽ˜์ด์ง€์˜ HTML / JavaScript(AJAX)์™€ ์›น ์„œ๋ฒ„์˜ CGI handler๊ฐ€ ์ผ์น˜ํ•˜๋„๋ก ๊ตฌํ˜„๋˜์–ด ์žˆ์–ด์•ผ ํ•œ๋‹ค. CGI์— ๊ด€ํ•œ ์„ค๋ช…์€ 'Getting Started Guide: WIZ550web์˜ CGI'์— ์„ค๋ช…๋˜์–ด ์žˆ๋‹ค.

์‚ฌ์šฉ์ž๋Š” Tutorial์„ ํ†ตํ•ด WIZ550web์— ๊ตฌํ˜„๋œ I/O interface function์˜ ์ดํ•ด์™€ ํ™œ์šฉ์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉ์ž๋Š” ์›๊ฒฉ์ง€์—์„œ ์›น ์„œ๋ฒ„๋กœ ์ ‘์†ํ•˜๊ณ , ์‚ฌ์šฉ์ž device์˜ ์ƒํƒœ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋ง ํ•˜๊ฑฐ๋‚˜ I/O์˜ on/off ๊ธฐ๋Šฅ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ์‚ฌ์šฉ์ž๋งŒ์˜ WIZ550web์šฉ ์›น ํŽ˜์ด์ง€๋ฅผ ์ œ์ž‘ํ•  ์ˆ˜ ์žˆ๋‹ค.

๋ณธ Tutorial ์—์„œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋‚ด์šฉ์„ ๋‹ค๋ฃฌ๋‹ค.

Tutorial 0: Introduce the I/O Interface functions and test webpage

 * Web browser์™€ WIZ550web์˜ ๊ธฐ๋ณธ์ ์ธ ๋™์ž‘์— ๋Œ€ํ•ด ์†Œ๊ฐœํ•˜๊ณ , ์‚ฌ์šฉ์ž๊ฐ€ ์›น ํŽ˜์ด์ง€๋งŒ ์ˆ˜์ •ํ•˜  ์—ฌ ์›ํ•˜๋Š” ํ˜•ํƒœ์˜ I/O ์ œ์–ด์šฉ ์›น ์‚ฌ์ดํŠธ๋ฅผ ๊ตฌ์„ฑ ํ•  ์ˆ˜ ์žˆ๋„๋ก ๋ฏธ๋ฆฌ ์ •์˜๋œ I/O interface function๊ณผ ํ…Œ์ŠคํŠธ ํŽ˜์ด์ง€๋ฅผ ์†Œ๊ฐœํ•œ๋‹ค. 

Tutorial 1: [Set the Digital I/O Status](/)

 * WIZ550web์—์„œ ์ œ๊ณตํ•˜๋Š” Digital I/O (16)์˜ On - Off ์ƒํƒœ๋ฅผ ์ œ์–ด ํ•  ์ˆ˜ ์žˆ๋Š” Web page ์ œ์ž‘์— ๋Œ€ํ•ด ๋‹ค๋ฃฌ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉ์ž๋Š” ์›น์„ ํ†ตํ•ด ์ œํ’ˆ์˜ LED / Relay ๋“ฑ์„ ์ œ์–ด ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด Tutorial์„ ํ†ตํ•ด ํ•™์Šตํ•œ ๊ธฐ๋Šฅ์„ ์‘์šฉํ•˜๋ฉด Digital I/O์˜ Direction (Input / Output / None) ์ œ์–ด ๊ธฐ๋Šฅ๋„ ์ œ์ž‘ ํ•  ์ˆ˜ ์žˆ๋‹ค. 

Tutorial 2: Get the Digital I/O Status Tutorial 3: Get the Analog Input Value Tutorial 4: Get/Set the WIZ550web IP Settings Tutorial 5: Real-time Data Update on WIZ550web Web page Tutorial 6: How to Make Custom Interface Functions with WIZ550web

๋ฏธ๋ฆฌ ์ •์˜๋œ I/O Function์— ๋Œ€ํ•œ ๋ช…์„ธ๋Š” ๋‹ค์Œ ๊ฐ€์ด๋“œ์—์„œ ํ™•์ธ ํ•  ์ˆ˜ ์žˆ๋‹ค.

Guide Document WIZ550web Get/Set Interface Functions Guide

Tutorial 0: Introduce the I/O Interface functions

Interface Functions Guide for WIZ550web#

Overview#

WIZ550web์€ ํŽŒ์›จ์–ด์˜ ์ˆ˜์ • ์—†์ด ์›น ํŽ˜์ด์ง€์˜ ์ œ์ž‘๋งŒ์œผ๋กœ ์žฅ์น˜ ์ด๋ฆ„ ๋ฐ Network ์„ค์ •, ๊ฐ๊ฐ์˜ Digital I/O์™€ Analog input์˜ ์ œ์–ด์™€ ๋ชจ๋‹ˆํ„ฐ๋ง์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก CGI๋ฅผ ์œ„ํ•œ HTTP Request function set์„ ์ œ๊ณตํ•œ๋‹ค.

GET / SET interface๋กœ ๋‚˜๋‰˜์–ด ๊ตฌํ˜„๋˜์–ด ์žˆ์œผ๋ฉฐ, ์‚ฌ์šฉ์ž๋Š” JavaScript์™€ AJAX๋ฅผ ์ด์šฉํ•œ HTTP GET / POST method๋กœ ๊ฐ ๊ธฐ๋Šฅ์— ํ•ด๋‹นํ•˜๋Š” CGI๋ฅผ ์š”์ฒญํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ํ™œ์šฉํ•˜๋ฉด ์†์‰ฝ๊ฒŒ WIZ550web์„ ์ œ์–ดํ•  ์ˆ˜ ์žˆ๋Š” ์›น ํŽ˜์ด์ง€๋ฅผ ๊ตฌํ˜„ ๋ฐ ์ œ์ž‘ ํ•  ์ˆ˜ ์žˆ๋‹ค. GET ๋ช…๋ น์˜ ๊ฒฝ์šฐ ํ•ด๋‹นํ•˜๋Š” ์š”์ฒญ์— ๋Œ€ํ•œ JavaScript Callback function์˜ ํ˜•ํƒœ๋กœ ๊ฐ’์„ ์–ป๋„๋ก ๊ตฌ์„ฑ ๋˜์—ˆ์œผ๋ฉฐ, SET ๋ช…๋ น์˜ ๊ฒฝ์šฐ CGI ์š”์ฒญ๊ณผ ํ•จ๊ป˜ ์„ค์ •ํ•˜๊ณ ์ž ํ•˜๋Š” ๊ฐ’์„ ์ง€์ •๋œ Web form element์˜ ํ˜•ํƒœ๋กœ HTTP request์— ํฌํ•จํ•˜์—ฌ WIZ550web์œผ๋กœ ์ „์†กํ•˜๋ฉด ๋œ๋‹ค.

WIZ550web์˜ CGI์— ๊ด€ํ•œ ๋‚ด์šฉ์€ 'Getting Started Guide: WIZ550web์˜ CGI' ์ฑ•ํ„ฐ๋ฅผ ์ฐธ์กฐํ•˜๊ธฐ ๋ฐ”๋ž€๋‹ค.

Download and Link#

Get/Set interface CGI๋ฅผ ์ด์šฉํ•œ ํ…Œ์ŠคํŠธ ์šฉ ์›น ํŽ˜์ด์ง€ ๋ฐ ํŽŒ์›จ์–ด๋Š” ๋‹ค์Œ ๋งํฌ์—์„œ ๋‹ค์šด๋กœ๋“œ ํ•  ์ˆ˜ ์žˆ๋‹ค.

WIZ550web GitHub Repository

๐ŸŒŽhttps://github.com/Wiznet/WIZ550web

WIZ550web GitHub Repository: Webpage source code

๐ŸŒŽGET/SET Interface functions Testpage

WIZ550web GET/SET Interface#

WIZ550web์˜ GET/SET interface๋ฅผ ์œ„ํ•œ CGI ๋ฆฌ์ŠคํŠธ๋Š” ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

GET Function List#

Get: Functions Table#

HTTP Request CGIname Description
widget.cgiGet Basic Settings
io.cgiGet I/O all status, include pin 90,91 on-board LED
io_alias.cgiGet all I/O status. direction and port names
adc.cgiGet all ADC Status/values
get_devinfo.cgiGet Device info
get_netinfo.cgiGet Network info
get_serial_data.cgiGet serial data from buffer (Console port)
get_uart0info.cgiGet Serial port 0 settings (UART1, Console)
get_uart1info.cgiGet Serial port 1 settings (UART2, AT command)
get_dio0.cgi ~ get_dio15.cgiGet I/O status per port
get_ain0.cgi ~ get_ain3.cgiGet ADC info per port
SectionCGI nameJavaScript Callback ParameterReturn TypeDescriptionValue (Example)Note
Device Informationget_devinfo.cgifwverStringFirmware version1.0.0-
devnameStringDevice nameWIZ550web-
pcodeStringProduct identifier1-2-0 For WIZ configuration tool mac String MAC address 00:08:DC:xx:xx:xx-
Network Informationget_netinfo.cgiipStringIP address192.168.11.2-
gwStringGateway IP address192.168.11.1-
subStringSubnet Mask255.255.255.0-
dnsStringDNS server IP address8.8.8.8-
dhcp1-digit numberDHCP enable0 or 11 : Enabled,0 : Disabled
Serial Port Informationget_uart0info.cgi get_uart1info.cgibaud1-digit numberBaud rate0 ~ 90:600,1:1200,2:2400,3:4800,4:9600,5:19200,6:38400,7:57600,8:115200,9:230400
databit1-digit numberData bit0 or 10:Databit8 1:Databit9
parity1-digit numberParity bit0 ~ 20:None 1:Odd 2:Even
stopbit1-digit numberStopbit0 or 10:Stopbit1 1:Stopbit2
flow1-digit numberFlow control0 ~ 30:None 1:RTS/CTS,2:RS-422,3:RS-485
16-Digital I/O(0 ~ 15)get_dio0.cgi~get_dio15.cgidio_p1 or 2-digit numbersI/O Pin Info.0-
dio_s1-digit numberI/O State0 or 10 : Low,1 : High
dio_d1-digit numberI/O Direction0/1/20 : NotUsed,1 : Input,2 : Output
dio_aStringI/O AliasDigital I/O #0-
4-Analog Inputs(12-bit ADC)get_ain0.cgi~get_ain3.cgiain_p1-digit numberAnalog input pin0 ~ 3-
ain_v1 ~ 4-digit numbersAnalog input value0 ~ 4095The values need to transform for use.

Get: JavaScript Callback Function Name Table

HTTP Request CGI nameJavaScript Function Name on Web page
get_devinfo.cgifunction DevinfoCallback(o)
get_netinfo.cgifunction NetinfoCallback(o)
get_uart0info.cgifunction UartinfoCallback(o)
get_uart1info.cgi
get_dio0.cgi~get_dio15.cgifunction DioCallback(o)
get_ain0.cgi~get_ain3.cgifunction AinCallback(o)

SET Function List#

Set: Functions Table

HTTP Request CGI nameDescription
config.cgiSet Basic Settings for ๐ŸŒŽDemoPages
dout.cgiSet I/O port On/Off
save_alias.cgiChange name of I/O port
dir_change.cgiChange I/O direction
tx_serial_data.cgiSend serial data to UART1(Console port)
set_default_io_status.cgiIO Settings Factory Reset and Reboot
set_devinfo.cgiSet Device info (changes takes effect after reboot)
set_netinfo.cgiSet Network info (changes takes effect after reboot)
set_uart0info.cgiSet Serial port 0 settings (UART1, Console) (changes takes effect after reboot)
set_uart1info.cgiSet Serial port 1 settings (UART2, AT command) (changes takes effect after reboot)
set_diodir.cgiChange I/O direction. same as dir_change.cgi
set_diostate.cgiSet I/O port On/Off. almost the same as dout.cgi
set_dioalias.cgi

config.cgi is for ๐ŸŒŽDemoPages.

Other common APIs are from set_devinfo.cgi

SectionCGI nameParameterWebform ElementDescriptionParameter ExampleNote
Device Configurationconfig.cgidevicenameParam: StringDevice namedevicename=WIZ550WEB
dhcpParam: 0 or 1DHCP enabledhcp=01 : Enabled 0 : Disabled
libParam: StingLocal IP addresslip=192.168.11.100Including dots
gw Param: StringGateway IP addressgw=192.168.11.254
subParam: StringSubnet Masksub=255.255.255.192
dnsParam: StringDNS server IP addressdns=168.126.63.1
baudrateParam: 1-digit numberBaud ratebaud=8
databitParam: 8~9Data bitdatabit=88:Databit8,9:Databit9
parityParam: 0~2Parity bitparity=00:None ,1:Odd ,2:Even
stopbitParam: 1~2Stopbitstopbit=11:Stopbit1 2:Stopbit2
flowcontrolParam: 0~3Flow controlflowcontrol=00:None,1:RTS/CTS,2:RS-422,3:RS-485
Device Informationset_devinfo.cgidevnameParam: StringDevice namedevname=Server1-
Network Informationset_netinfo.cgiipParam: StringIP addressip= 192.168.11.3Including dots
gwParam: StringGateway IP addressgw= 192.168.11.254
subParam: StringSubnet Mask sub= 255.255.255.192
dnsParam: StringDNS server IP addressdns= 168.126.63.1
dhcpParam: 0 or 1DHCP enabledhcp=01 : Enabled 0 : Disabled
Serial Port Informationset_uart0info.cgi set_uart1info.cgibaudParam: 1-digit numberBaud ratebaud=80:600,1:1200,2:2400,3:4800,4:9600,5:19200,6:38400,7:57600,8:115200,9:230400
databitParam: 8~9Data bitdatabit=88:Databit8,9:Databit9
parityParam: 0~2Parity bitparity=00:None,1:Odd,2:Even
stopbitParam: 1~2Stopbit stopbit=11:Stopbit1,2:Stopbit2
flowParam: 0~3Flow controlflow=00:None,1:RTS/CTS,2:RS-422,3:RS-485
16-Digital I/O(0 ~ 15)set_diostate.cgipin / valParams: digit numbersI/O Statepin=0&val=1pin:0~15,val=0(Low/On),val=1(High/Off)
set_diodir.cgipin / valI/O Directionpin=1&val=2pin:0~15 ,val=0(Not used),val=1(Input),val=2(Output)
set_dioalias.cgipin / valParams: digit numbers / StringI/O Aliaspin=1&val=pin#1pin:0~15 value:string