<?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>Error while execute DFU example in Mesh SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34616/error-while-execute-dfu-example-in-mesh-sdk</link><description>Hi all, 
 I am testing DFU example in Mesh SDK . I follow this tutorial : http://infocenter.nordicsemi.com/index.jsp . But when I execute to step 4 : 
 
 I get this error : 
 
 Any suggestion for this ? I use NRF52832 DK . Thank !!!</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Jun 2018 14:47:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34616/error-while-execute-dfu-example-in-mesh-sdk" /><item><title>RE: Error while execute DFU example in Mesh SDK</title><link>https://devzone.nordicsemi.com/thread/136801?ContentTypeID=1</link><pubDate>Tue, 19 Jun 2018 14:47:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:129a9866-d2d0-4e38-b197-e95eddd1c02c</guid><dc:creator>Thomas Stenersen</dc:creator><description>&lt;p class="part"&gt;Hi Giang,&lt;br /&gt;The issue is that the public key isn&amp;rsquo;t being converted to a bytearray properly.&lt;/p&gt;
&lt;p class="part"&gt;Applying the following diff will solve the problem&lt;/p&gt;
&lt;pre class="part"&gt;&lt;code class="diff hljs"&gt;diff --git a/tools/dfu/device_page_generator.py b/tools/dfu/device_page_generator.py
index 9fa9e6435..a3aa74028 100644
&lt;span class="hljs-comment"&gt;--- a/tools/dfu/device_page_generator.py&lt;/span&gt;
&lt;span class="hljs-comment"&gt;+++ b/tools/dfu/device_page_generator.py&lt;/span&gt;
@@ -66,7 +66,7 @@ class DevicePageEntry(object):
         #print(&amp;quot;Type: &amp;quot;, type(data).__name__)
         if not (isinstance(bl_info_type, BLInfoType) and
                 (isinstance(data, bytearray) or isinstance(data, str))):
&lt;span class="hljs-deletion"&gt;-            raise TypeError&lt;/span&gt;
&lt;span class="hljs-addition"&gt;+            raise TypeError(&amp;quot;Invalid type %r&amp;quot; % (type(data)))&lt;/span&gt;
 
         self.bl_info_type = bl_info_type
         if (isinstance(data, str)):
@@ -96,7 +96,7 @@ class DevicePage(object):
         self.softdevice = softdevice
 
     def generate_entries(self, platform, softdevice, bootloader_config):
