Member | Action | Date |
---|---|---|
![]() |
Updated
Z-Wave 700: How to use Software Timers on Knowledge Base
How to use Software Timers
In this KB we will demonstrate an example of using a Software Timer to perform a temperature and humidity sensor reading once every second.
It is documented in KB Z-Wave 700: How to implement I2C into the Z-Wave Embedded Framework how to readout the temperature and humidity sensor reading using I2C.
This KB will be using the AppTimer module from the Z-Wave Framework. This module is further documented in document INS14259 - Z-Wave Plus V2 Application Framework SDK7 (available in Simplicity Studio).
All software timers are essentially FreeRTOS timers. Using the AppTimer module, you ensure that timer callback functions are executed in the context of the application task.
Step 1: Continuing on an example This KB continues on the I2C example. It is suggested to complete that exercise in order to see the full effect of implementing the timer – it is however not required and this guide will instruct how to continue if not using I2C in the relevant steps.
Step 2: SSwTimer instance To start using application timers, you need a SSwTimer instance. In the PRIVATE DATA section, add a SSwTimer instance.
Step 3: Initialize timer In ApplicationTask() register a timer and add a callback. In this example we start the timer and configure it to 1000 ms.
Step 4: Add a new event When the timer fires, we want our callback function to enqueue an event to our state machine. Thus we need to add a new event in the _EVENT_APP_ typdedef. We call this event EVENT_APP_TEMPERATURE.
Step 5: Create the callback function In the PRIVATE FUNCTIONS section create the callback function TemperatureTimerCallback() and enqueue the event EVENT_APP_TEMPERATURE when called.
Step 6: Update the state machine to listen for the event In the AppStateManager(), find the state called STATE_APP_IDLE. In this state, create a new if-case and perform the temperature measurement if EVENT_APP_TEMPERATURE event is received.
Note: In this step, we are calling performMeasurements(). This function is part of the I2C example. You can leave out this function call, and just verify in the debug log that the event is called once every second.
Step 7: Build solution and test Build the solution and flash the new firmware image to the device. If you enable serial debug output, you should now see that we get the TemperatureTimerCallback() and that results in a temperature and humidity reading.
Z-Wave 700 End-device framework KBs Z-Wave 700: How to implement I2C into the Z-Wave Embedded Framework Z-Wave 700: How to use Software Timers (this guide) Z-Wave 700: How to implement SPI into the Z-Wave Embedded Framework Z-Wave 700: How to implement UART with interrupt into the Z-Wave Embedded Framework
Linked documentation (found in Simplicity Studio)
|
Apr 30 2019, 1:39 PM |
![]() |
Replied
to
The source code of Z-Wave PC Controller version 5.38
The source code for the PC Controller for Z-Wave 700 is not something we currently distribute.
Show more
|
Apr 30 2019, 11:10 AM |
![]() |
Selected an answer for
Z-Wave Plus v2 repeater device
You can make a Multilevel Switch DT or the Binary Switch DT, which can also implement the Color CC. If you make an Always-On Device, then it will work as a repeater as well. |
Apr 30 2019, 10:14 AM |
![]() |
Selected an answer for
Custom hardware ZM5101 is not sending or receiving anything over radio.
Please refer to the Z-Wave 500 Hardware Integration Guide: https://www.silabs.com/documents/login/user-guides/INS12213-14.pdf
|
Apr 30 2019, 10:12 AM |
![]() |
Selected an answer for
Z/IP about br-lan
Z/IP Gateway is a native IPv6 host, mapping IPv4 to IPv6 internally. Z/IP Gateway requests IPv4 addresses from the existing IPv4 network via DHCP and maps the IPv4 addresses to individual Z-Wave nodes. On Linux the raw ethernet connectivity is achieved by using the Linux TAP/TUN driver. Z/IP Gateway application works as a IPv6 gateway between a LAN network and a Z-Wave PAN (Personal Area Network). The Z/IP Gateway creates a TAP interface, usually named tap0. The tap interface is per default bridged to the physical network interface. You can use the tap0 interface directly. There is no need to attach it to a bridge with other network interfaces if you intend to use it only "locally" - i.e. no external incoming/outgoing connections. |
Apr 30 2019, 10:12 AM |
![]() |
Selected an answer for
About ram content after wake up from em4
You can write your values to NVM.
Refer to document INS14259, and see section "5.4 Setting Up Files in Non-Volatile Memory." |
Apr 30 2019, 10:11 AM |
![]() |
Selected an answer for
Using NVM3 with configuration parameters
Document INS 14259, section 5.4, describes "Setting Up Files in Non-Volatile Memory" for Z-Wave. For more general information, you can refer to |
Apr 30 2019, 10:11 AM |
![]() |
Selected an answer for
Z-WAVE LifeLine Group configuration
I'm assuming you are using Z-Wave 500.
SensorPIR sample app builds on Routing Slave library which has limitations due to no external NVM. Other sample apps, like the Switch On Off are build on e Enhanced 232 Slave library. More info about the libraries can be seen here:
The following document describes the sample apps. It also lists the "node count" for associations. For SensorPIR, refer to 4.5.3 Association groups, and you can see only 1 is available.
It is defined in config_app.h.
This is changed for Z-Wave 700. Here we only have 1 library, so this limitation does not exist. |
Apr 30 2019, 10:11 AM |
![]() |
Replied
to
Can't start Pyzip (Z/IP Client) on Ubuntu - missing pyzwave.zip.ZIPFirmware
Unfortunately, we have an error in the released version of PyZ/IP 1.21 which are missing some files. Hopefully, the attached version is working for you.
|
Apr 29 2019, 9:25 AM |
![]() |
Replied
to
Z-Wave Plus v2 repeater device
You can make a Multilevel Switch DT or the Binary Switch DT, which can also implement the Color CC. If you make an Always-On Device, then it will work as a repeater as well. |
Apr 29 2019, 9:22 AM |