<?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>pynrfjprog not working on Raspberry Pi 4</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82323/pynrfjprog-not-working-on-raspberry-pi-4</link><description>Hi, 
 I come from here: https://devzone.nordicsemi.com/f/nordic-q-a/80874/nrfjprog-not-working-on-raspberry-pi-4/336129 
 
 But for me the nrfjprog comand works fine: 
 
 
 However when I try to upload an hex with the pynrjprog pip module I get the following</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Dec 2021 11:30:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82323/pynrfjprog-not-working-on-raspberry-pi-4" /><item><title>RE: pynrfjprog not working on Raspberry Pi 4</title><link>https://devzone.nordicsemi.com/thread/341851?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 11:30:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe7bf681-9ce3-468f-bd25-14e132561cbf</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Looks like there may be a problem with the installation script. I noticed now that my /lib/python3.7/site-packages/pynrfjprog-10.15.1-py3.7.egg/pynrfjprog/&lt;strong&gt;lib_armhf&lt;/strong&gt;/ directory is empty after the installation.&lt;/p&gt;
&lt;p&gt;Can you try to manually copy the libraries from /opt/nrf-command-line-tools/python/pynrfjprog/lib_armhf?&lt;/p&gt;
&lt;p&gt;E.g.&lt;/p&gt;
&lt;p&gt;$ cp -R /opt/nrf-command-line-tools/python/pynrfjprog/lib_armhf /home/pi/Desktop/repo/gateway-software/productionVenv/lib/python3.7/site-packages/pynrfjprog-10.15.1-py3.7.egg/pynrfjprog/lib_armhf&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pynrfjprog not working on Raspberry Pi 4</title><link>https://devzone.nordicsemi.com/thread/341790?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 08:14:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ec778f3-ebbb-446f-b52c-10c520b279c6</guid><dc:creator>Mart&amp;#237;</dc:creator><description>&lt;p&gt;That makes more sense &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It still throws an error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Traceback (most recent call last):
  File &amp;quot;/home/pi/Desktop/repo/gateway-software/__init__.py&amp;quot;, line 4, in &amp;lt;module&amp;gt;
    main()
  File &amp;quot;/home/pi/Desktop/repo/gateway-software/gateway/mgateway.py&amp;quot;, line 32, in main
    OTA.updateBin(&amp;#39;&amp;#39;,&amp;#39;&amp;#39;)
  File &amp;quot;/home/pi/Desktop/repo/gateway-software/gateway/OTA.py&amp;quot;, line 115, in updateBin
    with HighLevel.API() as api:
  File &amp;quot;/home/pi/Desktop/repo/gateway-software/productionVenv/lib/python3.7/site-packages/pynrfjprog-10.15.1-py3.7.egg/pynrfjprog/HighLevel.py&amp;quot;, line 70, in __init__
    raise APIError(NrfjprogdllErr.NRFJPROG_SUB_DLL_NOT_FOUND, highlevel_nrfjprog_dll_path, log=self._logger.error)
pynrfjprog.APIError.APIError: An error was reported by NRFJPROG DLL: -150 NRFJPROG_SUB_DLL_NOT_FOUND. /home/pi/Desktop/repo/gateway-software/productionVenv/lib/python3.7/site-packages/pynrfjprog-10.15.1-py3.7.egg/pynrfjprog/lib_armhf/libhighlevelnrfjprog.so&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But I think I&amp;#39;m going to try to repeat your steps on a fresh installation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pynrfjprog not working on Raspberry Pi 4</title><link>https://devzone.nordicsemi.com/thread/341784?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 08:03:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cba849e-3e4e-4b0c-99da-1e984a5d5dc3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sorry, I didn&amp;#39;t mean to include pip in the command. Should have been python3 setup.py install --user. And the &amp;#39;--user&amp;#39; argument should be reduntant as you run it in venv.&lt;/p&gt;
&lt;p&gt;Try:&lt;/p&gt;
&lt;p&gt;$ python3 setup.py install&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pynrfjprog not working on Raspberry Pi 4</title><link>https://devzone.nordicsemi.com/thread/341774?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 07:19:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db6479fc-6163-4fa9-bc7f-1e40b51a3494</guid><dc:creator>Mart&amp;#237;</dc:creator><description>&lt;p&gt;So, I did:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;pi@raspberrypi:~/Downloads/nrf-command-line-tools-10.15.1_linux-armhf $ sudo dpkg -i JLink_Linux_V758b_arm.deb
(Reading database ... 114985 files and directories currently installed.)
Preparing to unpack JLink_Linux_V758b_arm.deb ...
Removing /opt/SEGGER/JLink ...
Unpacking jlink (7.582) over (7.582) ...
Setting up jlink (7.582) ...
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;pi@raspberrypi:~/Downloads/nrf-command-line-tools-10.15.1_linux-armhf $ sudo dpkg -i nrf-command-line-tools_10.15.1_armhf.deb 
(Reading database ... 114985 files and directories currently installed.)
Preparing to unpack nrf-command-line-tools_10.15.1_armhf.deb ...
Unpacking nrf-command-line-tools (10.15.1) over (10.15.1) ...
Setting up nrf-command-line-tools (10.15.1) ...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I switched into the venv, uninstalled pynrfjprog.&lt;/p&gt;
&lt;p&gt;Then I cd&amp;nbsp; (productionVenv) pi@raspberrypi:~/Downloads/nrf-command-line-tools-10.15.1_linux-armhf/nrf-command-line-tools/python $&lt;/p&gt;
&lt;p&gt;And ran:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="python"&gt;python3 -m pip setup.py install --user&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And got:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;(productionVenv) pi@raspberrypi:~/Downloads/nrf-command-line-tools-10.15.1_linux-armhf/nrf-command-line-tools/python $ python3 -m pip setup.py install --user
ERROR: unknown command &amp;quot;setup.py&amp;quot;&lt;/pre&gt;And just so that it&amp;#39;s clear:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;(productionVenv) pi@raspberrypi:~/Downloads/nrf-command-line-tools-10.15.1_linux-armhf/nrf-command-line-tools/python $ ls
build  cmake_install.cmake  __init__.py  MANIFEST.in  pynrfjprog  pynrfjprog.egg-info  README.md  setup.cfg  setup.py&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pynrfjprog not working on Raspberry Pi 4</title><link>https://devzone.nordicsemi.com/thread/341732?ContentTypeID=1</link><pubDate>Thu, 02 Dec 2021 14:38:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c6ba7c7-e356-4b59-af26-20ad879c4303</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It shouldn&amp;#39;t be a problem to run in it a virtual environment. Though I have not verified it here.&lt;/p&gt;
&lt;p&gt;Here is the code I used to program my hex file to the board:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="python"&gt;from pynrfjprog import HighLevel 

with HighLevel.API() as api:
    snrs = api.get_connected_probes()
    print(snrs)

    # To program J-Link probe at snr &amp;lt;snr&amp;gt;:
    with HighLevel.DebugProbe(api,683800344) as probe:
        probe.program(&amp;quot;ble_app_uart_pca10056_s140.hex&amp;quot;)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pynrfjprog not working on Raspberry Pi 4</title><link>https://devzone.nordicsemi.com/thread/341731?ContentTypeID=1</link><pubDate>Thu, 02 Dec 2021 14:35:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:081b502b-2343-4ad9-b982-2e172133632b</guid><dc:creator>Mart&amp;#237;</dc:creator><description>&lt;p&gt;I will give it a try.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Maybe the problem is that I&amp;#39;m running everything under a Python Virtual Enviorment?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pynrfjprog not working on Raspberry Pi 4</title><link>https://devzone.nordicsemi.com/thread/341727?ContentTypeID=1</link><pubDate>Thu, 02 Dec 2021 14:22:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dbe9639-46d6-4ea5-9d23-c33806858198</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I tested with a Pi4 here, and both nrfjprog and pynrfjprog worked. Maybe the python installation didn&amp;#39;t pull in the correct libraries in your case?&lt;/p&gt;
&lt;p&gt;This is what I did:&lt;/p&gt;
&lt;p&gt;1. Downloaded the zip&lt;/p&gt;
&lt;p&gt;2. Installed the jlink package first with sudo dpkg -i &amp;lt;jlink package&amp;gt;.deb&lt;/p&gt;
&lt;p&gt;3. Then the command line tools package using the same command as in step 2.&lt;/p&gt;
&lt;p&gt;4. Extracted the nrf-command-line-tools tarball then cd&amp;#39;ed to /nrf-command-line-tools-10.15.1_linux-armhf/nrf-command-line-tools/python and ran the setup script with this command: python3 -m pip setup.py install --user&lt;/p&gt;
&lt;p&gt;I suggest you try to uninstall the current pynrfjprog package and then try to install it like I did in step 4. Hope this helps.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>