# Wifi established = led blink

**URL:** <https://forum.amebaiot.com/t/wifi-established-led-blink/715>\
**Category:** WiFi\
**Created:** [August 5, 2021, 12:13pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715 "2021-08-05T12:13:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 5, 2021, 12:13pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/1 "2021-08-05T12:13:39Z")

</div>

Hello All,

rtlduino + example wlan\_repeater  
can anyone give a recipe on how to add to this when the rtlduino makes a successful connection to the AP (drone) the led builtin will dimly blink?

Thank You

---

<div class="post-metadata">

**Author:** ![Alphi\_Jiang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/alphi_jiang/32/379_2.png) [@Alphi\_Jiang](https://forum.amebaiot.com/u/Alphi_Jiang)\
**Post date:** [August 6, 2021, 7:17pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/2 "2021-08-06T19:17:14Z")

</div>

Brcisna,  
Are you using Arduino or SDK.  
If it is Ardunio, you can use GTIMER or use millis() function

```auto
#include <GTimer.h>
#include <WiFi.h>

char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "secretPassword"; // your network password

int led_status = 0; // the Wifi radio's status
void myhandler(uint32_t data) {
    //check wifi status
    if(WiFi.status() == WL_CONNECTED ) {
        led_status ^=1;
    } 
    else {
        led_status = 0; //if WiFi disconnected
    }
      //check wifi status, if connected AP , the led is flash , otherwirse led is dark
    digitalWrite(LED_BUILTIN, led_status); 
}
void setup() {
   //Initialize serial and wait for port to open:
    Serial.begin(115200);
    while (!Serial) {
        ; // wait for serial port to connect. Needed for native USB port only
    }

    // check for the presence of the shield:
    if (WiFi.status() == WL_NO_SHIELD) {
        Serial.println("WiFi shield not present");
        // don't continue:
        while (true);
    }

    // attempt to connect to Wifi network:
 
    WiFi.begin(ssid, pass);
    // initialize digital pin LED_BUILTIN as an output.
    pinMode(LED_BUILTIN, OUTPUT);
    // timerid 0, period 100ms invoke myhander
    GTimer.begin(0, (1 * 100 * 1000), myhandler);

}
void loop(void)
{

}

```

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 6, 2021, 8:51pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/3 "2021-08-06T20:51:17Z")

</div>

Hi Alphi,

Thank You for this  
Am using the ambd SDK,as this is how I have the rtlduino running as wlan\_repeater.  
How can I add the portion you posted along with the existing wlan\_repater . bin file?  
I am not smart at all on coding,it goes without saying.  
If i add though the Ardion IDE, the file you posted,it will overwrite my existing flash,will it not?

Thank You

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 9, 2021, 3:16am UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/4 "2021-08-09T03:16:50Z")

</div>

Hi Alphi,

Is it all possible to edit the examples wlan\_repeater.c file in ambd\_sdk and convert the code you have here.  
Have been trying to read a lot on the c coding but not smart enough to figure this out.

Thanks

---

<div class="post-metadata">

**Author:** ![Alphi\_Jiang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/alphi_jiang/32/379_2.png) [@Alphi\_Jiang](https://forum.amebaiot.com/u/Alphi_Jiang)\
**Post date:** [August 9, 2021, 11:36am UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/5 "2021-08-09T11:36:42Z")

</div>

i will try to added wifi blink code for SDK

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 9, 2021, 12:12pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/6 "2021-08-09T12:12:38Z")

</div>

Thank You Alphi,  
You’re a scholar.

---

<div class="post-metadata">

