Hi ! sorry for my poor english ... I have an arduino UNO R4 wifi that I want to connect with Thingsboard libraries. If I select in the UNO R4 wifi tab during compilation I get
"In file included from c:\Users\Teo\Documents\Arduino\libraries\ThingsBoard\src/OTA_Handler.h:10:0,
from c:\Users\Teo\Documents\Arduino\libraries\ThingsBoard\src/ThingsBoard.h:14,
from C:\Users\Teo\Documents\sketch_may12b\sketch_may12b.ino:7:"
ThingsBoard libraries src/Callback_Watchdog. h:12:10: fatal error: Ticker. h: No such file or directory #includes <Ticker. h>"
while if I select UNO Wifi everything is compiled regularly. When I try to send the sketch on the arduino but everything stops.
If I select the UNO R4 wifi and use a test sketch it works regularly. The problem is when I use Thingsboard libraries. THANKS for the help !
Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.
Repeated cross-posting can result in a suspension from the forum.
In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.
Hi @matteotara_8690. The immediate cause of the error is that, when compiling for the UNO R4 WiFi board, the "ThingsBoard" library has a dependency on the "Ticker" library:
The "ThingsBoard" library makes extensive use of the preprocessor to enable or disable various parts of the library depending on which board you are compiling for. This code here:
causes the OTA (over-the-air) code that depends on the "Ticker" library to be disabled when you have the UNO WiFi board selected, which is why you didn't encounter that " Ticker. h: No such file or directory" error when compiling for the Uno WiFi.
You could fix that immediate problem by installing the "Ticker" library via the Arduino IDE Library Manager, but you will just run into another error the next time you compile. The root problem is that the "ThingsBoard" library is configured so that it enables the OTA code when you compile for the UNO R4 WiFi board, but from what I can see that code simply isn't compatible with the UNO R4 WiFi board and so it still fails to compile even after you install all the missing library dependencies.
I was able to get it to compile for the UNO R4 WiFi board by editing the library code to disable the OTA feature. I don't know anything about ThingsBoard so I have no idea whether it will actually work with the UNO R4 WiFi board (a sketch may be completely non-functional in behavior even though it compiled perfectly), but in case you don't require the OTA feature and would like to give it a try, I'll provide instructions you can follow to make that modification to the library: