<?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>Invalid argument type when sending a write request in Python</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100496/invalid-argument-type-when-sending-a-write-request-in-python</link><description>Hi, 
 I have a service that receives an uint8_t and it looks as shown below in the nRF Connect app 
 
 I try to configure it via the PC-BLE framework by using an nRF52840 dongle, but I get the error &amp;quot; Invalid argument type&amp;quot; every time when I want to schedule</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Jun 2023 13:56:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100496/invalid-argument-type-when-sending-a-write-request-in-python" /><item><title>RE: Invalid argument type when sending a write request in Python</title><link>https://devzone.nordicsemi.com/thread/429592?ContentTypeID=1</link><pubDate>Tue, 06 Jun 2023 13:56:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05fcb2cd-2500-4975-b663-48ba5e2def43</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &amp;quot;Invalid argument type&amp;quot; issue comes from:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="python"&gt;self.adapter.write_req(self.conn, self.service, struct.pack(&amp;#39;b&amp;#39;, 20))&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see where self.service comes from, though. Are parts of the script missing? The second parameter you pass to write_req() should be the UUID of the characteristic you are writing to.&lt;/p&gt;
&lt;p&gt;PS: You can copy-paste code in a readable way from Insert -&amp;gt; Insert Code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>