Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


[Tutorial] Z-wave development


tinman

Recommended Posts

I post, because I hope it inspires other users to do development on Z-Wave Soc...

 

I adapted the SwitchOnOff project, to turn my "FrankenZwave" (Modified Z-Stick, see a few posts back for photo) in to a simple LED on/off light.

 

I am an amateur, but I toy with MCUs and I own thre Z-Uno boards so I do not really start from scratch. With this background, it took me about 20 hours to read most part of the relevant docs, debug the example, understand how the various objects and source files fit together, then adapt the code to fit the switch and LED on the FrankenZwave. I attach the source code.

  • I added defines to the end of the Makefile, so I could debug parts like the key scanner and GPIO, it outputs via UART0.
  • I created io_zstick.c and io_zstick.h, it replaces io_zdp03a. Actually, I cloned that file and adapted it.
  • I replaced S2 for inclusion with S1 triple click.
  • Apart from soldering wires to UART0 there are no board modifications.

Now I've got this going (I included it on my Z-Way server) I can think of something a bit more exciting, like RGB control of the LED. But then I have te read about that command class and implement the necessary code.

 

Would I recommend it to anyone?

  • If you know "Arduino" and just want to make devices, I'd say "no", you're better off with a Z-Uno. Less to learn, faster result. And an existing community!
  • If you want to do serious development... The question is: how long will it take them to release an new SDK for the 700 chip? The PDK uses an new programmer and it is still "coming soon". 

    Please login or register to see this link.

  • If you just like to play with this and improve your understanding of Z-Wave, I do think it is worth it!

Unzip this in your edk (e.g. C:\esdk\ProductPlus\ZstickSwitchOnOff) and follow @tinman's instructions.

 

Please login or register to see this attachment.

 

  • Like 1
