Hello! In a project I am working on I need an embedded BLE controller that is able to act as a BLE Host. I know there are several options out there, but I’m trying to figure out if the Artemis is capable of this. I can’t seem to find the answer in any of the documentation, so I’m turning here in hopes someone will be able to answer my question.
Can the Artemis’ BLE feature act as a BLE host? Or only as a connected device?
When unzipped, it has sections for clients, servers, etc. I looked in Clients, and one of them was Android. Sure enough, there is a BEAUTIFUL study guide covering implementation of a Android client that uses Android Studio to build an Android interface to BLE…AND IT WORKS FOR THE Artemis Nano Board Manager version 1.07 example8. (Example8 is missing from version 1.08 for some reason).
I have written an Android app similar to nRF Connect using the study guide and can send low, mid, and high states to the BUILTIN_LED. Example8 has Low and High turned on. It was pretty easy to modify BLE_example_funcs.cpp and nus_api.h to add a new method for the mid value. I can use pwm on the BUILTIN_LED to set the mid value to dim, high to high and low to off using analogWrite. Using digitalWrite and digitalRead, I can get the stat of the BUILTIN_LED. Should be easy to read and write digital to any of the GPIO pins. Haven’t figured out how to add methods for more than one pin yet but should be possible.
I’ve got a github account but have never tried to create a project on it. I might try and do that to upload the code to in the next few days.
Don’t know why Sparkfun got rid of Example8 in 1.08 Arduino board manager. It seems like BLE wold work great for iot. I was able to turn on/off LED from accross 3500 sq. foot house. Bonus…the upload only took 9% of the available RAM vs esp8266 with OTA just about maxed out the esp8266 ram.
Thank you for the above info, I got the latest BLE example to work with the Artemis Red Nano and an iPhone 6s using the Nordic NRF Connect app on the phone. But could not get the Nano BLE 5.0 to stay connected on an Android Moto e 2nd Gen BLE 4.0 phone. The Nordic NRF Connect app was able to see the Nano and the services, but would not stay connected. The BLE 5.0 should be backwards compatible with BLE 4.0.
What I read unrelated to this is that some of the BLE 5.0 advertising features are incompatible with the 4.0. So wondering, if the “Immediate Alert” service that the BLE example uses may not be compatible with pre-5.0 BLE. Any suggestions if this may be correct? And which BLE service should be used for backwards compatibility?