&lt;span class="hljs-deletion"&gt;-        public_key = bootloader_config["public_key"] \&lt;/span&gt;
&lt;span class="hljs-addition"&gt;+        public_key = bytearray.fromhex(bootloader_config["public_key"]) \&lt;/span&gt;
                      if &amp;quot;public_key&amp;quot; in bootloader_config else None
         if public_key:
             self.entries.append(
&lt;/code&gt;&lt;/pre&gt;
&lt;p class="part"&gt;Additionally, there was an issue where the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;device_page_generator.py&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;would always output the same filename (&lt;code&gt;device_page_nrf52832_xxAA_s132_6.0.0.hex&lt;/code&gt;). That is fixed with the following diff:&lt;/p&gt;
&lt;pre class="part"&gt;&lt;code class="diff hljs"&gt;diff --git a/tools/dfu/device_page_generator.py b/tools/dfu/device_page_generator.py
index a3aa74028..0e8eb9e3d 100644
&lt;span class="hljs-comment"&gt;--- a/tools/dfu/device_page_generator.py&lt;/span&gt;
&lt;span class="hljs-comment"&gt;+++ b/tools/dfu/device_page_generator.py&lt;/span&gt;
@@ -207,7 +207,7 @@ def main():
     for plt in platforms:
         plt_str += &amp;#39;&amp;#39;.join(plt["name"]) + &amp;#39;\n&amp;#39;
 
&lt;span class="hljs-deletion"&gt;-    SOFTDEVICE = &amp;quot;s132_5.0.0&amp;quot;&lt;/span&gt;
&lt;span class="hljs-addition"&gt;+    SOFTDEVICE = &amp;quot;s132_6.0.0&amp;quot;&lt;/span&gt;
     DEVICE = &amp;quot;nrf52832_xxAA&amp;quot;
     parser = argparse.ArgumentParser(description=&amp;quot;Device Page Generator&amp;quot;)
     parser.add_argument(&amp;quot;-d&amp;quot;, &amp;quot;--device&amp;quot;, help=&amp;quot;Select device: &amp;quot; + &amp;#39;&amp;#39;.join(plt_str),
@@ -217,12 +217,15 @@ def main():
     parser.add_argument(&amp;quot;-c&amp;quot;, &amp;quot;--bootloader-config&amp;quot;,
                         default=&amp;quot;bootloader_config_default.json&amp;quot;,
                         help=&amp;quot;Bootloader configuration file&amp;quot;)
&lt;span class="hljs-deletion"&gt;-    parser.add_argument(&amp;quot;-o&amp;quot;, &amp;quot;--output-file&amp;quot;, help=&amp;quot;Output hex file&amp;quot;,&lt;/span&gt;
&lt;span class="hljs-deletion"&gt;-                        default=&amp;quot;bin/device_page_%s_%s.hex&amp;quot; % (DEVICE, SOFTDEVICE))&lt;/span&gt;
&lt;span class="hljs-addition"&gt;+    parser.add_argument(&amp;quot;-o&amp;quot;, &amp;quot;--output-file&amp;quot;,&lt;/span&gt;
&lt;span class="hljs-addition"&gt;+                        help=&amp;quot;Output hex file (default: bin/device_page_%s_%s.hex).&amp;quot; % (&amp;quot;&amp;lt;DEVICE&amp;gt;&amp;quot;, &amp;quot;&amp;lt;SOFTDEVICE&amp;gt;&amp;quot;),&lt;/span&gt;
&lt;span class="hljs-addition"&gt;+                        default=False)&lt;/span&gt;
     parser.add_argument(&amp;quot;--all&amp;quot;, default=False, action=&amp;quot;store_true&amp;quot;,
                         help=(&amp;quot;Writes all known device page combinations to &amp;quot;
                               + &amp;quot;\&amp;#39;bin/\&amp;#39;&amp;quot;))
     args = parser.parse_args()
&lt;span class="hljs-addition"&gt;+    if not args.output_file:&lt;/span&gt;
&lt;span class="hljs-addition"&gt;+        args.output_file = &amp;quot;bin/device_page_%s_%s.hex&amp;quot; % (args.device, args.softdevice)&lt;/span&gt;
 
     dirname = os.path.dirname(args.output_file)
     if not os.path.exists(dirname):
&lt;/code&gt;&lt;/pre&gt;
&lt;p class="part"&gt;For your convenience I&amp;rsquo;ve uploaded a copy of the script with the changes applied:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2438.device_5F00_page_5F00_generator.py"&gt;devzone.nordicsemi.com/.../2438.device_5F00_page_5F00_generator.py&lt;/a&gt;&lt;/p&gt;
&lt;p class="part"&gt;Best,&lt;br /&gt;Thomas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while execute DFU example in Mesh SDK</title><link>https://devzone.nordicsemi.com/thread/132729?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 11:18:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38f03efa-7999-41cc-bead-3fcd5208d1ae</guid><dc:creator>a.wallwitz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/device_5F00_page_5F00_generator.py"&gt;devzone.nordicsemi.com/.../device_5F00_page_5F00_generator.py&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here you go.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while execute DFU example in Mesh SDK</title><link>https://devzone.nordicsemi.com/thread/132724?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 10:55:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b12f5f7d-e124-4c34-bd6b-bdf208a6c8c7</guid><dc:creator>Giang</dc:creator><description>&lt;p&gt;Yeah , I know it is python error , But I dont use python . So , can you give me this file ? Thank&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while execute DFU example in Mesh SDK</title><link>https://devzone.nordicsemi.com/thread/132721?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 10:50:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69ddd607-5616-4dc8-a773-5ebe283f0cbe</guid><dc:creator>a.wallwitz</dc:creator><description>&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/492387/indentationerror-unindent-does-not-match-any-outer-indentation-level"&gt;https://stackoverflow.com/questions/492387/indentationerror-unindent-does-not-match-any-outer-indentation-level&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That is a python error. Check if your leading spaces/tabs are correct for the added lines.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while execute DFU example in Mesh SDK</title><link>https://devzone.nordicsemi.com/thread/132711?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 10:30:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69237a27-7ae5-4930-9c50-71c2aa4173bb</guid><dc:creator>Giang</dc:creator><description>&lt;p&gt;Thank,&amp;nbsp;You also encounter this error?&lt;/p&gt;
&lt;p&gt;After I insert your code :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0675.1.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;I get error :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  File &amp;quot;device_page_generator.py&amp;quot;, line 69
    if not (isinstance(bl_info_type, BLInfoType) and
                                                   ^
IndentationError: unindent does not match any outer indentation level&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Any suggest ? Thank&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while execute DFU example in Mesh SDK</title><link>https://devzone.nordicsemi.com/thread/132692?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 09:13:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc85bca1-1312-4e69-8b89-161868343fa8</guid><dc:creator>a.wallwitz</dc:creator><description>&lt;p&gt;Check the beginning of my ticket here:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34378/mesh-dfu-example-not-working-no-serial-communication-for-linux-and-more"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/34378/mesh-dfu-example-not-working-no-serial-communication-for-linux-and-more&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is how I fixed it.&lt;br /&gt;&lt;br /&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;- Using the device_page_generator.py the string for the public key was read as unicode so I had to add this part:&lt;/p&gt;
&lt;p&gt;if(isinstance(data, unicode)):&lt;br /&gt;&amp;nbsp; &amp;nbsp; data = data.encode(&amp;#39;utf-8&amp;#39;)&lt;/p&gt;
&lt;p&gt;after line 65. So I got this running and could generate device pages. Even though I can not imagine that I am the only one having this problem O_o&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>