Link to comment
Share on other sites

  • Topic Author
  • 8 hours ago, petergebruers said:

    I adapted the SwitchOnOff project, to turn my "FrankenZwave" (Modified Z-Stick, see a few posts back for photo) in to a simple LED on/off light.

     

    nice :)

     

    8 hours ago, petergebruers said:
    • If you want to do serious development... The question is: how long will it take them to release an new SDK for the 700 chip? The PDK uses an new programmer and it is still "coming soon". 

      Please login or register to see this link.

     

    not before Q4, and volume production is totally different story. I bet, ZW500 will not disappear from market at least till end of 2019

    Link to comment
    Share on other sites

    • 2 weeks later...
  • Topic Author
  • very interesting presentation from Dr. Zwave, presented on Z-Wave Summit 2018

     

    Please login or register to see this link.

     

     

    • Thanks 2
    Link to comment
    Share on other sites

    Thanks. Quote: "odd things happen at around 100 nodes". Confirmed... 

    Link to comment
    Share on other sites

    Hi Timan,

     

    Thanks for your great post, I have followed your post but got an issue like below shows, and I can't get the Keil project files as well :( 

    ________________

    .....

    GENERATING INTEL H386 FILE: .\build\WallController_slave_enhanced_232_OTA_ZW050x
    _TI\WallController_slave_enhanced_232_OTA_ZW050x_EU_TI.ota
    Fixbootcrc - Application start address 0x1800 (0)
    applicationFirmwareDescriptorOffset 0x7FB8
    0x0E3B CRC - Bank1  - Start 0x08000, Length 0x7CE5
    0xD41A CRC - Bank2  - Start 0x10000, Length 0x6225
    0xCE0C CRC - Bank3  - Start 0x18000, Length 0x6794
    0xFAE4 CRC - Common - Start 0x01800, Length 0x67C4
    ApplicationCommonLength 0x7FC6
    C:\\SDK\\Tools\\HexTools\\srec_cat.exe .\build\WallController_slave_enhanced_232
    _OTA_ZW050x_TI\WallController_slave_enhanced_232_OTA_ZW050x_EU_TI.ota -intel -ex
    clude 0x0 0x1800 -offset -0x1800 -o .\build\WallController_slave_enhanced_232_OT
    A_ZW050x_TI\WallController_slave_enhanced_232_OTA_ZW050x_EU_TI.ota.bin -binary
    C:\SDK\Z-Wave\lib\otacompress\otacompress.exe .\build\WallController_slave_enhan
    ced_232_OTA_ZW050x_TI\WallController_slave_enhanced_232_OTA_ZW050x_EU_TI.ota.bin
     .\build\WallController_slave_enhanced_232_OTA_ZW050x_TI\WallController_slave_en
    hanced_232_OTA_ZW050x_EU_TI.ota.bin.lz1
    process_begin: CreateProcess(C:\SDK\Z-Wave\lib\otacompress\otacompress.exe, C:\S
    DK\Z-Wave\lib\otacompress\otacompress.exe .\build\WallController_slave_enhanced_
    232_OTA_ZW050x_TI\WallController_slave_enhanced_232_OTA_ZW050x_EU_TI.ota.bin .\b
    uild\WallController_slave_enhanced_232_OTA_ZW050x_TI\WallController_slave_enhanc
    ed_232_OTA_ZW050x_EU_TI.ota.bin.lz1, ...) failed.
    make (e=216): Error 216
    make[1]: *** [.\build\WallController_slave_enhanced_232_OTA_ZW050x_TI\WallContro
    ller_slave_enhanced_232_OTA_ZW050x_EU_TI.ota.bin.lz1] Error 216
    make: *** [TARGET_OUT_BOOT_TEST_INTERFACE_LIBRARY_FREQUENCY_CODE_MEMORY_MODE_SEN
    SOR_TYPE_CHIP_WATCHDOG] Error 1

    C:\SDK\ProductPlus\WallController>

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

    Thank you

    YQ

    Edited by yuqian
    Link to comment
    Share on other sites

    Just a long shot... Does "C:\SDK\Z-Wave\lib\otacompress\otacompress.exe" exist ?

     

    I'm asking you, because, if you have followed the exact instructions from post 1, the path is:

     

    "C:\esdk\Z-Wave\lib\otacompress\otacompress.exe"

     

    It's defined in the environment variable, like this (see chapter 3 in document INS12366 Working in 500 Series Environment User Guide):

     

    TOOLSDIR=C:\esdk\Tools

    Link to comment
    Share on other sites

  • Topic Author
  • you have to use "" when starting mk command, without it will not work, e.g. mk "FREQUENCY=EU"

    Link to comment
    Share on other sites

    Hi Petergebruers

    >>Just a long shot... Does "C:\SDK\Z-Wave\lib\otacompress\otacompress.exe" exist ?

    Yes, it is in there, I can see it, and my path of TOOLSDIR is absolutely same as Tinman's post 

     

    Hi Timan,

    >>you have to use "" when starting mk command, without it will not work, e.g. mk "FREQUENCY=EU"

    Yes, I did, it is like  mk “BOOT=BOOTLOADER_ENABLED" "FREQUENCY=CN” "UVISION=1"

     

    Also, I have attached full log for your reference

     

    Thank you,

    YQ

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • try to use otacompress from attached file, it is from older SDK, i had same issues and Sigma was not able to replicate it. However, it worked for me with older otacompress.

     

    For no reason (actually i only cleaned up my Keil installation, and reinstalled it) 6.81.01 with newer otacompress is working now for me. 

     

    Please login or register to see this attachment.

     

     

    Link to comment
    Share on other sites

    Hi Tinman,

     

    It works with the old otacompress.exe file, I got the Keil project files and compiled with Keil without problem,  thank you.

    You mean you just cleaned up your Keil and reinstalled SDK6.81.01, everything is working for you now?

     

    YQ

    Edited by yuqian
    Link to comment
    Share on other sites

    13 minutes ago, yuqian said:

    It works with the old otacompress.exe file

    I'm glad you've found a workaround.

     

    20 minutes ago, tinman said:

    For no reason (actually i only cleaned up my Keil installation, and reinstalled it) 6.81.01 with newer otacompress is working now for me.

     

    No problems with otacompress in 6.81.01 here either... Weird... 

     

    "C:\esdk\Z-Wave\lib\otacompress\otacompress.exe .\build\WallController_slave_enhanced_232_OTA_ZW050x_TI\WallController_slave_enhanced_232_OTA_ZW050x_CN_TI.ota.bin .\build\WallController_slave_enhanced_232_OTA_ZW050x_TI\WallController_slave_enhanced_232_OTA_ZW050x_CN_TI.ota.bin.lz1"

    Link to comment
    Share on other sites

  • Topic Author
  • 23 minutes ago, yuqian said:

    Hi Tinman,

     

    It works with the old otacompress.exe file, I got the Keil project files and compiled with Keil without problem,  thank you.

    You mean you just cleaned up your Keil and reinstalled SDK6.81.01, everything is working for you now?

     

    YQ

     

    right, and do mk clean to ensure all precompiled files are gone as well.  

    Link to comment
    Share on other sites

    Hi Tinman,

    It is strange for me, I've tried clean up my system and even reinstalled a brand new WIN7 system, but I still got the same issue :(

    Would you please tell me what kind of Windows system are you using?

    Also, Does anyone who still have such issue?

    YQ

    Link to comment
    Share on other sites

  • Topic Author
  • i got it on Win 10, Sigma told me "hmm, it works for us", i installed clean Win 7 and got exact same issue, Sigma again told me "it work, probably you forgot "" signs in make". Win 7 got fixed with that, Win 10 not, so i had to clean reinstall Keil and that helped. However, feel free to ask Silabs, they have Ticket System and they will check it for you. 

     

    Link to comment
    Share on other sites

    Hi Tinman,

    Thank you. I've been posted a support requirement to their Ticket system, hopefully, will get the response soon :( 

    YQ

    Link to comment
    Share on other sites

    I can confirm the same problem. It seems that otacompress.exe included with the latest SDK will only work on 64bit version of Windows, so if you run 32bit you should grab the older version.

    Wojtek

    • Thanks 1
    Link to comment
    Share on other sites

    • 1 year later...

    Hey guys....

     

    I have setup the SDK (6.81.01) and have Keil C51 setup (9.54a) and setup my environment variables.  I'm getting the following error when running mk.bat in the WallController folder:

     

    makefile:177: *** first argument to `word' function must be greater than 0.  Stop.

     

    Line 177 of the makefile reads BASEDIR=$(shell cd)

     

    I've tried running shell cd in the command prompt, but get: 

    'shell' is not recognized as an internal or external command, operable program or batch file.

     

    Am I missing something?  I am supposed to be running this in a Cygwin or MinGW shell?

     

    If I set BASEDIR to:

     

    BASEDIR="C:\Users\unknown\Documents\SiLabs\SDK_v6_81_06\SDK_v6_81_06\ProductPlus\WallController"

     

    Then I get:

     

    0 [main] sh 7972 sync_with_child: child 16648(0x1B8) died before initialization with status code 0xC0000142
        199 [main] sh 7972 sync_with_child: *** child state waiting for longjmp
    /usr/bin/sh: fork: Resource temporarily unavailable
    make: *** [clearerror] Error -1073741502

     

    Which is indicating it's looking for a linux shell?  :/

     

    Any help would be appreciated.  Thanks.

     

    Maybe I can create the uVision project myself?  Or is Simplicity Studio the way to go nowadays?  I'm developing for the ZM5101 - custom board.  I have tested the board with an Aeotec Gen 5 and Zniffer and it seems all is good.

     

     

     

    Link to comment
    Share on other sites

    1 hour ago, AdvancedNewbie said:

    I am supposed to be running this in a Cygwin or MinGW shell?

    No.

     

    I have had similar weirdness when I first started and this is what I would do: start again from the start and follow the procedure in post #1 "to the letter" so mind versions, casing, spaces in (directory) names, settings of environment variables, path variable and so on...

     

    1 hour ago, AdvancedNewbie said:

    Maybe I can create the uVision project myself?

    Yes and no... You can make one to edit the source code, but you'll still need the command line toolchain to build the firmware image.

     

    1 hour ago, AdvancedNewbie said:

    Or is Simplicity Studio the way to go nowadays?

    No, thats for series 700 modules only...

    Link to comment
    Share on other sites

    Well, I tried about 10 different times on my Windows 10 machine with no luck.  So I installed a Windows 7 OS in a Virtual Machine and it worked right away.  Not ideal, but I can move ahead anyways...

     

    I'm still curious why it won't work in Windows 10.  Has anyone else had any luck with the same problem and managed to fix it?

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...