**Author:** ![Alphi\_Jiang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/alphi_jiang/32/379_2.png) [@Alphi\_Jiang](https://forum.amebaiot.com/u/Alphi_Jiang)\
**Post date:** [August 10, 2021, 1:32pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/7 "2021-08-10T13:32:24Z")

</div>

Bcinna,  
Add the simplest code（but i not tested）, create a Task when connected online, and blink. Of course, you can use callback event, for example  
wifi\_reg\_event\_handler(WIFI\_EVENT\_IP\_CHANGED, (rtw\_event\_handler\_t)wifi\_ip\_changed\_hdl, NULL);

//some code

wifi\_indication(WIFI\_EVENT\_IP\_CHANGED, NULL,0, 0);  
wifi\_unreg\_event\_handler(WIFI\_EVENT\_IP\_CHANGED,(rtw\_event\_handler\_t) wifi\_ip\_changed\_hdl);

```auto
#include <platform_opts.h>
#include "FreeRTOS.h"
#include "task.h"
#include <platform/platform_stdlib.h>

#include "wifi_constants.h"
#include "wifi_structures.h"
#include "lwip_netconf.h"
#include "wifi_conf.h"

#if CONFIG_EXAMPLE_WLAN_FAST_CONNECT
typedef int (*init_done_ptr)(void);
extern init_done_ptr p_wlan_init_done_callback;
extern int wlan_init_done_callback();
#endif
#if CONFIG_BRIDGE
extern void bridgeif_set_mac_init(char *bmac);
extern void bridgeif_add_port_ap_netif(void);
extern void bridgeif_add_port_sta_netif(void);
#endif

#if CONFIG_EXAMPLE_WLAN_REPEATER

#if CONFIG_LWIP_LAYER
extern struct netif xnetif[NET_IF_NUM]; 
#endif

/**
 * @brief Wi-Fi example for mode switch case: Mode switching between concurrent mode and STA and add to bridge.
 * @note Process Flow:
 * - Disable Wi-Fi
 * - Enable Wi-Fi with concurrent (STA + AP) mode
 * - Start AP
 * - Check AP running
 * - Connect to AP using STA mode
 */
static void example_wlan_repeater_thread(void *param)
{
	/* To avoid gcc warnings */
	( void ) param;

	// Wait for other task stable.
	vTaskDelay(4000);

	/ *********************************************************************************
	*	1. Enable Wi-Fi with concurrent (STA + AP) mode
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Enable Wi-Fi with concurrent (STA + AP) mode\n");

	/ *********************************************************************************
	*	1-1. Disable Wi-Fi
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Disable Wi-Fi\n");
	wifi_off();
	vTaskDelay(20);

	/ *********************************************************************************
	*	1-2. Enable Wi-Fi with STA + AP mode
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Enable Wi-Fi with STA + AP mode\n");
	if(wifi_on(RTW_MODE_STA_AP) < 0){
		printf("\n\r[WLAN_REPEATER_EXAMPLE] ERROR: wifi_on failed\n");
		return;
	}

	uint8_t *mac = LwIP_GetMAC(&xnetif[0]);
	bridgeif_set_mac_init(mac);
	bridgeif_add_port_sta_netif();
	bridgeif_add_port_ap_netif();

	/ *********************************************************************************
	*	1-3. Start AP
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Start AP\n");
	char *ssid = "AmebaRPT";
	char *password = "12345678";	// NULL for RTW_SECURITY_OPEN
	int channel = 6;

	if(wifi_start_ap(ssid, (password)?RTW_SECURITY_WPA2_AES_PSK:RTW_SECURITY_OPEN, password, strlen(ssid), (password)?strlen(password):0, channel) < 0) {
		printf("\n\r[WLAN_REPEATER_EXAMPLE] ERROR: wifi_start_ap failed\n");
		return;
	}

	/ *********************************************************************************
	*	1-4. Check AP running
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Check AP running\n");
	int timeout = 20;
	while(1) {
		char essid[33];
		if(wext_get_ssid(WLAN1_NAME, (unsigned char *) essid) > 0) {
			if(strcmp((const char *) essid, (const char *)ssid) == 0) {
				printf("\n\r[WLAN_REPEATER_EXAMPLE] %s started\n", ssid);
				break;
			}
		}
		if(timeout == 0) {
			printf("\n\r[WLAN_REPEATER_EXAMPLE] ERROR: Start AP timeout\n");
			return;
		}
		vTaskDelay(1 * configTICK_RATE_HZ);
		timeout --;
	}

	/ *********************************************************************************
	*	1-5. Connect to AP using STA mode and start DHCP client
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Connect to AP\n");
	if(p_wlan_init_done_callback)
		p_wlan_init_done_callback();

	if(xTaskCreate(example_wifi_status_thread, ((const char*)"example_wlan_status"), 1024, NULL, tskIDLE_PRIORITY + 2, NULL) != pdPASS)
		printf("\n\r%s xTaskCreate failed\n", __FUNCTION__ );

	vTaskDelete(NULL);
}
void example_wifi_status_thread(void *param)
{
	uint8_t led = 0;
	uint8_t i;
	for(i=0;i<10;i++) {
		gpio_write(&gpio_wlan_act, led);
		led^=1;
		vTaskDelay(1 * configTICK_RATE_HZ);

	}
	vTaskDelete(NULL);

}
void example_wlan_repeater(char* id){
	if(xTaskCreate(example_wlan_repeater_thread, ((const char*)"example_wlan_repeater_thread"), 1024, NULL, tskIDLE_PRIORITY + 1, NULL) != pdPASS)
		printf("\n\r%s xTaskCreate failed\n", __FUNCTION__ );
}

#endif /* CONFIG_EXAMPLE_WLAN_REPEATER */

```

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 10, 2021, 6:19pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/8 "2021-08-10T18:19:10Z")

