Jump to content
tinman

[Tutorial] Z-wave development

Recommended Posts

Posted (edited)

as already posted everybody can now play with Z-Wave SDK, as it has been completely released to the public.

 

To make it bit easier here small how to:

 

1 - you need to register on silabs.com first

2 - you need the Z-Wave SDK

3 - you need Keil Compiler License

4 - you need proper Keil Version

5 - you need to setup few things

6 - playing with examples

7 - ... and now you can compile your first project :)

8 - test your first z-wave firmware

 

---------------------------------------------------------------------------------------

 

1 - that simple, just go to silabs.com page and register

 

 ---------------------------------------------------------------------------------------

 

2 - once you registered, download the Embedded SDK (e.g. 6.81.01) 

Please login or register to see this link.


It is good idea to unzip it somewhere short-named, e.g. C:\ESDK

 

image.png.5803d4a730c9d8aa690ed6a572e544b4.png

 

---------------------------------------------------------------------------------------

 

3 - to get Keil license you can get one from Keil itself (go to keil.com and request test license), but you can use Silabs provided License as well:

 

Go to 

Please login or register to see this link.

and fill out the form, once you did it and requested your PSN will get displayed

 

image.png.dd729bfe11954320738e1adab3323648.png

 

You could download from the provided link the Keil Compiler, but it will not properly compile Z-Wave ESDK, you need different version

 

---------------------------------------------------------------------------------------

 

4 - go to 

Please login or register to see this link.

and enter the PSN under "Maintenance and previous Versions", click on submit

 

image.png.73b1e249107db939145a91be426087e6.png

 

you will get a list, download the 9.54a version (this is important)

 

image.png.4d9f75d0221098f3c6ed999474c3d2b5.png

 

---------------------------------------------------------------------------------------

 

5 - Now install the Keil Compiler to e.g. C:\Keil

 

After installation start it, go to File -> License Management -> Single-User License. Copy from there the CID and click on "Get LIC via Internet",

you will get forwarded to

Please login or register to see this link.

 

Fill out all data and click on submit - you will get an email (so don't use fake email) with License Number for your PC.

After you got it, go back to Keil uVision and enter the License Key into "New License ID ..." and click on "Add LIC" 

 

You need no to set your environment variables, which differ from OS to OS, just ggl for "How to Set Environment Variables in Windows xx"

You have to set two of them:

 

KEILPATH=C:\Keil\C51

TOOLSDIR=C:\ESDK\Tools

 

Now you can in principle start with compiling your first test firmware, but please check this PDF

 

image.png.3b446aaaff57522844b5bd2d2f0090ed.png

 

---------------------------------------------------------------------------------------

 

6 - let's play a bit first with provided examples, e.g. WallController

 

Open Command Prompt and got to "c:\ESDK\ProductPlus\WallController"

 

Now type "mk" and enter, you will get list of possible parameters, more about them in the PDF mentioned above 

 

image.png.3122162abc2fc4c9e6b58141523899e7.png

 

now you can enter mk "BOOT=BOOTLOADER_ENABLED" "FREQUENCY=EU" and compile it from command line, which is ok when you using your fav editor. 

 

In case you wish to use Keil uVision Editior, you need first to create Keil project file, so compile it once with additional parameter (compiling it once, will check if everything is being setup properly, not that something i wrong and you will spend hours thinking the changes you made to provided examples are the source of compiler errors hehe)

 

mk "BOOT=BOOTLOADER_ENABLED" "FREQUENCY=EU" "UVISION=1"

 

Once compiled, you will see the uVision Project File, open it 

 

image.png.ec393c9b076cadba7ae2d33be8198b5d.png

 

image.png.fb243ed9842fa5e9620fcd8bc5c15c6d.png

 

Now you need "some time", to read all the docs and understand how easy z-wave is :) 

 

---------------------------------------------------------------------------------------

 

7 - it is good idea to start with these two files:

 

image.png.f8a057e75e096713499698d55e05bdb8.png

 

Application Framework will help you a lot to develop simple things, all examples are z-wave plus certified, so it's good start from here.

 

---------------------------------------------------------------------------------------

 

8 - i will edit this point later ...

 

 

Another topic, with information how to diag z-wave problems is here ->

 

 

 

 

Edited by tinman
  • Like 2
  • Thanks 5

Share this post


