GET/POST question


#1

Hello,

I meanwhile got the WIZ550WEB EVB and eventually everything works so far in the local LAN, including firmware update to v1.1.1
and WEB page without SD card. It took some time, but it works.

(Btw. just a proposal for next firmware version : It should be possible simply to copy files from SD-Card to flash memory.)

However , one thing does not work. At least I can’t get it work correctly.
I read
wizwiki.net/wiki/doku.php?id=pro … 0webgsg_en -> CGI for WI/5500web -> GET and POST
as well as
wizneteu.wordpress.com/tag/wiz550web-evb/ -> WIZ550WEB-EVB controls power supply of WIZ107SR-TTL-EVB – part #2

The problem is, if I use curl -data “pin=0&val=1” 192.168.11.100/dout.cgi , I just can turn D0 on. With “Pin=0&Val=0” I can
not turn it off . It even doesn’t matter which pin number I use, it does always set D0. (e.g even “Pin=7&Val=0” sets D0)
I assume I’m doing something wrong, I’m not quite familiar with CGI.

Can anyone help please and provide some examples ?

Thank you

Robert


#2

I got it by myself.

Set data ( Relx and LEDx on ) : curl -d “pin=x&val=0” 192.168.11.100/dout.cgi
Reset data ( Relx and LEDx off) : curl -d “pin=x&val=1” 192.168.11.100/dout.cgi

x = 0…7


#3

On page “Getting Started Guide with WIZ550web” there is a line: “Users can learn how to control the H/W (I/O, UART, Registers and Etc.) using the web page.”

Would be better if these fictions where documented already for people who have no idea where to look.

Anyway. I did some digging around:

Issues I’ve found:

  • dout.cgi are inverted? on = 0 and off = 1, this is not the case on set_diostate.cgi
  • USART names are wrong in the Demo site
    USART1 on page = UART2 on data sheet (Serial Port - Data) and
    USART2 on page = UART1 on data sheet (Serial Port - AT command)

GET Commands
Example:
curl -G http://192.168.11.100/get_dio5.cgi or use web browser

widget.cgi (Get Basic Settings)
io.cgi (Get I/O all status, include pin 90,91 on-board LED)
io_alias.cgi (Get all I/O status. direction and port names)
adc.cgi (Get all ADC Status/values)
get_devinfo.cgi (Get Device info)
get_netinfo.cgi (Get Network info)
get_serial_data.cgi (Get serial data from buffer) (Console port)
get_uart0info.cgi Get Serial port 1 settings (UART1, Console)
get_uart1info.cgi Get Serial port 1 settings (UART2, AT command)
get_ain0.cgi ~ get_ain3.cgi (Get ADC info per port)
get_dio0.cgi ~ get_dio15.cgi (Get I/O status per port)

SET Set commands
Example:
curl -d “pin=5&val=1” http://192.168.11.100/set_diostate.cgi (Set I/O port 5 to On/High) or
curl -d “lip=192.168.11.100” http://192.168.11.100/config.cgi (to set only the “lip” parameter

config.cgi (Basic configure setup: Device name, LAN, UART2 = AT Port))
devicename=WIZ550WEB
dhcp=0
lip=192.168.11.100
gw=192.168.1.1
sub=255.255.255.0
dns=0.0.0.0
baudrate=0-9 (600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400)
databit=8,9
parity=0-2 (None, Odd, Even)
stopbit=1,2
flowcontrol=0-3 (None, CTS/RTS, RS422, RS485)

dout.cgi (Set I/O port On/Off)
pin=0-15,90,91 (I/O port number, 90/91=on-board led)
val=0 (High/On)
val=1 (Low/Off)

save_alias.cgi (Change name of I/O port)
pin=0-15 (I/O port number)
val=Digital IO #5

dir_change.cgi (Change I/O direction)
pin=0-15 (I/O port number)
val=0-2 (Not used,Input,Output)

tx_serial_data.cgi (Send serial data to UART1 = Console port)
data=text here

set_default_io_status.cgi (IO Settings Factory Reset and Reboot)
io_reset=1

set_devinfo.cgi (Configure Device name) **changes takes effect after reboot
devname=WIZ550WEB