</div>

Hi Alphi,

Appreciate you doing this.  
Unfortunately,I dont understand what I need to do to compile this,or add to existing example\_wlan\_repeater.c file ?  
I am very dense on this but try to learn a little of how to do it. , sorry

Thank You

---

<div class="post-metadata">

**Author:** ![Alphi\_Jiang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/alphi_jiang/32/379_2.png) [@Alphi\_Jiang](https://forum.amebaiot.com/u/Alphi_Jiang)\
**Post date:** [August 11, 2021, 1:03am UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/9 "2021-08-11T01:03:07Z")

</div>

Hi Brcisna,  
Did you check the status of the LEDs? I am using wifi\_led in the example and it only blinks. In the example, should the LED blink even when the data is exchanged?

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 11, 2021, 1:50am UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/10 "2021-08-11T01:50:44Z")

</div>

Hi Alphi,

I do not see an wifi\_led directory in the ‘examples’ directory in the ambd\_sdk?  
maybe i am looking in wrong location in the sdk?  
What I would like ideally,is power on repeater on side of drone, once the repeater is connected to drone AP, is the repeater led just blinks slowly,at this point we can have the drone take off. Hope this makes sense.

Thank You

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 12, 2021, 1:37pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/11 "2021-08-12T13:37:30Z")

</div>

Hi Alphi,

The three lines of code you gave to make the led blink below //some code----\> in the previous post you made here.  
Were would i put this into the existing example\_wlan\_repeater.c file?  
I know nothing about coding syntax,sorry

Thank You

---

<div class="post-metadata">

**Author:** ![Alphi\_Jiang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/alphi_jiang/32/379_2.png) [@Alphi\_Jiang](https://forum.amebaiot.com/u/Alphi_Jiang)\
**Post date:** [August 13, 2021, 2:11pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/12 "2021-08-13T14:11:20Z")

</div>

Hi Brcisna,  
This is another way to call the SDK Event Callback method to determine when the function is called while connected.

Please also make sure that the LED is working properly. You can light up the LED when you power up

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 13, 2021, 2:48pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/13 "2021-08-13T14:48:11Z")

</div>

Hi Alphi,

Thank You for trying to help me out.  
No the led on this never does light up,even when powering on. Wasn’t sure the builtin led was suppose to light at power up.

I asked earlier, How do i write in the code you gave for an example for the led to light up at AP connection?  
Am lost on how to add this type of code to an existing .c file  
AKA: example\_wlan\_repeater.c

Thanks again

---

<div class="post-metadata">

**Author:** ![Alphi\_Jiang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/alphi_jiang/32/379_2.png) [@Alphi\_Jiang](https://forum.amebaiot.com/u/Alphi_Jiang)\
**Post date:** [August 13, 2021, 3:09pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/14 "2021-08-13T15:09:05Z")

</div>

Hi, brcisna  
Well, I will check which LED RTLDunio actually uses and test if it will brighten up when connected. Anyway it is still necessary to understand how to use the SDK and call the API

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 13, 2021, 3:33pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/15 "2021-08-13T15:33:32Z")

</div>

Hi Alphi,

Just thought i would add this,my simple findings.  
When i first got these RTLduino’s B&T.  
When i run the simple example "blink "sketch on them from the Arduino IDE, the builtin led light never actually would light after uploading,BUT if i changed the code to BUILTIN\_B or BUILTIN\_R and uploaded the led would blink either blue or red whatever you specified.  
What am saying is,it appears the default ‘green’ would not showup ? Not sure why this it.

Thank You

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 15, 2021, 9:40pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/16 "2021-08-15T21:40:36Z")

</div>

Hi Alphi,

