# Simple BLE Read, Write Example

**URL:** <https://community.sparkfun.com/t/simple-ble-read-write-example/39482>\
**Category:** Artemis\
**Created:** [April 29, 2020, 3:56pm UTC](https://community.sparkfun.com/t/simple-ble-read-write-example/39482 "2020-04-29T15:56:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![themethod](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@themethod](https://community.sparkfun.com/u/themethod)\
**Post date:** [April 29, 2020, 3:56pm UTC](https://community.sparkfun.com/t/simple-ble-read-write-example/39482/1 "2020-04-29T15:56:56Z")

</div>

I was able to download nRF Connect app from the Google Play store and connect to the Artemis using the example BLE code. I was able to send x3 different “Immediate Alert” codes from the phone app to the Artemis (“WRITE”) however I would now like to send codes from the Artemis to the phone ( “READ”).

I see that under “Link Loss” there is an “Alert Level” that supports both READ and WRITE. What I would like to do is use the Serial Monitor to keyboard type in a code and have the Artemis send that code to the phone app. Is there some hacky but reliable way of doing this?

I am creating an embedded prototype with a companion app. I suspect that for now at least, I will send off bursts of these alert levels so that they match some lookup table that contains the data I need to Read and Write. Unless any of you have another way of doing this. Thank you for your input.

---

<div class="post-metadata">

**Author:** ![paulvha](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@paulvha](https://community.sparkfun.com/u/paulvha)\
**Post date:** [April 29, 2020, 5:26pm UTC](https://community.sparkfun.com/t/simple-ble-read-write-example/39482/2 "2020-04-29T17:26:40Z")

</div>

I have created a server app for the Artemis. It can do a number of aspects including a simple “chat” between client and server.

That might help you.

The client I have created is either running on Linux (Ubuntu or Raspberry) or on another Apollo3 based board. The source software and documentation is available on [https://github.com/paulvha/apollo3](https://github.com/paulvha/apollo3) as BLE\_amdtp\_arduino or BLE\_amdtp\_raspPI

---

<div class="post-metadata">

**Author:** ![KHE](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@KHE](https://community.sparkfun.com/u/KHE)\
**Post date:** [April 30, 2020, 6:16pm UTC](https://community.sparkfun.com/t/simple-ble-read-write-example/39482/3 "2020-04-30T18:16:53Z")

</div>

Here’s an example of paulhva’s server (modified) communicating with an Android app for robot control. Sends commands that are echo’d back and responds to enq with ack to reset a WatchDogTimer. If WDT not reset, robot reboots, stopping it , which prevents falling off roof should communication fail for some reason.

[https://github.com/kerryeven/AndroidArt … UartClient](https://github.com/kerryeven/AndroidArtemisBleUartClient)
