Program CC2530 for Smartthings?

Hello,
I am trying to program a CC2530 ZigBee dev kit to be discoverable by the Smartthings hub. I am going to work on the device handler later, but I want it so the hub can see my device. I am using IAR 8051 workbench to program the CC2530F256 TI chip. The software is in C/C++. I would really appreciate any response for how to program my CC2530 ZigBee dev kit to be discovered by the Smartthings hub.

SmartThings uses the Zigbee Home Autmation profile (ZHA1.2). So the easiest way to make a zigbee device controllable from SmartThings is to load the ZHA profile.

@johnr can say more.

You should also look at the following thread:

To be honest, though, if you donā€™t know what a zigbee profile is, youā€™ve got to make a decision upfront whether you want to actually learn how to work with zigbee or whether you just want to get help with a few steps to kind of get past the protocol issues and just get this one device to work. Because profiles are a basic concept of zigbee networks. Something that would be introduced on the first day of ā€œzigbee 101.ā€

http://www.eetimes.com/document.asp?doc_id=1278223

Iā€™m not saying you have to get into any engineering concepts in order to be able to get your device to work, Iā€™m just saying that youā€™re going to have a hard time understanding most of the documentation if you donā€™t have at least a basic understanding of zigbee fundamentals. So if youā€™re going to skip over that step, youā€™re always going to need other peopleā€™s help to figure out what to do at each stage.

Ok I figure out what you meant by the ZHA. I opened it up on the IAR, but Iā€™m not sure if these programs are able to make my CC2530 board visible to Smartthings or if they only work for the TI dev kit? Plus how do these programs make the CC2530 boards discoverable by the Smartthings hub?

1 Like

@rpress is your TI guy. I will be happy to help with any generic ZigBee questions.

3 Likes

I tested out the SampleLight program from the Zigbee Home Automation samples on my board, but it wasnā€™t able to be discovered by the Smartthings hub. Are there any suggestions or other sample codes that might make my board discoverable?

Check out the Device Type Handler code for simple ZigBee Devices like ZigBee Switch available in the IDE and SmartThings Public GitHub.

Replace the ā€œFingerprintā€ section with the values sent by your firmware (defined in your Z-Stack programā€™s configuration section).

This is the only config thing I could find. Is this what I should be looking at? If so, what are the values sent by my firmware?

/*

  •                       f8wConfig.cfg
    
  • Compiler command-line options used to define a TI Z-Stack ZigBee device.
  • To move an option from here to the project file, comment out or delete the
  • option from this file and enter it into the ā€œDefine Symbolsā€ box under the
  • Preprocessor tab of the C/C++ Compiler Project Options. New user defined
  • options may be added to this file, as necessary.
  • Each macro is prefixed with ā€˜-Dā€™. The entries are to be constructed as if
  • they are to be on the compiler command line invocation (which they are).
  • NOTE: The RHS (Right-Hand-Side) must be quoted if there are embedded blanks.
  •    See the DEFAULT_KEY definition for an example.
    

*/

/* Enable ZigBee-Pro */
-DZIGBEEPRO

/* Set to 1 to enable security. To disable set to 0 */
-DSECURE=1
-DZG_SECURE_DYNAMIC=0

/* Enable the Reflector */
-DREFLECTOR

/* Default channel is Channel 11 - 0x0B */
// Channels are defined in the following:
// 0 : 868 MHz 0x00000001
// 1 - 10 : 915 MHz 0x000007FE
// 11 - 26 : 2.4 GHz 0x07FFF800
//
//-DMAX_CHANNELS_868MHZ 0x00000001
//-DMAX_CHANNELS_915MHZ 0x000007FE
//-DMAX_CHANNELS_24GHZ 0x07FFF800
//-DDEFAULT_CHANLIST=0x04000000 // 26 - 0x1A
//-DDEFAULT_CHANLIST=0x02000000 // 25 - 0x19
//-DDEFAULT_CHANLIST=0x01000000 // 24 - 0x18
//-DDEFAULT_CHANLIST=0x00800000 // 23 - 0x17
//-DDEFAULT_CHANLIST=0x00400000 // 22 - 0x16
//-DDEFAULT_CHANLIST=0x00200000 // 21 - 0x15
//-DDEFAULT_CHANLIST=0x00100000 // 20 - 0x14
//-DDEFAULT_CHANLIST=0x00080000 // 19 - 0x13
//-DDEFAULT_CHANLIST=0x00040000 // 18 - 0x12
//-DDEFAULT_CHANLIST=0x00020000 // 17 - 0x11
//-DDEFAULT_CHANLIST=0x00010000 // 16 - 0x10
//-DDEFAULT_CHANLIST=0x00008000 // 15 - 0x0F
//-DDEFAULT_CHANLIST=0x00004000 // 14 - 0x0E
//-DDEFAULT_CHANLIST=0x00002000 // 13 - 0x0D
//-DDEFAULT_CHANLIST=0x00001000 // 12 - 0x0C
-DDEFAULT_CHANLIST=0x07FFF800//0x00000800 // 11 - 0x0B

