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

 

 

 

 

 

 

Advertisements

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