[Bug] Restarting via API wipes the wifi connection

The wifi module connection is not re-established after restarting the device via API. There are issues related to this on the forum but the bug is still not fixed.

Steps to re-create:

Run this python script with appropriate arguments

import sys
from boltiot import Bolt

api_key = sys.argv[1]
device_id  = sys.argv[2]
mybolt = Bolt(api_key, device_id)
response = mybolt.restart()
print (response)


$ python3 restart.py "API_KEY" "DEVICE_ID"

Steps to fix the connection:

Step 1: Re-plug the module to power.
Step 2: Log in to your Bolt IoT mobile application.
Step 3: Without removing the device, click on add new device on the application and follow through with the prompts.
Step 4: Provide the wifi password again.

In my case, after step 4, it shows an error saying no internet connection but after clicking retry it connects.

It could be a bug in either the API or the module that wipes the wifi connection. Kindly look into it.

Device details:

Device: ESP8266
Firmware: 1.4.3
Hardware: 2