/* Define the default PAN ID.
*

  • Setting this to a value other than 0xFFFF causes
  • ZDO_COORD to use this value as its PAN ID and
  • Routers and end devices to join PAN with this ID
    */
    -DZDAPP_CONFIG_PAN_ID=0xFFFF

/* Minimum number of milliseconds to hold off the start of the device

  • in the network and the minimum delay between joining cycles.
    */
    -DNWK_START_DELAY=100

/* Mask for the random joining delay. This value is masked with

  • the return from osal_rand() to get a random delay time for
  • each joining cycle. This random value is added to NWK_START_DELAY.
  • For example, a value of 0x007F will be a joining delay of 0 to 127
  • milliseconds.
    */
    -DEXTENDED_JOINING_RANDOM_MASK=0x007F

/* Minimum number of milliseconds to delay between each beacon request

  • in a joining cycle.
    */
    -DBEACON_REQUEST_DELAY=100

/* Mask for the random beacon request delay. This value is masked with the

  • return from osal_rand() to get a random delay time for each joining cycle.
  • This random value is added to DBEACON_REQUEST_DELAY. For example, a value
  • of 0x00FF will be a beacon request delay of 0 to 255 milliseconds.
    */
    -DBEACON_REQ_DELAY_MASK=0x00FF

/* Jitter mask for the link status report timer. This value is masked with the

  • return from osal_rand() to add a random delay to _NIB.nwkLinkStatusPeriod.
  • For example, a value of 0x007F allows a jitter between 0-127 milliseconds.
    */
    -DLINK_STATUS_JITTER_MASK=0x007F

/* in seconds; set to 0 to turn off route expiry */
-DROUTE_EXPIRY_TIME=30

/* This number is used by polled devices, since the specā€™d formula

  • doesnā€™t work for sleeping end devices. For non-polled devices,
  • a formula is used. Value is in 2 milliseconds periods
    */
    -DAPSC_ACK_WAIT_DURATION_POLLED=3000

/* Default indirect message holding timeout value:

  • 1-65535 (0 -> 65536) X CNT_RTG_TIMER X RTG_TIMER_INTERVAL
    */
    -DNWK_INDIRECT_MSG_TIMEOUT=7

/* The number of simultaneous route discoveries in network */
-DMAX_RREQ_ENTRIES=8

/* The maximum number of retries allowed after a transmission failure */
-DAPSC_MAX_FRAME_RETRIES=3

/* Max number of times retry looking for the next hop address of a message */
-DNWK_MAX_DATA_RETRIES=2

/* Number of times retry to poll parent before indicating loss of synchronization

  • with parent. Note that larger value will cause longer delay for the child to
  • rejoin the network.
    */
    -DMAX_POLL_FAILURE_RETRIES=2

/* The number of items in the broadcast table */
-DMAX_BCAST=9

/* The maximum number of groups in the groups table */
-DAPS_MAX_GROUPS=16

/* Number of entries in the regular routing table plus additional

  • entries for route repair
    */
    -DMAX_RTG_ENTRIES=40

/* Maximum number of entries in the Binding table. */
-DNWK_MAX_BINDING_ENTRIES=4

/* Maximum number of cluster IDs for each binding table entry.

  • Note that any value other than the default value may cause a
  • compilation warning but Device Binding will function correctly.
    */
    -DMAX_BINDING_CLUSTER_IDS=4

/* Default security key. */
-DDEFAULT_KEY="{0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

/* Reset when ASSERT occurs, otherwise flash LEDs */
//-DASSERT_RESET

/* Set the MAC MAX Frame Size (802.15.4 default is 102) */
-DMAC_MAX_FRAME_SIZE=116

/* Minimum transmissions attempted for Channel Interference detection,

  • Frequency Agility can be disabled by setting this parameter to zero.
    */
    -DZDNWKMGR_MIN_TRANSMISSIONS=20

/* Compiler keywords */
-DCONST=ā€œconst __codeā€
-DGENERIC=__generic

/****************************************

  • The following are for End Devices only
    ***************************************/

-DRFD_RCVC_ALWAYS_ON=FALSE

/* The number of milliseconds to wait between data request polls to the coordinator. */
-DPOLL_RATE=1000

/* This is used after receiving a data indication to poll immediately

  • for queued messagesā€¦in milliseconds.
    */
    -DQUEUED_POLL_RATE=100

/* This is used after receiving a data confirmation to poll immediately

  • for response messagesā€¦in milliseconds
    */
    -DRESPONSE_POLL_RATE=100

/* This is used as an alternate response poll rate only for rejoin request.

  • This rate is determined by the response time of the parent that the device
  • is trying to join.
    */
    -DREJOIN_POLL_RATE=440

