<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Controlling a Trådfri bulb with nRF52840 - how to make it join?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61039/controlling-a-tradfri-bulb-with-nrf52840---how-to-make-it-join</link><description>Hi, 
 I have an nRF52840 Development Kit, and am trying to control an IKEA Tr&amp;#229;dfri bulb. I&amp;#39;m following the commands from the SDK documentation , but it feels like they&amp;#39;re missing a step, explaining how to make the bulb actually join the new network: </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 May 2020 20:16:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61039/controlling-a-tradfri-bulb-with-nrf52840---how-to-make-it-join" /><item><title>RE: Controlling a Trådfri bulb with nRF52840 - how to make it join?</title><link>https://devzone.nordicsemi.com/thread/248812?ContentTypeID=1</link><pubDate>Thu, 07 May 2020 20:16:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60be2adf-f9c6-460b-8390-0ecdcf887d49</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;Writing a new reply, since the root cause turned out to not be what &lt;a href="https://devzone.nordicsemi.com/members/marjeris-romero"&gt;Marjeris Romero&lt;/a&gt; suggested, but a stupid mistake of my own. &lt;em&gt;The short summary is that I needed to use gcc 7.2.1 instead of 9.2.1.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;To give a bit more detail, I originally compiled the CLI example myself, but got two warnings:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;../../../../../../../../components/zigbee/cli/zigbee_cli_cmd_zdo.c: In function &amp;#39;cmd_zb_simple_desc_req_cb&amp;#39;:
../../../../../../../../components/zigbee/cli/zigbee_cli_cmd_zdo.c:277:52: warning: taking address of packed member of &amp;#39;struct zb_af_simple_desc_1_1_s&amp;#39; may result in an unaligned pointer value [-Waddress-of-packed-member]
  277 |     zb_uint16_t * p_cluster_list  = (zb_uint16_t *)p_resp-&amp;gt;simple_desc.app_cluster_list;
      |                                                    ^~~~~~
../../../../../../../../components/zigbee/cli/zigbee_cli_cmd_zdo.c: In function &amp;#39;cmd_zb_match_desc&amp;#39;:
../../../../../../../../components/zigbee/cli/zigbee_cli_cmd_zdo.c:789:79: warning: taking address of packed member of &amp;#39;struct zb_zdo_match_desc_param_s&amp;#39; may result in an unaligned pointer value [-Waddress-of-packed-member]
  789 |         if (!sscan_cluster_list(argv + 5, p_req-&amp;gt;num_in_clusters, (uint16_t *)p_req-&amp;gt;cluster_list))&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I looked at the code, but concluded that there wasn&amp;#39;t any clear, easy fixes, so I just removed&amp;nbsp; -Werror, assuming that this was a inconsequential warning that had somehow snuck past the release checks, without thinking more of it (MCU vendors supplying code with warnings is unfortunately not unheard of, although I was a bit surprised Nordic would do so).&lt;/p&gt;
&lt;p&gt;However, after reading the answers, I realized I could test with an outlet instead of a bulb, since those are easier to factory reset (holding the button for 5 s). This unfortunately still didn&amp;#39;t work, but it then struck me that I had never tried the precompiled hex files, so and when doing so it turned out the outlet was immediately joined.&lt;/p&gt;
&lt;p&gt;Seeing that, I suddenly realized I was using a different compiler version than the SDK was supposed to be used with: arm-none-eabi-gcc 2019-q4 (9.2.1), from the Ubuntu repos. instead of 2018-q1 (7.2.1), originally referred to in Makefile.posix.&lt;/p&gt;
&lt;p&gt;I therefore went back and downloaded 7.2.1 myself, and when recompiling with that, the warnings went away and the CLI worked as expected. Testing further, I also discovered that the example works when recompiling with 9.2.1 but without -Os.&lt;/p&gt;
&lt;p&gt;The conclusion hence seems to be that there is some optimization that 9.2.1 does when compiled with -Os that causes the example to not work, and it&amp;#39;s seems likely to be related to the warning given above. This hence may be worth fixing in a future SDK update.&lt;/p&gt;
&lt;p&gt;Thanks for the help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controlling a Trådfri bulb with nRF52840 - how to make it join?</title><link>https://devzone.nordicsemi.com/thread/248677?ContentTypeID=1</link><pubDate>Thu, 07 May 2020 10:23:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48655995-ceb3-4330-9f05-03a64fc43eee</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Small update, depending on which version of the Trådfri lightbulb you are using it may be using ZLL channels, so it would be best to test using channel 15 or channel 20 when testing.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Controlling a Trådfri bulb with nRF52840 - how to make it join?</title><link>https://devzone.nordicsemi.com/thread/248520?ContentTypeID=1</link><pubDate>Wed, 06 May 2020 14:40:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65ec426e-05eb-4784-8c90-c488adf801f3</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;When you factory reset the bulb, does the bulb start to &amp;quot;flash&amp;quot; after the 6th time? You need to be sure it actually has been reset. If you have problems resetting the plain white (non-colour) IKEA bulb, try making the &amp;quot;ons&amp;quot; very brief (less than a second) and the &amp;quot;offs&amp;quot; longer, this has fixed some of my problems earlier.&lt;/p&gt;
&lt;p&gt;You can change the channel of the coordinator by using command &amp;#39;bdb channel&amp;#39;. You can only open a network with a coordinator in one channel so changing the channel mask to all channels will not change that (but you can use this mask if using the CLI example as a router for example).&lt;/p&gt;
&lt;p&gt;It&amp;#39;s been a while since I have tried to connect with IKEA trådfri but they should send a beacon request on each channel after factory reset, so which channel you set the coordinator shouldn&amp;#39;t matter. You can perhaps check that the bulb is sending beacon requests in the same channel as your coordinator by using the nRF Sniffer.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>