Posts: 1
Threads: 1
Joined: Sep 2023
Institution: CAU Kiel
Hi there,
is there a possibility to run the phyphox BLE library on Arduino Wifi R4, or is support planned in near future?
Posts: 441
Threads: 16
Joined: Apr 2020
Institution: RWTH Aachen University
We have just received two of the new Unos, however, not yet looked into these.
Support is certainly planned, “when” depends on the effort we have to put into it. Hard to tell right now.
Posts: 441
Threads: 16
Joined: Apr 2020
Institution: RWTH Aachen University
At first sight, it looks that the new Unos operate exactly like the IoTs. The following patch makes it work for the time being (the libraries are stored in the sketchbook folder):
Code:
diff -dur phyphox_BLE.std/library.properties phyphox_BLE/library.properties
--- phyphox_BLE.std/library.properties
+++ phyphox_BLE/library.properties
@@ -6,5 +6,5 @@
paragraph=The purpose of this library is to use the open source phyphox app (see https://phyphox.org) to plot sensor data on your phone. phyphox is much more than only 'plotting your data'. You can also perform data analysis with it or access your phones sensors to use in your Arduino project.
category=Other
url=https://phyphox.org/arduino
-architectures=mbed,esp32,samd,mbed_nano
+architectures=mbed,esp32,samd,mbed_nano,renesas_uno
includes=phyphoxBle.h
diff -dur phyphox_BLE.std/src/phyphoxBLE_NanoIOT.cpp phyphox_BLE/src/phyphoxBLE_NanoIOT.cpp
--- phyphox_BLE.std/src/phyphoxBLE_NanoIOT.cpp
+++ phyphox_BLE/src/phyphoxBLE_NanoIOT.cpp
@@ -1,4 +1,4 @@
-#ifdef ARDUINO_SAMD_NANO_33_IOT
+#if defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_UNOR4_WIFI)
#include "phyphoxBLE_NanoIOT.h"
#include "Arduino.h"
diff -dur --minimal phyphox_BLE.std/src/phyphoxBle.h phyphox_BLE/src/phyphoxBle.h
--- phyphox_BLE.std/src/phyphoxBle.h
+++ phyphox_BLE/src/phyphoxBle.h
@@ -23,7 +23,7 @@
#elif defined(ESP32)
#include "phyphoxBLE_ESP32.h"
-#elif defined(ARDUINO_SAMD_NANO_33_IOT)
+#elif defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_UNOR4_WIFI)
#include <ArduinoBLE.h>
#include "phyphoxBLE_NanoIOT.h"
#else
Please note that you also need to add “PhyphoxBLE::poll();” to the “loop()” function and you must provide a name in “PhyphoxBLE::start("<name>");” (likely a bug in our BLE driver for the IoT)…
Posts: 441
Threads: 16
Joined: Apr 2020
Institution: RWTH Aachen University
BTW, the BLE support has just been added to the Arduino code base on August 30. Please note that you have to update the board firmware to make it work at all…
Posts: 2
Threads: 0
Joined: Sep 2023
Institution: Teacher
Hi Jens,
great you found time, supporting the R4 Wifi.
As a newbie in Arduino / C++ I don't really have an idea, what to do with the patch-code.
Do I have to include it to the first section of declarations in my *.ino file or do I need to modify the phyphoxBle.h file or similar?
Posts: 441
Threads: 16
Joined: Apr 2020
Institution: RWTH Aachen University
In order to patch (edit), you need to find the Arduino sketchbook folder, head to the libraries and phyphox_BLE folder, and edit the three files in the “diff […]” lines. The diffs perhaps speak for themselves…
If you have (hopefully just) some hours of time, I would recommend to wait for the library update. The next major update has been pending for days (weeks). At the moment, it looks that the R4 changes are either minimal –or fix substantial … inconveniences in the IoT part anyway. So we should not hold these back.
Posts: 2
Threads: 0
Joined: Sep 2023
Institution: Teacher
Had been impatient ;-)
- anyway, it is working now and I have learned something in the end.
Thanks
Posts: 441
Threads: 16
Joined: Apr 2020
Institution: RWTH Aachen University
The update is now available in the Arduino IDE: phyphoxBLE 1.2.0 (see
https://github.com/phyphox/phyphox-ardui...tag/v1.2.0)…