# rtln8720Dn Bluetooth wifi config code

**URL:** <https://forum.amebaiot.com/t/rtln8720dn-bluetooth-wifi-config-code/980>\
**Category:** BT\
**Tags:** rtl872xd\
**Created:** [December 16, 2021, 3:27pm UTC](https://forum.amebaiot.com/t/rtln8720dn-bluetooth-wifi-config-code/980 "2021-12-16T15:27:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonu\_kushwh](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/sonu_kushwh/32/711_2.png) [@sonu\_kushwh](https://forum.amebaiot.com/u/sonu_kushwh)\
**Post date:** [December 16, 2021, 3:27pm UTC](https://forum.amebaiot.com/t/rtln8720dn-bluetooth-wifi-config-code/980/1 "2021-12-16T15:27:21Z")

</div>

Hello  
I am using the “Bluetooth wifi config code” of Arduino example and I want to save SSID and Password In the EEPROM

* * *

> #include “BLEDevice.h”  
> #include “BLEWifiConfigService.h”
> 
> BLEWifiConfigService configService;
> 
> void setup() {  
> Serial.begin(115200);
> 
> ```auto
> BLE.init();
> BLE.configServer(1);
> configService.addService();
> configService.begin();
> 
> // Wifi config service requires a specific advertisement format to be recognised by the app
> // The advertisement needs the local BT address, which can only be obtained after starting peripheral mode
> // Thus, we stop advertising to update the advert data, wait for advertising to stop, then restart advertising with new data
> BLE.beginPeripheral();
> BLE.configAdvert()->stopAdv();
> BLE.configAdvert()->setAdvData(configService.advData());
> BLE.configAdvert()->updateAdvertParams();
> delay(100);
> BLE.configAdvert()->startAdv();
> 
> ```
> 
> }
> 
> ## void loop() {
> 
> delay(1000);  
> }

I want to print SSID and PASSWORD, Like Serial.println(SSID())

Please let me know how I do that.

---

<div class="post-metadata">

**Author:** ![xidameng](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/xidameng/32/18_2.png) [@xidameng](https://forum.amebaiot.com/u/xidameng)\
**Post date:** [December 17, 2021, 2:11am UTC](https://forum.amebaiot.com/t/rtln8720dn-bluetooth-wifi-config-code/980/2 "2021-12-17T02:11:11Z")

</div>

Hi @sonu_kushwh  
To save the wifi SSID and password you can using the `FlashMemory` module,

> <https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/FlashMemory/FlashMemory.cpp>

but to read the Wi-Fi SSID and password you key in in the App, you will have to add something to the code at

> <https://github.com/ambiot/ambd_arduino/blob/6626360b6f6af698bfed794ca9e396b14a44ca3c/Arduino_package/hardware/libraries/BLE/src/BLEWifiConfigService.cpp#L59>

as this is not a currently supported feature under Arduino