Just thought i would mention. I did doa make all after replacing the original example\_wlan\_repeater.c file with the one you provided here.  
When trying to compile with this replaced wlan\_repeater.c file i get two errors:

```auto
example_wlan_repeater.c:112:17: error: 'example_wifi_status_thread' undeclared (first use in this function)
  if(xTaskCreate(example_wifi_status_thread, ((const char*)"example_wifi_status"), 1024, NULL, tskIDLE_PRIORITY + 2, NULL) != pdPASS)
                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
                 
                 /component/common/example/wlan_repeater/example_wlan_repeater.c:122:15: error: 'gpio_wlan_act' undeclared (first use in this function)
   gpio_write(&gpio_wlan_act, led);
               ^ ~~~~~~~~~~~~

```

Thanks for trying to help out here.

---

<div class="post-metadata">

**Author:** ![Alphi\_Jiang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/alphi_jiang/32/379_2.png) [@Alphi\_Jiang](https://forum.amebaiot.com/u/Alphi_Jiang)\
**Post date:** [August 16, 2021, 2:09am UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/17 "2021-08-16T02:09:16Z")

</div>

Hi brcisna  
add GPIO initialize function , it’s compile without error

```auto
#include <platform_opts.h>
#include "FreeRTOS.h"
#include "task.h"
#include <platform/platform_stdlib.h>

#include "wifi_constants.h"
#include "wifi_structures.h"
#include "lwip_netconf.h"
#include "wifi_conf.h"
/* GPIO relate header file */
#include "gpio_api.h"
#include "PinNames.h"
#if CONFIG_EXAMPLE_WLAN_FAST_CONNECT
typedef int (*init_done_ptr)(void);
extern init_done_ptr p_wlan_init_done_callback;
extern int wlan_init_done_callback();
#endif
#if CONFIG_BRIDGE
extern void bridgeif_set_mac_init(char *bmac);
extern void bridgeif_add_port_ap_netif(void);
extern void bridgeif_add_port_sta_netif(void);
#endif

#if CONFIG_EXAMPLE_WLAN_REPEATER

#if CONFIG_LWIP_LAYER
extern struct netif xnetif[NET_IF_NUM]; 
#endif

#define GPIO_WLAN_ACT PA_5
gpio_t gpio_wlan_act;

static void example_wifi_status_thread(void *param)
{
	uint8_t led = 0;
	uint8_t i;
	for(i=0;i<10;i++) {
		gpio_write(&gpio_wlan_act, led);
		led^=1;
		vTaskDelay(1 * configTICK_RATE_HZ);

	}
	vTaskDelete(NULL);}
/**
 * @brief Wi-Fi example for mode switch case: Mode switching between concurrent mode and STA and add to bridge.
 * @note Process Flow:
 * - Disable Wi-Fi
 * - Enable Wi-Fi with concurrent (STA + AP) mode
 * - Start AP
 * - Check AP running
 * - Connect to AP using STA mode
 */
static void example_wlan_repeater_thread(void *param)
{
	/* To avoid gcc warnings */
	( void ) param;

	// Wait for other task stable.
	vTaskDelay(4000);

	/ *********************************************************************************
	*	1. Enable Wi-Fi with concurrent (STA + AP) mode
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Enable Wi-Fi with concurrent (STA + AP) mode\n");

	/ *********************************************************************************
	*	1-1. Disable Wi-Fi
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Disable Wi-Fi\n");
	wifi_off();
	vTaskDelay(20);

	/ *********************************************************************************
	*	1-2. Enable Wi-Fi with STA + AP mode
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Enable Wi-Fi with STA + AP mode\n");
	if(wifi_on(RTW_MODE_STA_AP) < 0){
		printf("\n\r[WLAN_REPEATER_EXAMPLE] ERROR: wifi_on failed\n");
		return;
	}

	uint8_t *mac = LwIP_GetMAC(&xnetif[0]);
	bridgeif_set_mac_init(mac);
	bridgeif_add_port_sta_netif();
	bridgeif_add_port_ap_netif();

	/ *********************************************************************************
	*	1-3. Start AP
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Start AP\n");
	char *ssid = "AmebaRPT";
	char *password = "12345678";	// NULL for RTW_SECURITY_OPEN
	int channel = 6;

	if(wifi_start_ap(ssid, (password)?RTW_SECURITY_WPA2_AES_PSK:RTW_SECURITY_OPEN, password, strlen(ssid), (password)?strlen(password):0, channel) < 0) {
		printf("\n\r[WLAN_REPEATER_EXAMPLE] ERROR: wifi_start_ap failed\n");
		return;
	}

	/ *********************************************************************************
	*	1-4. Check AP running
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Check AP running\n");
	int timeout = 20;
	while(1) {
		char essid[33];
		if(wext_get_ssid(WLAN1_NAME, (unsigned char *) essid) > 0) {
			if(strcmp((const char *) essid, (const char *)ssid) == 0) {
				printf("\n\r[WLAN_REPEATER_EXAMPLE] %s started\n", ssid);
				break;
			}
		}
		if(timeout == 0) {
			printf("\n\r[WLAN_REPEATER_EXAMPLE] ERROR: Start AP timeout\n");
			return;
		}
		vTaskDelay(1 * configTICK_RATE_HZ);
		timeout --;
	}

	/ *********************************************************************************
	*	1-5. Connect to AP using STA mode and start DHCP client
	********************************************************************************* /
	printf("\n\r[WLAN_REPEATER_EXAMPLE] Connect to AP\n");
	if(p_wlan_init_done_callback)
		p_wlan_init_done_callback();
	if(xTaskCreate(example_wifi_status_thread, ((const char*)"example_wifi_status"), 1024, NULL, tskIDLE_PRIORITY + 2, NULL) != pdPASS)

	vTaskDelete(NULL);
}

void example_wlan_repeater(char* id){
	//initialize GPIO
	gpio_init(&gpio_wlan_act, GPIO_WLAN_ACT);
	gpio_dir(&gpio_wlan_act, PIN_OUTPUT);
	gpio_mode(&gpio_wlan_act, PullNone);

	gpio_write(&gpio_wlan_act, 0);

	if(xTaskCreate(example_wlan_repeater_thread, ((const char*)"example_wlan_repeater_thread"), 1024, NULL, tskIDLE_PRIORITY + 1, NULL) != pdPASS)
		printf("\n\r%s xTaskCreate failed\n", __FUNCTION__ );
}

#endif /* CONFIG_EXAMPLE_WLAN_REPEATER */

```

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 16, 2021, 3:02am UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/18 "2021-08-16T03:02:27Z")

