Nick_Pyner:
I haven't heard of "Serial1.readString()". getting rid of it was probably a good move.
I'm using the Arduino Micro Pro with the Atmel ATmega32U4, that has Serial for usb-serial and Serial1 for the RX/TX. The readString() has a timeout unless I send a new-line char, which I don't
Nick_Pyner:
Is noteworthy. It implies you don't need to, and you may never need to. And splitting it up into 20b packages was probably unnecessary.
While testing with apps like BLE Scanner, I was only able to receive 20 byte. In retrospect that might also have been the app limiting it to sending only the first 20 bytes of the string without any AT-commands.
By changing the code a bit (removing the readString() for example) and reading each byte into a buffer, I'm now able to receive 128 bytes without issue (with my own app). Tried 256, but where was more than 500ms delay between sending the data and the data being printed out to the usb serial (both Serial and Serial1 running at a baud rate of 115'200). That was a bit to much for this project. Anyhow, 128 bytes will be enough for now.
Nick_Pyner:
I don't think it was the API, I think we got rid of the nerds. And indeed one of the great things about bluetooth is that it is easier than you thought.
You should be able to treat bluetooth just like you treat the serial monitor.
Perhaps, I can't say for sure, but I recall BLE on Android being a bit more complex to utilize a few years ago than I felt today, code wise. It might be due to changes in the API or due to me growing as an Android developer.
FYI, this project will remote control a custom made media player on an Android device. The app will display music videos or (when playing mp3's) music visualizations in fullscreen. The remote will be use to change tracks and what not. So I'll need to send the track name (artist and title) to the Arduino to be displayed on an OLED display so you know what song you're selecting.
This will be used in a modded show-car with large sound system, the Android device (tablet) will be connected to a LCD display in the back via HDMI. Having the ability to change song on the display will look bad on the big screen as Android will just mirror the image of the tablets display to the external one.