/* Rejoin retry backoff silent period timer duration in milliseconds - default 15 minutes according to HA test spec */
-DREJOIN_BACKOFF=900000

/* Rejoin retry backoff scan timer duration in milliseconds - default 15 minutes according to HA test spec */
-DREJOIN_SCAN=900000

Nopeā€¦ There must be another section buried in the code somewhere which defines the various parts of the Fingerprint. ZigBee HA documentation describes the format for the Fingerprint (HA 1.2 indicator, device type, clusters, ā€¦, manufacturer name).

You can try putting your Hub in ā€œAdd Deviceā€ mode while watching its Event Logging in the IDE and initiating your test hardware. If SmartThings sees anything, it will show the Fingerprint received in the Hub Event list. Thatā€™s the usual starting point to try to create a device handler for an unknown ZigBee HA device.

(And due respect and thanks to everyone on the Community who help out with these questions - I have asked and benefited many times too and those answers are in existing posts, so I pay back in kindā€¦; but there comes a point, perhaps, when this should move to a consulting engagement with a reasonable fee. Itā€™s hard to balance the genuine appreciation and spirit of mutual community assistance by just answering a few questions and pointing in the right direction vs. the normal desire to earn a fair living for providing professional services and tutoring.)

Looking back, it looks like Iā€™ve answered quite a few questions for Cookie already. Time to invest in some private one-one tutorials with me, Cookie! :mortar_board:

ā€œIf SmartThings sees anything, it will show the Fingerprint received in the Hub Event list. Thatā€™s the usual starting point to try to create a device handler for an unknown ZigBee HA device.ā€

Well unfortunately my Smartthings hub doesnā€™t see my device listed at the very top. So that has been my problem as of right now. Do you have a suggestion to make my hub see my CC2530 device?

Not off the top of my head. As mentioned, itā€™s pretty complicatedā€¦

Quite likely your firmware is not sending out a join request or a proper one (ZigBee Pro is not compatible with ZigBee HA on the SmartThings Hub, etc.). Drop me an email or Private Message to negotiate a detailed environment and code analysis.

1 Like

Does anyone have a suggestion? Iā€™d really appreciate anyoneā€™s reply.

Letā€™s take it a step at a time. First you need to verify your device is joining the SmartThings ZigBee HA network. With the xBee you can look at an association parameter to see if it joined the network. On a TI chip I donā€™t know what the equivalent command is. But once you find it it will tell you if the hub allowed you to join the network. If your device isnā€™t allowed to join the ZigBee HA network than most likely you have a security setting messed up or a protocol setting set incorrectly. You will need to address that and try to join again. Once you have your device physically joined to the SmartThings ZigBee HA network we can go onto the next step of getting your device visible in the SmartThings cloud.

Your config file only shows it listening on channel 11. You need to change it like so:

-DDEFAULT_CHANLIST=MAX_CHANNELS_24GHZ

4 Likes

Hey cookierookie44 do you have any lucky to put CC2530 work with smartthings HUB? You make any changes on IAR HA examples?

Anyone figure out how connect IAR Home Automation Examples with smarthings hub? I am new this things i need some help in this matter.

1 Like

I canā€™t afford IAR license!!! :cry:

But I had some success with an HA profile and Switch and Temperature clusters a while back.

I can only assist with this on a paid consulting basis though ā€¦ have to be able to figure out how to afford that software sometimeā€¦ right? PM me if you want.

Having similar problem. I got a ZB600 (https://www.waveshare.com/wiki/ZB600) development board, loaded a sample light switch app in there but itā€™s not connecting to the Samsung Hub. It chokes in the middle of joining the ZigBee network. I submitted a separate post with the detailed description of my issue (Unable to join samsung hub ZigBee network using CC2530 ZigBee stack). It seems like there is something very minor with I donā€™t understand. Can somebody point me to the right direction? Is there maybe guidelines from Samsung?

1 Like

@JohnR has been among the most helpful ā€œCommunityā€ members on this Topic, but not a SmartThings employee.

I canā€™t think offhand who to tag from SmartThings because staff and roles have changed significantly over there over the past several months.

Start at the page below to sign-up for a new Developer Account, read the latest Documentation, and open Developer Support tickets.

Unfortunately, I didnā€™t find anything useful on the developer web site in regards to what I need namely connect my own TI2530 device to a Samsung hub. The only thing I found is ā€œCurrently you can connect ZigBee or Z-Wave devices with either a SmartThings hub or Samsung Connect Home hub. We will offer developer tools and guides for hub-connected devices soon.ā€ When that will be offered? Where to find anything in regards to custom device - Samsung hub communication? All that is a mystery. I created a support ticket as well but that did not lead anywhere. I got a similar link which doesnā€™t shed a light on how to connect to the Samsung hub. Does anybody have a direct link to a documentation describing how to connect to a Samsung hub?