<?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>Loss of connection between rf24 transmitter &amp;amp; receiver</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73256/loss-of-connection-between-rf24-transmitter-receiver</link><description>Loss of comms between nRF24L01+ transmitter and receiver after successful data transfer. 
 One rf24 is configured as a PTX (sensor device) communicating in a simple point-point link with a second in PRX mode (base unit) over pipe 0. Both are connected</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 13 Apr 2021 13:50:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73256/loss-of-connection-between-rf24-transmitter-receiver" /><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/304588?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 13:50:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14025973-3f9b-417f-aa42-cc05414bcb04</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am glad to hear that the problems have disappeared!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]- in former “p_out()” subroutine (subr), I swopped the order of&amp;nbsp; the open_tx_pipe(A1) and stop_listening() subrs (so that Open now proceeds Stop).&amp;nbsp; I don’t know whether this had any effect, but please comment if it could have.[/quote]
&lt;p&gt;You normally want to configure the device before starting the specific mode (it being TX or RX). For this specific routine, it does not matter much.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]&lt;p&gt;- the unnecessary CRC() subr was removed, with CRC for 2 bytes set in the init_radio() subr.&lt;/p&gt;
&lt;p&gt;- I changed the any_rx() subr from interrupt scanning on the RX_EMPTY bit in FIFO_STATUS to scanning on the RX_DR bit in STATUS.&lt;/p&gt;
&lt;p&gt;- in former “p_in()” subr, I (a) swopped the order of&amp;nbsp; the open_tx_pipe(A1) and stop_listening() subrs (so that Open now proceeds Stop), (b) added a check on the received packet length to be &amp;lt;32 bytes using R_RX_PL_WID with a break out of the infinite loop if &amp;gt;32, (c) encapsulated the Receive() subr &amp;nbsp;in a loop testing for more than 1 received payload per interrupt&amp;nbsp; .. by using a loop test on RX_EMPTY in FIFO_STATUS.&lt;/p&gt;
&lt;p&gt;I therefore note that for my code to have started working, is that my PTX completes a (PWR_UP &amp;amp; PTX) state mode followed by a (PWR_DOWN &amp;amp; PRX) state mode cycle.&amp;nbsp; Whereas my PRX always stays in a (PWR_UP &amp;amp; PRX) state mode. &amp;nbsp;Of course, it’s possible that further code modification might also be successful, but I don’t have the time to explore further.&lt;/p&gt;
&lt;p&gt;Thank you again for your detailed interest and help!!&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;Always happy to help!&lt;/p&gt;
&lt;p&gt;Good to hear that you added checks for handling the dynamic payload approach. This will save you debugging hours in the future.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]PS – once my particular nRF24L01+ application has been completed, I might investigate using some of your other similar products, so I would find a copy of your algorithm for the C based API for the whole nRF24L-series devices very helpful if your offer is still valid.[/quote]
&lt;p&gt;&amp;nbsp;Its just a simplistic API, and the real work is getting the logic up-and-running, with catching the corner-cases (like &amp;gt;32 byte payload), which the API does not show. I would recommend that you stick with the setup that you already have running, and rather contact us if&amp;nbsp;any issues/questions&amp;nbsp; pop up.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/304373?ContentTypeID=1</link><pubDate>Mon, 12 Apr 2021 20:00:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5f19903-f496-4e6b-8100-7bf40fb81f61</guid><dc:creator>mikebyrne</dc:creator><description>&lt;p&gt;Dear&amp;nbsp;H&amp;aring;kon,&lt;/p&gt;
&lt;p&gt;It seems that my re-coding has worked and I now have a working system! &amp;nbsp;I made several changes that resulted in this but, unfortunately because of time pressure, I can&amp;rsquo;t be sure whether one change in particular did the trick or just the whole combination of minor changes.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve stopped using the ping-pong format and have made my Sensor_unit a dedicated PTX and the Base_unit a dedicated PRX. This avoided the possibility of the TX missing a response from the RX in the infinite loop example of the ping-pong sequence.&lt;/p&gt;
&lt;p&gt;1) Code changes to the PTX:&lt;/p&gt;
&lt;p&gt;- in former &amp;ldquo;p_out()&amp;rdquo; subroutine (subr), I swopped the order of&amp;nbsp; the open_tx_pipe(A1) and stop_listening() subrs (so that Open now proceeds Stop).&amp;nbsp; I don&amp;rsquo;t know whether this had any effect, but please comment if it could have.&lt;/p&gt;
&lt;p&gt;2) Code changes to the Rx:&lt;/p&gt;
&lt;p&gt;- the unnecessary CRC() subr was removed, with CRC for 2 bytes set in the init_radio() subr.&lt;/p&gt;
&lt;p&gt;- I changed the any_rx() subr from interrupt scanning on the RX_EMPTY bit in FIFO_STATUS to scanning on the RX_DR bit in STATUS.&lt;/p&gt;
&lt;p&gt;- in former &amp;ldquo;p_in()&amp;rdquo; subr, I (a) swopped the order of&amp;nbsp; the open_tx_pipe(A1) and stop_listening() subrs (so that Open now proceeds Stop), (b) added a check on the received packet length to be &amp;lt;32 bytes using R_RX_PL_WID with a break out of the infinite loop if &amp;gt;32, (c) encapsulated the Receive() subr &amp;nbsp;in a loop testing for more than 1 received payload per interrupt&amp;nbsp; .. by using a loop test on RX_EMPTY in FIFO_STATUS.&lt;/p&gt;
&lt;p&gt;I therefore note that for my code to have started working, is that my PTX completes a (PWR_UP &amp;amp; PTX) state mode followed by a (PWR_DOWN &amp;amp; PRX) state mode cycle.&amp;nbsp; Whereas my PRX always stays in a (PWR_UP &amp;amp; PRX) state mode. &amp;nbsp;Of course, it&amp;rsquo;s possible that further code modification might also be successful, but I don&amp;rsquo;t have the time to explore further.&lt;/p&gt;
&lt;p&gt;Thank you again for your detailed interest and help!!&lt;/p&gt;
&lt;p&gt;PS &amp;ndash; once my particular nRF24L01+ application has been completed, I might investigate using some of your other similar products, so I would find a copy of your algorithm for the C based API for the whole nRF24L-series devices very helpful if your offer is still valid.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/303641?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 07:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:133fbaa8-9bf1-47b9-87e9-1a1110cc773c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]i) One of your previous points was &amp;quot;Those routines seems to flush RX + TX FIFOs, then also clear all interrupt flags&amp;quot; - I&amp;#39;m unclear as to whether you think that this was good or bad?[/quote]
&lt;p&gt;&amp;nbsp;My apologies, that is good.&lt;/p&gt;
[quote user="mikebyrne"]&lt;span&gt;iii) I don&amp;#39;t know what would make my PTX miss a payload send, but I take your point.&amp;nbsp;I&amp;#39;m not yet sure whether I can easily change my coding to test your&amp;nbsp;hypothesis above... still thinking on this! &amp;nbsp;However, as&amp;nbsp;&lt;/span&gt;&lt;span&gt;this code is representative of my intended application, (PTX sends &amp;#39;data_out&amp;#39; &amp;amp; PRX responds with &amp;#39;data_back&amp;#39;) &amp;nbsp;I could think about setting a timer within the Receive loop to escape the loop if the return &amp;#39;pong&amp;#39; has not been received within an acceptable time.&lt;/span&gt;[/quote]
&lt;p&gt;Wireless applications will lose a packet every now and then. This is true for all wireless protocols; wifi, bluetooth, GPS, satellite TV, etc.&lt;/p&gt;
&lt;p&gt;You do not need to change your code to test the scenario; you need to reproduce the issue and examine the registers state and/or check the current consumption of the nRF radio using a ampere-meter.&lt;/p&gt;
&lt;p&gt;If the issue is reproduced and identified; you can move on to solving the issue in code.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that this is not an issue on the receiver side logic, but on the transmitter side logic, which assumes that it will receive a packet every time it sends one. Its OK that you continuously poll the status (or FIFO_STATUS) register to see if you have received a payload on a primary receiver, as it is expected that this one shall be in RX most of its life-time.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;iv) Yes, I did notice the&amp;nbsp;ACK payload&amp;quot; &amp;nbsp;option in the data sheet, but I don&amp;#39;t feel that I want to go there yet.&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Good that you were aware of this! It is a logical next step if you need bidirectional communication, but I understand that you want to take this step-by-step.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]1) I will select and fix the CRC at start up and remove my &amp;quot;set_CRC()&amp;quot; subr - just to eliminate this as a potential problem source. &amp;nbsp;I don&amp;#39;t understand the case between using 1 or 2 CRC bytes (perhaps you might know?) but I will use the latter.[/quote]
&lt;p&gt;&amp;nbsp;1 byte = 256 combinations&lt;/p&gt;
&lt;p&gt;2 byte = 256*256 combinations&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2 byte is much stronger in terms of getting a random matching CRC. I would strongly recommend that you use 2 byte CRC.&lt;/p&gt;
[quote user="mikebyrne"]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2) My code has been responding to the INTERRUPT using the &lt;span&gt;RX_EMPTY bit in &lt;/span&gt;FIFO_STATUS in subr &amp;quot;any_rx()&amp;quot;, so I&amp;#39;ll change this to use the RX_DR bit in STATUS.&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;If you choose to check the STATUS or the FIFO_STATUS register, it does not make a huge difference when you are polling the nRF radio.&lt;/p&gt;
&lt;p&gt;Its usually a bit more convenient to use the STATUS register, as it is shifted back on MISO by-default.&lt;/p&gt;
[quote user="mikebyrne"]3)&amp;nbsp;I will also re-code to reflect the full RX handling procedure described in the RF24 datasheet&amp;#39;s table 27, STATUS register footnote (c), which I now realise I didn&amp;#39;t implement fully. This should deal with more than one RX packet per Interrupt.[/quote]
&lt;p&gt;&amp;nbsp;Good! Given that you flush the FIFOs after each reception, your logic handles this scenario eventually; but I guess you&amp;#39;re interested in the other payloads that might be queued up as well.&lt;/p&gt;
[quote user="mikebyrne"]4) My&amp;nbsp;Receive code has not been using R_RX_PL_WID to check packet width, even though my code only ever transmits 3 or 4 bytes at a time, but I will now add this check into my receive subroutines in case an event somehow produces &amp;gt; 32 bytes and causes a problem[/quote]
&lt;p&gt;You seem to have dynamic payload length disabled, and use a static length.&lt;/p&gt;
&lt;p&gt;While I always recommend to have this check implemented (precaution for when you choose to enable dynamic payload length) ; it should not have caused any troubles for you, as you currently use a static payload length.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]I will re-code to do the following and let you know how I get on (this might take me a couple of days!)[/quote]
&lt;p&gt;&amp;nbsp;Let me know how it goes!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/303583?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 16:23:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98370bb0-75ba-4aac-a408-37dcf273f830</guid><dc:creator>mikebyrne</dc:creator><description>&lt;p&gt;Dear&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you again for spending the time on this with me - I really do appreciate it !&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To answer your points:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;i) One of your previous points was &amp;quot;Those routines seems to flush RX + TX FIFOs, then also clear all interrupt flags&amp;quot; - I&amp;#39;m unclear as to whether you think that this was good or bad?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;ii) I guess that the p_in() function could block if a non-ideal packet is received...so I will change my Receive code on this (see below)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;iii) I don&amp;#39;t know what would make my PTX miss a payload send, but I take your point.&amp;nbsp;I&amp;#39;m not yet sure whether I can easily change my coding to test your&amp;nbsp;hypothesis above... still thinking on this! &amp;nbsp;However, as&amp;nbsp;&lt;/span&gt;&lt;span&gt;this code is representative of my intended application, (PTX sends &amp;#39;data_out&amp;#39; &amp;amp; PRX responds with &amp;#39;data_back&amp;#39;) &amp;nbsp;I could think about setting a timer within the Receive loop to escape the loop if the return &amp;#39;pong&amp;#39; has not been received within an acceptable time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;iv) Yes, I did notice the&amp;nbsp;ACK payload&amp;quot; &amp;nbsp;option in the data sheet, but I don&amp;#39;t feel that I want to go there yet.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;v) Thanks for your comment about an&amp;nbsp;algorithm, but I think that you&amp;#39;re right, let&amp;#39;s stay with trying to debug my code for now.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My next step:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Taking on your helpful comments, I will re-code to do the following and let you know how I get on (this might take me a couple of days!):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;1) I will select and fix the CRC at start up and remove my &amp;quot;set_CRC()&amp;quot; subr - just to eliminate this as a potential problem source. &amp;nbsp;I don&amp;#39;t understand the case between using 1 or 2 CRC bytes (perhaps you might know?) but I will use the latter.&lt;/p&gt;
&lt;p&gt;2) My code has been responding to the INTERRUPT using the &lt;span&gt;RX_EMPTY bit in &lt;/span&gt;FIFO_STATUS in subr &amp;quot;any_rx()&amp;quot;, so I&amp;#39;ll change this to use the RX_DR bit in STATUS.&lt;/p&gt;
&lt;p&gt;3)&amp;nbsp;I will also re-code to reflect the full RX handling procedure described in the RF24 datasheet&amp;#39;s table 27, STATUS register footnote (c), which I now realise I didn&amp;#39;t implement fully. This should deal with more than one RX packet per Interrupt.&lt;/p&gt;
&lt;p&gt;4) My&amp;nbsp;Receive code has not been using R_RX_PL_WID to check packet width, even though my code only ever transmits 3 or 4 bytes at a time, but I will now add this check into my receive subroutines in case an event somehow produces &amp;gt; 32 bytes and causes a problem&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Mike Byrne&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/303465?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 11:43:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:960c2cb6-863d-4fdd-afe3-f0d251468bf0</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]&lt;p&gt;while True:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Main loop does one full ping-pong cycle&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not PRX:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # start as PTX&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_out(&amp;quot;ping&amp;quot;)&amp;nbsp;&amp;nbsp;&amp;nbsp; # send ping&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_in()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # go into receive mode and wait for reply&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # start as PRX&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_in()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # receive and display msg&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_out(&amp;quot;pong&amp;quot;)&amp;nbsp;&amp;nbsp;&amp;nbsp; # send pong&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep(10) &amp;nbsp; &amp;nbsp; &amp;nbsp;# &amp;nbsp; &amp;nbsp;delay before starting next ping-pong cycle&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;p_in() function seems to be blocking until it receives a payload. Are you sure its not stuck in that utime.sleep()?&lt;/p&gt;
&lt;p&gt;If the PTX misses a payload, then the whole logic seems to go into a bad state where both act as PRX awaiting a PING/PONG from each other. If you can read back the registers on both devices, you should be able to check if my hypothesis is correct or not.&lt;/p&gt;
&lt;p&gt;Alternative can be to check the current consumption of each nRF-radio when it enters the bad state. If both show ~13 mA, then they&amp;#39;re likely in RX.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that there&amp;#39;s a possibility to use &amp;quot;ACK payload&amp;quot; to piggy back information back to the PTX device, from the PRX device.&amp;nbsp;How to enable and use this feature is mentioned more in-depth in the nRF24L01+ datasheet, chapter 7.4.1. If you look into this option, you do not have to switch the roles every time, but you would have to send in total two payloads to the PRX device (one for preparing the ACK payload, and one for fetching the ACK payload).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]You&amp;#39;ve kindly spent some &amp;nbsp;time looking at my code, but would it be more efficient in your time/effort if you could send me some example code (based on the simple code format that I&amp;#39;m trying to use here) which I imagine you engineers must have which demonstrates the very simple point-point communication that I&amp;#39;m trying to achieve? &amp;nbsp;That way I could hopefully work out where my lack of understanding is by comparing the code and minimize wasting your time.[/quote]
&lt;p&gt;The nRF24L01+ is a pure SPI based radio transceiver, which means that you can hook it up to any platform that has SPI master capabilities and start controlling it. This is also one of the drawbacks when me and you are debugging, meaning that there&amp;#39;s so many different possibilities of host controllers that is capable of driving the nRF24L01+. The code that we have is in the nRFgo SDK, and uses a common C based API for the whole nRF24L-series devices, while you are using a python based API on your own system.&lt;/p&gt;
&lt;p&gt;I could provide you a algorithm, but it would be much faster if we debug specifically towards your implemented platform.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/303267?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 15:54:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9b3d895-4bda-4f1e-9424-655f70ae7f57</guid><dc:creator>mikebyrne</dc:creator><description>&lt;p&gt;HI&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for replying today (Tuesday 6/4/21). &amp;nbsp;As you can probably guess, I&amp;#39;ve no previous experience with these radios and I don&amp;#39;t have the means (or understanding&amp;nbsp;how) &amp;nbsp;to send the state of the rf24 registers when the communication freezes. Sorry! &amp;nbsp;In answer to your points today:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1) OK, so there&amp;#39;s no link as such... I feel like I have to assume that the CRCs are ok as data does flow successfully until all stops. I don&amp;#39;t know how to prove otherwise. &amp;nbsp;I initialise the RF24s in RF channel 108...could this matter?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2) my code doesn&amp;#39;t do anything specific with the interrupts except the Rx code polls for receipt using the subroutine:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;def any_rx():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return not bool(reg_read(FIFO_STATUS,nop) &amp;amp; RX_EMPTY) # Lo if data in FIFO&lt;/p&gt;
&lt;p&gt;3) Over the last weekend, I lost confidence in, my code, so I reverted to code that &amp;quot;ping-pongs&amp;quot; brief 4 byte messages between the PTX &amp;amp; PRX at regular intervals...which I kept increasing until the communication froze again (it got up to about 40 mins). Perhaps my code is flushing buffers at the wrong time and this eventually causes the comms to freeze. &amp;nbsp;I simply don&amp;#39;t know? But, as you can see with the above subroutine, my code is checking the FIFO_STATUS.&lt;/p&gt;
&lt;p&gt;The code that follows is my &amp;#39;ping-pong&amp;#39; code - the same code for the PTX and PRX microcomputers but a button press on each device at start up determines which RF24 starts the sequence as PTX and which starts as PRX. &amp;nbsp;Maybe you can spot &amp;nbsp;where my code is in error.....obviously this code is as simple as I can make it.&lt;/p&gt;
&lt;p&gt;*** SUGGESTION ***&lt;/p&gt;
&lt;p&gt;You&amp;#39;ve kindly spent some &amp;nbsp;time looking at my code, but would it be more efficient in your time/effort if you could send me some example code (based on the simple code format that I&amp;#39;m trying to use here) which I imagine you engineers must have which demonstrates the very simple point-point communication that I&amp;#39;m trying to achieve? &amp;nbsp;That way I could hopefully work out where my lack of understanding is by comparing the code and minimize wasting your time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;___________________________________________&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s my simple &amp;#39;ping-pong&amp;#39; code:&lt;/p&gt;
&lt;p&gt;# nRF24L01+ registers:&lt;/p&gt;
&lt;p&gt;CONFIG = const(0x00)&lt;/p&gt;
&lt;p&gt;EN_AA = const(0x01)&lt;/p&gt;
&lt;p&gt;EN_RXADDR = const(0x02)&lt;/p&gt;
&lt;p&gt;SETUP_AW = const(0x03)&lt;/p&gt;
&lt;p&gt;SETUP_RETR = const(0x04)&lt;/p&gt;
&lt;p&gt;RF_CH = const(0x05)&lt;/p&gt;
&lt;p&gt;RF_SETUP = const(0x06)&lt;/p&gt;
&lt;p&gt;STATUS = const(0x07)&lt;/p&gt;
&lt;p&gt;RX_ADDR_P0 = const(0x0A)&lt;/p&gt;
&lt;p&gt;TX_ADDR = const(0x10)&lt;/p&gt;
&lt;p&gt;RX_PW_P0 = const(0x11)&lt;/p&gt;
&lt;p&gt;FIFO_STATUS = const(0x17)&lt;/p&gt;
&lt;p&gt;DYNPD = const(0x1C)&lt;/p&gt;
&lt;p&gt;# CONFIG:&lt;/p&gt;
&lt;p&gt;EN_CRC = const(0x08)&lt;/p&gt;
&lt;p&gt;CRCO = const(0x04)&lt;/p&gt;
&lt;p&gt;PWR_UP = const(0x02)&lt;/p&gt;
&lt;p&gt;PRIM_RX = const(0x01)&lt;/p&gt;
&lt;p&gt;# STATUS register&lt;/p&gt;
&lt;p&gt;RX_DR = const(0x40)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # RX data ready; write 1 to clear&lt;/p&gt;
&lt;p&gt;TX_DS = const(0x20)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # TX data sent; write 1 to clear&lt;/p&gt;
&lt;p&gt;MAX_RT = const(0x10)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # max retransmits reached; write 1 to clear&lt;/p&gt;
&lt;p&gt;# FIFO_STATUS register&lt;/p&gt;
&lt;p&gt;RX_EMPTY = const(0x01)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1 if RX FIFO is empty&lt;/p&gt;
&lt;p&gt;# constants for instructions&lt;/p&gt;
&lt;p&gt;R_RX_PL_WID = const(0x60)&amp;nbsp;&amp;nbsp; # read RX payload width&lt;/p&gt;
&lt;p&gt;R_RX_PAYLOAD = const(0x61)&amp;nbsp; # read RX payload&lt;/p&gt;
&lt;p&gt;W_TX_PAYLOAD = const(0xA0)&amp;nbsp; # write TX payload&lt;/p&gt;
&lt;p&gt;FLUSH_TX = const(0xE1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # flush TX FIFO&lt;/p&gt;
&lt;p&gt;FLUSH_RX = const(0xE2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # flush RX FIFO&lt;/p&gt;
&lt;p&gt;nop = const(0xFF)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # use to read registers&lt;/p&gt;
&lt;p&gt;payload_size = const(0x04)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 4 bytes for ping-pong tests&lt;/p&gt;
&lt;p&gt;channel = const(0x6C)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # chan 108 - above WIFI chans&lt;/p&gt;
&lt;p&gt;A1 = b&amp;#39;\x78\x78\x78\x78\x78&amp;#39;&amp;nbsp;&amp;nbsp;&amp;nbsp; # data pipe0 address&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 0x7878787878 - doesn&amp;#39;t work&lt;/p&gt;
&lt;p&gt;# my buffers:&lt;/p&gt;
&lt;p&gt;buf_out = bytearray(1)&lt;/p&gt;
&lt;p&gt;buf_in = bytearray(1)&lt;/p&gt;
&lt;p&gt;rx_buf = bytearray(payload_size)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;def init_radio():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; utime.sleep_ms(5)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(SETUP_AW,0b11)&amp;nbsp;&amp;nbsp;&amp;nbsp; # addr width to 5 bytes&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; res = reg_read(SETUP_AW,nop)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if res != 0b11:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; display.scroll(&amp;quot;E1&amp;quot;)&amp;nbsp;&amp;nbsp;&amp;nbsp; # check comms with hw&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep(1000)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(EN_AA,0x01)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # enable auto ack on pipe0 only&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #reg_write(SETUP_RETR,0x68)&amp;nbsp; # auto re-tx delay 1750us &amp;amp; count 8&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(SETUP_RETR,0xFF)&amp;nbsp; # auto re-tx delay 4ms &amp;amp; count 15 attempts&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(RF_CH,0x6C)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # rf chan 108&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(RF_SETUP, 0x22)&amp;nbsp;&amp;nbsp; # 250KB, -12dBm low power&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #reg_write(RF_SETUP, 0x26)&amp;nbsp;&amp;nbsp; # 250KB, 0dBm&amp;nbsp; max power&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(DYNPD,0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # disable dynamic payloads&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_crc(2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # CRC 2 bytes&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(STATUS,RX_DR|TX_DS|MAX_RT)&amp;nbsp;&amp;nbsp;&amp;nbsp; # clr flags&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flush_rx()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flush_tx()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def flush_rx():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buf_out[0] = FLUSH_RX&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin16.write_digital(0)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; spi.write_readinto(buf_out,buf_in)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin16.write_digital(1)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def flush_tx():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buf_out[0] = FLUSH_TX&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin16.write_digital(0)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; spi.write_readinto(buf_out,buf_in)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin16.write_digital(1)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def set_crc(length):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; config = reg_read(CONFIG,nop) &amp;amp; ~(CRCO | EN_CRC)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if length == 0:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif length == 1:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; config |= EN_CRC&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; config |= EN_CRC | CRCO&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(CONFIG, config)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def open_tx_pipe(addr):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #EN_AA &amp;amp; SETUP_AW already set in init_radio for pipe0 &amp;amp; 5 byte addr width&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # reg_write(EN_RXADDR,0x01)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # enable data pipe0&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(RX_PW_P0,payload_size)&amp;nbsp;&amp;nbsp;&amp;nbsp; # RX payload bytes in pipe0&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write_bytes(RX_ADDR_P0,addr)&amp;nbsp;&amp;nbsp;&amp;nbsp; # set pipe0 rx addr&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write_bytes(TX_ADDR,addr)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # set tx addr to same&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def open_rx_pipe(addr):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #EN_AA &amp;amp; SETUP_AW already set in init_radio fro pipe0 &amp;amp; 5 byte addr width&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(EN_RXADDR,0x01)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # enable data pipe 0&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(RX_PW_P0,payload_size)&amp;nbsp;&amp;nbsp;&amp;nbsp; # RX payload bytes in pipe0&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write_bytes(RX_ADDR_P0,addr)&amp;nbsp;&amp;nbsp;&amp;nbsp; # set pipe0 rx addr&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # reg_write_bytes(TX_ADDR,addr)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # set tx addr to same&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def start_send(data):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # transmit pipe0 should already be set up&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(CONFIG,(reg_read(CONFIG,nop) | PWR_UP))&amp;nbsp;&amp;nbsp; # set PUP&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep(2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # wait for 1.5msec start up time&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # now in Standby-I mode&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(CONFIG,(reg_read(CONFIG,nop) &amp;amp; ~PRIM_RX)) # set TX mode&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; utime.sleep_us(150)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # wait for TX setting time&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; load_TX_FIFO(data)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # now transmit data&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin12.write_digital(1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ### set CE for Active Tx Mode ###&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; utime.sleep_us(15)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # needs to be &amp;gt;10us&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin12.write_digital(0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ### reset CE Chip Enable ###&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def end_send():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # end send mode&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(STATUS,RX_DR|TX_DS|MAX_RT)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # clr flags&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(CONFIG,reg_read(CONFIG,nop) | PRIM_RX)&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set RX mode&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(CONFIG,reg_read(CONFIG,nop) &amp;amp; ~PWR_UP)&amp;nbsp;&amp;nbsp;&amp;nbsp; # power down&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flush_rx()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flush_tx()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def start_listening():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # receive pipe0 should already be set up&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(CONFIG,reg_read(CONFIG,nop) | PWR_UP)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # PUP&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep(2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # wait for &amp;gt;1.5 msec&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # now in Standby-I mode&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(CONFIG,reg_read(CONFIG,nop) | PRIM_RX)&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set RX mode&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(STATUS,RX_DR|TX_DS|MAX_RT)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # clr flags extra&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flush_rx()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# needed?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flush_tx()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # needed?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin12.write_digital(1)&amp;nbsp; ### set CE Chip Enable to start active RX mode ###&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; utime.sleep_us(150)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # wait Rx setting time&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def stop_listening():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin12.write_digital(0)&amp;nbsp; ### reset CE Chip Enable ###&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; utime.sleep_us(150)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # returned to Standby-I mode&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(STATUS,RX_DR|TX_DS|MAX_RT)&amp;nbsp;&amp;nbsp; # clr flags extra&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flush_rx()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flush_tx()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def any_rx():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return not bool(reg_read(FIFO_STATUS,nop) &amp;amp; RX_EMPTY) # Lo if data in FIFO&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def receive(reg,rx_buf):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buf_out[0] = reg&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin16.write_digital(0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # CS Lo&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; spi.write_readinto(buf_out,buf_in)&amp;nbsp; # send reg&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rx_buf = spi.read(payload_size)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # get code&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pin16.write_digital(1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # CS Hi&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_write(STATUS,RX_DR)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return rx_buf&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # now ready for entering TX or RX mode or power down mode&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def p_out(code):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Enter Tx mode:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; open_tx_pipe(A1)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stop_listening()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep(1000)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # wait for receiver to display previously received msg&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display.show(&amp;quot;&amp;gt;&amp;quot;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep(500)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display.clear()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; start_send(code)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end_send()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;def p_in():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; open_rx_pipe(A1)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; start_listening()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while not any_rx():&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; utime.sleep_us(10)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; res = receive(R_RX_PAYLOAD,rx_buf)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display.scroll(str(res,&amp;#39;UTF-8&amp;#39;))&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;# Initialise:&lt;/p&gt;
&lt;p&gt;init_SPI()&lt;/p&gt;
&lt;p&gt;init_radio()&lt;/p&gt;
&lt;p&gt;if button_b.is_pressed():&amp;nbsp;&amp;nbsp; # using input as Tx/Rx mode selection&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRX = True&lt;/p&gt;
&lt;p&gt;else:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRX = False&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if not PRX:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display.show(&amp;#39;t&amp;#39;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep(3000)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display.clear()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;else:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display.show(&amp;#39;r&amp;#39;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep(3000)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display.clear()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;while True:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Main loop does one full ping-pong cycle&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not PRX:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # start as PTX&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_out(&amp;quot;ping&amp;quot;)&amp;nbsp;&amp;nbsp;&amp;nbsp; # send ping&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_in()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # go into receive mode and wait for reply&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # start as PRX&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_in()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # receive and display msg&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_out(&amp;quot;pong&amp;quot;)&amp;nbsp;&amp;nbsp;&amp;nbsp; # send pong&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep(10) &amp;nbsp; &amp;nbsp; &amp;nbsp;# &amp;nbsp; &amp;nbsp;delay before starting next ping-pong cycle&lt;/p&gt;
&lt;p&gt;_____________________________________________________&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s the last line - sleep() which I increase until the comms freezes.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re unable to send me some example code, then I hope that you can spot what I&amp;#39;m doing wrong!&lt;/p&gt;
&lt;p&gt;Kind Regards&lt;/p&gt;
&lt;p&gt;Mike Byrne&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/303193?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 13:38:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5b9d3a8-74f9-4c98-8534-ebd42b43e924</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;My apologies for the late reply. Its been Easter holiday here in Norway.&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]i) Given that I haven&amp;#39;t yet had the time to run this for, say, 24 hours between &amp;nbsp;RF24 code transmissions, I&amp;#39;m not yet confident that the RF24 link will stay up that long without any activity. My hope is that the RF24 system could go for days between brief transmissions.[/quote]
&lt;p&gt;There&amp;#39;s no &amp;quot;link&amp;quot; in that sense. These are quite simple radio protocols, as long as the on-air physical parameters match, and the CRC is OK; the payload is received, regardless of when this was received in time.&amp;nbsp;&lt;/p&gt;
[quote user="mikebyrne"]2) Also, although I now suspect it, I have no understanding of how the Base unit&amp;#39;s second radio might interfere with RF24 radios. &amp;nbsp;The pattern was that it&amp;#39;s the Sensor unit which freezes far more often than the Base unit (although both are side by side on the bench within radio range of the second radio system during this development phase).[/quote]
&lt;p&gt;It would be very informative if you were able to get a readback of the nRF24L01+ registers when the radio locked up. There was not much radio handling in the code that you posted, for instance; how do you handle the interrupt from the radio? Do you poll the radio or use the IRQ pins?&lt;/p&gt;
[quote user="mikebyrne"]3) Thirdly, I use the following subroutines to set the RF24 radios into Tx or Rx mode. But I&amp;#39;ve added the &amp;quot;open_tx/rx&amp;quot; and &amp;#39;start_listening/stop_listening&amp;#39; &amp;nbsp;subrs into the start of the Main loop code.......I think that this helps but I&amp;#39;m not sure! I&amp;#39;d welcome your advice on this please.[/quote]
&lt;p&gt;&amp;nbsp;Those routines seems to flush RX + TX FIFOs, then also clear all interrupt flags.&lt;/p&gt;
&lt;p&gt;Its hard to say what exactly can be the problem here, especially without seeing the logic for interrupt/radio payload handling, but it sounds like the RX FIFO is filled up without your host controller reading/clearing. Note that the RX FIFO is 3 levels deep, meaning that for one interrupt you can have up to 3 payload queued up. You can read the &amp;quot;FIFO_STATUS&amp;quot; register to see if you have more payloads that needs to be read out.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/302460?ContentTypeID=1</link><pubDate>Mon, 29 Mar 2021 17:59:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:865f1f46-7ce6-4e56-b8df-d4bd79e3161c</guid><dc:creator>mikebyrne</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Just to report that after the RF24 link staying alive this morning for a couple of consecutive periods of 1 hour and 1.5 hours between brief transmissions, it eventually failed again sometime over a 3 hr 20 minute period this afternoon - despite no transmission activity from my Base&amp;#39;s second radio source!! &amp;nbsp;This time it was the Base unit which froze and requiring a re-boot to start responding to the Sensor transmissions again (itself not needing a reboot this time). Dissapointing but somehow not a surprise. Hopefully you will know better, but to me that suggests that the second radio source may not be the cause of the problem, whatever help my re-coding did to try to separate the transmissions of the two radio systems may have had. &amp;nbsp;Will I really need to get my Sensor unit to send a regular &amp;#39;heatbeat&amp;#39; transmission to keep the link alive?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/302331?ContentTypeID=1</link><pubDate>Mon, 29 Mar 2021 10:03:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84b09cf6-fabf-4bd1-935b-f439b4eafb6a</guid><dc:creator>mikebyrne</dc:creator><description>&lt;p&gt;Morning&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I decided to explore my problem further over the weekend before replying and have some extra information for you. Firstly, I don&amp;#39;t have a register dump - but I&amp;#39;m fairly confident that the registers have the correct values. Each RF24 is initialised with the same subroutine code: which includes setting the CRC for 2 bytes:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;def init_rf24_radio():&lt;br /&gt; utime.sleep_ms(5)&lt;br /&gt; reg_write(SETUP_AW,0b11) # addr width to 5 bytes&lt;br /&gt; res = reg_read(SETUP_AW,nop)&lt;br /&gt; if res != 0b11:&lt;br /&gt; display.scroll(&amp;quot;E1&amp;quot;) # check comms with hw&lt;br /&gt; sleep(1000)&lt;br /&gt; reg_write(EN_AA,0x01) # enable auto ack on pipe0 only&lt;br /&gt; reg_write(SETUP_RETR,0x68) # auto re-tx delay 1750us &amp;amp; count 8&lt;br /&gt; #reg_write(SETUP_RETR,0xFF) # auto re-tx delay 4ms &amp;amp; count 15 attempts&lt;br /&gt; reg_write(RF_CH,0x6C) # rf chan 108&lt;br /&gt; reg_write(RF_SETUP, 0x22) # 250KB, -12dBm low power&lt;br /&gt; #reg_write(RF_SETUP, 0x26) # 250KB, 0dBm max power&lt;br /&gt; reg_write(DYNPD,0) # disable dynamic payloads&lt;br /&gt; set_crc(2) # CRC 2 bytes&lt;br /&gt; reg_write(STATUS,RX_DR|TX_DS|MAX_RT) # clr flags&lt;br /&gt; flush_rx()&lt;br /&gt; flush_tx()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My code tries to keep both units in Standby-I mode, so neither uses the PWR_UP = 0 command.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tried reducing the SETUP_RETR values (above) from their maximum, but I don&amp;#39;t think this changed matters.&amp;nbsp;&lt;/span&gt;&lt;span&gt;The CRC subr is called, but as I only use 2 bytes, I could just replace with it a single command, but the CRC subr is:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;def set_crc(length):&lt;br /&gt; config = reg_read(CONFIG,nop) &amp;amp; ~(CRCO | EN_CRC)&lt;br /&gt; if length == 0:&lt;br /&gt; pass&lt;br /&gt; elif length == 1:&lt;br /&gt; config |= EN_CRC&lt;br /&gt; else:&lt;br /&gt; config |= EN_CRC | CRCO&lt;br /&gt; reg_write(CONFIG, config)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Secondly, I reduced the code in both the Sensor (PTX) and Base unit (PRX) and run just the RF24 relevant code - and this *seemed to have worked* &amp;nbsp;- well as least kept the RF24 link up in point-point mode for intervals of up to 1 hour. &amp;nbsp;I had my Sensor unit send one (3 byte) transmission every hour. ....This apparent progress led me to realize an important admission from my original problem description: Namely&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;that my base unit has a second different radio transmitting source, also working on the 2.4GHz band, but not on the same channel - RF24 chan is 108 (2508MHz) and the 2nd radio on chan 7 (2407MHz). &amp;nbsp;This led me to change my code so that instead of having both radios simultaneously receiving/transmitting, the Base Unit now disables the 2nd radio while the main code loop allows the RF24 to receive (listen) for an incoming code, and then when one is received, the RF24 is stopped listening and the 2nd radio turned on long just enough to transmit its code before being switched off again for the RF24 to go back into its listening mode. &amp;nbsp;So far.. as of this morning.. the Sensor is working in a stable manner, succesfully transmitting a code every hour to the Base station ......&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However, &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;i) Given that I haven&amp;#39;t yet had the time to run this for, say, 24 hours between &amp;nbsp;RF24 code transmissions, I&amp;#39;m not yet confident that the RF24 link will stay up that long without any activity. My hope is that the RF24 system could go for days between brief transmissions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2) Also, although I now suspect it, I have no understanding of how the Base unit&amp;#39;s second radio might interfere with RF24 radios. &amp;nbsp;The pattern was that it&amp;#39;s the Sensor unit which freezes far more often than the Base unit (although both are side by side on the bench within radio range of the second radio system during this development phase).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3) Thirdly, I use the following subroutines to set the RF24 radios into Tx or Rx mode. But I&amp;#39;ve added the &amp;quot;open_tx/rx&amp;quot; and &amp;#39;start_listening/stop_listening&amp;#39; &amp;nbsp;subrs into the start of the Main loop code.......I think that this helps but I&amp;#39;m not sure! I&amp;#39;d welcome your advice on this please.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;PRX Base Unit :&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A1 = b&amp;#39;\x78\x78\x78\x78\x78&amp;#39;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# RF24 Base unit starts in Rx mode&lt;br /&gt;reg_write(CONFIG,(reg_read(CONFIG,nop) | PWR_UP)) # set PUP&lt;br /&gt;sleep(2) # wait for 1.5msec start up time&lt;br /&gt;# now in Standby-I mode&lt;br /&gt;reg_write(CONFIG,reg_read(CONFIG,nop) | PRIM_RX) # Set RX mode&lt;br /&gt;utime.sleep_us(150) # wait for TX setting time&lt;br /&gt;open_rx_pipe(A1)&lt;br /&gt;start_listening()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;def open_rx_pipe(addr):&lt;br /&gt; #EN_AA &amp;amp; SETUP_AW already set in init_radio for pipe0 &amp;amp; 5 byte addr width&lt;br /&gt; reg_write(EN_RXADDR,0x01) # enable data pipe 0&lt;br /&gt; reg_write(RX_PW_P0,payload_size) # RX payload bytes in pipe0&lt;br /&gt; reg_write_bytes(RX_ADDR_P0,addr) # set pipe0 rx addr&lt;br /&gt; &lt;br /&gt;def start_listening():&lt;br /&gt; reg_write(STATUS,RX_DR|TX_DS|MAX_RT) # clr flags extra&lt;br /&gt; flush_rx()&lt;br /&gt; flush_tx()&lt;br /&gt; pin12.write_digital(1) ### set CE Chip Enable to start active RX mode ###&lt;br /&gt; utime.sleep_us(150) # wait Rx setting time&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;PTX Sensor Unit :&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A1 = b&amp;#39;\x78\x78\x78\x78\x78&amp;#39;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# RF24 Sensor unit starts in Tx mode&lt;br /&gt;# PUP &amp;amp; set Tx mode, then go into Standby I mode&lt;br /&gt;reg_write(CONFIG,(reg_read(CONFIG,nop) | PWR_UP)) # set PUP&lt;br /&gt;sleep(2) # wait for 1.5msec start up time&lt;br /&gt;# now in Standby-I mode&lt;br /&gt;reg_write(CONFIG,(reg_read(CONFIG,nop) &amp;amp; ~PRIM_RX)) # set TX mode&lt;br /&gt;utime.sleep_us(150) # wait for TX setting time&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;def open_tx_pipe(addr):&lt;br /&gt; #EN_AA &amp;amp; SETUP_AW already set in init_radio for pipe0 &amp;amp; 5 byte addr width&lt;br /&gt; reg_write(RX_PW_P0,payload_size) # RX payload bytes in pipe0&lt;br /&gt; reg_write_bytes(RX_ADDR_P0,addr) # set pipe0 rx addr&lt;br /&gt; reg_write_bytes(TX_ADDR,addr) # set tx addr to same&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;def stop_listening():&lt;br /&gt; pin12.write_digital(0) ### reset CE Chip Enable ###&lt;br /&gt; utime.sleep_us(150)&lt;br /&gt; # returned to Standby-I mode&lt;br /&gt; reg_write(STATUS,RX_DR|TX_DS|MAX_RT) # clr flags extra&lt;br /&gt; flush_rx()&lt;br /&gt; flush_tx()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;def flush_rx():&lt;br /&gt; buf_out[0] = FLUSH_RX&lt;br /&gt; pin16.write_digital(0)&lt;br /&gt; spi.write_readinto(buf_out,buf_in)&lt;br /&gt; pin16.write_digital(1)&lt;br /&gt; &lt;br /&gt;def flush_tx():&lt;br /&gt; buf_out[0] = FLUSH_TX&lt;br /&gt; pin16.write_digital(0)&lt;br /&gt; spi.write_readinto(buf_out,buf_in)&lt;br /&gt; pin16.write_digital(1)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I hope that this is enough information for you to assess my problem, but please let me know if not. &amp;nbsp;Thank you again for looking into this for me.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind Regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mike Byrne&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/302105?ContentTypeID=1</link><pubDate>Fri, 26 Mar 2021 10:33:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac09fe10-9eea-4bde-9e60-e5e66857d8e1</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you share your configuration? Address used, crc configuration, and so forth.&lt;/p&gt;
[quote user=""]&lt;p&gt;As far as I can tell, my code correctly implements the RF24 state diagrams, the registers appear to be correctly&amp;nbsp;&lt;/p&gt;
&lt;p&gt;configured and the TX-FIFO &amp;amp; RX-FIFO are flushed as necessary.&lt;/p&gt;[/quote]
&lt;p&gt;Do you have a register dump of the expected values, and when the issue occurs?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Loss of connection between rf24 transmitter &amp; receiver</title><link>https://devzone.nordicsemi.com/thread/302078?ContentTypeID=1</link><pubDate>Fri, 26 Mar 2021 09:11:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca2a1fb9-ddae-410b-a2e7-a926a20a716b</guid><dc:creator>mikebyrne</dc:creator><description>&lt;p&gt;To be clear, i should have added that my hope is for the PTX &amp;amp; PRX to be on continuously, that the TX is only likely to send a dozen or so transmissions a day, each transmission will only be 3 ASCII chars long. In fact, following initial power up, my code only uses the command:&amp;nbsp;CONFIG write PWR_UP = 1 once, and (now) I never use the command PWR_UP = 0 in order to keep both devices in Standby I mode the whole time unless transmitting or receiving. &amp;nbsp;I also enable the maximum Auto Retransmit delay (4 msec) &amp;amp; maximum Auto Retransmit count (15).&lt;/p&gt;
&lt;p&gt;I can only assume that there is something fundamental about basic point-point operation that I don&amp;#39;t understand, so I welcome some guidance please!&lt;/p&gt;
&lt;p&gt;Kind Regards&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>