</div>

Hi Alphi,

Thank You for this hard work!  
It compiles fine.  
Problem: rtlduino boots up , looks good, like before,in terminal and gets to were you hit enter key to start typing AT commands,It hangs here for about 10 seconds then freezes. Can never get the # to type in at commands.  
It does this both the same in picocom Linux & Tera Term Windows. This has always worked without issue in both OS’s

Thanks again

---

<div class="post-metadata">

**Author:** ![Alphi\_Jiang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/alphi_jiang/32/379_2.png) [@Alphi\_Jiang](https://forum.amebaiot.com/u/Alphi_Jiang)\
**Post date:** [August 17, 2021, 3:09am UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/19 "2021-08-17T03:09:59Z")

</div>

Hi Brcisna,  
You can provide a more detailed screenshot or message, because using wifi\_repeater. theoretically, there are not implements AT command sets. This Behavior is confusing to me.

---

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [August 17, 2021, 1:17pm UTC](https://forum.amebaiot.com/t/wifi-established-led-blink/715/20 "2021-08-17T13:17:21Z")

</div>

Hi Alphi,

I will attach a screenshot of what happens with this code, and also,(if I can a simple screen recording).  
After I upload the code.  
I reset the rtlduino.  
In the terminal i still have to do:

1. ATWS # scan for networks, this finds the drone’s SSID, Drone\_XYZ
2. ATW0=Drone\_XYZ # drone SSID , add  
3.(do not need to do ATW1=password , as this is an open AP)
3. ATWC # to connect the repeater to the drone Drone\_XYZ , AP.  
Now in terminal I will see the repeater doing a successful connection to Drone\_XYZ AP.

Hope this makes sense  
The bottom line is when the repeater with this code boots up, I can not press enter to get to the # to enter the AT commands as it is locked up.  
If you look at screenshot lower left the cursor is locked after blinking for a couple seconds.

See s

 ![picocom_wlan_repeater](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/1X/87ace692c418fca889fd5d501260259800c9f623.png)

[Next page](https://forum.amebaiot.com/t/wifi-established-led-blink/715.md?page=2)
