This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Z-Tool: How to run scripts correctly?

Other Parts Discussed in Thread: CC2531, Z-STACK, CC2530

I'm trying to set up a Zigbee HA coordinator with TI Ztool and CC2531 USB dongle following the steps in this blog. Steps 1-3 go through normally, Ztool starts up and finds the cc2531 USB dongle without problem. Then I can send commands manually and receive responses.
The problem occurs when I try to execute the script coordinator_light.zjs (ZC_Com in the script was changed to COM30). Judging by the inscription in the status bar, script starts, but then nothing happens. There are no messages in the log windows, the COM30.html, Serial.html and Trace.log files created by the script are also empty.


What could it mean and how to run the scripts correctly in the program?

The system and software:

Windows 10 Pro x64 (1809 build 17763)
Z-Stack Home 1.2.2a.44539
Z-Tool v2.0.6.

CC2531 custom USB dongle
CC2531ZNP-Pro-Secure_LinkKeyJoin.hex

  • I suppose you should revise COM port settings in zjs file to use COM30.
  • ZC_Com in the script has been changed to COM30 (please see the original message).

    I wrote a simple script to test:

    import System;
    import System.Text;
    import TI.ZPI2;
    
    class TheScript
    {
      // Main class function that effects the work of this test script.
      function run()
      {
          ZEngine.WriteLog("TEST\n");  // Display the message.
      }
    }
    
    // The script engine will execute the following code.
    var script:TheScript = new TheScript();
    script.run();
    

    The result is the same, no messages in the logs.

  • I tried Z-Tool with scripts in Windows 7 x86 as a guest OS in VirtualBox (the host system is the same Windows 10 x64), and Z-Tool works as expected. So I have a problem with Z-Tool only in Windows 10.
  • Try to use the script file provided by TheDarkSide in e2e.ti.com/.../1208179
  • I have already tried these scripts. The result is the same. The problem is that, most likely, any scripts do not run at all. Something is wrong in the interaction of Z-Tool script control with Windows 10 and I can not understand what exactly.
  • I can use the Z-Tool script on my Win 10 desktop without problem. I suggest you to try another Win 10 desktop and see if this is a specific issue on the specific Win 10 desktop.
  • Thanks for the advice. I would also like to know the opinion of the developers of the program. Probably, there are diagnostic procedures that will allow to establish the exact cause of the malfunction.

  • As I know, the only document for Z-Tool can be access from Z-Tool -> Help -> Contents.
  • It's working on my Windows 10 machine as well (same build as yours).

    Perhaps try reinstalling Z-Stack Home 1.2.2a.44539.
  • I have tried 4 versions of Z-Tool:

    - C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Tools\Z-Tool
    - C:\Texas Instruments\simplelink\zstack_home_1_02_02a_44539\Tools\Z-Tool
    - C:\Texas Instruments\Z-Stack 3.0.2\Tools\Z-Tool
    - C:\ti\simplelink_cc13x2_26x2_sdk_3_10_00_53\tools\zstack\ztool

    The result is the same.
    As I understood, since there is no possibility to turn on a detailed debug log in  Z-Tool, I have to either use the VirtualBox or not use scripts.

    By the way, when I tried Z-Tool from Z-Stack 3.0.2 together with the CC2531 firmware from the same stack, I received a message:

    *** WARNING ***
        Expected Z-Stack version (2.7.1) does not match with actual Z-Stack version (2.7.2).  Z-Tool may not work properly.

  • Z-Tool is just a reference SW for you to test ZNP command. I suppose you have to rewrite your own ZAP host so I would suggest you to use/test Z-Tool without script. For different ZNP, you need matched Z-Tool so you should use matched Z-Tool embedded in the same Z-Stack installation.
  • YiKai Chen said:
    For different ZNP, you need matched Z-Tool so you should use matched Z-Tool embedded in the same Z-Stackinstallation.

    I use Z-Tool from Z-Stack 3.0.2 together with the CC2531 firmware from the SAME stack.

    From C:\Texas Instruments\Z-Stack 3.0.2\Z-Stack Core Release Notes.txt:
    The Z-Stack 3.0.2 release is based on Z-Stack Core 2.7.2.

    From C:\Texas Instruments\Z-Stack 3.0.2\Tools\Z-Tool\ZToolConfig.xml:
    <zstack_version>2.7.1</zstack_version>

    Apparently, this is the reason for the warning.

  • If it’s a warning from minor version difference, it should be no big deal.
  • Z-Tool not running your script is likely independent of the ZNP; you can actually run your simple script (prints "TEST" ) without any ZNP connected to the PC.
    There may be some discrepancy at a lower level of Windows that we are not aware of.

    Please check on a different Windows 10 machine.
  • Trying to connect Z-Tool with CC2530, I came across the need to change the connection speed to 115200 and got an error (English translation):
    System.ArgumentException: The surrogate pair (0xD88B, 0xFFFF) is invalid. The top surrogate mark (0xD800 - 0xDBFF) must always be a pair with the bottom surrogate mark (0xDC00 - 0xDFFF).
    The next start Z-Tool leads to an error:
    System.IndexOutOfRangeException: The index was outside the bounds of the array.
    The investigation revealed that the Windows registry element HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Texas Instruments\ZStack-Apps-1.2.0\Z-Tool 2.0\Settings\ComsInfo looks very strange, when I delete it, Z-Tool can be run without error.

    Video from the screen can be viewed here.

    Toby Pan said:
    Please check on a different Windows 10 machine.

    I don’t have access to other computers with Windows 10 x64 at the present, but I can use the Z-Tool with  Windows 7 x86 without problems.

  • Which OS is the video showing? I assume Windows 10?
    Does this happen in your windows 7 VM?

    You were able to interface successfully before w/ Windows 10, right?

    Looks like there's some corruption in ComsInfo.

    This is likely due to a .NET issue, as one of the popup indicates.

  • Toby Pan said:
    Which OS is the video showing? I assume Windows 10?

    Yes, this is Windows 10 Pro x64 (1809 build 17763).

    Toby Pan said:
    Does this happen in your windows 7 VM?

    No. Z-Tool in Windows 7 VM works fine with CC2531 USB dongle directly and with CC2530 via CP2102 USB-UART dongle. Scripts also work ok.

    Toby Pan said:
    You were able to interface successfully before w/ Windows 10, right?

    I could connect Z-Tool in Windows 10 with CC2531 before. But I didn't change the rate because it doesn't matter when working through the USB CDC-ACM driver directly with the CC2531 USB dongle. Scripts didn't work. But when I establish a connection with the CC2530, the rate must be changed, which led to what can be seen on the video. 

    I added error logs to this post.0066.logs.zip

  • What language is used in the Windows 7 VM?
  • Toby Pan said:
    What language is used in the Windows 7 VM?

    Do you mean the Windows display language? Russian in both Windows.

  • Looks like there's some corruption in the Registry for Z-Tool (REG_MULTI_SZ) caused by the initial attempt to change the baudrate, which in turn causes Z-Tool to not open properly afterwards.

    This is likely a Windows 10/.NET issue.

    If you need to use Z-Tool, I would suggest just using it in the VM for now.