UNO R4 BLE Central or Peripheral Questions

I am new to arduino and BLE, but would like to make a robot vehicle using an Arduino R4 WiFi, controlled by an iPad over BLE.

  1. Is this even possible? Or is there a better way?
  2. After reading the documentation, I think that the ipad would be the peripheral, making the desired wheel speeds available as Characteristics, and the arduino would read these values ad drive the motors accordingly. Is that the best way?
  3. Any recommendations on what software to use to create the iPad app? Or any good BLE Peripheral simulation iPad app? (I don't have a Mac for iPad development)
  4. Is there a good example of how to do this? Or even just a side-by-side explanation of the Central and Peripheral bluetooth commands?
  5. Is there an iPad or Android Ap that would act like a BLE Peripheral that I can use for testing my Arduino code?

There may be a much easier way to do this, so please feel free to point out the obvious!

Tia

Unless you have a Mac, you cannot create an iOS app. However, you can create Android apps.

One solution is to use the MIT App Inventor to create the Android app. Here is a link to a YouTube video that does this for an ESP32. You may be able to adapt this for the Uno R4 WIFI.

I have created a library that allows one to control an Uno R4 WIFI over ble using Python scripts.

The Uno is a peripheral, and the Python script is a central. The two communicate using the BLE UART service. This creates a virtual serial link between the two.

I hope that this may point you in the right direction. If you have any questions about my library, I would be glad to answer.

I have played with App Inventor but am not an expert on it. However, it is pretty straightforward.

2 Likes

Thanks, MrY, that's really helpful. I'll take a look when I get some time

First, let me explain how Telemetrix works. It consists of a "fixed" server sketch that listens for commands across the link and generates reports for data changes to be sent to the Python client. So, the Arduino is only programmed once, and the application is created using the Python API.

To try it out, first load the library using the Arduino IDE. Next, go to examples and select Telemetrix4UnoR4/WIFI/Telemetrix4UnoR4BLE.

The source for the sketch may be found here. There is a lot of code, so if you have any questions, please ask.

On the PC side of things, to install the client software, go through the steps in this and the following few sections of the User's Guide.

The examples may be found here.

Please note that you do not need to do any BLE pairing. The Python side will look for the Arduino and connect automatically.

Let me know if you have any additional questions.

2 Likes

Not at all in the way. To help you understand, here are some pointers within the sketch:

The "secret sauce" is this libraryOwner avatar Arduino-HardwareBLESerial

I include in my sketch here.

I instantiate the class here.

I set up the name of the BLE server here.

I check for incoming data here, here and here.

I send data out like so.

Hopefully, that will help you from reading all my code and get you the information you want.

1 Like