Link to post
Share on other sites
  • Topic Author
  • small update - Silabs have not yet updated / included al documents provided by Sigma Designs / ZTS, so it make sense to check from time to time what's new on their web.

    Share this post


    Link to post
    Share on other sites

    Hi @tinman and thank you for sharing this information here.

     

    One question regarding z-wave is made public:

     

    Shall we be more worried about security of our z-wave home systems now when everything is made public?

     

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • 1 hour ago, Sankotronic said:

    Shall we be more worried about security of our z-wave home systems now when everything is made public?

     

    the only "dangerous" tool is zniffer, as it gives anybody lot of information's about z-wave networks in the neighbourhood (which is not the case when talking about installer tools like CIT from z-wavealliance.org or Toolbox from zwaveproducts.com). However, too see does not means to be able to do something, especially when security is being enabled (S0 is sufficient, but it produce more traffic than S2). Open does not means insecure :)

     

    • Thanks 1

    Share this post


    Link to post
    Share on other sites
    Posted (edited)

    @tinman

     

    First, thx for sharing this info.

    Can't wait to get my hands on the Keil compiler.

     

    In step 3, what Target MCU do I need to pick?

     

    Edited by BitBucket

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • Just now, BitBucket said:

    Can't wait to my hands a the Keil compiler.

    In step 3, what Target MCU do I need to pick?

     

    actually you don't have to pickup anything, by default it is zw0301 (even if currently SDK will only compile for zw0500 and not anymore for zw0300), because the uvision project generator and linker scripts are taking care of everything for you, the best start is to take the "MyProductPlus", compile it from command prompt with "UVISION=1" and then open the created uVision project (and start from there to develop). Sure, you can play directly with makefiles if you wish^^ 

     

    There are in SDK two dirs, "ApplicationUtilities" (general zwave developemnt) and "ApplicationCommandHandlers" (zwave application framework - the easy way to develop), they are very useful and takes lot of works from you. It make sense to read the app. prog. guide and application framework guide.

     

    As far i can see, not all documents from ZTS has been published on silabs website, but that's because they cleaned up a lot, i have tons of historical documents from older SDK versions, where however some can be downloaded on request from silabs page.

     

    Share this post


    Link to post
    Share on other sites

    @tinman

     

    Sorry, my question was a bit unclear.

     

    On 21-4-2018 at 5:19 PM, tinman said:

    Go to 

    Please login or register to see this link.

    and fill out the form

    The form asks me to select a Target MCU but which one?
    No Z-Wave CPU listed. Maybe Silabs changed the form, I don't know.

     

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • Just now, BitBucket said:

    The form asks me to select a Target MCU but which one?

    No Z-Wave CPU listed. Maybe Silabs changed the form, I don't know.

     

    ahh ok, well take any 8051Fxxx, it does not matter for now. I asked Silabs about test license for zwave mcu, waiting for answer.

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • Just now, BitBucket said:

    @tinman

    Thx, got the PSN. Why D/L Keil 9.54a and not a newer version?

     

    because of critical linker scripts and banking problems with other versions, the firmware will not compiler or not run with newer version.

    Keil uvision 9.54A is good for SDK 6.71.03 and 6.81.01, both are available on silabs page (6.81.xx supports smart start, 6.71.xx not).

    Share this post


    Link to post
    Share on other sites

    @tinman

    2 minutes ago, tinman said:

    because of critical linker scripts and banking problems with other versions, the firmware will not compiler or not run with newer version.

    So you already tried never versions ?

    Usually a newer compiler has some bugs resolved.

    This is a bad thing. Maybe we find time to look into this later.

    Will go for 9.54a for now. Thx and good night.

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • 6 minutes ago, BitBucket said:

    @tinman

    So you already tried never versions ?

    Usually a newer compiler has some bugs resolved.

    This is a bad thing. Maybe we find time to look into this later.

    Will go for 9.54a for now. Thx and good night.

     

    Keil "introduce" very often new bugs in newer versions, for sure you can try 9.57 (i haven't - i stick always to what manufacturer recommend), but you can as well ask silabs if they tested it already.

    Share this post


    Link to post
    Share on other sites
    Posted (edited)
    9 hours ago, tinman said:

    by default it is zw0301

    Do you know, is there any lowcost breakouts of ZMxxxx chip on market? (not a SigmeDesign SDK for $2k)

    For development purposes? For commercial?

    Thans in advance

    Edited by jack.daniels

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • you can buy modules, chip, or regional boards from e.g. digikey -> 

    Please login or register to see this link.

    or you can buy e.g. cheap wall controller like ZME_WALLC-S (from zwave.me) - it does have only 4 switches, 2 leds, zw500 chip, connections for programmer, and can be easily used for the wall controller example. 

    • Thanks 1

    Share this post


    Link to post
    Share on other sites
    1 hour ago, jack.daniels said:

    Do you know, is there any lowcost breakouts of ZMxxxx chip on market?

     

    Not really, not yet... Will it come? If the Chinese market likes Z-Wave, they might assemble one for a few $ It is possible. On Aliexpress: ESP8266 is $3 and ESP32 breakout is $6.

     

    Cheapest Z--Wave on Aliexpress/e-bay/amazon, I think, is  OOOPS... This is the Fibaro forum :-)

     

    Maybe by 2nd hand Fibaro device?

     

    47 minutes ago, tinman said:

    cheap wall controller like ZME_WALLC-S (from zwave.me)

     

    Excellent advice! I have one and maybe I can finally fix it :-)

    I would say... Use other power source than CR2032, it is rather weak.

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • 3 hours ago, petergebruers said:

     

    Not really, not yet... Will it come? If the Chinese market likes Z-Wave, they might assemble one for a few $ It is possible. On Aliexpress: ESP8266 is $3 and ESP32 breakout is $6.

     

    Cheapest Z--Wave on Aliexpress/e-bay/amazon, I think, is  OOOPS... This is the Fibaro forum :-)

     

    Xeon one hang low have some :P

    Please login or register to see this link.

    • Thanks 1

    Share this post


    Link to post
    Share on other sites
    Posted (edited)
    3 hours ago, tinman said:

    Please login or register to see this link.

     

    OMG ;D

     

    "Currently unavailable" - you ordered all available stock? ;-)

     

    Thanks for the tutorial! Build example: OK. Edit code in uvision: OK. Flash onto my Z-Stick: OK, but no more USB loader so I'll have to go the "serial" route. Oh. Well.

     

    Edit... I'm back in business. First had to perform surgery, because UART0 pins are not soldered on a Aeon Z-Stick... Then took me a while to understand, the programmer only works with a CP2102 USB to UART bridge, which I do have, but wasn't using for my first attempts (FT232H). My Aeon Z-Stick starts to look like a Frankenstein incarnation :-) - FrankenZwave?

     

    IMG_20180423_164739.jpg.1e1e6cd0a5beffdfeb8136cb1867f9da.jpg

     

    Edited by petergebruers

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • 6 hours ago, petergebruers said:

     

    OMG ;D

     

    "Currently unavailable" - you ordered all available stock? ;-)

     

    i remember they had lot of these Xeon zwave modules, but now their whole shop seems to be empty.

    To be honest, i needed once extra board, but ZM5101 (2x UART), and not ZM5202 based, that's how i found them.

    Finally it ended up with the one below ...

     

    6 hours ago, petergebruers said:

     

    Thanks for the tutorial! Build example: OK. Edit code in uvision: OK. Flash onto my Z-Stick: OK, but no more USB loader so I'll have to go the "serial" route. Oh. Well.

     

    it takes some time to find out the proper configuration (e.g. which pin is controlling external flash/eeprom, boot mit vcp, board for which will get compiled - in your case ZDB5101 or ZDB3502, pin swap ... )

     

    6 hours ago, petergebruers said:

     

    Edit... I'm back in business. ... 

     

     

    :) 

     

    6 hours ago, petergebruers said:

    FrankenZwave?

     

    broken zwave.me stick, re-used as (half) ZDB5101 dev board. Sure, 1hr work was not really cheaper than original ZDB5101,

    but hard to resist having all parts/things here.

     

    zme_for_pgm2.jpg.e8bf195785e4ac39aa26522c48025d1e.jpg

    Please login or register to see this attachment.

     

    Share this post


    Link to post
    Share on other sites
    11 hours ago, tinman said:

    broken zwave.me stick, re-used as (half) ZDB5101 dev board. Sure, 1hr work was not really cheaper than original ZDB5101,

    but hard to resist having all parts/things here.

    Awesome picture, I'd say that is "SpiderZwave".

    I am very happy to see... you still use perfboard, just like me, and magnet wire to connect. At least, for those "one-off projects. ;-) Now I do not feel so old anymore.

     

    11 hours ago, tinman said:

    it takes some time to find out the proper configuration (e.g. which pin is controlling external flash/eeprom, boot mit vcp, board for which will get compiled - in your case ZDB5101 or ZDB3502, pin swap ... )

    Thanks for the hints. Reading the source, and looking at your SpiderZwave, I see have two or three options to make my FrankenZwave do something (I'd like to control the onboard RGB LED). Either (1) move buttons/leds onto the correct pin, (2) modify the code to match the board, or (3) activate some compile time options (like "pin swap"). The weather is bad in Belgium, I'll start by RTFM ;-)

     

    It is nice to have the code:

    Please login or register to see this code.

     

    On 4/23/2018 at 12:30 AM, tinman said:

    because of critical linker scripts and banking problems with other versions, the firmware will not compiler or not run with newer version.

    Keil uvision 9.54A is good for SDK 6.71.03 and 6.81.01, both are available on silabs page (6.81.xx supports smart start, 6.71.xx not).

    I already had C51V957 on my laptop, so I did a quick test and I can confirm it (still) does not work... Sounds like banking issue:

     

    Please login or register to see this code.

     

    Share this post


    Link to post
    Share on other sites

    The topic has been moved from "

    Please login or register to see this link.

    " to "

    Please login or register to see this link.

    ".

     

    Temat został przeniesiony z "

    Please login or register to see this link.

    " do "

    Please login or register to see this link.

    ".

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    ×