How to configureWiz550S2E/Wiz550WEB using WIZnet Configuration Tool

Introduction

This post introduces the usage of configuration tool for WIZnet Product  Wiz550S2E / Wiz550WEB. This configuration tool provides two ways to configure our product in GUI mode and Command line mode, so users can choose a way depending on their convenience.

For example, if you want to test several functions or changes on a product, then GUI mode would be a better choice. In the other hand, if you want to update same information of multiple products in factory repeatedly, then Command line mode would be much better and convenient.

This post will shows how to use the configuration tool in GUI mode and Command line mode.

Before starting, refer following link for creating runnable jar file for our source code.

Exporting Runnable Jar from project for WIZnet Configuration Tool

 

Gui Mode

In order to use GUI mode, execute runnable jar without arguments

tool_dsc1

tool_dsc2

  1. Connect modules which will be configured
  2. Click [Search] to find connected modules.
  3. Run other functions as you need.
    • Setting : update changed information
    • F/W Uploading : upload firmware using TFTP server
    • Reset : reset module
    • Factory Reset : reset module as factory setting

Command Line Mode

When you want to configure modules in Console Mode, then use argument with runnable jar file in command line.

Search Modules

tool_dsc3

-b : search available modules and display found modules

Firmware Upload

tool_dsc4

-m : designate mac address

-f : firmware filename to be uploaded on module

-s : TFTP server address

-t : TFTP server port [default:69]

-p : setting password of module

to upload new firmware on module, the module has to be set up with correct network information (and TFTP server should be reachable).

e.g) If TFTP server address is 192.168.111.110

Module’s IP should be 192.168.111.*

 

Functions with parameters

Users can change module’s information manually using parameters.

Parameter Format

Command[2Letters] Data

Command and data should be concatenated.

E.g) IP192.168.111.248 DH1 BR115200

Command List

Command Data Description
DP Display Information
RT Reset Module
FR Factory reset
MN WIZ550SE, or WIZ550WEB.. Model name
LI Local IP address
SM Subnet mask
GW Gateway
HI Host IP address
LP Local port number
RP Remote host port number
WO CLIENT(0)/SERVER(1)/MIXED(2)/

UDP(3)

Working mode
IT Inactivity timer(0~65535ms)
RI Reconnect interval(0~65535ms)
BR 300/600/1200/1800/… 115200.. Baud rate
DB 7/8/9 Data bits
PR NONE(0)/ODD(1)/EVEN(2) Parity
SB 1/2 Stop bits
FL NONE(0)/RTSCTS(1)/RS422(2)/

RS485(3)

Flow control
AT Enable(1)/Disable(0) AT Command
TC FFFFFF Trigger cod(fixed 3 bytes in hex)
PT Serial data packing interval

(0~65535ms)

PS Packing size(0~255)
PL 0/1/2/3/4 Packing delimiter length
PD FFFFFFFF Packing delimiters in hex(max 4 bytes)
PA 0/1/2 Packing data appendix
DH Enable(1)/Disable(0) DHCP flag
DN Enable(1)/Disable(0) DDNS flag
DS DNS server IP
DO Domain
NP Connection password
SP Setting password

Reset Module

tool_dsc5

-m : designate mac address

-p : setting password

RT : command to reset

 

 

Factory Reset Module

tool_dsc6

-m : designate mac address

-p : setting password

FR : command to factory-reset

Display Module’s Information

tool_dsc7

-m : designate mac address to manipulate

-p : setting password

DP : command to display module

 

Change Module’s Information

tool_dsc8

tool_dsc9

-m : designate mac address

-p : setting password

[parameter list]: command and data sets to be applied

e.g)

DH1 (enable DHCP),

MNWIZ550S2E_TEST(set Module name as WIZ550S2E_TEST)

Exporting Runnable Jar from project for Wiznet Configuration Tool

Introduction

This post introduces how to create runnable file from Wiznet github project. This configuration tool provides 2 ways to configure our product in GUI mode and Console mode, so users can choose a way depending on their convenience.

 

Project file(Github)

 

https://github.com/Wiznet/WIZnet_Configuration_Tool

 

Exporting project file

  1. Choose project on Project Browser and click right-button of mouse
  2. Select [Export]-[Java]-[Runnable JAR file]

1

3. In Launch configuration choose WIZnet_Configuration_Tool and designate exported   file path.

2

Handling with Project ‘configuration_tool’ is missing required library Error

When this project is imported and builded, following error might occur

3

