# Soft hack to open telnet
You need gateway 3(mgl03) connected to MiHome. And also ip and gateway token.
### 1 way (recommended)
Via [XiaomiGateway3](https://github.com/AlexxIT/XiaomiGateway3) component.
You must input in the 'Open Telnet command' field:
```
{"method":"set_ip_info","params":{"ssid":"""","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}}
```
### 2 way (recommended if not using Home Assistant)
php-miio (https://github.com/skysilver-lab/php-miio)
You may need to change id.
```sh
php miio-cli.php --ip GW_IP --token GW_TOKEN --sendcmd '{"id":123,"method":"set_ip_info","params":{"ssid":"""","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}}'
```
### 3 way (maybe problem with sequence id)
python-miio (https://github.com/rytilahti/python-miio)
```sh
miiocli device --ip GW_IP --token GW_TOKEN raw_command set_ip_info '{"ssid":"""","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}'
```
After opening telnet, it is better to install custom firmware.
Read here:
https://gist.github.com/zvldz/b40b4873e3c4c1a64ac536e8ce5dbdad#the-easy-way
This method should also work with:
* lumi.gateway.mgl03 - Mi Smart Home Hub
* lumi.gateway.acn01 - Aqara Hub M1S CN
* lumi.gateway.aeu01 - Aqara Hub M1S EU
* lumi.aircondition.acn05 - Aqara Air Conditioning Controller P3
* lumi.gateway.sacn01 - Smart USB Wall Outlet Hub
I am not author, I just tested and improved and published.