set_netinfo.cgi (Configure Lan port) **changes takes effect after reboot
ip=192.168.11.100
gw=192.168.11.1
sub=255.255.255.0
dns=0.0.0.0

set_uart0info.cgi (Configure UART1= Console Port) **changes takes effect after reboot
baud=0-9 (600,1200,2400,4800,9600,19200,38400,57600,115200,230400)
databit=8,9
parity=0-2 (None,odd,even)
stopbit=1,2
flow=0-3 (None,CTS/RTS,RS422,RS485)

set_uart1info.cgi (Configure UART2 = AT port) **changes takes effect after reboot
baud=0-9 (600,1200,2400,4800,9600,19200,38400,57600,115200,230400)
databit=8,9
parity=0-2 (None,odd,even)
stopbit=1,2
flow=0-3 (None,CTS/RTS,RS422,RS485)

set_diodir.cgi (Change I/O direction. same as dir_change.cgi)
pin=0-15 (I/O port number)
val=0-2 (Not used,Input,Output)

set_diostate.cgi (Set I/O port On/Off. almost the same as dout.cgi)
pin=0-15 (I/O port number)
val=0 (Low/Off)
val=1 (High/On)

set_dioalias.cgi (Change name of I/O port. same as save_alias.cgi)
pin=0-15
val=Digital IO #5

Wiz Team, feel tree to add this in the Wiz Wiki


#4

Hello, ThaHandy.

Thanks for your kind info :slight_smile:

WIZ550web developer had previously created something related to the command.
First, we will release this and add your friendly comments.
If we release it, we will reply.


I answer two of the issues you have found.

Yes, That is correct. Value is invert.
This can be checked / changed in 624Line in userHandler.c.
I will discuss with existing developer on whether to change this to on = 1, off = 0.

Where in the data sheet does UART2 specify Serial Port - DATA?
In the Schematic, you can see that UART2 = AT command, UART1 = Data.
Maybe it’s not what I’m looking for, so I would appreciate it if you let me know where you saw it.


Once again thank you for your kind info :slight_smile:


#5

Dear ThaHandy,

Thank you for your great advice.

In fact, there is a guide for WIZ550web that has not been released. The reason was that the customer did not feel a great need.

However, I learned from your proposal that users could have needs more details guide. So, we will release some of the existing guides / tutorials.

http://wizwiki.net/wiki/doku.php?id=products:wiz550web:wiz550web_tutorial_kr

I hope you will review the link’s documentation and give me more advice.
Currently only Korean documents, but soon I will release English documents and additional contents.
(Depending on the schedule, the release may be slightly delayed.)

Again, Thank you sincerely.

Regards,
Eric


#6

@ UART part, my bad.

When testing I’ve lost track on which is which.
I got confused by the name and thinking AT command was for console and Data was for port2.
So in my opinion:
UART1 = Console/Debug/Program port (RS232 on the dev board)
UART2 = Data/AT command port (RS485/422 on the dev board)


#7

Ok, When we update the wiki this time, I will add a description of the functions of UART1,2.

Thank you for your feedback :slight_smile:


#8

I added it like below to Basic Webpages Demo

Serial Port (for Data & Debug / AT commands)
 - UART1 : Data/Console/Debug/Program port (RS232 on the dev board)
 - UART2 : AT command port (RS485/422 on the dev board)

The reason I added it to the Getting Start category is that it only makes sense when using GitHub code.


#9

Tutorial that was originally written in Korean was translated into English.

In addition, I have included some of your suggestions in the tutorial, and I will discuss them with existing developers and add more.

Please refer to the english tutorial link.


Thanks!


#10

Thank you for the tutorial, we’re getting there.

A few things:

curl -d “lip=192.168.11.100” http://192.168.11.100/config.cgi (to set only the “lip” parameter) example does not make sens if the config.cgi is not included in the example.

set_uart0(and 1)info.cgi uses databit=8 or 9 not 0 or 1 (get_uart0(and 1)info.cgi its indeed 0 or 1)

And set_diostate.cgi, set_diodir.cgi, set_dioalias.cgi example are incomplete.

My SET commands are correct as far I know, as I have debugged all of them them using wireshark.


#11

Oh, this is our mistake.

I will add and supplement the rest of the contents.

Thanks!