This error occurs because Library path is set as absolute path in Eclipse, so this error can be solved following way. (This solution will be updated later)

  1. Select [x]-marked library and click [Edit] button
  2. Select corresponding library in your [Eclipse installed path]\plugins folder(Versions might be different depending on your develop environment)

45

 

Setup Window Builder for Java GUI

Wiznet Configuration tool is based on Java GUI Tool,Window Builder, so you need to install to make use of our source code.

  1. open eclipse.org/windowbuilder
  2. move to the Download page

6

3.On the red-squared area, click the download link site(Update Site), which suitable your Eclipse version.(Integration Version might be unstable, so choose Release Version)

7

4.When you click the link, a page below will show up (in this post I clicked “4.3(Kelper)”

8

5.Follow the instructions on the page, then plug-in will be installed.

6.Run Eclipse and select “Help -> Install New Software..”

9

7.In the pop-up window, clink [Add…] button and “Add Repository” window shows up.

10

8.In “Add Repository” window, enter arbitrary name in “Name” box, and copy and paste the address of the update site in “Location” box. (refer to red-squared box in following picture)

11

9.When “OK” button clicked, following contents will show up. Here, click “Select All” and “Next>” buttons

12

10.Items to be installed will show up. Confirm and click “Next >” button.

13

11.Accept the term and the license agreement. Click “Finish” button.

14

12.Installing will start

15

13. After finishing click “Yes” button and restart Eclipse.16

14.After restarting Eclipse, to activate Window Builder click 1. [Window -> Show Toolbar] and [Maximizing button] on upper right side.

17

 

 

 

 

 

 

WIZ550web interacting with professional homeautomation KNX bus

Prerequisite – Why KNX

I’ve been renewing a part of my house and as I always wanted to have some home automation – the decision was set. It was not easy and I was quite long considering what to take. There were so many wireless and wired solutions available. I did not want to go for wireless – at least not as primary system. I already used some remote controlled plugs – but I’m sick of changing empty batteries. Sometimes messages got lost, so I had to press the buttons twice. So the decision was set to take some bus system. There are a couple of vendors that provide actuators and sensors. There are also some free implementations available, like Freebus, which directly couple to the bus – so you can build your own devices.

For me there were some criteria important: reliable function of basics, no battery changes, interaction with my Fhem home server possible. The reliability was most important for me. Basic functions like switching light on and off, should always work. A worst case scenario, which I was thinking of, was: I’m in a bright house in the evening on the way to bed, and then the home server got messed up by some update or reconfiguration and I cannot switch my bedroom light on, and the other part of the house off! So my decision was, all the parts for basic functions have to be “off the shelf”. All the additonal functions (automatic light switching, automatic blind control, etc) don’t need the same level of reliability (Even i did not require that in the beginning, I reached a quite high level in the end). Even I like to hack or build stuff on my own – I want to have the possiblity to just “buy” spare parts if something breaks.

I thought this would be a good base. KNX is based on the EIB (European Installation Bus) and uses usually Green wires similar to telephone cables 2 x 2 x 0.8 mm2. Two of the wires are used for the bus communication and can also power devices with 29V. The other pair can be used for an auxiliary power source in case your device needs more power, or the bus communication is disturbing.

So finally my home got (at least partially) touch panels in the rooms for light, blind and heating control as KNX sensors. The lamps are controlled by KNX actuators directly from the mains distribution.

Based on that system I’m now able to implement fancy home automation stuff.

automated light – motion sensors control with server

My wife often complains that I do not shut the light off. But when I want to return soon, I let it on. So I decided to go for an automated solution with motion detectors- thanks to KNX it’s an easy task. You just set the actuator to stairway mode with. In that mode the light will go automatically off after, e.g., 90 seconds. As I have dimming actuators it’s even possible to set some warning time, so 20 seconds before the light will go off it will dim to 50% – so even something goes wrong I can still use the remaining light to switch back to 100%. So the configuration of actuator was an easy task, but when I wanted to order PIR sensors for the KNX bus, I almost fell of my chair. 100EUR each – and I wanted to have around 10! That’s why I thought here I go for my own development. I found on ebay some PIR sensor modules for around 1 EUR (!) each from China . As I was not in a hurry I ordered and around 3 weeks later they arrived. evb-pir

Right after the modules arrived I took one and connected it to one GPIO of a WIZ550web-EVB. The output of the PIR module is 3V so it can go to the GPIO of the module directly. This is good, as I don’t want to use an EVB for my “production” use and just the module itself. The WIZnet module has a preinstalled demo web page, which makes it possible to directly access the inputs and outputs. So after powering up I was immediately able to see that the Webpage showed Input D8 was high for some seconds,  when I was moving around.

First I thought there was an instability during boot. Whenever I pressed the Reset button on the board, the module did not come up and was waiting in the bootloader! But as I figured out this is not a bug but a feature. D8 has a second meaning during boot – in case you mess up the application code, you can pull D8 high during reset and the module will wait in the bootloader! This was not so good in my case, as soon as I moved my hand in direction of the Reset pin, the PIR module raised the level of D8 to high! To circumvent this for development, I just moved to another Input pin. (As look ahead to part2: I recompiled the bootloader and removed this feature, as i wanted to use all input pins without limitation – in case something really goes wrong during development, I can easily reflash the module via serial line – but if D8 is high during boot while in production use my application will “hang”)

Eibd on home server

Fine now I have a website with a virtual LED showing motion. I have an Alix-D3D board (this could be an Raspberry or something else today) hosting my FHEM server. To communicate with the KNX bus I need some Modem. I ordered a TUL from busware.de which can be connected via USB. The TUL is not standalone you still need an eibd on the system to communicate with the bus. There are also some gateways on the market that have already implemented it, but they cost more.  Eibd can also be a gateway to the ethernet. This is handled by multicasts, so the KNX bus is then available also as let’s say “virtual bus” on the ethernet also. IP devices can join that multicast group and get also all messages same as they were on the physical TP bus. gateway(look ahead: I will use that gateway function later)

Anyway, for my first try I don’t use that gateway functionality.But as the Eibd is running on that system it is possible to directly execute the “group(s)write” command on the command line and send a group message to the KNX bus.

Now I wrote a small script that is getting the output of WIZ550-web via php (php5-curl) every second. If D8 is “1” then ‘ON’ is sent to the actuator. This worked out of the box, but I’m not happy with it. I absolutely don’t like the polling every second. Even it’s my LAN that can easily manage that little data, it hurts my engineers heart if unneccessary data is constantly transmitted with http overhead every second. It’s a little bit like a dripping watertap. So as I had formerly seen, Eibd can be setup as a Gateway, so it’s possible to send directly a multicast to switch on the light…

Part2: Talk “Directly” to KNX devices via Gateway.

com-waysMy next idea was to write my own Firmware for the WIZ550web. systemAs the Eibd is transferring the KNX bus data to the ethernet, the module shall directly communicate with the KNX bus. So no more polling every second, just one packet for switching on the light.

Another goal for me is receiving multicasts on the module to get feedback. I wanted to control the module also. The module needs some information if it is currently night – because at night I don’t want to have a bright bed room in case the cat walks through…

(Look ahead: In part 3 I’ll also use this to control my projector and my power amplifier)

So first I had to install the toolchain and get the source code of WIZ550web.

Toolchain – Compiler and Eclipse

The following two articles describe how to install the Toolchain on a Linux System:

https://wizneteu.wordpress.com/2015/03/19/install-eclipse-and-compiler-for-stm32-with-w5500-on-linux/

https://wizneteu.wordpress.com/2015/03/19/flashing-stm32-via-serial-line-on-linux-stm32flash/

Import Source code to Eclipse

The following article is describing how to import an repository to eclipse. It also shows how to fork a repository. For further processing I suggest you sign up for a free github account, then fork the repository directly on github.com.Bildschirmfoto vom 2015-03-31 16:16:24 When you fork it to your account you are able to commit your changes to your repository so others can also participate. I have a branch “freebus” beside my “master” branch. That’s what you need to use when you are in eclipse.

https://wizneteu.wordpress.com/2015/03/19/import-github-project-of-the-webserver-wiz550web-to-eclipse/

https://github.com/7tobias/WIZ550web

Here you can see a picture of the Git Repository view of Eclipse:

eclipse-git

 

Currently I use a small python script to catch the multicast packets that are already on the bus, and I replay them with my module. It would be even nice to configure the module via the ETS software but that’s something for the future. For the beginning I’m fine with it how it is currently.

The module is checking the status of the input pins, as soon as there is a rising edge on a watched pin my multicast is sent out and the light is on…

Using the plain module

powerregulator web-wpowerAs I don’t need the complete EVB for my “production use” I bought some 3V voltage regulators. I added some jumper cables, so I can connect the power source directly to the module. As i don’t have any parts beside the power regulation I skip a special EVB; all PIR outputs are connected directly to the input pins of the module. In the picture on the right side you see only one PIR.

 

Part3: Control of Projector, Projection Blind and AVR Power Amplifier

My next step is using a second module to control my home cinema in my living room.

I have:

  • Projection blind
  • Projector Epson
  • AVR Denon power amplifier

Projection blind control

My blind is motor driven and has a RF remote control. So I soldered just some cables in parallel to the buttons of my remote control. These are attached to the relays of the EVB. When I want to roll up or down, I just have to close the circuit via the relay for a certain time, e.g., 0.3 seconds similar to what a human would do.

Projector Epson

My Projector has a RS232 port. It’s possible to control many things on that port and ask for error codes. But my primary use case is just to switch it off and on. All the other settings stay currently the same. So just have to wait for “:” as command prompt then I can send “PWR ON” or “PWR OFF” with 9600 bps on the serial line and the projector is starting or shutting down. If I ask with “PWR?”, I can get “PWR=01” or “PWR=00” as answer. I ask this every couple of seconds, as I also want to send feedback to the KNX Bus in case someone is switching on my Projector manually – so my touch panel is showing always the correct state.

AVR Power Amplifier

The Denon AVR is in one thing ahead of the Projector. Every time some setting is changed (input, volume, power, etc) this information is directly sent to the serial line. So I do not need to ask the AVR regularly for changes. That’s quite nice. Beside that the protocol is documented and not very complex. Basically I need power on and off the main zone. I also need to select the input source, and I want to control the volume of the main zone.

 

Conclusion

This setup is working well. I do not regret that I went for this solution combining KNX with my self made addons. I’d go for it again if I had to choose. There is still plenty of room for enhancements. I’ll report when there is something new.

Import Github project of the Webserver WIZ550web to Eclipse

In the load-two articles I Showed how to install the toolchain and how to flash the binary with stm32flash. This article will show how to import the project into eclipse with git Directly from Github. Git is a very powerful version managment system. GitHub is a platform implementing a git server with more nice tools for collaborating. If you do not know it yet, give it a try – you will be amazed how easy collaborative work will be.

So first we have to decide Which repository we will use. The primary repository can be found under https://github.com/Wiznet/WIZ550web. But at the time of writing this article there were some small errors as the case of some letters in file names were different. So on this case sensitve operating systems lead to compile errors. To circumvent this I forked the project and you can therefore clone my repository https://github.com/7tobias/WIZ550web

In case you want to publish your work so to others it would be even better to fork one of the mentioned repositories into your own github account. Then you can push your changes to your own github repository. You should give it a try, it’s very easy – and as public repositories are free, it does not even cost you money.

In the Following I’ll clone my own repsository I forked in github before.

First start eclipse and just go to the “File” menu and choose “Import …”. There you have to select “Git” / “Projects from Git”. In the next dialog you have to choose “Clone URI”.

 

Screenshot from 2015-03-18 15:25:55 Screenshot from 2015-03-18 15:24:19

In the next dialog enter the URI – host and repository path will be filled out automatically. In case you forked the repository to your own github account, you should enter your username and password into this dialog to be able to push your changes later.

The remaining steps are of basically “Next”, “Next”…, and “Finish”

Screenshot from 2015-03-18 15:26:17 Screenshot from 2015-03-18 15:27:15 Screenshot from 2015-03-18 15:27:27

Now you have to click on “Workbench” to see the following window. Now, you are ready and can build the project.

Screenshot from 2015-03-19 09:42:13

by TW

Flashing STM32 via serial line on Linux – stm32flash

For Windows users there is a tool called “Flash Loader Demonstrator”. This obviously does not run on Linux, but there is also a possibility to natively flash a binary (or hex file) in case you cannot use the WIZnet update tools that use the bootloader. So this is basically needed when you want to upgrade the bootloader. In case you don’t have subversion installed you need to do the following in a console:
tw@kallisto:~# sudo apt-get update && sudo apt-get install subversion

After that you have to first checkout the latest sourcecode of the tool

tw@kallisto:~$ svn checkout http://stm32flash.googlecode.com/svn/trunk/ stm32flash

Then you can compile and install the tool

tw@kallisto:~$ cd stm32flash && make && sudo make install

Bildschirmfoto vom 2015-03-18 14:17:16

Now you have to bring the board into boot mode. There is usually some BootEnable pin. Hold that booten pin during power up or reset of the module. After that, the module is waiting for the following command:
tw@kallisto:~$ stm32flash –w combine.bin –v /dev/ttyS0

Bildschirmfoto-Namenloses Fenster

Generate Padding for the Bootloader

There is one important difference between the Windows version of Flashloader Demo and the stm32flash. In the current version of the stm32flash the complete flash is erased before programming. As long as you have only one binary for the application this is no issue. But in case you have a bootloader and an application the bootloader is erased when you flash the application.
As a workaround for this you have to combine the two files.
How to combine Bootloader and Application file.

As an example i’ll show how to combine the bootloader and application file of WIZ550web. As per note on http://wizwiki.net/wiki/doku.php?id=products:wiz550web:wiz550web_download the bootloader shall go to the adress 0x8000000 and the application shall go to 0x8006000. So as we will copy both files together the bootload needs some padding to be exactly 0x6000 = 24576 in size.

Bildschirmfoto vom 2015-03-18 14:30:56So first we find out the size of the bootloader. In this example it is 23312 bytes in size. So we just calculate 0x6000 – 23312 = 1264. To get the padding we just dump 1264 bytes from the device /dev/zero which contains an unlimited number of zeros into some file, e.g., zeroes.bin.

tw@kallisto:~$ dd if=/dev/zero of=zeroes.bin bs=1 count=1264

After that, we just add these zeroes.bin to the bootloader file.

tw@kallisto:~$ cat zeroes.bin >> WIZ550web_Boot.bin

If you check now with ls, you can see that the size is now exactly 0x6000 = 24576 bytes.

Bildschirmfoto vom 2015-03-18 14:48:01

Now we can combine bootloader and application file in the same way. Later when you compile only the application, you can reuse the padded bootloader file, and only need this last step.

tw@kallisto:/tmp$ cp WIZ550web_Boot.bin combine.bin && cat WIZ550web_App.bin >> combine.bin

Bildschirmfoto vom 2015-03-18 14:55:16

tw@kallisto:~$ stm32flash –w combine.bin –v /dev/ttyS0

There is one important difference between the Windows version of Flashloader Demo and the stm32flash. In the current version of the stm32flash the complete flash is erased before programming. As long as you have only one binary for the application this is no issue. But in case you have a bootloader and an application the bootloader is erased when you flash the application.
As a workaround for this you have to combine the two files.

How to combine Bootloader and Application file.

As an example i’ll show how to combine the bootloader and application file of WIZ550web. As per note on http://wizwiki.net/wiki/doku.php?id=products:wiz550web:wiz550web_download the bootloader shall go to the adress 0x8000000 and the application shall go to 0x8006000. So as we will copy both files together the bootload needs some padding to be exactly 0x6000 = 24576 in size.

Bildschirmfoto vom 2015-03-18 14:30:56So first we find out the size of the bootloader. In this example it is 23312 bytes in size. So we just calculate 0x6000 – 23312 = 1264. To get the padding we just dump 1264 bytes from the device /dev/zero which contains an unlimited number of zeros into some file, e.g., zeroes.bin.

tw@kallisto:~$ dd if=/dev/zero of=zeroes.bin bs=1 count=1264

After that, we just add these zeroes.bin to the bootloader file.

tw@kallisto:~$ cat zeroes.bin >> WIZ550web_Boot.bin

If you check now with ls, you can see that the size is now exactly 0x6000 = 24576 bytes.

Bildschirmfoto vom 2015-03-18 14:48:01

Now we can combine bootloader and application file in the same way. Later when you compile only the application, you can reuse the padded bootloader file, and only need this last step.

tw@kallisto:~$ cp WIZ550web_Boot.bin combine.bin && cat WIZ550web_App.bin >> combine.bin

Bildschirmfoto vom 2015-03-18 14:55:16

by TW

Install Eclipse and Compiler for STM32 with W5500 on Linux

This installation was done on Debian Wheezy

Contents Installation and Configuration of

  • Build Essential
  • GNU GCC ARM Embedded tool chain
  • Oracle Java SE
  • Eclipse
  • GNU ARM Eclipse Plugins

Tool Chain – Install Build Essential

First you have to install the essential tool chain. Go to a root terminal,e.g., with “su” and do the following:

root@kallisto:~# apt-get update && apt-get install build-essential

Tool Chain – Install GCC ARM Embedded GNU

Go to https://launchpad.net/gcc-arm-embedded and download the latest “Linux installation tarball”. Then extract it. Most likely your filename will not be exactly gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2 but a little bit different – so adjust this command line to name of the downloaded one.
root@kallisto:/home/tw/Downloads# mkdir /usr/local/arm && tar xjvf gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2 -C /usr/local/arm

If you want to have it available for you users without the need for absolute pathes you can symbolic link it to the folder /usr/local/bin

root@kallisto:~# ln -s /usr/local/arm/gcc-arm-none-eabi-4_9-2014q4/bin/arm-none-eabi-* /usr/local/bin/

If you like, you can check this from the user account:

gccversion

JAVA SE Installation

There are no Oracle Java SDK repositories for Debian Wheezy, but you can add the ubuntu repository.

root@kallisto:~# echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" >> /etc/apt/sources.list && echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" >> /etc/apt/sources.list && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886

then install Oracle JAVA 8 after updating the repository:

root@kallisto:~# apt-get update && apt-get install oracle-java8-installer

If you like, you can check this from the user account:

Bildschirmfoto vom 2015-03-18 11:18:53

Eclipse Installation

First go to  http://eclipse.org/downloads/ and download the latest Version of “Eclipse IDE for C / C ++ Developers” – depending on the Java Version you installed you should go for 32bit or 64bit. As my Java is 64bit I’ll go for 64bit.

Bildschirmfoto vom 2015-03-18 11:29:22

Now extract eclipse:

root@kallisto:/home/tw/Downloads# tar xzvf eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz -C /usr/local/

Bildschirmfoto vom 2015-03-18 12:40:48

On my Debian Wheezy Eclipse Luna crashed during start (https://bugs.eclipse.org/bugs/show_bug.cgi?id=430736) . So in case your eclipse doesn’t start either you also have to execute “export SWT_GTK3=0” before the start of eclipse. You can make this persistent with:

tw@kallisto:~$ echo "export SWT_GTK3=0" >> ~/.profile

GNU ARM Eclipse Plugins

On the eclipse IDE, go to the Menu line and select  “Help” -> “Install New Software”. The following window will appear, where you have to click “Add”.

Bildschirmfoto vom 2015-03-18 12:56:37

There you have to enter the following data.
Name: GNU ARM Eclipse Plugins
Location: http://gnuarmeclipse.sourceforge.net/updates

On the next page, just select “GNU ARM C/C++ Cross Development Tools” and after some “Next” and “Finish” clicks the installation is finished.

WIZ550WEB-EVB controls power supply of WIZ107SR-TTL-EVB – part #2

First we need to determine the command that will be sent to the webserver to toggle one of the outputs. We therefore make use of the wireshark program to capture the http stream that will be sent to the webserver after having clicked a button on the WIZ550WEB-EVB website.

Picture 1: Screenshot of wireshark
Picture 1: Screenshot of wireshark

After having found the right tcp stream we can figure out, that we simply have to send this POST request to our webserver (IP: 192.168.111.182):

“pin=6&val=0” http://192.168.111.182/dout.cgi

 This can be done with the use of the cURL package – this package can send HTTP POST requests from the command line and act as if it was a user clicking on a web page. The simple. but complete command to send a HTTP POST request with cURL is:

curl –silent –output out.txt –data “pin=6&val=1” http://192.168.111.182/dout.cgi

This command forces the relay on output #6 of our WIZ550WEB-EVB to close. In the same way the relay can also be forced to open again by simply changing the value of “val” to 0. If the relay is closed, the WIZ107SR-TTL will be powered on. Including these requests into a small bash script can automate the power cycling really easy – we just have to add some wait states for the right timing and everything can be read in our PuTTY log clearly. As an example a bash script could look like this:

while [ true ]; do
echo “module on”
curl –silent –output out.txt –data “pin=6&val=0” http://192.168.111.182/dout.cgi
sleep 15
echo “module off”
curl –silent –output out.txt –data “pin=6&val=1” http://192.168.111.182/dout.cgi
sleep 5
done

In this screenshot you can see our bash script toggling the WIZ107SR-TTL operating voltage and the PuTTY log for the serial console, as well as the 550WEB Demopage that shows us the state of the relay #6:

screenshot1
Picture 2: Overview

Our primary goal was to check the long-time functionality of the WIZ107SR-TTL dns functionality – we can clearly see that if the DNS does not resolve properly or cannot be reached, that there are plenty of error messages on the serial interface of the WIZ107SR-TTL-EVB:

DNS fail log
Picture 3: DNS fail log

Using the log functionality of PuTTY we can write every boot sequence of the WIZ107SR-TTL to a text file. There are plenty of tools that can easily analyse this log file for error messages. In our first testing sequence of 600 power cycles of the WIZ107SR-TTL we did not have one failure.

Please feel free to contact us  at support AT wiznet DOT eu in case you have any questions regarding this article – fk.