[SOLVED] Openhab2 - Xiaomi Mi Gateway - does not respond

Hi, I’m trying to edit my Mi Home V3 gateway.
I have the token, have managed to enable telnet (php miio-cli.php --ip 192.168.10.195 --token **** --sendcmd ‘{“id”:0,“method”:“enable_telnet_service”, “params”:}’)

Then i telnet 192.168.10.195

Trying 192.168.10.195...
Connected to 192.168.10.195.
Escape character is '^]'.

rlxlinux login: admin
Lumi Linux version 3.0
  _               _    _  _
 | |             |_|  | ||_|
 | | _  _  _____  _   | | _ ____  _   _  _  _
 | || || ||     \| |  | || |  _ \| | | |\ \/ /
 | || || || | | || |  | || | | | | |_| |/    \
 |_|\____||_|_|_||_|  |_||_|_| |_|\____|\_/\_/

For further information check:
https://www.aqara.com


BusyBox v1.22.1 (2020-03-19 12:38:22 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

and in /etc/services i find

MijiaRootCert.pem hostapd_1.wps_upnp
avahi-autoipd.action hostapd_none.conf
ble_info hostapd_test.conf
ca-certificates.crt hostapd_wep.conf
ecryptfs-passphrase hostapd_wpa2.conf
ecryptfs-wrap-passphrase hosts
factory_test.conf important.txt
hapd_none-2g init.d
hapd_none-5g inittab
hapd_none-wlan0-2g localtime
hapd_none-wlan0-5g mime.types
hapd_psk.wpa-mix mosquitto
hapd_psk.wpa-tkip motd
hapd_psk.wpa-wps2-mix myhostapd.conf
hapd_psk.wpa2-ccmp myhostapd2.conf
hapd_psk.wpa2-ccmp-wlan0-2g myhostapd3.conf
hapd_psk.wpa2-ccmp-wlan0-5g mywpa-wep.conf
hapd_wep mywpa-wpa2.conf
host.conf mywpa.conf
hostapd.accept passwd
hostapd.conf passwd_default
hostapd.deny ppp
hostapd.eap_user resolv.conf
hostapd.eap_user_sqlite rootfs_fw_info
hostapd.none services
hostapd.none_security shadow
hostapd.radius_clients shadow_default
hostapd.sim_db smb.conf
hostapd.vlan udhcp
hostapd.wpa_psk version
hostapd.wps_upnp wpas.conf
hostapd_0.wps_upnp

Anything useful?

BTW: I have “ Xiaomi Mijia Multimode Gateway 3 ” = power via a Micro-USB cable, , MIJIA Logo in the center

Hey,

What command were you trying to use for this? I am trying to test this out now, as I burnt off my soldersing connection on the board :S

Hi @rothm,

I am trying to test your OTA trick with my lumi gateway lmuk01. I had it all working before but had to do a reset, and this caused me to lose ssh. I burnt off my soldering connection point on the board, so would like to try your OTA method. Any help on the steps would be great! I downloaded both miio software and the python-miio software. with miiocli I can see the info of the device. I also have the token (which I got from the hacked android app).

Thanks!

This is how i managed to enable telnet:

php miio-cli.php --ip 192.168.10.195 --token **** --sendcmd ‘{“id”:0,“method”:“enable_telnet_service”, “params”:}’

But after the last gateway update (1.4.6_0030) this is the response when i use miio-cli: Device 192.168.10.195 is not available or is not responding.

Telnet is disabled as well.

Sorry I never took time to test the proper miio command to flash the firmware.

hi Marc, do you solve it ? tx and rx ?

You can most likely also do this from within openHAB miio binding.
While miio binding has nothing specific to the lumi gateway, it should be possible to send commands to it and get the token from the Xiaomi cloud.

The lumi would show as unsupported device, but will have a command channel There you can send the command like: enable_telnet_service. The miio binding will then indeed send ‘{“id”:0,“method”:“enable_telnet_service”, “params”:}’ to the lumi device.

After that, you don’t need the miio binding anymore to control the lumi.

I don’t have a lumi device to test this, but would be surprised if it would be so different to other devices that it wont work

hi guys, can you help me please, i have a hub Aqara but the rx and tx is not the same pins that the xiaomi gateway, do you know the rx and tx pins for aqara hub? and do you know if this hub also has programming mode?

Thanks ¡

imgAQARA

Hi @cadavre I have a problem in my gateway (dgnwg05lm) with miio_client, can you help me?

this is my connections:

    root@imx6ull14x14evk:~# /etc/init.d/dropbear start
    Starting Dropbear SSH server: /usr/sbin/dropbear is already running
    420
    root@imx6ull14x14evk:~# netstat -ulptn
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      420/dropbear
    tcp6       0      0 :::22                   :::*                    LISTEN      420/dropbear
    udp        0      0 0.0.0.0:10008           0.0.0.0:*                           363/gw

I have followed all your steps and dropbear seems to be active, but I can’t see my gateway in HA.

Anyone who can help me?

Not sure, but I think this gateway is not supported at the moment.

I have received a new v2 gateway (I already have one which works). This came with port 9898 closed. I managed to get the device connected to the PC and can type in commands. I typed in psm-set network.open_pf 3 a couple of times, verified with psm-get network.open_pf and it replies
network.open_pf = 3 (1 bytes)
so this seems good. However if I unplug it, wait and put it back in the socket (without the UART attached) and try the nmap, port 9898 is still closed. What am I doing wrong?
(don’t know if it matters but I upgraded to the newest firmware. Don’t recall if I turned on the LAN support before doing so. Did I mess that up?)

Hi all.
we have completed the firmware for the gateway

1 Like

Tested with OH 3.0.0.M1 and a lumi.gateway.mieu01. Did not work.

Hello folks.

I get the newest Gateway from xiaomi. EU Version.
Im now able to read out the data feed.

i get this information:
help
–Print help.
ver
–Get fireware version.
LED01
–LED RED ON.
LED11
–LED Green ON.
LED21
–LED BLUE ON.
LED3
–LED white ON.
LED00
–LED OFF.
LUMEN
–Return illumination value.
speaker
–Play 1khz sinusoidal sound.
key
–Test key.
m_play
–Play music.Usage : m_play name volume.
test_mfi
–Test the mfi chip.
cmd_chk_zig
–Test the zigbee chip communication, return zigbee chip firmware version
join
–Zigbee join.
remove
–remove device.
get_zig_temp
–Get zigbee temperature.
cali_temp
–Cal zigbee temperature.
test_zig_rf
–Test zigbee rf.
test_ota
–Test zigbee ota.
devices
–Show the device in zigbee.
wifi_mac
–Return wifi mac.
wifi
–Return wifi rssi.
set_wifi_mac
–set wifi mac for realtek modual.
set_wifi_modual
–set wifi modual.
set_sn
–Set soft version,usage:set_sn 123456.
get_sn
–Get soft version.
set_hd_ver
–Set hardware version,usage:set_hd_ver 123.
get_hd_ver
–Get hardware version.
setup_code
–Set homekit setup code.
set_language
–Set homekit language.
set_hk_model
–Set homekit model.
get_setup_code
–get homekit setup code.
set_did
–set mi did key mac model.
get_did
–get mi did key mac model.
nfc_poll
–NFC polling.
exit_factory
–Exit test.
test_ok
–Create the test ok file and exit test.
test_pcba
–PCBA Test.
get_result
–Get PCBA Test result.
reboot
–Reboot.

when i send psm-set network.open_pf 3 then its geting back :
Command not found!

When i write : exit_factory
i get
Exit test…
OK
.
umount: /mnt/.psplash: not mounted

Freescale i.MX Release Distro 4.1.15-2.0.0 imx6ull14x14evk /dev/ttymxc0

im43ex6ull14x14evk login:

so anybody know how i can open the port 9898??

Cheers

Hello guys I has followed all the procedures.
I was able to send the commands to gateway and I got the right response.

But everytime I restart gateway the port is closed again :frowning: :confused:

Can someone try to help me ?
Thanks

Hi,

since a few days I am owner of one of the aqara hub (EU version)
I followed the intsructions to gain root access via ftdi without any problem.

I append the line in rc.local to start ssh server.

When I reboot I noticed that wlan0 was not found.
Also rc.local is now empty and of course I have no backup (blame on me)

Are these security mechanism from xiaomi?
Will it help to wire USB and try to install openLumi?

Any help is appreciated

Cheers
Arne

I have the v2 chinese gateway.

a week ago as i was reorganizing cables, i accidentally pressed the button on the gateway for a few seconds, the gateway was reset.

Does a reset like this also disable the LAN-Mode/Developer mode?
since then i haven’t been able to communicate with the gateway for more than a few minutes. the psm-set network.open_pf 3 command doesn’t help either.

Hey there,

Sorry to reply on such an old thread, but I need help :frowning: I’ve followed the steps exactly as @cadavre stated but can’t seem to get it work.When I call “boot” after setting bootargs process moves until starting Kernel then it’s all hieroglyphics. I get no prompt, interface halts. When I try to boot it into login -without setting args- I get:

====================================
========== start mi=================
====================================
.
umount: /mnt/.psplash: not mounted
INIT: no more processes left in this runlevel

and it halts again, I get no prompt. Any help is appreciated.

Gateway model : lumi.gateway.mieu01

If you have the 2 pin version without the ground pin, soldering the earth pin to a plug with an earth lead, and then inserting that plug into the same power strip that your FTDI UART PC uses will prevent ground loops and (induced?) voltages on the GND of the UART (which is connected to AC socket GND).