Arduino Ubuntu Including additional files

Hello everyone,

I am working on a project for the Nicla Sense ME and I am trying to figure out if Tensorflow libraries work with the Nicla, as is has a NRF SoC. My main problem for now is, since there is no supported final library for this.

First I am trying to include some files I found on github, but the problem is that arduino IDE doesn't seem to be able to find these files.

Here is my simple code, which basically does nothing:



#include "Nicla_System.h"
#include "Arduino.h"
#include "math.h"
#include "tensorflow/lite/micro/all_ops_resolver.h"
#include "tensorflow/lite/micro/micro_error_reporter.h"
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"


void setup() {
  nicla::begin();
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

I was able to make this run by putting the tensorflow folder in my root directory and where my sketch is. I start the Arduino IDE in the terminal with "sudo ./Arduino", while in the download folder of the Arduino IDE. This was the only way how I was able to make it work and have access to the serial port.

As you can see from the error mesage:


Arduino: 1.8.19 (Linux), Board: "Nicla Sense ME"

In file included from /root/Arduino/MLtry/MLtry.ino:6:0:
/root/Arduino/MLtry/tensorflow/lite/micro/all_ops_resolver.h:18:10: fatal error: tensorflow/lite/micro/compatibility.h: No such file or directory
 #include "tensorflow/lite/micro/compatibility.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Nicla Sense ME.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The builder finds the first file, but all the other #include statements in these .h files are not found.

I feel like I am missing something really simple, but I haven"t been able to make this work.

There is also an experimental library called Arduino_TensorflowLite, so if everything else fails I will have to try that.

Thanks in advance

Your topic was MOVED to its current forum category as it is more suitable than the original

There are three locations where the IDE will look for that file.

  1. The sketch directory.
  2. The libraries directory in the sketchbook; this is where 3rd party libraries are installed.
  3. The libraries directory in the installation directory'; your additional files should NOT be there.

Where are the tensorflow files installed? What are the permissions on those files and on the directories where they are located?

That's worrying. Why don't you have it in your user directory?

That's worrying. Why don't you have it in your user directory?

Not sure why this particular sketch is there, but I tried many ways to import all the files and it didn't work. The Arduino IDE seems very weird in ubuntu, the only way I was able to connect to the board and programm it (get my serial connection) was with runing the downloaded standalone version of the IDE with the terminal and sudo command, so technically it's not installed. The file structure is still too weird for me.

Frotunately, I found a premade "tensorflow Lite" library in alpha stage, that seems to work, so I will use that for a while. Thanks for the tips though.