Problem with Attiny84 and NRF24L01

Hello,

I have a problem with attiny84 on which is connected a NRF24L01.
I have a NRF24L01 (0) connected to an arduino UNO that sends data to the NRF24L01 (1) connected to an attiny84.
The communication between 0 and 1 works well but after some times 1 doesn't receives any more information. I am forced to restart the attiny for it to work again.

Have you ever encountered this problem or would you have an idea?

thank you

You need to post your two programs.

How is the Attiny powered?

...R
Simple nRF24L01+ Tutorial

I have no experience of the TMRh20 Network library - I have never needed it.

Have you ever had reliable wireless communication with the Attiny? If not I suggest you put the Network and all the sensor stuff to one side and just get simple wireless comms working - try the first example in this Simple nRF24L01+ Tutorial. Obviously you will need to make some changes for the Attiny, but keep them to the absolute minimum.

…R

PS … why does your project need the Network library?

Yes I have already had reliable wireless communication with the Attiny.
The wireless communication work well, but after a moment the Attiny can't send or receive.

I need the network library for use the mesh network.
Example of typology use.

You have posted 3 programs. Which one has the problem?

I need the network library for use the mesh network.

Then I must ask why do you need the mesh network?

IMHO unless the distance between nodes is so far that messages need to be relayed I can't see any value in using either the Network or Mesh libraries.

The Attiny has very limited SRAM - might that be the cause of the problem?

...R

The last code has the problem ( Node 031 ).

Yes, the distance between nodes is so far that messages need to be relayed.
I also thought about a SRAM problem but I do not know how to check and/or empty the SRAM.

Sorry, I have no idea how to debug that program. It seems a lot of program for an Attiny and what's visible does not include the code from the 3 libraries.

...R

Robin2:
Sorry, I have no idea how to debug that program. It seems a lot of program for an Attiny and what's visible does not include the code from the 3 libraries.

...R

All libraries are included.
What are the 3 libraries you are talking about

alb12:
All libraries are included.
What are the 3 libraries you are talking about

Sorry. I did not express myself clearly. All I meant is that the code in your program does not show all the lines of code that are in the libraries that it references.

...R

Only this library are not show because they are in the arduino library list

#include <OneWire.h>
#include <DallasTemperature.h>
#include <stdlib.h>

// ADD FOR NRF24L01+
#include <SPI.h>
#include <RF24.h>
#include <RF24Network.h>

RF24:

https://tmrh20.github.io/RF24

RF24Netwrok :
https://tmrh20.github.io/RF24Network/

alb12:
Only this library are not show because they are in the arduino library list

You are missing my point.

Have you looked at the source code for the libraries you use? How many lines of code are there?

When you compile a program all those lines of code in the libraries must be considered as well as the lines of code that you wrote. Your program in Reply #4 is about 250 lines long. When you add in the lines of code in the libraries that probably grows to 800 or 1000 lines, maybe a lot more. And after it is compiled all that has to fit in an Attiny

...R

Of course.

All code fit in Attiny84, below the compile response

Le croquis utilise 7928 octets (96%) de l'espace de stockage de programmes. Le maximum est de 8192 octets.
Les variables globales utilisent 245 octets (47%) de mémoire dynamique, ce qui laisse 267 octets pour les variables locales. Le maximum est de 512 octets.

Referring to Reply #14 ...

It may compile, but is the available 267 bytes sufficient for everything else that has to happen while the program is running?

Personally I have no idea. If I was developing a program for an Attiny I would do so in small steps testing at each stage. Then I could see if adding some feature caused a problem.

...R

the problem is that the bug occurs randomly so not easy to debug.

Does it possible to clean with code dynamic memory on Attiny84

alb12:
Does it possible to clean with code dynamic memory on Attiny84

I wonder if that should read “is it possible to write reliable code with dynamic memory on an Attiny84” ?

But even with that re-write I am not clear about the question. What is the code that needs dynamic memory?

Personally I would avoid dynamic memory usage on all Arduinos.

…R