phyphox Forums
Support for Arduino Uno Wifi R4 - Printable Version

+- phyphox Forums (
+-- Forum: App-Feedback (
+--- Forum: Feature requests (
+--- Thread: Support for Arduino Uno Wifi R4 (/showthread.php?tid=1798)

Support for Arduino Uno Wifi R4 - kaddigat - 09-11-2023

Hi there,

is there a possibility to run the phyphox BLE library on Arduino Wifi R4, or is support planned in near future?

RE: Support for Arduino Uno Wifi R4 - Jens Noriʇzsɔɥ - 09-11-2023

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.

RE: Support for Arduino Uno Wifi R4 - Jens Noriʇzsɔɥ - 09-13-2023

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):
diff -dur phyphox_BLE.std/ phyphox_BLE/
--- phyphox_BLE.std/
+++ phyphox_BLE/
@@ -6,5 +6,5 @@
paragraph=The purpose of this library is to use the open source phyphox app (see 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.
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 @@
+#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"

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)…

RE: Support for Arduino Uno Wifi R4 - Jens Noriʇzsɔɥ - 09-13-2023

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…

RE: Support for Arduino Uno Wifi R4 - HannoK - 09-14-2023

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?

RE: Support for Arduino Uno Wifi R4 - Jens Noriʇzsɔɥ - 09-14-2023

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… Smile

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.

RE: Support for Arduino Uno Wifi R4 - HannoK - 09-15-2023

Had been impatient ;-)
- anyway, it is working now and I have learned something in the end.

RE: Support for Arduino Uno Wifi R4 - Jens Noriʇzsɔɥ - 09-15-2023

The update is now available in the Arduino IDE: phyphoxBLE 1.2.0 (see…

RE: Support for Arduino Uno Wifi R4 - Ekfereth - 11-19-2023

Ηι, Ι try to use an Arduino UNO R4 with a sonar sensor HC-SR04.
I get this error message : Compilation error: 'currentConnections' is not a member of 'PhyphoxBLE'
I send you my code
#include <ArduinoBLE.h>
#include <phyphoxBle.h>
#include <NewPing.h>

#define TRIGGER_PIN  12  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     11  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

char board_name[]="UnoUltraSonic";
unsigned long initial_time, first_time, first_difference_float ;

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

void setup() {
  Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
  PhyphoxBLE::minConInterval = 6; //6 = 7.5ms
  PhyphoxBLE::maxConInterval = 6; //6 = 7.5ms
  PhyphoxBLE::slaveLatency = 0; //
  PhyphoxBLE::timeout = 10; //10 = 100ms
  PhyphoxBLE::start(board_name); // Το όνομα του board μπορεί να αλλάξει στην αρχή του προγράμματος
  PhyphoxBLE::configHandler=&receivedData; // δείτε το παράδειγμα της βιβλιοθήκης Phyphox Arduino library

void receivedData(){ // δείτε το παράδειγμα της βιβλιοθήκης Phyphox Arduino library
   if (PhyphoxBLE::currentConnections == 1){
      initial_time = millis(); //ορίζει την αρχή του χρόνου

void loop() {
  delay(50);                     // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
  Serial.print("Ping: ");
  Serial.print(sonar.ping_cm()); // Send ping, get distance in cm and print result (0 = outside set distance range)
  first_time = millis();
  first_difference_float = ((float)first_time-(float)initial_time)/1000;
  PhyphoxBLE::write(first_difference_float, sonar.ping_cm() );

RE: Support for Arduino Uno Wifi R4 - Jens Noriʇzsɔɥ - 11-19-2023

There is no “currentConnections” in the NanoIOT driver that is used for the UNO R4. It just exists for ESP32 boards and boards with NRF52.

Which example is your code built one? I wonder if all the class members that you are accessing should really be exposed to public…