Home Assistant release with the issue: 0.89.2
Last working Home Assistant release (if known): NA
Operating environment (Hass.io/Docker/Windows/etc.): Docker
Component/platform: PyXiaomiGateway (?)
Description of problem: Not recognizing Mijia Xiaomi Gateway EU version
Model details:
mDNS lookup: lumi-gateway-mieu01_miio9497xxxx._miio._udp.local.
Inspection:
Device ID: 949xxxxx
Model info: lumi.gateway.mieu01
Address: 192.168.x.x
Token: 6566704a6b4a39xxxxxxxxxxxxxx via stored token
Support: At least generic
Type info: miio
Capabilities:
Firmware version: 3.3.10_117
Hardware version: Linux
MCU firmware version: 0143
WiFi: Xxxxxxxxx (XX:XX:XX:XX:XX:XX) RSSI: 100/100
Remote access (Mi Home App): Maybe
NMap results:
Starting Nmap 7.60 ( https://nmap.org ) at 2019-03-15 17:53 EET
Nmap scan report for 192.168.x.x
Host is up (0.035s latency).
PORT STATE SERVICE
4321/udp closed rwhois
9898/udp open|filtered monkeycom
MAC Address: 7C:49:EB:XX:XX:XX (Unknown)
Problem-relevant configuration.yaml
entries and (fill out even if it seems unimportant):
xiaomi_aqara:
discovery_retry: 10
gateways:
- host: 192.168.x.x
mac: 7c49ebxxxxxx
Traceback (if applicable):
Additional information:
Works with MiHome app. Current version 5.4.61 (to get token from logs). Also works with latest.
Cannot activate dev mode, no matter what I try.
Found token after a couple of days of trying and added to local tokens.json.
I cannot find the correct site where I can file a report to xiaomi to enable local net (devmode) support. Could someone please give me a url?
Hi! Got the EU Gateway today at Mi Store.
on my hass.io installation I received this notification:
"The following components and platforms could not be set up:
I tried to find the token in log but unsuccessfully, how did you got it?
Anyway I think we should wait a little bit, because the gateway just came out and the firmware is different from the chinese version
Hi Tarkus,
this https://android-apk.app/com.xiaomi.smarthome/43397902-mi-home/ xiaomi home apk was released by mistake having debug logs enabled.
Download, install and pair the gateway with it.
Then in your phone, open a file explorer and go to your storage (not sure if it's sd or internal), find the folder SmartHome/logs/. In there you will see a file with the date and extension txt. Open it and search for the word token. It's so simple.
BR,
Nodas
P.S. I think that my gateway is Mijia and not Aqara. The error you get, specifically states to check your config. I suspect something is wrong with your config and that if you fix it you will be alright. I say so because hass.io detected the device and complained. Mine doesn't even detect the gateway.
@Tarkus, one more thing. If I am not mistaken, in order to setup your gateway with hass.io you will need to enable local network and use the devmode password, not the token from the above apk.
@nodkan Thank you! I'll try with the suggested downgrade of the app, but I think our connection problem will be definitively solved when this new gateway will have spent a bit more time on the market. It's annoying to use the EU server, I can't control my Ikea lights or my Yeelight Bulb v2, there would be a lot of possibilities without software limitations.
Hope this thread will help other european Xiaomi users, I'll post here updates about hassio and the gateway! :)
PS: I think it's not possible to activate developer mode in Mi Home with the actual release
PS: I think it's not possible to activate developer mode in Mi Home with the actual release
Correct
You could try switch your account to Mainland China (MiHome->Settings->Region).
I think only Mainland Chine gives option to enable developer mode.
@bastshoes would be great to use China, but this new gateway only works with EU server :)
I think we'll have to wait a little
Have you tried connecting main board to serial port and issuing psm-set network.open_pf 3
command? Even without using Gateway control – access to connected devices like motion sensors or door sensors would be great-to-have in HA.
I also have one Mijia Gateway EU, but waiting for new soldering iron. After I got one I'll try to open gateway and find RxTx.
You could also try to extract the miIO token the access the miIO API (the one used of the android app) via miiocli (part of python-miio). There is an API method to set the key
for the LAN protocol. I'm guess the firewall (psm-set network.open_pf 3) must be changed nevertheless.
I've found RX/TX and connected successfully to the gateway. It boots with factory test mode on serial. You can exit this mode but then it asks about login and password – which I didn't managed to "break".
Boot output:
U-Boot 2016.03 (Nov 07 2017 - 20:11:55 +0800)
CPU: Freescale i.MX6ULL rev1.1 528 MHz (running at 396 MHz)
CPU: Commercial temperature grade (0C to 95C) at 39C
Reset cause: POR
Board: Lumi international Gateway
I2C: ready
DRAM: 256 MiB
NAND: 256 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment
Display: TFT43AB (480x272)
Video: LCDIF@0x21c8000 is fused, disable it
In: serial
Out: serial
Err: serial
Net: Ethernet@0x20b4000 is fused, disable it
Board Net Initialization Failed
No ethernet found.
## Enter main_loop() Now##
Normal Boot
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x300000, size 0x700000
7340032 bytes read: OK
NAND read: device 0 offset 0xa00000, size 0x100000
1048576 bytes read: OK
Kernel image @ 0x80800000 [ 0x000000 - 0x617290 ]
## Flattened Device Tree blob at 83000000
Booting using the fdt blob at 0x83000000
Using Device Tree in place at 83000000, end 8300c0e1
Modify /soc/aips-bus@02000000/tsc@02040000:status disabled
Modify /soc/aips-bus@02000000/can@02090000:status disabled
Modify /soc/aips-bus@02000000/can@02094000:status disabled
Modify /soc/aips-bus@02100000/lcdif@021c8000:status disabled
Modify /soc/aips-bus@02100000/pxp@021cc000:status disabled
Modify /soc/aips-bus@02100000/csi@021c4000:status disabled
Modify /soc/aips-bus@02000000/ethernet@020b4000:status disabled
Modify /soc/aips-bus@02100000/usb@02184200:status disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/sai@0202c000:status disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/sai@02030000:status disabled
Modify /soc/aips-bus@02100000/serial@021f4000:status disabled
Modify /soc/aips-bus@02100000/serial@021fc000:status disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/serial@02018000:status disabled
Modify /soc/aips-bus@02000000/pwm@020f0000:status disabled
Modify /soc/aips-bus@02000000/pwm@020f4000:status disabled
Modify /soc/aips-bus@02000000/pwm@020f8000:status disabled
Modify /soc/aips-bus@02000000/pwm@020fc000:status disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/ecspi@02010000:status disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/ecspi@02014000:status disabled
Modify /soc/aips-bus@02100000/i2c@021a8000:status disabled
Modify /soc/aips-bus@02100000/i2c@021f8000:status disabled
Modify /soc/aips-bus@02000000/gpt@020e8000:status disabled
Modify /soc/aips-bus@02000000/epit@020d4000:status disabled
ft_system_setup for mx6
No PMIC found!
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.1.15+gb63f3f5 (chenlong@gitlab) (gcc version 5.3.0 (GCC) ) #37 SMP PREEMPT Tue Jun 19 15:28:38 CST 2018
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Freescale i.MX6 ULL 14x14 EVK Board
[ 0.000000] Reserved memory: failed to allocate memory for node 'linux,cma'
[ 0.000000] cma: Reserved 96 MiB at 0x8a000000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] PERCPU: Embedded 12 pages/cpu @89da3000 s16908 r8192 d24052 u49152
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
[ 0.000000] Kernel command line: console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs cma=96M mtdparts=gpmi-nand:3m(boot),7m(kernel),1m(dtb),-(rootfs)
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Memory: 148920K/262144K available (8035K kernel code, 423K rwdata, 2812K rodata, 540K init, 426K bss, 14920K reserved, 98304K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0x90800000 - 0xff000000 (1768 MB)
[ 0.000000] lowmem : 0x80000000 - 0x90000000 ( 256 MB)
[ 0.000000] pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
[ 0.000000] modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
[ 0.000000] .text : 0x80008000 - 0x80aa01f8 (10849 kB)
[ 0.000000] .init : 0x80aa1000 - 0x80b28000 ( 540 kB)
[ 0.000000] .data : 0x80b28000 - 0x80b91fa0 ( 424 kB)
[ 0.000000] .bss : 0x80b94000 - 0x80bfeb5c ( 427 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Additional per-CPU info printed with stalls.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] mxc_clocksource_init 24000000
[ 0.000000] Switching to timer-based delay loop, resolution 41ns
[ 0.000016] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000055] clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.002576] Console: colour dummy device 80x30
[ 0.002617] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.002651] pid_max: default: 32768 minimum: 301
[ 0.002871] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.002902] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.004249] CPU: Testing write buffer coherency: ok
[ 0.004743] /cpus/cpu@0 missing clock-frequency property
[ 0.004784] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.004894] Setting up static identity map for 0x80008280 - 0x800082d8
[ 0.041169] Brought up 1 CPUs
[ 0.041209] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.041229] CPU: All CPU(s) started in SVC mode.
[ 0.042328] devtmpfs: initialized
[ 0.063995] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.064876] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.072728] pinctrl core: initialized pinctrl subsystem
[ 0.075402] NET: Registered protocol family 16
[ 0.093456] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.120891] cpuidle: using governor ladder
[ 0.150945] cpuidle: using governor menu
[ 0.193816] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.193852] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.197045] imx6ul-pinctrl 20e0000.iomuxc: Invalid fsl,pins property in node /soc/aips-bus@02000000/iomuxc@020e0000/imx6ul-evk/hoggrp-1
[ 0.197751] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[ 0.198424] imx6ul-pinctrl 2290000.iomuxc-snvs: initialized IMX pinctrl driver
[ 0.258291] mxs-dma 1804000.dma-apbh: initialized
[ 0.264946] SCSI subsystem initialized
[ 0.266389] usbcore: registered new interface driver usbfs
[ 0.266580] usbcore: registered new interface driver hub
[ 0.266808] usbcore: registered new device driver usb
[ 0.269337] i2c i2c-0: IMX I2C adapter registered
[ 0.269384] i2c i2c-0: can't use DMA
[ 0.270959] i2c i2c-1: IMX I2C adapter registered
[ 0.271000] i2c i2c-1: can't use DMA
[ 0.271306] Linux video capture interface: v2.00
[ 0.271540] pps_core: LinuxPPS API ver. 1 registered
[ 0.271564] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[ 0.271838] PTP clock support registered
[ 0.274555] MIPI CSI2 driver module loaded
[ 0.275251] Advanced Linux Sound Architecture Driver Initialized.
[ 0.277394] Bluetooth: Core ver 2.20
[ 0.277520] NET: Registered protocol family 31
[ 0.277541] Bluetooth: HCI device and connection manager initialized
[ 0.277581] Bluetooth: HCI socket layer initialized
[ 0.277614] Bluetooth: L2CAP socket layer initialized
[ 0.277697] Bluetooth: SCO socket layer initialized
[ 0.279816] Switched to clocksource mxc_timer1
[ 0.306527] NET: Registered protocol family 2
[ 0.308171] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.308275] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.308368] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.308505] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.308565] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.308988] NET: Registered protocol family 1
[ 0.312418] imx rpmsg driver is registered.
[ 0.315091] Bus freq driver module loaded
[ 0.317442] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.335580] VFS: Disk quotas dquot_6.6.0
[ 0.336041] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.340311] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.342101] fuse init (API version 7.23)
[ 0.353298] io scheduler noop registered
[ 0.353346] io scheduler deadline registered
[ 0.353881] io scheduler cfq registered (default)
[ 0.354905] imx-weim 21b8000.weim: Driver registered.
[ 0.359458] lumi_r supply power not found, using dummy regulator
[ 0.361643] lumi_b supply power not found, using dummy regulator
[ 0.363409] lumi_g supply power not found, using dummy regulator
[ 0.365696] MIPI DSI driver module loaded
[ 0.366140] MIPI DSI driver module loaded
[ 0.371933] imx-sdma 20ec000.sdma: no event needs to be remapped
[ 0.372150] imx-sdma 20ec000.sdma: loaded firmware 3.3
[ 0.380061] imx-sdma 20ec000.sdma: initialized
[ 0.382144] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 19, base_baud = 5000000) is a IMX
[ 1.031395] console [ttymxc0] enabled
[ 1.036929] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 217, base_baud = 5000000) is a IMX
[ 1.082853] imx-rng 2284000.rngb: iMX RNG Registered.
[ 1.088576] imx sema4 driver is registered.
[ 1.093064] [drm] Initialized drm 1.1.0 20060810
[ 1.099023] [drm] Initialized vivante 1.0.0 20120216 on minor 0
[ 1.131970] brd: module loaded
[ 1.148912] loop: module loaded
[ 1.152884] pn54x_dev_init-->lumi
[ 1.156403] pn54x_probe
[ 1.158923] pn544 1-0028: FIRM GPIO <OPTIONAL> error getting from OF node
[ 1.165915] pn544 1-0028: CLKREQ GPIO <OPTIONAL> error getting from OF node
[ 1.172985] 1-0028 supply nxp,pn54x-pvdd not found, using dummy regulator
[ 1.180005] 1-0028 supply nxp,pn54x-vbat not found, using dummy regulator
[ 1.186952] 1-0028 supply nxp,pn54x-pmuvcc not found, using dummy regulator
[ 1.194109] 1-0028 supply nxp,pn54x-sevdd not found, using dummy regulator
[ 1.201164] pn54x_probe: request irq_gpio 7
[ 1.205391] pn54x_probe: request ven_gpio 3
[ 1.210086] pn54x_probe : requesting IRQ 35
[ 1.229557] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
[ 1.236052] nand: Micron MT29F2G08ABAEAWP
[ 1.240149] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 1.248534] gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
[ 1.256011] Bad block table found at page 131008, version 0x01
[ 1.262160] Bad block table found at page 130944, version 0x01
[ 1.268397] 4 cmdlinepart partitions found on MTD device gpmi-nand
[ 1.274685] Creating 4 MTD partitions on "gpmi-nand":
[ 1.279830] 0x000000000000-0x000000300000 : "boot"
[ 1.287270] 0x000000300000-0x000000a00000 : "kernel"
[ 1.294799] 0x000000a00000-0x000000b00000 : "dtb"
[ 1.302051] 0x000000b00000-0x000010000000 : "rootfs"
[ 1.310458] gpmi-nand 1806000.gpmi-nand: driver registered.
[ 1.322448] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.329052] ehci-mxc: Freescale On-Chip EHCI Host driver
[ 1.334959] usbcore: registered new interface driver usb-storage
[ 1.341269] usbcore: registered new interface driver usb_ehset_test
[ 1.350183] 2184800.usbmisc supply vbus-wakeup not found, using dummy regulator
[ 1.359244] 2184000.usb supply vbus not found, using dummy regulator
[ 1.373860] mousedev: PS/2 mouse device common for all mice
[ 1.381584] input: 20cc000.snvs:snvs-powerkey as /devices/platform/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
[ 1.399350] snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r as rtc0
[ 1.408562] i2c /dev entries driver
[ 1.414997] IR NEC protocol handler initialized
[ 1.419596] IR RC5(x/sz) protocol handler initialized
[ 1.424788] IR RC6 protocol handler initialized
[ 1.429372] IR JVC protocol handler initialized
[ 1.433996] IR Sony protocol handler initialized
[ 1.438658] IR SANYO protocol handler initialized
[ 1.443449] IR Sharp protocol handler initialized
[ 1.448203] IR MCE Keyboard/mouse protocol handler initialized
[ 1.454124] IR XMP protocol handler initialized
[ 1.464955] imx2-wdt 20bc000.wdog: use WDOG_B to reboot.
[ 1.471366] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
[ 1.478625] sdhci: Secure Digital Host Controller Interface driver
[ 1.484961] sdhci: Copyright(c) Pierre Ossman
[ 1.489378] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.496842] /soc/aips-bus@02100000/usdhc@02190000: voltage-ranges unspecified
[ 1.504130] sdhci-esdhc-imx 2190000.usdhc: could not get ultra high speed state, work on normal mode
[ 1.514730] sdhci-esdhc-imx 2190000.usdhc: No vmmc regulator found
[ 1.521028] sdhci-esdhc-imx 2190000.usdhc: No vqmmc regulator found
[ 1.570060] mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA
[ 1.604211] usbcore: registered new interface driver usbhid
[ 1.610176] usbhid: USB HID core driver
[ 1.614845] vf610-adc 2198000.adc: Debug vf610_adc_proble()
[ 1.621166] 2198000.adc supply vref not found, using dummy regulator
[ 1.627844] vf610-adc 2198000.adc: Debug[0] channels[2]
[ 1.643496] wm8524_i2c_probe:
[ 1.650025] mmc0: new high speed SDIO card at address 0001
[ 1.656475] wm8960 1-001a: Failed to issue reset
[ 1.661537] wm8960: probe of 1-001a failed with error -5
[ 1.670218] fsl-asrc 2034000.asrc: driver registered
[ 1.683059] imx_wm8524_probe:
[ 1.686751] wm8524_probe:
[ 1.690973] imx-wm8524 sound2: wm8524-hifi <-> 2028000.sai mapping ok
[ 1.698867] imx-wm8524 sound2: snd-soc-dummy-dai <-> 2034000.asrc mapping ok
[ 1.706468] imx-wm8524 sound2: wm8524-hifi <-> 2028000.sai mapping ok
[ 1.720174] NET: Registered protocol family 26
[ 1.726819] NET: Registered protocol family 10
[ 1.733626] sit: IPv6 over IPv4 tunneling driver
[ 1.740329] NET: Registered protocol family 17
[ 1.745151] Bluetooth: RFCOMM TTY layer initialized
[ 1.750308] Bluetooth: RFCOMM socket layer initialized
[ 1.755527] Bluetooth: RFCOMM ver 1.11
[ 1.759345] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 1.764758] Bluetooth: BNEP filters: protocol multicast
[ 1.770082] Bluetooth: BNEP socket layer initialized
[ 1.775095] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 1.781109] Bluetooth: HIDP socket layer initialized
[ 1.786121] 8021q: 802.1Q VLAN Support v1.8
[ 1.790437] lib80211: common routines for IEEE802.11 drivers
[ 1.796331] Key type dns_resolver registered
[ 1.802586] cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
[ 1.837399] ubi0: attaching mtd3
[ 2.168158] random: nonblocking pool is initialized
[ 2.525547] ubi0: scanning is finished
[ 2.543900] ubi0: attached mtd3 (name "rootfs", size 245 MiB)
[ 2.549703] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 2.556735] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 2.563959] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 2.571008] ubi0: good PEBs: 1956, bad PEBs: 4, corrupted PEBs: 0
[ 2.577126] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 2.584479] ubi0: max/mean erase counter: 8/1, WL threshold: 4096, image sequence number: 1813099077
[ 2.593678] ubi0: available PEBs: 0, total reserved PEBs: 1956, PEBs reserved for bad PEB handling: 36
[ 2.603059] ubi0: background thread "ubi_bgt0d" started, PID 73
[ 2.609050] dhd_module_init in
[ 2.613906] input: regulators:gpio-keys as /devices/platform/regulators/regulators:gpio-keys/input/input1
[ 2.624240] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:11:40 UTC (700)
[ 2.654574] gpio_dvfs: disabling
[ 2.657853] vref-3v3: disabling
[ 2.661122] can-3v3: disabling
[ 2.664553] ALSA device list:
[ 2.667544] #0: wm8524-audio
[ 2.692163] UBIFS (ubi0:0): recovery needed
[ 2.730261] UBIFS (ubi0:0): recovery deferred
[ 2.734814] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode
[ 2.743266] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 2.753255] UBIFS (ubi0:0): FS size: 241635328 bytes (230 MiB, 1903 LEBs), journal size 12062720 bytes (11 MiB, 95 LEBs)
[ 2.764175] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[ 2.770926] UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID AD7DD6E8-1329-4760-93D9-E1A4D3A2465D, small LPT model
[ 2.783076] VFS: Mounted root (ubifs filesystem) readonly on device 0:14.
[ 2.790952] devtmpfs: mounted
[ 2.795054] Freeing unused kernel memory: 540K (80aa1000 - 80b28000)
INIT: version 2.88 booting
Starting udev
[ 3.875137] udevd[105]: starting version 3.1.5
[ 4.380347] UBIFS (ubi0:0): completing deferred recovery
[ 4.429536] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 129
[ 4.441919] UBIFS (ubi0:0): deferred recovery completed
INIT: Entering runlevel: 5
Configuring network interfaces... eth0: ERROR while getting interface flags: No such device
Running local boot scripts (/etc/rc.local)[ 7.739683] RTL871X: module init start
[ 7.747651] RTL871X: rtl8723bs v4.4.2_17831.20160519_BTCOEX20151223-654a
[ 7.754687] RTL871X: build time: Mar 29 2017 03:05:03
[ 7.759763] RTL871X: rtl8723bs BT-Coex version = BTCOEX20151223-654a
[ 7.775264] RTL871X: rtw_hal_config_rftype RF_Type is 3 TotalTxPath is 1
[ 7.782169] RTL871X: Chip Version Info: CHIP_8723B_Normal_Chip_TSMC_F_CUT_1T1R_RomVer(0)
[ 7.793764] RTL871X: SetHwReg8723B: bMacPwrCtrlOn=1
[ 7.799470] RTL871X: PowerOnCheck: val_mix:0x0000063f, res:0x0000063f
[ 7.805982] RTL871X: PowerOnCheck: 0x100 the result of cmd52 and cmd53 is the same.
[ 7.813840] RTL871X: PowerOnCheck: 0x1B8 test Pass.
[ 7.819359] RTL871X: ReadAdapterInfo8723BS, 0x4e=0xe2
[ 7.824620] RTL871X: EEPROM type is E-FUSE
[ 7.829414] RTL871X: hal_EfuseSwitchToBank: Efuse switch bank to 0
[ 7.910866] RTL871X: hal_ReadEFuse_WiFi: data end at address=0xad
[ 7.916985] RTL871X: Efuse Realmap:
[ 7.920524]
[ 7.922032] 29 81 03 7C 51 08 28 00 62 07 0D 45 10 02 00 00
[ 7.927968] 2B 2B 2B 2B 2B 2B 2D 2D 2D 2D 2D E0 FF FF FF FF
[ 7.933938] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 7.939900] FF FF FF FF FF FF FF FF FF FF 2D 2D 2D 2D 2D 2D
[ 7.945834] 2D 2D 2D 2D 2D E0 FF FF FF FF FF FF FF FF FF FF
[ 7.951802] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 7.957735] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 7.963767] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 7.969700] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 7.975719] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 7.981689] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 7.987622] FF FF FF FF FF FF FF FF 20 23 1C 00 00 00 FF FF
[ 7.993590] FF 29 20 11 00 00 00 FF 00 FF 12 FF FF FF FF FF
[ 7.999521] 3E 10 01 02 23 00 00 FF 20 04 4C 02 23 B7 21 02
[ 8.005485] 0C 00 22 04 00 08 00 32 FF 21 02 0C 00 22 2A 01
[ 8.011448] 01 00 00 00 00 00 00 00 00 00 00 00 02 00 FF FF
[ 8.017377] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 8.023333] 00 EB 00 6E 01 00 00 00 00 FF 58 B3 FC 71 E3 04
[ 8.029264] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.035223] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.041185] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.047118] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.053120] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.059054] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.065079] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.071048] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.076980] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.082946] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.088878] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.094840] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.100799] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.106732] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 8.120782] RTL871X: Hal_EfuseParseBTCoexistInfo_8723B: Enable BT-coex, ant_num=1
[ 8.128294] RTL871X: hal_com_config_channel_plan chplan:0x20
[ 8.134822] RTL871X: Hal_EfuseParsePackageType_8723B phy efuse read 0x1FB =fc
[ 8.142249] RTL871X: PackageType = 0x4
[ 8.146017] RTL871X: Hal_EfuseParseVoltage_8723B hwinfo[EEPROM_Voltage_ADDR_8723B] =62
[ 8.154135] RTL871X: Hal_EfuseParseVoltage_8723B pHalData->adjuseVoltageVal =6
[ 8.161496] RTL871X: AutoloadFail =0,
[ 8.165509] RTL871X: pHalData->EEPROMRFGainVal=33
[ 8.170276] RTL871X: EEPRORFGainOffset = 0x29
[ 8.175803] RTL871X: SetHwReg8723B: bMacPwrCtrlOn=0
[ 8.181748] RTL871X: rtw_hal_read_chip_info in 390 ms
[ 8.187099] RTL871X: init_channel_set((null)) ChannelPlan ID:0x20, ch num:13
[ 8.195421] RTL871X: rtw_alloc_macid((null)) if1, hwaddr:ff:ff:ff:ff:ff:ff macid:1
[ 8.203190] RTL871X: Init_ODM_ComInfo_8723b(): fab_ver=0 cut_ver=0
[ 8.209413] RTL871X: rtw_macaddr_cfg mac addr:58:b3:fc:71:e3:04
[ 8.215731] RTL871X: bDriverStopped:True, bSurpriseRemoved:False, bup:0, hw_init_completed:0
[ 8.224331] RTL871X: rtw_wiphy_alloc(phy0)
[ 8.228450] RTL871X: rtw_wdev_alloc(padapter=90d39000)
[ 8.233663] RTL871X: rtw_wiphy_register(phy0)
[ 8.238036] RTL871X: Register RTW cfg80211 vendor cmd(0x67) interface
[ 8.248770] RTL871X: rtw_ndev_init(wlan0) if1 mac_addr=58:b3:fc:71:e3:04
[ 8.281940] RTL871X: module init ret=0
====================================
========== start mi=================
====================================
fac_test bulid time:06:57:28 Aug 31 2018
gobal_cmd_list size 3204
Input cmd:
I can issue 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.
exit_factory
and we get to the:
Input cmd:exit_factory
Exit test...
OK
.
umount: /mnt/.psplash: not mounted
Freescale i.MX Release Distro 4.1.15-2.0.0 imx6ull14x14evk /dev/ttymxc0
imx6ull14x14evk login:
Any ideas?
get_did
gives particularly interesting output:
did={8-char int}
key={16-char aZ0-9 string}
mac=7C:49:EB:93:5B:1A
vendor=lumi
model=lumi.gateway.mieu01
Update:
Now: there's no psm-...
commands in it!
netstat -tlpun
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:54322 0.0.0.0:* LISTEN 377/miio_client
tcp 0 0 127.0.0.1:54323 0.0.0.0:* LISTEN 377/miio_client
udp 0 0 0.0.0.0:10008 0.0.0.0:* 11982/gw
udp 0 0 0.0.0.0:54321 0.0.0.0:* 377/miio_client
udp 0 0 0.0.0.0:5353 0.0.0.0:* 377/miio_client
This looks like it's not about opening ports... It's about launching process that actually listens on this port. :)
More details on how-to hack:
https://community.openhab.org/t/solved-openhab2-xiaomi-mi-gateway-does-not-respond/52963/188?u=cadavre
Great job, Cadavre.
It appears to me that hacking the GW still gives no benefit other than getting ssh to it, or am I missing something here?
So, I would guess that the communication protocol is different to the Chinese version of the GW. (?) If that is the case then I would imagine there is no way of connecting the GW to Hass.io unless someone develops a plugin utilizing the new protocol.
@nodkan that is correct. I could potentially develop some plugin to just mock communication between gateway
and miio_client
that would expose communication on regular ports, but I cannot find any decent documentation on which ports are actually used for discovery and which for sending/receiving commands. I can read always 4321 and 9898, but also 54321 vs 54322 and 54323 and I'm not sure which is which and what communication shall be estabilished via them.
Any docs or link to source code that could be helpful – appreciated!
@nodkan that is correct. I could potentially develop some plugin to just mock communication between
gateway
andmiio_client
that would expose communication on regular ports, but I cannot find any decent documentation on which ports are actually used for discovery and which for sending/receiving commands. I can read always 4321 and 9898, but also 54321 vs 54322 and 54323 and I'm not sure which is which and what communication shall be estabilished via them.Any docs or link to source code that could be helpful – appreciated!
Hello Cadavre,
udp.mdns default port is 5353 which I can see is open on your gateway
also, if I remember correctly some weeks ago I was able to capture communications on 54321 during the initial pairing of the gateway (after reset and during the wifi setup procedure)
the two tcp (54322, 54323) ports that the gw is listening to, I suppose might be the ones communicating with xiaomi cloud services (most probably over ssl)
the port that I never seen before is 10008 (big question mark here)
The miio_client internal communication is the same as for the vacuum cleaner. You can find it in my slides (e.g. Defcon or CCC)
Thanks very much @dgiese. So as to be all aligned, the new xiaomi-mijia gateway uses the same protocol for internal communications as the vacuum cleaner. (which I finally managed to setup today) Thus the xiaomi-aqara add on for hass.io is not going to work. Does anyone know if someone has developed any add on for xiaomi mijia? (otherwise I guess I will have to buy some books on python and try it myself :-P)
Thanks very much @dgiese. So as to be all aligned, the new xiaomi-mijia gateway uses the same protocol for internal communications as the vacuum cleaner. (which I finally managed to setup today) Thus the xiaomi-aqara add on for hass.io is not going to work. Does anyone know if someone has developed any add on for xiaomi mijia? (otherwise I guess I will have to buy some books on python and try it myself :-P)
PS. I couldn't help myself. I have to ask this @dgiese. Do you think we could use the vacuum addon and extend it in order to support the gateway?
Yeah, I am planing to release the non-cloud component soon. Bonus: You can use it for the vacuum cleaner as an endpoint too.
I ran gw
command in tty to see whats happening over there. Port 10008
is listening and receiving all data from both: sensors and mobile app. I guess it's a heart of the device which triggers all actions on it.
I tried to send some data to it via UDP and seen received data:
======gateway recv_data from app,len:12
7b 63 6d 64 3a 77 68 6f 69 73 7d 0a
I tried to use miio.protocol
: Utils
and Message
to send data to it. It was received and while using padded messages I got additional message on the gateway that it is starting to parse JSON message but then fails – because of wrong decryption of the message I guess.
Instead of data I sent I can see decoded message on the gateway like:
p(?;???
?ŀA$????;?C??h?????%&j?)Z?h?IC
which obviously cannot be parsed as JSON.
I have all data from gateway, including: key
, token
, did
, uid
but couldn't find a way to encrypt data that was correctly decrypted on the gateway.
If I'm no wrong port 10008
is what we can use in LAN to control the gateway without cloud. It's opened by default and if we manage to communicate – we would be able to add integration with literally no hacking into it.
@cadavre, apparently you could not wait for Dennis to release the add on.
It's great to know that the actual communication port is 10008, so we can all, also mess about, a bit. Speaking of messing about, did you try to multicast data on 224.0.0.50 or did you just send them to the gateways IP on 10008 using UDP?
Another thing I would try would be to edit the /etc/hosts of the gateway and add all the xiaomi servers pointing to some local machine on which I would receive the traffic ...
Example for Germany servers would be:
192.168.1.1 de.ot.io.mi.com
192.168.1.1 de.ott.io.mi.com
... this way all the traffic instead of going to the cloud would end up on the local machine and you could inspect it. (heartbeat every 15 seconds and initial connection message every 30 minutes)
Anyways having a _guess_ the miio implementation (Utils, Message) that you tried to use, probably does not create appropriate messages as the LAN (non-cloud) communication protocol defines. (no idea where to find the LAN protocol definition. On Denis's papers I could only find the cloud com protocol explained)
BTW, do check Dennis's presentation from Defcon26? (I think pages 10-13 are very helpful to what we are trying to achieve as there you can see the messages structure etc).
Also do check the dustcloud implementation.
Dustcloud intercepts the cloud communication reading and changing messages and then forwards them to the cloud.
Finally, I am thinking of trying to use SSLSplit (or mitmproxy) on a Pi in order to sniff the cloud messages the same way I described above. (gateway <-> Pi (SSLSplit) <-> Cloud). If I have any updates I will post them as soon as possible.
Hi all.
I'm trying to connect the lumi.gateway.mieu01 to home assistant using hass.io. Did you guys manage to find a solution? @cadavre @nodkan
Hello.
I would also know if something is moving with this issue. Recently bought Mi smart sensor set, which contains lumi.gateway.mieu01. Would like to connect it from my HA.
Same problem here, also interested on this.
Hopefully we can have a solution for this.
Hi @cadavre any news?
I've opened the device and I've seen my EU board looks like yours. I've not soldered anything for now.
I THINK I've got the key (downloaded from iPhone backup, extracted via miio-extract-tokens and then converted the 32 char HEX to 16char ASCII.
After that I've cofigured the device like that:
xiaomi_aqara:
gateways:
- mac: 50EC5041B540
key: <my_key>
host: 192.168.3.20
After restart, in the logs, I've got:
2019-05-22 21:13:57 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi_aqara is taking over 10 seconds.
2019-05-22 21:13:57 ERROR (SyncWorker_6) [xiaomi_gateway] Cannot connect to Gateway
2019-05-22 21:13:57 ERROR (SyncWorker_6) [xiaomi_gateway] No data in response from hub None
2019-05-22 21:13:57 INFO (SyncWorker_6) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-22 21:14:07 ERROR (SyncWorker_6) [xiaomi_gateway] Cannot connect to Gateway
2019-05-22 21:14:07 INFO (SyncWorker_6) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-22 21:14:17 ERROR (SyncWorker_6) [xiaomi_gateway] Cannot connect to Gateway
2019-05-22 21:14:17 INFO (SyncWorker_6) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-22 21:14:27 ERROR (SyncWorker_6) [xiaomi_gateway] Cannot connect to Gateway
2019-05-22 21:14:27 INFO (SyncWorker_6) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-22 21:14:37 ERROR (SyncWorker_6) [xiaomi_gateway] Cannot connect to Gateway
2019-05-22 21:14:37 INFO (SyncWorker_6) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-22 21:14:47 ERROR (SyncWorker_6) [xiaomi_gateway] Cannot connect to Gateway
2019-05-22 21:14:52 INFO (SyncWorker_6) [xiaomi_gateway] Gateway discovery finished in 5 seconds
2019-05-22 21:14:52 INFO (SyncWorker_6) [xiaomi_gateway] Creating Multicast Socket
2019-05-22 21:14:52 INFO (MainThread) [homeassistant.setup] Setup of domain xiaomi_aqara took 65.2 seconds.
2019-05-22 21:14:52 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.xiaomi_aqara
2019-05-22 21:14:52 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.xiaomi_aqara
2019-05-22 21:14:52 INFO (MainThread) [homeassistant.components.switch] Setting up switch.xiaomi_aqara
2019-05-22 21:14:52 INFO (MainThread) [homeassistant.components.light] Setting up light.xiaomi_aqara
2019-05-22 21:14:52 INFO (MainThread) [homeassistant.components.cover] Setting up cover.xiaomi_aqara
2019-05-22 21:14:52 INFO (MainThread) [homeassistant.components.lock] Setting up lock.xiaomi_aqara
2019-05-22 21:15:35 INFO (MainThread) [homeassistant.components.discovery] Found new service: xiaomi_gw {'host': '192.168.3.20', 'port': 54321, 'hostname': 'lumi-gateway-mieu01_miio264420999.', 'properties': {'path': '/mydevice'}}
And now?
I cannot find any discovered devices under states.
I'm not sure thats the right way.
Thanks, Simon
For now, without soldering, there's nothing you can do. roth-m
from Github prepared a miio_client
replacement that enables us to communicate locally with Gateway without encryption. He also prepared a package for OTA update, but there's no one who tried it (and how to try it).
Take a look at: https://github.com/roth-m/miioclient-mqtt
Hi @cadavre , no problem at all if it's the way to bring the device to work.
I've some questions for you about that:
1- if I follow the miio_client
setup, then do I need the key anyway? How to extract it? I think not, because it's unencrypted and the encryption was decrypted by the key, if I've understood correctly.
2- Due it's a EU Version that I could control only via EU servers, if I purchase other sensors not in the EU list, I'm not able to add those devices?
I know, the zigbee2mqtt bridge will solve my problems, btw I would like to start first with what I have ;-)
Thanks a lot for your help!
Cheers, Simon
No other ideas for now @xefil :/
1- if I follow the miio_client setup, then do I need the key anyway? How to extract it? I think not, because it's unencrypted and the encryption was decrypted by the key, if I've understood correctly.
Yes, key is not needed.
2- Due it's a EU Version that I could control only via EU servers, if I purchase other sensors not in the EU list, I'm not able to add those devices?
After you install changed miio_client
– gateway will appear as "Offline" in Mi Home app. I'm actually using zigbee2mqtt
so I can't even answer if sensors are supported via miio_client
. I can't see anything in MQTT client, but it doesn't mean that it wont appear in miio_client
– in fact I believe it does.
Fast answer @cadavre ! So if you have already zigbee2mqtt
, for what are you using the Gateway? Only as light and siren?
Um, actually – yes. :p
Ok, good, it makes sense btw ;-)
I've ordered the hardware for zigbee2mqtt
... now I've to wait ony some months until it's delivered :-D
Thanks @cadavre for your suggestions!
Hello @cadavre
I was able to gain SSH access to the device. Your guide is awesome, only dropbear needs to start the first time via init.d to generate the ssh key, then it can be added to rc.local.
Into /lumi/conf I've found the token, which is the same I've take from the iPhone backup. At least the procedure was good ;-)
BTW nothing is changed actually. Now I've the modified miio_client in execution:
root@imx6ull14x14evk:/lumi/conf# ps -edaf | grep miio_c
root 369 1 0 10:33 ? 00:00:00 /bin/sh ./miio_client_helper_nomqtt.sh /lumi/conf
root 5744 3532 0 10:48 pts/0 00:00:00 /home/root/miioclient_hack/miio_client
But I think there are not the correct ports listening:
root@imx6ull14x14evk:/lumi/conf# netstat -ulptn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:54322 0.0.0.0:* LISTEN 5744/miio_client
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 436/dropbear
tcp6 0 0 :::22 :::* LISTEN 436/dropbear
udp 0 0 0.0.0.0:10008 0.0.0.0:* 363/gw
udp 0 0 0.0.0.0:54321 0.0.0.0:* 5744/miio_client
So during the home-assistant startup a warning appears that the key is not provided and then:
2019-05-25 08:56:16 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi_aqara is taking over 10 seconds.
2019-05-25 08:56:16 ERROR (SyncWorker_2) [xiaomi_gateway] Cannot connect to Gateway
2019-05-25 08:56:16 ERROR (SyncWorker_2) [xiaomi_gateway] No data in response from hub None
2019-05-25 08:56:16 INFO (SyncWorker_2) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-25 08:56:26 ERROR (SyncWorker_2) [xiaomi_gateway] Cannot connect to Gateway
2019-05-25 08:56:26 INFO (SyncWorker_2) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-25 08:56:36 ERROR (SyncWorker_2) [xiaomi_gateway] Cannot connect to Gateway
2019-05-25 08:56:36 INFO (SyncWorker_2) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-25 08:56:46 ERROR (SyncWorker_2) [xiaomi_gateway] Cannot connect to Gateway
2019-05-25 08:56:46 INFO (SyncWorker_2) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-25 08:56:56 ERROR (SyncWorker_2) [xiaomi_gateway] Cannot connect to Gateway
2019-05-25 08:56:56 INFO (SyncWorker_2) [xiaomi_gateway] Discovering Xiaomi Devices
2019-05-25 08:57:06 ERROR (SyncWorker_2) [xiaomi_gateway] Cannot connect to Gateway
2019-05-25 08:57:11 INFO (SyncWorker_2) [xiaomi_gateway] Gateway discovery finished in 5 seconds
2019-05-25 08:57:11 INFO (SyncWorker_2) [xiaomi_gateway] Creating Multicast Socket
2019-05-25 08:57:11 INFO (MainThread) [homeassistant.setup] Setup of domain xiaomi_aqara took 65.3 seconds.
2019-05-25 08:57:11 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.xiaomi_aqara
2019-05-25 08:57:11 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.xiaomi_aqara
2019-05-25 08:57:11 INFO (MainThread) [homeassistant.components.switch] Setting up switch.xiaomi_aqara
2019-05-25 08:57:11 INFO (MainThread) [homeassistant.components.light] Setting up light.xiaomi_aqara
2019-05-25 08:57:11 INFO (MainThread) [homeassistant.components.lock] Setting up lock.xiaomi_aqara
2019-05-25 08:57:11 INFO (MainThread) [homeassistant.components.cover] Setting up cover.xiaomi_aqara
So what I'm doing wrong? :)
Thanks!
Simon
Hi @cadavre,
I'm here again. AFAYK it's correct that lan-mode works only if port 9898 is open?
BTW it's not there... of it's there a way to define it if there is a different one?
For the rest, see my previous post ;-)
Thanks!!!
Hi @xefil, the thing is that with any current implementation of miio_client for lumi.gateway.mieu01
– it won't work with Home Assistant or rather PyXiaomiGateway
as it uses different way to communicate – encrypted LAN messages that is.
With roth-m's modified client – we "just" get unencrypted communication on UDP port 54321 which is pure Mi Cloud communication intercepted.
Making it work via MQTT makes sense, but to make it a whole component would require too much work (equals time).
Other thing I'm really curious is to binary from other (working) Gateways. Maybe we could adapt them? But I cant find any on the Internet, maybe someone you know could extract one from their's?
Hi @cadavre,
How are you actually using this gateway then? I was thinking you're using it via home-assistant.
BTW, ask the community to get the miio_client binary and test it on our gateway, that could be a possibility.
It's enough to double check if the process which opens the lan_mode (9898 right) is the miio_client process and so trying it in our setup.
I'll give on it a try to get the file if this is what your're asking for ;-)
Simon
HA implementation of PyXiaomiGateway
discovers gateway by sending {"cmd":"whois"}
via port 4321
, then uses Multicast on 224.0.0.50:9898
to communicate with discovered devices using SID (their identifier).
What's missing on our gateways is mDNS like Avahi and a client to handle discovery and communication, which I believe is just an interface to miio_client
. We already have this low-level communication.
I'm currently starting to use my Gateway via miioclient_mqtt
, few more hours and I'll have:
1) LED control: including toggling, brightness and full colors palette.
2) Alarm arming and disarming.
3) Controlling all volumes. Muting.
4) Playing a sound and stopping a playback.
I'll also disconnect one PIR from my zigbee2mqtt and test it with gateway – all by miio_client commands, including: pairing, making a linkage between sensor and alarm, getting sensor updates.
EDIT: If I find some more time, probably I'll write Home Assistant implementation of miioclient_mqtt
(so it won't need to run separately).
Good morning @cadavre
Ok, now I've understood. You're interacting with the gateway using miioclient_mqtt
and not the unencrypted version of miio_client
.
Now I'm doubt if the first needs the second anyway.
This is a MQTT client which will connect to the modified miio_client on the gateway
(answerred myself... rtfm ;-) )
BTW seems you're on a good point of managing the device! Actually I'm waiting the zigbee2mqtt
hardware, so this will be my choise as well. BTW using the gateway as alarm and led... why not!
I'll wait news from you to test mine the same way!
Many thanks for the tech backgroud behind HA and Mii!
Cheers, Simon
Actually since my last post I've made some... steps – and yes – I got rid of miioclient_mqtt
so you were actually right. :)
I've played some with HA itself and created a bunch of auto-discovery devices for gateway itself (excluding Zigbee sensors linked to gateway).
This way for now I've created:
light
for build-in LED with brightness and color control.sensor
for built-in illumination sensor (yes, it looks gateway has one).media_player
for built-in speaker supporting volume change, muting, play, stop and play_media
for given ringtone ID.alarm
for built-in alarm functionality. For now it changes/gets arming status and uses media_player
to actually trigger the alarm from HA.I'm working right now on alarm
and stability of whole construct. Will share soon!
@cadavre ... great!
Where can I then leave you a beer offered? ;-)
OK, I guess I reached a point where I can put my new component into my HA production environment. :) So I guess it's a time when I can also share it.
This component requires running modified miio_client
on gateway and supports only single gateway.
Also Zigbee subdevices are not yet supported.
PS There might be one error: if so comment out line self.schedule_update_ha_state()
inside _set_init_*
methods in media_player
and alarm_ctrl_panel
WOW @cadavre !
I'll give it a try this evening ;-)
Thanks!!
Simon
Hi @cadavre ,
I'm trying your setup. Actually I'm checking it by remote (via IP-cam).
Seems works all well, but how to let the media player play the default audio? Like the alarm sounds?
I've tested send to it TTS as well, but nothing is played.
I can listen only when I arm or disarm the alarm_panel.
Should it work?
Simon
Hello @cadavre
sorry, I've anther question ....
I've added the alarm control panel but how to configure pin?
I've already a manual alarm like the example in the doc which works.
Thanks, Simon
--- update ---
Ok, this is maybe solved. I've added an automation which call the 'alarm_control_panel.alarm_arm_home' service on my miio_gw alarm panel in case the manual alarm panel is armed at home, which works.
I don't know if there is a faster way ;-)
For the above, still in doubt how to send the audio (default or TTS) :-)
Thank you @cadavre for this, after hours, I finally done it, just one question remains for me... I don't know if it's only for me but I have to leave open a ssh session in order for HA to pick up data... is it supposed to work this way?
Hello @darksider4all ,
Not for me. SSH is not needed anymore. Have you tried a reboot ;-) BTW I've added ssh on boot.
Do you have an idea about TTS and / or let the GW play siren or sounds?
Thanks, Simon
@xefil sorry but I don't use TTS because I gave google mini for that, the alarms works for me... can we talk in pm? leave me some contact data.
Of course! Uhm... how to contact someone in PM here? You can reach me here: xefil -at- xefil -dot- com. ;)
Hi there,
I finished yesterday updated version of component – lots ot things fixed, initial state sync and more. I'll share in the evening. :)
@darksider4all no there's no need to keep SSH connection. In first I thought gateway is closing UDP connection as well, but it had more to do with Python implementation on HA side.
@xefil there's no TTS available on the gateway, it's just added by HA, I don't know why actually because I've found no flag responsible for TTS support. If it comes to alarm code – you'd need to implement it in your own component, but... I've created another component called coupled_alarm
– to have my manual alarm control panel, but coupled with gateway alarm. This way I never actually control gateway alarm (arm, disarm, trigger etc.). I'll share as well.
@cadavre, thank you mate, can't wait for the update. I'll buy you a drink if you manage to add the sensors state as well. It's a promise.
Great @cadavre ,
I'll wait your last update prior to ask other simple/stupid questions ;-)
And yes, a beer is the minimal we can do :+1:
Ok, here you go:
miio_gateway.zip
_Changelog:_
coupled_alarms
component to bind two alarms together. This way you can use your regular alarm_control_panel
– with code or triggering alarm only on single entity – and have gateway being used as "executor" for arming/disarming sounds, siren and red light._TODO:_
_FYI_ I believe that supporting sensors will be quite easy, AFAIK states of sensors are also updated via miio_client
. Will work on this one!
Oh, and exemplary config.yml:
miio_gateway:
host: 192.168.1.1
port: 54321
alarm_control_panel:
- platform: manual # manual alarm
name: Alarm
pending_time: 0
delay_time: 0
disarmed:
trigger_time: 0
armed_night:
trigger_time: 10
armed_home:
trigger_time: 10
armed_away:
delay_time: 2
trigger_time: 10
coupled_alarms:
alarms:
entities:
- alarm_control_panel.alarm
- alarm_control_panel.gw_alarm # renamed gateway entity to this via Entity registry in Settings
automations:
- alias: 'Alarm: triggers while away'
trigger:
- platform: state
entity_id: binary_sensor.motion_bikes
to: 'on'
- platform: state
entity_id: binary_sensor.motion_corridor
to: 'on'
- platform: state
entity_id: binary_sensor.garage_gate_contact
to: 'on'
- platform: state
entity_id: binary_sensor.garage_door_contact
to: 'on'
condition:
- condition: state
entity_id: alarm_control_panel.alarm
state: armed_away
action:
- service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.alarm # trigger only on single alarm entity
And in Lovelace also only for single alarm entity:
entity: alarm_control_panel.alarm
name: Alarm
states:
- arm_home
- arm_away
- arm_night
type: alarm-panel
Thanks to "coupling" alarms – gateway alarm will take same states as manual alarm.
Some teaser screenshots:
GREAT work @cadavre !!
I've updated my setup and now the automation on which alarm panel A was updating the miio one is not more needed ;-)
BTW, I'm still missing how to play the siren alarm on the miio and set the volume.
Some hints?
Thanks!!
Simon
@xefil try to issue media_player.media_play
on gateway. It looks like gateway is not responding with initial volume and state stays None
. Take a look at your logs. You can always add to config.yml
:
logger:
default: warning
logs:
custom_components.miio_gateway: debug
custom_components.coupled_alarms: debug
To see all communication between HA and gateway.
@cadavre so I don't know what I'm missing, but without my ssh session opened to see logs and stuff on the gateway my HA componnent won't connect, zenmap show the port is opened|filtered, I've rebooted a thousand times...
@cadavre maybe I've not explained the problem well.
I have no idea how to let the media player execute a siren (which should be an internal audio in the miio), triggered by a sensor or whatever. Do you have an example?
Pressing the media_player I can change the volume and the miio is beeping the selection based on the volume.
BTW here some debug logs:
2019-06-05 07:16:02 INFO (SyncWorker_0) [custom_components.miio_gateway] Starting setup...
2019-06-05 07:16:02 INFO (SyncWorker_0) [custom_components.miio_gateway] Creating socket...
2019-06-05 07:16:02 INFO (Thread-2) [custom_components.miio_gateway] Starting listener thread...
2019-06-05 07:16:02 DEBUG (SyncWorker_0) [custom_components.miio_gateway] Starting to track availability...
2019-06-05 07:16:02 DEBUG (SyncWorker_5) [custom_components.coupled_alarms] Couples setting up...
2019-06-05 07:16:04 INFO (SyncWorker_4) [custom_components.miio_gateway.media_player] Setting up sound player
2019-06-05 07:16:04 INFO (SyncWorker_4) [custom_components.miio_gateway] Adding callback for call ID: 1
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] Sending data:
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id": 1, "method": "get_prop", "params": ["gateway_volume"]}'
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"result":[50],"code":0,"id":1}\x00'
2019-06-05 07:16:05 INFO (Thread-2) [custom_components.miio_gateway.media_player] SETTING VOL: 50
2019-06-05 07:16:05 INFO (SyncWorker_1) [custom_components.miio_gateway.alarm_control_panel] Setting up alarm
2019-06-05 07:16:05 INFO (SyncWorker_1) [custom_components.miio_gateway] Adding callback for call ID: 2
2019-06-05 07:16:05 INFO (SyncWorker_1) [custom_components.miio_gateway] Adding callback for call ID: 3
2019-06-05 07:16:05 DEBUG (SyncWorker_8) [custom_components.coupled_alarms] Setting coulped state
2019-06-05 07:16:05 DEBUG (SyncWorker_8) [custom_components.coupled_alarms] State: unknown
2019-06-05 07:16:05 DEBUG (SyncWorker_8) [custom_components.coupled_alarms] From: alarm_control_panel.miio_gw_alarm01
2019-06-05 07:16:05 DEBUG (SyncWorker_8) [custom_components.coupled_alarms] To: alarm_control_panel.home_alarm
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] Sending data:
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id": 2, "method": "get_prop", "params": ["arming"]}'
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] Sending data:
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id": 3, "method": "get_prop", "params": ["alarming_volume"]}'
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"result":["on"],"code":0,"id":2}\x00'
2019-06-05 07:16:05 INFO (Thread-2) [custom_components.miio_gateway.alarm_control_panel] SETTING ARMED: on
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:05 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"result":[15],"code":0,"id":3}\x00'
2019-06-05 07:16:05 INFO (Thread-2) [custom_components.miio_gateway.alarm_control_panel] SETTING ARMED VOL: 15
2019-06-05 07:16:06 INFO (SyncWorker_8) [custom_components.miio_gateway.sensor] Setting up illumination sensor
2019-06-05 07:16:12 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:12 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":163,"method":"_otc.log","params":{"gw_info":{"z_ch":11,"w_ch":1}}}\x00'
2019-06-05 07:16:12 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:12 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":102,"method":"props","params":{"ota_state":"idle"}}\x00'
2019-06-05 07:16:15 INFO (SyncWorker_5) [custom_components.miio_gateway.light] Setting up light
2019-06-05 07:16:15 DEBUG (Thread-2) [custom_components.miio_gateway] Sending data:
2019-06-05 07:16:15 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id": 4, "method": "toggle_light", "params": ["off"]}'
2019-06-05 07:16:15 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:15 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"result":["ok"],"code":0,"id":4}\x00'
2019-06-05 07:16:17 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:17 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":164,"method":"props","model":"lumi.gateway.mieu01","params":{"from.light":",,,","light":"off"}}\x00'
2019-06-05 07:16:17 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:17 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":104,"method":"props","params":{"from.light":",,,","light":"off"}}\x00'
2019-06-05 07:16:22 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:22 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":165,"method":"_otc.log","params":{"gw_info":{"z_ch":11,"w_ch":1}}}\x00'
2019-06-05 07:16:22 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:16:22 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":105,"method":"props","params":{"ota_state":"idle"}}\x00'
2019-06-05 07:21:03 DEBUG (Thread-2) [custom_components.miio_gateway] Sending data:
2019-06-05 07:21:03 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"method": "internal.PING"}'
2019-06-05 07:21:03 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:21:03 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"method": "internal.PONG", "result": ["online"]}\x00'
2019-06-05 07:24:53 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:24:53 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":166,"method":"event.heartbeat","params":[{"w_SL":"","w_LQ":"","TIME":"946285","FRAM":"195973120"}]}'
2019-06-05 07:24:53 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:24:53 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":167,"method":"event.heartbeat","params":[{"w_SL":"","w_LQ":"","TIME":"946285","FRAM":"195973120"}]}'
2019-06-05 07:24:53 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:24:53 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":168,"method":"_sync.neighborDevInfo","params":{"did":[]}}\x00'
2019-06-05 07:26:03 DEBUG (Thread-2) [custom_components.miio_gateway] Sending data:
2019-06-05 07:26:03 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"method": "internal.PING"}'
2019-06-05 07:26:03 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:26:03 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"method": "internal.PONG", "result": ["online"]}\x00'
2019-06-05 07:31:04 DEBUG (Thread-2) [custom_components.miio_gateway] Sending data:
2019-06-05 07:31:04 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"method": "internal.PING"}'
2019-06-05 07:31:04 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-05 07:31:04 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"method": "internal.PONG", "result": ["online"]}\x00'
@darksider4all seems similar problem I've got on mine. The first time I've hacked the device, the ssh session gets disconnected every 20 seconds. I've changed nothing; the day after, after a reboot done via ssh, the problem disappear. Just be sure the WiFi connection is stable first of all. I dunno, open a ping and check whether it's not a wifi problem? But this would not answer why it's stable, in your case, having an ssh session opened.
Cheers, Simon
I've done it, apparently it was running the original binary miio_client file, and what I was doing till now, it was that I was running killall miio_client && temp/miio_client, leaving the ssh session as a logging process, solution was to backup the file and replace it with roth's client, anyways, my bad... P.S. Good job @cadavre can't wait for the next updates.
Right now I cannot use the hack on the gateway with the lack of sensor, so until you manage to add sensor states, or my zigbee stick get's here, unfortunately...
P.S.S. looking forward.
@xefil logs looks good, Gateway as media_player
is initialized fine and also setting its initial state.
To play siren try calling service:
Service: media_player.play_media
Entity: media_player.your_gw_player
Data:
{
"entity_id": "media_player.gw_player",
"media_content_type": "music",
"media_content_id": 2
}
Where media_content_id
is integer ID of siren (1, 2, 3...)
BTW good news, I've played some with my Gateway and I've managed to add service to start Zigbee discovery right from HA! It means adding new sensors will happen right inside HA.
I also registered one of my PIRs so now I have:
DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":4114,"sid":"lumi.abcd0002d3bf0a","model":"lumi.sensor_motion.v2","method":"event.motion","params":[]}\x00'
DEBUG (Thread-2) [custom_components.miio_gateway] Received event: lumi.sensor_motion.v2 lumi.abcd0002d3bf0a : event.motion
Now what I want to do is to add self-discovery on event from non-registered sensor (hard part as I don't get HASS and Python that well :p) and after that – map some basic sensors:
Hei @cadavre, Thanks for the job!
Even if I did not have time use the miio firmware myself (lack of time), I've been following the topic, and I want to use it.
Specially now that are close to get the sensors to work, I believe I also can buy you a beer! :) (just say how!)
Thanks @xifle and @darksider4all for helping with this.
@gohlas I'll chip in as well. @cadavre great news, and great job, just let us know where to send the beers!
Hello @cadavre ,
Ok, all works perfectly! Calling the service with your parameters does the job.
Is the volume a parameter I could pass to the media_player.play_media
service? Seems not.
Now I'll try some automations based on it :-)
Great news about the pairing, even if I've ordered the zigbee2mqtt hardware as well ;-)
Thanks!
Simon
I gave up self-discovery because it's too much effort for me. I decided to introduce manual config with "unrecognized sensor found" logging:
miio_gateway:
host: 192.168.1.41
port: 54321
sensors:
- sid: lumi.abcd0002d3bf0a
class: motion
And if you pair a sensor that you haven't listed – logs will show WARNING (so you'll see from (i) logs):
Unregistered sensor found: lumi.sensor_motion.v2 sid: lumi.abcd0002d3bf0a
This concludes in:
I need to map more sensors and button now. I'll be back. ;)
PS I already also ordered and launched zigbee2mqtt, but in the end I think I'll move back to pure-gateway solution.
Battery and signal, would be VERY interesting!
I'll choose as soon I'll have zigbee2mqtt as well. Meanwhile your making a big job with it.
;-)
OK folks, I've made it and already tested it in my home environment. :)
You can find latest code now always under:
https://github.com/cadavre/miio_gateway
Changelog:
If there will be a need I can also add water leak sensor, smoke sensor and Mi Smart Cube.
TODO:
If our sensor are already paired, do we have to pair them again in order to get sid for them?
@darksider4all no, you don't need to do anything. Pairing them with service is exactly the same as "official" pairing.
But remember that sensors enabled in Mi Home for alarm, doorbell or nightlight will still be linked and functional. So if you want to move all automations to HA – you need to unlink them.
Well @cadavre gotta hand it to ya, great job, send me a contribution link for a 6-pack of beer xD, you earned it.
@cadavre another question, regarding the button, can you suggest a way to add the different actions of the button in automations?
@darksider4all you're right, I missed that one. :)
Check updated README: https://github.com/cadavre/miio_gateway/blob/master/README.md#using-zigbee-button
PS If you'd like to contribute you can always find my PayPal on my profile. :)
Good morning guys!
Actually I'm not at home to test the latest version, but I'll do it soon!
I've some question as well @cadavre :-)
@xefil let me answer:
lumi
s. I'm quite sure that all Xiaomi/Aqara/Mijia sensors will work, but can't tell about other.miio_client
via SSH to turn on pairing via Mi Home app. :)Update:
I believe this concludes this integration as v.1.0. :)
@cadavre YEAH!
Ok, no time to wait, let me bring up my VPN and check it out ;-)
And next step, I'll order some other sensors, like temperature, or whatever!
Cheers, Simon
Ok, version updated.
I've launched a discovery / pairing call but the devices are not shown.
BTW the first time I've tested the miio original, the devices (motion and door sensors) are discovered from official app. In this moment the devices are in their box (I'm not at home).
It's normal they are not shown on a start_zigbee_join
or on startup?
2019-06-07 15:11:51 DEBUG (Thread-2) [custom_components.miio_gateway] Sending data:
2019-06-07 15:11:51 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id": 6, "method": "start_zigbee_join"}'
2019-06-07 15:11:51 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-07 15:11:51 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"result":["ok"],"code":0,"id":6}\x00'
2019-06-07 15:11:53 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-07 15:11:53 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":4,"method":"props","model":"lumi.gateway.mieu01","params":{"alarm_value":0.0,"alarm_volume":15,"gateway_lang":null,"gateway_volume":19,"light":"off","rgb":1677721856}}\x00'
2019-06-07 15:11:57 DEBUG (Thread-2) [custom_components.miio_gateway] Sending data:
2019-06-07 15:11:57 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"method": "internal.PING"}'
2019-06-07 15:11:57 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-07 15:11:57 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"method": "internal.PONG", "result": ["online"]}\x00'
2019-06-07 15:11:58 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-07 15:11:58 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":5,"method":"_otc.log","params":{"gw_info":{"z_ch":11,"w_ch":1}}}\x00'
2019-06-07 15:11:58 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-07 15:11:58 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":101,"method":"props","params":{"ota_state":"idle"}}\x00'
2019-06-07 15:14:38 DEBUG (Thread-2) [custom_components.miio_gateway] Received data:
2019-06-07 15:14:38 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":6,"method":"props","model":"lumi.gateway.mieu01","params":{"from.illumination":"10,,840148759,0.trg=0,,","illumination":466}}\x00'
It's not discovery – it's devices pairing – if they were not previously paired to gateway.
If you've launched pairing, gateway just told "Waiting for child devices to connect". This is what you do with new sensors that are not known to gateway – i.e. after you bough new ones. ;)
After launching start_zigbee_join
you shall press reset for 5sec in child devices.
You don't have to do it, if you already have paired Zigbees with your gateway. What you need to do – is to move in front of motion sensor, open/close your door or press button. :)
OOOuuukey! Let me reach home later and make some tests!
so it means there is no heartbeat check from sensors to see alive, battery and/or status if they are not triggered? (by motion, temperature, press, or whatever).
I have seen a little problem with initial state on HA, when I restart it the initial state of the sensors is reset.
@xefil No, I didn't found any method
to get a list of connected child devices to gateway. If we're talking about heartbeats (or "keep alives") – it's 100% up to sensor when it's sent.
@darksider4all Yup, states are not saved – by purpose. It's better to have state once sensor actually sends something than lie about the state, because it might have changed since "last seen". Most automations are made with state to: "open"
etc. – for this we don't need to save the state. It's exactly the same as zigbee2mqtt – by default it have no state retain
ing.
ooh, good point, but at least retain the gateway state, like on/off and color?
@darksider4all I think @cadavre will ban us soon ;-)
I'm waiting for paycheck, really considering of contribute ;)
oh yep.... btw Poland is not soooo far from here, but to offer a beer I think I'll choose the paypal method too ;-D
Hi, this is more like a hardware question ...
Could you please describe the size of the screwdriver.
I see it is H Type screwdriver, but I whould line to know the exacly size before to by on in Amazon.
Hi @cadavre good morning!
I’m testing happy your last release and till now it works flawless!
Btw I’ve some questions:-)
Thanks for your time!
Hi @JBelinchon I confirm you it’s an H screw. I send you later a picture!
Cheers, Simon
Hi here! I was busy lately but will get back of upgrades soon!
@darksider4all I'm thinking about changing entity type to RestoreEntity which will allow to store the states between HA restarts, but I think I'll make it optional.
@xefil hah, let me know when you'll be around, we can get some beer and talk home automation. ;)
Quick answers:
I've digged a little into gateway and found something that wasn't there before. o.O
Looks like this could be a good source for what Gateway can support:
[
{
"models":["lumi.sensor_wleak.aq1"],
"properties":[],
"events":["battery_end_of_life", "leak", "no_leak"]
},
{
"models":["lumi.sensor_motion.aq2"],
"properties":["illumination"],
"events":["battery_end_of_life"]
},
{
"models":["lumi.sensor_magnet.aq2", "lumi.sensor_magnet.v2"],
"properties":[],
"events":["open", "close", "battery_end_of_life"]
},
{
"models":["lumi.weather.v1", "lumi.sensor_ht.v1"],
"properties":["temperature", "humidity", "pressure"],
"events":["battery_end_of_life"]
},
{
"models":["lumi.vibration.aq1"],
"properties":[],
"events":["tilt", "vibrate", "free_fall", "battery_end_of_life"]
},
{
"models":["lumi.remote.b1acn01", "lumi.sensor_switch.v2"],
"properties":[],
"events":["click", "double_click", "long_click_press", "battery_end_of_life"]
},
{
"models":["lumi.sensor_switch.aq2"],
"properties":[],
"events":["click", "double_click", "battery_end_of_life"]
},
{
"models":["lumi.sensor_switch.aq3"],
"properties":[],
"events":["click", "double_click", "long_click_press", "shake", "battery_end_of_life"]
},
{
"models":["lumi.remote.b286acn01"],
"properties":[],
"events":["click_ch0", "double_click_ch0", "click_ch1", "double_click_ch1", "both_click",
"long_click_ch0", "long_click_ch1", "battery_end_of_life"]
},
{
"models":["lumi.remote.b186acn01"],
"properties":[],
"events":["click_ch0", "double_click_ch0", "long_click_ch0", "battery_end_of_life"]
},
{
"models":["lumi.plug.mitw01"],
"properties":["channel_0"],
"events":["plug_detection"]
},
{
"models":["lumi.sensor_86sw2.v1"],
"properties":[],
"events":["click_ch0", "double_click_ch0", "click_ch1", "double_click_ch1", "both_click", "battery_end_of_life"]
},
{
"models":["lumi.sensor_86sw1.v1"],
"properties":[],
"events":["click_ch0", "double_click_ch0", "battery_end_of_life"]
},
{
"models":["lumi.ctrl_neutral2.v1"],
"properties":["neutral_0", "neutral_1"],
"events":["click_ch0", "click_ch1", "both_click"]
},
{
"models":["lumi.ctrl_neutral1.v1"],
"properties":["neutral_0"],
"events":["click_ch0"]
},
{
"models":["lumi.ctrl_86plug.v1", "lumi.ctrl_86plug.aq1"],
"properties":["channel_0"],
"events":[]
},
{
"models":["lumi.ctrl_ln1.v1", "lumi.ctrl_ln1.aq1"],
"properties":["channel_0"],
"events":["click_ch0"]
},
{
"models":["lumi.ctrl_ln2.v1", "lumi.ctrl_ln2.aq1", "lumi.relay.c2acn01"],
"properties":["channel_0", "channel_1"],
"events":["click_ch0", "click_ch1", "both_click"]
},
{
"models":["lumi.curtain.v1"],
"properties":["curtain_level"],
"events":[]
},
{
"models":["lumi.lock.aq1", "lumi.lock.acn02"],
"properties":["psw_wrong", "alarm", "fing_wrong", "card_wrong", "reverse_locked"],
"events":["fing_verified", "psw_verified", "card_verified", "key_verified"]
},
{
"models":["lumi.sensor_cube.aqgl01", "lumi.sensor_cube.v1"],
"properties":[],
"events":["flip90", "flip180", "move", "tap_twice", "shake_air", "rotate"]
},
{
"models":["lumi.light.aqcn02", "lumi.dimmer.rgbegl01"],
"properties":["power_status"],
"events":[]
},
{
"models":["lumi.plug.v1"],
"properties":["neutral_0"],
"events":[]
},
{
"models":["lumi.sensor_natgas.v1", "lumi.sensor_smoke.v1"],
"properties":[],
"events":["alarm", "self_check", "battery_end_of_life"]
},
{
"models":["lumi.sensor_occupy.v1"],
"properties":["status", "no_in"],
"events":[]
},
{
"models":["lumi.lock.v1"],
"properties":["reminder"],
"events":[]
},
{
"models":["lumi.sensor_motion.v2"],
"properties":[],
"events":["motion", "battery_end_of_life"]
},
{
"models":["lumi.gateway.mitw01", "lumi.gateway.mihk01", "lumi.gateway.mieu01", "lumi.gateway.v3",
"lumi.acpartner.v1", "lumi.acpartner.v2", "lumi.acpartner.v3", "lumi.camera.aq1"],
"properties":[],
"events":["arming_magnet_open", "arming_motion_motion", "arming_switch_click", "arming_cube_alert",
"arming_vibration_vibrate", "arming_camera_md"]
}
]
This is actually great because it gives us all events and props on the plate. :)
Hello @cadavre! Wow, interesting!! Seems are devices are ready to be added... and battery_end_of_life interesting too!
About your answers, I've found how to graph an attribute, that's ok. BTW how can i understand, in example, starting from a received message like this:
2019-06-12 15:39:04 DEBUG (Thread-2) [custom_components.miio_gateway] b'{"id":2053,"method":"_otc.log","model":"lumi.sensor_motion.v2","params":{"subdev_zigbee":{"CCA":1,"chip_temperature":86,"cur_state":3,"lqi":142,"power_tx":10,"pre_state":1,"resend_sucess_cnt":0.0,"reset_cnt":4,"send_all_cnt":1,"send_fail_cnt":0.0,"voltage":3065}},"sid":"lumi.158d000316c6d5"}'
2019-06-12 15:39:04 DEBUG (Thread-2) [custom_components.miio_gateway] Received event: lumi.sensor_motion.v2 lumi.158d000316c6d5 - _otc.log
2019-06-12 15:39:04 INFO (MainThread) [custom_components.miio_gateway.binary_sensor] Vol:3065 lqi:142
which sensor in fact is it on homeassistant? I have binary_sensor.motion_sensor
and binary_sensor.motion_sensor_2
.
@JBelinchon the screw is an SP6, so you need an SP6 screwdriver:
Cheers!
Simon
@xefil Thanks a lot !!
@cadavre is it possible to use the same hack (enable ssh, replacing lib, etc) for lumi.camera.aq1 ?
btw, @cadavre, I have a lot of different aqara devices (sensors) and can help with testing for integration of new sensors.
Did someone has the issue with hub/sensors after restart Mi Control Hub? I get a huge delay (±5 mins or even more) after the restart before I can control hub or fetch info/state from sensors in HA.
Anyway, thanks a lot @cadavre! Amazing job!
@IamMik I have this issue only on the light sensor from the gateway itself, otherwise... nothing to report on my end.
@IamMikl it is generic method to obtain access to linux-like systems. It might be, but can't tell without actually doing it.
@IamMikl in a matter of delay – remember that replacing of miio_client
from original (which is required due to WiFi connection) to modified is made with a delay within your rc.local
:
sleep 20
killall miio_client && /home/root/miio_client
Depends on your sleep
value – it won't be available for given time before starting client that can be handled with HA.
Mine in 20s – it's enough to connect WiFi. I can remember @roth-m suggested to give higher value so maybe it's the case?
@IamMikl sure we can implement and test more sensors. For myself I already ordered temp/humidity and vibration sensors so it's "pending" to be implemented. :)
@xefil
I have binary_sensor.motion_sensor and binary_sensor.motion_sensor_2.
You need to figure it out. :D But I think Settings -> Entity registry
can help you with that.
@IamMikl @cadavre Yes, I did put a 10 minutes delay with the sleep command.
Why 10 minutes? Because I thought users might need some time to add a new device or to complete a firmware update (never seen one).
The WIFI setup (init and then starting it) is indeed performed by "miio_client_helper_nomqtt.sh" (/lumi/app/miio). So launching the WIFI could be made automatically (without the original miio_client).
But replacing the mechanism (turning the gateway into an hotspot) used to setup the password from the App (Android/IPhone) might take some time...
Btw, it looks like there were meant to be some tools to capture WIFI traffic on this gateway (see rc.local-mi).... looks strange to me if not suspicious! Just my 2 cents (and I won't think any further ;) )
@roth-m I can't find any sniffing in rc.local.mi
. Maybe it's just randomly put in several devices? :o
@cadavre hummm.... You should have it in /lumi ..... /lumi/rc.local-mi
Let me know! (Such that I can know if I'm "under surveillance" lol)
@roth-m correct, in /lumi/
there's one, but it doesn't look like a path to a sniffer. :P In fact I don't have a binary at all.
hi there,
@roth-m @cadavre I've seen that's a script, it calls some strange scripts, but actually they are not present, i.e. /home/root/wifi_capture
is not present. The file is neither present on all the filesystem.
My 2 cents for now ;-)
Cheers, Simon
Hi @cadavre ,
I'm testing if the light is capable of effects but it doesn't work:
via web,
Service: light.turn_on
Entity: light.sf9csgzwtx_gw_light
{
"entity_id": "light.sf9csgzwtx_gw_light",
"effect": "fire"
}
Does it mean that it's not supported or it's me I'm doing something wrong?
Thanks,
Simon
hi there,
@roth-m @cadavre I've seen that's a script, it calls some strange scripts, but actually they are not present, i.e./home/root/wifi_capture
is not present. The file is neither present on all the filesystem.
My 2 cents for now ;-)
Cheers, Simon
Yes, it is not present.
However this could be installed during an OTA update ;)
What caught me is it they thought about capturing the Wifi traffic...
Well, a chinese device that has tested some stuff about checking what the devices are doing around the world is something I would not surprised in. Then we fear about on what Alexa is listening or not. Meanwhile via Lumi/Aqara/Mijia they could have a lot of environment sensor data, merged with nice maps of the houses made by the Vacuum. :'(
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
@cadavre thank you so much for all your time in sharing your knowledge.
Just 1 question more please, do we still need to solder the hub? Or can we use your client without?
"PS I already also ordered and launched zigbee2mqtt, but in the end I think I'll move back to pure-gateway solution."
Unfortunately still need to solder RX/TX to access terminal. :/
@IamMikl in a matter of delay – remember that replacing of
miio_client
from original (which is required due to WiFi connection) to modified is made with a delay within yourrc.local
:sleep 20 killall miio_client && /home/root/miio_client
Depends on your
sleep
value – it won't be available for given time before starting client that can be handled with HA.Mine in 20s – it's enough to connect WiFi. I can remember @roth-m suggested to give higher value so maybe it's the case?
Hi @cadavre and @roth-m
Thanks for your support!
After some test, I was trying to find the right place to insert the the lines above... I found a working solution: I decided to paste those lines into start_ot.sh (/lumi/app/miio), so now my file looks like this:
#!/bin/sh
cd /lumi/app/miio
#./wifi_start.lumi_gw.sh &
/lumi/app/miio/wifi_start.sh &
./miio_client -l 0 -d /lumi/conf &
./miio_client_helper_nomqtt.sh /lumi/conf &
sleep 20
killall miio_client && /home/root/miio_client
What do you think? How did you solve this?
IMO, the best way would be to have no timeout.
Instead of launching directly killall miio_client && miio_client there should be a bash script with a loop polling for wifi connection to be established (with iwconfig).
Just getting ready to solder but came across this...
which has confused me regarding...
could anyone clarify what I should be soldering where?
As always any and all help is greatly appreciated.
EDIT: I have the lumi.gateway.mieu01 EU version
Gateway - UART
--------------
GND - GND
RX - TX
TX - RX
All described here:
https://community.openhab.org/t/solved-openhab2-xiaomi-mi-gateway-does-not-respond/52963/188
Oh, and exemplary config.yml:
miio_gateway: host: 192.168.1.1 port: 54321 alarm_control_panel: - platform: manual # manual alarm name: Alarm pending_time: 0 delay_time: 0 disarmed: trigger_time: 0 armed_night: trigger_time: 10 armed_home: trigger_time: 10 armed_away: delay_time: 2 trigger_time: 10 coupled_alarms: alarms: entities: - alarm_control_panel.alarm - alarm_control_panel.gw_alarm # renamed gateway entity to this via Entity registry in Settings automations: - alias: 'Alarm: triggers while away' trigger: - platform: state entity_id: binary_sensor.motion_bikes to: 'on' - platform: state entity_id: binary_sensor.motion_corridor to: 'on' - platform: state entity_id: binary_sensor.garage_gate_contact to: 'on' - platform: state entity_id: binary_sensor.garage_door_contact to: 'on' condition: - condition: state entity_id: alarm_control_panel.alarm state: armed_away action: - service: alarm_control_panel.alarm_trigger entity_id: alarm_control_panel.alarm # trigger only on single alarm entity
And in Lovelace also only for single alarm entity:
entity: alarm_control_panel.alarm name: Alarm states: - arm_home - arm_away - arm_night type: alarm-panel
Thanks to "coupling" alarms – gateway alarm will take same states as manual alarm.
@cadavre Thanks for the script it's very helpful!
There's just one thing:
How can you solve this?
Thanks!
@cadavre you are a scholar and a gentleman, beer money sent.
Just to be more of a pain, I'm stuck at the boot loader part...
Connected with putty everything is all good can get to input cmd, can exit_factory etc.. help... but we cant figure out how to change the password? doesn't accept any commands like psm etc...
EDIT: Got there, missed the hit any key...
Error?
)
[ 1.899842] UBI error: cannot open mtd 3, error -19dhd_module_init in
[ 1.908244] input: regulators:gpio-keys as /devices/platform/regulators/regulators:gpio-keys/input/input1
[ 1.918668] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 01:44:34 UTC (6274)
[ 1.949038] gpio_dvfs: disabling
[ 1.952317] vref-3v3: disabling
[ 1.955586] can-3v3: disabling
[ 1.959013] ALSA device list:
[ 1.962004] #0: wm8524-audio
[ 1.965790] UBIFS error (pid: 1): cannot open "ubi0:rootfs", error -19VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19
[ 1.979054] Please append a correct "root=" boot option; here are the available partitions:
[ 1.987514] 0100 65536 ram0 (driver?)
[ 1.992175] 0101 65536 ram1 (driver?)
[ 1.996915] 0102 65536 ram2 (driver?)
[ 2.001570] 0103 65536 ram3 (driver?)
[ 2.006267] 0104 65536 ram4 (driver?)
[ 2.010920] 0105 65536 ram5 (driver?)
[ 2.015609] 0106 65536 ram6 (driver?)
[ 2.020263] 0107 65536 ram7 (driver?)
[ 2.024952] 0108 65536 ram8 (driver?)
[ 2.029604] 0109 65536 ram9 (driver?)
[ 2.034293] 010a 65536 ram10 (driver?)
[ 2.039032] 010b 65536 ram11 (driver?)
[ 2.043875] 010c 65536 ram12 (driver?)
[ 2.048619] 010d 65536 ram13 (driver?)
[ 2.053447] 010e 65536 ram14 (driver?)
[ 2.058195] 010f 65536 ram15 (driver?)
[ 2.062985] 1f00 262144 mtdblock0 (driver?)
[ 2.068077] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 2.076362] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 78.302374] random: nonblocking pool is initialized
@Frank802 try adding this to you config.yml and check Dev tools Logs afterwards:
logger:
logs:
custom_components.coupled_alarms: debug
@Morphus1 thank you! Have you went through "To reset root password" part? Have you accomplished to change the password or problem above showed-up on boot? It looks like you've made a bad copy-paste from bootargs=...
.
You should end up with:
setenv bootargs '... single rw init=/bin/bash'
Be careful on quotes, whitespaces etc.!
EDIT: Just checked mine so you can compare:
console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs cma=96M mtdparts=gpmi-nand:3m(boot),7m(kernel),1m(dtb),-(rootfs)
Hmm... ubi.mtd=3
and root=ubi0:rootfs
looks the same.
setenv
command should look like this in my case:
setenv bootargs 'console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs cma=96M mtdparts=gpmi-nand:3m(boot),7m(kernel),1m(dtb),-(rootfs) single rw init=/bin/bash'
@cadavre I have resolved the issue. I forgot to install the coupled_alarms component, because it's not present or mentioned in your github repo. However now I got the coupled alarms, but I am not able to make the automations work properly. For example I've specified that the armed_night is triggered only with door and window sensors, but it's triggered also with motion sensors... Any ideas ?
@Frank802 in your gateway (Mi Home app) – you must not have your original alarm triggered by any sensors. Disable modified miio_client and check it in Mi Home app.
@cadavre all good, I just copied to much...
I'm in and it's all working as intended. Thanks again, I really appreciate all your sharing! Same goes for everyone here SUPER helpfull!
EDIT: IM HAVING SO MUCH FUN WITH THIS!
Guys, how do I get the key for this device? I'm running xiaomi home v5.6.6 patched by vevs, but I can't find the password/key anywhere. HA won't connect using ip and mac only...
@Frank802 in your gateway (Mi Home app) – you must not have your original alarm triggered by any sensors. Disable modified miio_client and check it in Mi Home app.
Thanks! Everything is working fine!
Hi all!
I've got some trouble with alarm_control_panel after updating to version 0.103.0.
The log says:
Error while setting up platform miio_gateway
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/miio_gateway/alarm_control_panel.py", line 17, in setup_platform
devices.append(XiaomiGatewayAlarm(gateway))
TypeError: Can't instantiate abstract class XiaomiGatewayAlarm with abstract methods supported_features
I have found this:
https://github.com/home-assistant/home-assistant/issues/29852
@cadavre I've modified the alarm_control_panel.py:
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY, SUPPORT_ALARM_ARM_HOME,
SUPPORT_ALARM_ARM_NIGHT, SUPPORT_ALARM_TRIGGER,
)
Then by adding the following property in 'XiaomiGatewayAlarm' class:
@property
def supported_features(self) -> int:
"""Return the list of supported features."""
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT | SUPPORT_ALARM_TRIGGER
Now it's works just fine.
I will ask for a pull request to your repo!
Thanks ;)
Same problem here, also interested on this.
Hopefully we can have a solution for this.
lumi-gateway-lmuk01_miap75A3
Hello @cadavre @roth-m , I recently received the Xiaomi Smart Home EU gateway and want to use it with Home Assistant. However, I do not currently have a UART converter to use it for root access.
I have however a NodeMCU ESP8266, is it possible to somehow use that for this?
I also found this on the miioclient-mqtt repo:
https://github.com/roth-m/miioclient-mqtt/tree/master/firmware-mod
But I see it is untested. If I try to do this without soldering, is there a chance that I brick the gateway?Or if something goes wrong I can just revert to another firmware?
EDIT: I managed to use the NodeMCU and USB to Serial adapter to enable SSH and everything almost works, getting the alarm control panel above but will manually modify the code to fix it.
I have a question though about the motions sensors: after what amount of time do they go back to the off
state?Can't seem to get automations with from off
to on
working properly, only the first time works after a restart.
EDIT2: So far it seems that the sensors are working as expected :)
However I have a question about the gateway, is it possible to disable the sounds it makes when arming/disarming the alarm or at least make them quieter?They are too loud for the apartment where I live in. I have used the plugging to sync a manual alarm to the gateway alarm, but if the sounds of the gateway can't be modified I am guessing I will only be using the manual alarm.
EDIT3: The restore
parameter seems to not work, I set it to true
but after a restart my door sensors are all open. Really annoying since I have to manually go and open/close the door/window again...
hello everyone,@cadavre @roth-m, I have followed the various procedures, but I cannot start the mqtt client.
I copied the file into a folder
/hack/miio_client
and started in rc.local . Unfortunately, I get a "permission denied" error message.
I attach the log and configuration. thanks to everyone who can help me out.
log.txt
chmod ug+x /hack/miio_client
U-Boot 2016.03 (Nov 07 2017 - 20:11:55 +0800)
CPU: Freescale i.MX6ULL rev1.1 528 MHz (running at 396 MHz)
CPU: Commercial temperature grade (0C to 95C) at 44C
Reset cause: POR
Board: Lumi international Gateway
I2C: ready
DRAM: 256 MiB
NAND: 256 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
* Warning - bad CRC, using default environment
Display: TFT43AB (480x272)
Video: LCDIF@0x21c8000 is fused, disable it
In: serial
Out: serial
Err: serial
Net: Ethernet@0x20b4000 is fused, disable it
Board Net Initialization Failed
No ethernet found.
Normal Boot
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x300000, size 0x700000
7340032 bytes read: OK
NAND read: device 0 offset 0xa00000, size 0x100000
1048576 bytes read: OK
Kernel image @ 0x80800000 [ 0x000000 - 0x617290 ]
Booting using the fdt blob at 0x83000000
Using Device Tree in place at 83000000, end 8300c0e1
Modify /soc/aips-bus@02000000/tsc@02040000:status disabled
Modify /soc/aips-bus@02000000/can@02090000:status disabled
Modify /soc/aips-bus@02000000/can@02094000:status disabled
Modify /soc/aips-bus@02100000/lcdif@021c8000:status disabled
Modify /soc/aips-bus@02100000/pxp@021cc000:status disabled
Modify /soc/aips-bus@02100000/csi@021c4000:status disabled
Modify /soc/aips-bus@02000000/ethernet@020b4000:status disabled
Modify /soc/aips-bus@02100000/usb@02184200:status disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/sai@0202c000:status disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/sai@02030000:status disabled
Modify /soc/aips-bus@02100000/serial@021f4000:status disabled
Modify /soc/aips-bus@02100000/serial@021fc000:status disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/serial@02018000:status
disabled
Modify /soc/aips-bus@02000000/pwm@020f0000:status disabled
Modify /soc/aips-bus@02000000/pwm@020f4000:status disabled
Modify /soc/aips-bus@02000000/pwm@020f8000:status disabled
Modify /soc/aips-bus@02000000/pwm@020fc000:status disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/ecspi@02010000:status
disabled
Modify /soc/aips-bus@02000000/spba-bus@02000000/ecspi@02014000:status
disabled
Modify /soc/aips-bus@02100000/i2c@021a8000:status disabled
Modify /soc/aips-bus@02100000/i2c@021f8000:status disabled
Modify /soc/aips-bus@02000000/gpt@020e8000:status disabled
Modify /soc/aips-bus@02000000/epit@020d4000:status disabled
ft_system_setup for mx6
No PMIC found!
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.1.15+gb63f3f5 (chenlong@gitlab) (gcc version
5.3.0 (GCC) ) #37 SMP PREEMPT Tue Jun 19 15:28:38 CST 2018
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7),
cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing
instruction cache
[ 0.000000] Machine model: Freescale i.MX6 ULL 14x14 EVK Board
[ 0.000000] Reserved memory: failed to allocate memory for node
'linux,cma'
[ 0.000000] cma: Reserved 96 MiB at 0x8a000000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] PERCPU: Embedded 12 pages/cpu @89da3000 s16908 r8192 d24052
u49152
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 65024
[ 0.000000] Kernel command line: console=ttymxc0,115200 ubi.mtd=3
root=ubi0:rootfs rootfstype=ubifs cma=96M
mtdparts=gpmi-nand:3m(boot),7m(kernel),1m(dtb),-(rootfs)
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072
bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Memory: 148920K/262144K available (8035K kernel code, 423K
rwdata, 2812K rodata, 540K init, 426K bss, 14920K reserved, 98304K
cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0x90800000 - 0xff000000 (1768 MB)
[ 0.000000] lowmem : 0x80000000 - 0x90000000 ( 256 MB)
[ 0.000000] pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
[ 0.000000] modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
[ 0.000000] .text : 0x80008000 - 0x80aa01f8 (10849 kB)
[ 0.000000] .init : 0x80aa1000 - 0x80b28000 ( 540 kB)
[ 0.000000] .data : 0x80b28000 - 0x80b91fa0 ( 424 kB)
[ 0.000000] .bss : 0x80b94000 - 0x80bfeb5c ( 427 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Additional per-CPU info printed with stalls.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] mxc_clocksource_init 24000000
[ 0.000000] Switching to timer-based delay loop, resolution 41ns
[ 0.000015] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every
89478484971ns
[ 0.000056] clocksource mxc_timer1: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 79635851949 ns
[ 0.002569] Console: colour dummy device 80x30
[ 0.002609] Calibrating delay loop (skipped), value calculated using
timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.002643] pid_max: default: 32768 minimum: 301
[ 0.002868] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.002901] Mountpoint-cache hash table entries: 1024 (order: 0, 4096
bytes)
[ 0.004258] CPU: Testing write buffer coherency: ok
[ 0.004752] /cpus/cpu@0 missing clock-frequency property
[ 0.004795] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.004905] Setting up static identity map for 0x80008280 - 0x800082d8
[ 0.041168] Brought up 1 CPUs
[ 0.041206] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.041226] CPU: All CPU(s) started in SVC mode.
[ 0.042325] devtmpfs: initialized
[ 0.064012] VFP support v0.3: implementor 41 architecture 2 part 30
variant 7 rev 5
[ 0.064900] clocksource jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.072769] pinctrl core: initialized pinctrl subsystem
[ 0.075448] NET: Registered protocol family 16
[ 0.093448] DMA: preallocated 256 KiB pool for atomic coherent
allocations
[ 0.120886] cpuidle: using governor ladder
[ 0.150951] cpuidle: using governor menu
[ 0.193783] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4
watchpoint registers.
[ 0.193820] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.197017] imx6ul-pinctrl 20e0000.iomuxc: Invalid fsl,pins property in
node /soc/aips-bus@02000000/iomuxc@020e0000/imx6ul-evk/hoggrp-1
[ 0.197722] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[ 0.198410] imx6ul-pinctrl 2290000.iomuxc-snvs: initialized IMX pinctrl
driver
[ 0.258354] mxs-dma 1804000.dma-apbh: initialized
[ 0.265020] SCSI subsystem initialized
[ 0.266435] usbcore: registered new interface driver usbfs
[ 0.266629] usbcore: registered new interface driver hub
[ 0.266854] usbcore: registered new device driver usb
[ 0.269365] i2c i2c-0: IMX I2C adapter registered
[ 0.269412] i2c i2c-0: can't use DMA
[ 0.270975] i2c i2c-1: IMX I2C adapter registered
[ 0.271016] i2c i2c-1: can't use DMA
[ 0.271320] Linux video capture interface: v2.00
[ 0.271553] pps_core: LinuxPPS API ver. 1 registered
[ 0.271576] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo
Giometti giometti@linux.it
[ 0.271853] PTP clock support registered
[ 0.274583] MIPI CSI2 driver module loaded
[ 0.275281] Advanced Linux Sound Architecture Driver Initialized.
[ 0.277436] Bluetooth: Core ver 2.20
[ 0.277563] NET: Registered protocol family 31
[ 0.277585] Bluetooth: HCI device and connection manager initialized
[ 0.277625] Bluetooth: HCI socket layer initialized
[ 0.277658] Bluetooth: L2CAP socket layer initialized
[ 0.277741] Bluetooth: SCO socket layer initialized
[ 0.279867] Switched to clocksource mxc_timer1
[ 0.306670] NET: Registered protocol family 2
[ 0.308320] TCP established hash table entries: 2048 (order: 1, 8192
bytes)
[ 0.308422] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.308515] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.308651] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.308717] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.309153] NET: Registered protocol family 1
[ 0.312563] imx rpmsg driver is registered.
[ 0.315248] Bus freq driver module loaded
[ 0.317567] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.335695] VFS: Disk quotas dquot_6.6.0
[ 0.336165] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096
bytes)
[ 0.340467] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.342241] fuse init (API version 7.23)
[ 0.353473] io scheduler noop registered
[ 0.353522] io scheduler deadline registered
[ 0.354054] io scheduler cfq registered (default)
[ 0.355069] imx-weim 21b8000.weim: Driver registered.
[ 0.359603] lumi_r supply power not found, using dummy regulator
[ 0.361789] lumi_b supply power not found, using dummy regulator
[ 0.363547] lumi_g supply power not found, using dummy regulator
[ 0.365833] MIPI DSI driver module loaded
[ 0.366279] MIPI DSI driver module loaded
[ 0.372085] imx-sdma 20ec000.sdma: no event needs to be remapped
[ 0.372299] imx-sdma 20ec000.sdma: loaded firmware 3.3
[ 0.380287] imx-sdma 20ec000.sdma: initialized
[ 0.382368] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 19,
base_baud = 5000000) is a IMX
[ 1.031638] console [ttymxc0] enabled
[ 1.037147] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 217,
base_baud = 5000000) is a IMX
[ 1.083099] imx-rng 2284000.rngb: iMX RNG Registered.
[ 1.088816] imx sema4 driver is registered.
[ 1.093309] [drm] Initialized drm 1.1.0 20060810
[ 1.099265] [drm] Initialized vivante 1.0.0 20120216 on minor 0
[ 1.132039] brd: module loaded
[ 1.148965] loop: module loaded
[ 1.152943] pn54x_dev_init-->lumi
[ 1.156470] pn54x_probe
[ 1.158994] pn544 1-0028: FIRM GPIO
[ 1.165993] pn544 1-0028: CLKREQ GPIO
node
[ 1.173069] 1-0028 supply nxp,pn54x-pvdd not found, using dummy regulator
[ 1.180088] 1-0028 supply nxp,pn54x-vbat not found, using dummy regulator
[ 1.187042] 1-0028 supply nxp,pn54x-pmuvcc not found, using dummy
regulator
[ 1.194202] 1-0028 supply nxp,pn54x-sevdd not found, using dummy
regulator
[ 1.201256] pn54x_probe: request irq_gpio 7
[ 1.205480] pn54x_probe: request ven_gpio 3
[ 1.210167] pn54x_probe : requesting IRQ 35
[ 1.229640] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
[ 1.236135] nand: Micron MT29F2G08ABAEAWP
[ 1.240234] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048,
OOB size: 64
[ 1.248622] gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO
mode 5
[ 1.256100] Bad block table found at page 131008, version 0x01
[ 1.262246] Bad block table found at page 130944, version 0x01
[ 1.268477] 4 cmdlinepart partitions found on MTD device gpmi-nand
[ 1.274762] Creating 4 MTD partitions on "gpmi-nand":
[ 1.279908] 0x000000000000-0x000000300000 : "boot"
[ 1.287335] 0x000000300000-0x000000a00000 : "kernel"
[ 1.294865] 0x000000a00000-0x000000b00000 : "dtb"
[ 1.302104] 0x000000b00000-0x000010000000 : "rootfs"
[ 1.310517] gpmi-nand 1806000.gpmi-nand: driver registered.
[ 1.322509] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.329114] ehci-mxc: Freescale On-Chip EHCI Host driver
[ 1.335031] usbcore: registered new interface driver usb-storage
[ 1.341336] usbcore: registered new interface driver usb_ehset_test
[ 1.350250] 2184800.usbmisc supply vbus-wakeup not found, using dummy
regulator
[ 1.359302] 2184000.usb supply vbus not found, using dummy regulator
[ 1.373922] mousedev: PS/2 mouse device common for all mice
[ 1.381656] input: 20cc000.snvs:snvs-powerkey as
/devices/platform/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
[ 1.399417] snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered
20cc000.snvs:snvs-r as rtc0
[ 1.408631] i2c /dev entries driver
[ 1.415052] IR NEC protocol handler initialized
[ 1.419649] IR RC5(x/sz) protocol handler initialized
[ 1.424844] IR RC6 protocol handler initialized
[ 1.429426] IR JVC protocol handler initialized
[ 1.434049] IR Sony protocol handler initialized
[ 1.438714] IR SANYO protocol handler initialized
[ 1.443512] IR Sharp protocol handler initialized
[ 1.448265] IR MCE Keyboard/mouse protocol handler initialized
[ 1.454186] IR XMP protocol handler initialized
[ 1.465016] imx2-wdt 20bc000.wdog: use WDOG_B to reboot.
[ 1.471407] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
[ 1.478666] sdhci: Secure Digital Host Controller Interface driver
[ 1.485003] sdhci: Copyright(c) Pierre Ossman
[ 1.489419] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.496887] /soc/aips-bus@02100000/usdhc@02190000: voltage-ranges
unspecified
[ 1.504179] sdhci-esdhc-imx 2190000.usdhc: could not get ultra high
speed state, work on normal mode
[ 1.514779] sdhci-esdhc-imx 2190000.usdhc: No vmmc regulator found
[ 1.521076] sdhci-esdhc-imx 2190000.usdhc: No vqmmc regulator found
[ 1.570112] mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc]
using ADMA
[ 1.604275] usbcore: registered new interface driver usbhid
[ 1.610238] usbhid: USB HID core driver
[ 1.614918] vf610-adc 2198000.adc: Debug vf610_adc_proble()
[ 1.621228] 2198000.adc supply vref not found, using dummy regulator
[ 1.627904] vf610-adc 2198000.adc: Debug[0] channels[2]
[ 1.643547] wm8524_i2c_probe:
[ 1.650085] mmc0: new high speed SDIO card at address 0001
[ 1.656533] wm8960 1-001a: Failed to issue reset
[ 1.661588] wm8960: probe of 1-001a failed with error -5
[ 1.670287] fsl-asrc 2034000.asrc: driver registered
[ 1.683132] imx_wm8524_probe:
[ 1.686824] wm8524_probe:
[ 1.691057] imx-wm8524 sound2: wm8524-hifi <-> 2028000.sai mapping ok
[ 1.698942] imx-wm8524 sound2: snd-soc-dummy-dai <-> 2034000.asrc
mapping ok
[ 1.706546] imx-wm8524 sound2: wm8524-hifi <-> 2028000.sai mapping ok
[ 1.720290] NET: Registered protocol family 26
[ 1.726922] NET: Registered protocol family 10
[ 1.733720] sit: IPv6 over IPv4 tunneling driver
[ 1.740422] NET: Registered protocol family 17
[ 1.745247] Bluetooth: RFCOMM TTY layer initialized
[ 1.750400] Bluetooth: RFCOMM socket layer initialized
[ 1.755621] Bluetooth: RFCOMM ver 1.11
[ 1.759436] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 1.764842] Bluetooth: BNEP filters: protocol multicast
[ 1.770169] Bluetooth: BNEP socket layer initialized
[ 1.775183] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 1.781196] Bluetooth: HIDP socket layer initialized
[ 1.786210] 8021q: 802.1Q VLAN Support v1.8
[ 1.790525] lib80211: common routines for IEEE802.11 drivers
[ 1.796435] Key type dns_resolver registered
[ 1.802683] cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found
(-19)
[ 1.837462] ubi0: attaching mtd3
[ 2.166774] random: nonblocking pool is initialized
[ 2.523811] ubi0: scanning is finished
[ 2.542283] ubi0: attached mtd3 (name "rootfs", size 245 MiB)
[ 2.548088] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976
bytes
[ 2.555117] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 2.561987] ubi0: VID header offset: 2048 (aligned 2048), data offset:
4096
[ 2.568981] ubi0: good PEBs: 1956, bad PEBs: 4, corrupted PEBs: 0
[ 2.575147] ubi0: user volume: 1, internal volumes: 1, max. volumes
count: 128
[ 2.582554] ubi0: max/mean erase counter: 5/0, WL threshold: 4096, image
sequence number: 1813099077
[ 2.591771] ubi0: available PEBs: 0, total reserved PEBs: 1956, PEBs
reserved for bad PEB handling: 36
[ 2.601178] ubi0: background thread "ubi_bgt0d" started, PID 73
[ 2.607185] dhd_module_init in
[ 2.612453] input: regulators:gpio-keys as
/devices/platform/regulators/regulators:gpio-keys/input/input1
[ 2.623173] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to
1970-01-01 00:00:01 UTC (1)
[ 2.653188] gpio_dvfs: disabling
[ 2.656468] vref-3v3: disabling
[ 2.659630] can-3v3: disabling
[ 2.663151] ALSA device list:
[ 2.666148] #0: wm8524-audio
[ 2.690847] UBIFS (ubi0:0): recovery needed
[ 2.718024] UBIFS (ubi0:0): recovery deferred
[ 2.722662] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name
"rootfs", R/O mode
[ 2.730996] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max.
I/O unit sizes: 2048 bytes/2048 bytes
[ 2.740970] UBIFS (ubi0:0): FS size: 241635328 bytes (230 MiB, 1903
LEBs), journal size 12062720 bytes (11 MiB, 95 LEBs)
[ 2.751887] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[ 2.758526] UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID
AD7DD6E8-1329-4760-93D9-E1A4D3A2465D, small LPT model
[ 2.771012] UBIFS error (ubi0:0 pid 1): ubifs_read_node: bad node type
(255 but expected 0)
[ 2.779396] UBIFS error (ubi0:0 pid 1): ubifs_read_node: bad node at LEB
1150:57784, LEB mapping status 1
[ 2.789035] Not a node, first 24 bytes:
[ 2.792754] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ........................
[ 2.805927] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.15+gb63f3f5 #37
[ 2.812763] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 2.819000] [<80015d78>] (unwind_backtrace) from [<8001271c>]
(show_stack+0x10/0x14)
[ 2.826841] [<8001271c>] (show_stack) from [<807a68d0>]
(dump_stack+0x84/0xc4)
[ 2.834143] [<807a68d0>] (dump_stack) from [<801e75c4>]
(ubifs_read_node+0x28c/0x308)
[ 2.842044] [<801e75c4>] (ubifs_read_node) from [<802041e0>]
(ubifs_tnc_read_node+0x48/0x138)
[ 2.850636] [<802041e0>] (ubifs_tnc_read_node) from [<801eab18>]
(ubifs_tnc_locate+0x1c4/0x1cc)
[ 2.859367] [<801eab18>] (ubifs_tnc_locate) from [<801e22d8>]
(ubifs_iget+0x74/0x630)
[ 2.867264] [<801e22d8>] (ubifs_iget) from [<801e2d30>]
(ubifs_mount+0x49c/0x1794)
[ 2.874898] [<801e2d30>] (ubifs_mount) from [<800edab4>]
(mount_fs+0x14/0xa4)
[ 2.882095] [<800edab4>] (mount_fs) from [<80105b50>]
(vfs_kern_mount+0x4c/0xf4)
[ 2.889522] [<80105b50>] (vfs_kern_mount) from [<80108814>]
(do_mount+0x19c/0xbb0)
[ 2.897168] [<80108814>] (do_mount) from [<801095b0>]
(SyS_mount+0x90/0xc4)
[ 2.904203] [<801095b0>] (SyS_mount) from [<80aa2104>]
(mount_block_root+0x110/0x29c)
[ 2.912091] [<80aa2104>] (mount_block_root) from [<80aa2488>]
(prepare_namespace+0xa8/0x1d8)
[ 2.920595] [<80aa2488>] (prepare_namespace) from [<80aa1e4c>]
(kernel_init_freeable+0x1d4/0x1e4)
[ 2.929495] [<80aa1e4c>] (kernel_init_freeable) from [<807a2bdc>]
(kernel_init+0x8/0xe8)
[ 2.937649] [<807a2bdc>] (kernel_init) from [<8000f528>]
(ret_from_fork+0x14/0x2c)
[ 2.945362] UBIFS error (ubi0:0 pid 1): ubifs_iget: failed to read inode
1, error -22
[ 2.953933] List of all partitions:
[ 2.957462] 0100 65536 ram0 (driver?)
[ 2.962259] 0101 65536 ram1 (driver?)
[ 2.966915] 0102 65536 ram2 (driver?)
[ 2.971667] 0103 65536 ram3 (driver?)
[ 2.976324] 0104 65536 ram4 (driver?)
[ 2.981101] 0105 65536 ram5 (driver?)
[ 2.985754] 0106 65536 ram6 (driver?)
[ 2.990446] 0107 65536 ram7 (driver?)
[ 2.995103] 0108 65536 ram8 (driver?)
[ 2.999754] 0109 65536 ram9 (driver?)
[ 3.004441] 010a 65536 ram10 (driver?)
[ 3.009181] 010b 65536 ram11 (driver?)
[ 3.013950] 010c 65536 ram12 (driver?)
[ 3.018690] 010d 65536 ram13 (driver?)
[ 3.023460] 010e 65536 ram14 (driver?)
[ 3.028198] 010f 65536 ram15 (driver?)
[ 3.033044] 1f00 3072 mtdblock0 (driver?)
[ 3.038137] 1f01 7168 mtdblock1 (driver?)
[ 3.043269] 1f02 1024 mtdblock2 (driver?)
[ 3.048357] 1f03 250880 mtdblock3 (driver?)
[ 3.053518] No filesystem could mount root, tried: ubifs
[ 3.058977] Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0)
[ 3.067264] ---[ end Kernel panic - not syncing: VFS: Unable to mount
root fs on unknown-block(0,0)
Normal Boot
Hit any key to stop autoboot: 0
=> printenv
baudrate=115200
board_name=EVK
board_rev=14X14
bootargs=console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs
cma=96M mtdparts=gpmi-nand:3m(boot),7m(kernel),1m(dtb),-(rootfs)
bootcmd=nand read ${loadaddr} 0x300000 0x700000;nand read ${fdt_addr}
0xA00000 0x100000;bootz ${loadaddr} - ${fdt_addr}
bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
bootdelay=1
console=ttymxc0
ethprime=FEC
fdt_addr=0x83000000
fdt_high=0xffffffff
initrd_addr=0x83800000
initrd_high=0xffffffff
loadaddr=0x80800000
mfgtool_args=setenv bootargs console=${console},${baudrate} cma=96M
rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1
g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F
g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber=""
mtdparts=gpmi-nand:3m(boot),7m(kernel),1m(dtb),-(rootfs)
mtdids=nand0=gpmi-nand
mtdparts=mtdparts=gpmi-nand:3m(boot),7m(kernel),1m(dtb),-(rootfs)
panel=TFT43AB
Environment size: 1004/131068 bytes
I don't know how I did it. I was trying to change bootargs, because
the system was loaded read-only. now I am in this condition.
by chance do you know how I can solve it?
I'm italian, sorry for my bad english.
Thanks for your help
Il giorno mer 5 feb 2020 alle ore 08:50 roth-m notifications@github.com
ha scritto:
chmod ug+x /hack/miio_client
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/22078?email_source=notifications&email_token=AOFAPHSUIB3C5IXZKMKQ6YTRBJVTLA5CNFSM4G63FHYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK2O6RQ#issuecomment-582283078,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AOFAPHUKA2TNZUX6YDBL6ETRBJVTLANCNFSM4G63FHYA
.
Hi,
Thanks for all of your hard work. I got the UK version of the plug with the board similar to @cadavre . I managed to gain root access but even after adding dropbear before the fac_test line in the rc.local file, and restarting the device, I still get connection refused when trying to ssh into the gateway.
Can anyone help please?
Solved it! More info here: https://community.openhab.org/t/solved-openhab2-xiaomi-mi-gateway-does-not-respond/52963/278
Ni thejena82, I have the same issue. I cannot boot my gateway. I have the same error.
[ 3.053518] No filesystem could mount root, tried: ubifs
[ 3.058977] Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0)
[ 3.067264] ---[ end Kernel panic - not syncing: VFS: Unable to mount
root fs on unknown-block(0,0)
Did you find solution for this?
Tnx,
Prontoo
Hello All!
I think this was a pretty good discussion here.
Can someone please help us with the new Xiaomi Gateway V3 (Model ZNDMWG03LM)?
We already have a thread here but nobody could help so far.
Maybe you can oder have it already solved?
The new xiaomi_miio integration might be able to comunicate with the EU gateway (lumi.gateway.mieu01).
Could someone try to manually setup the integration (in the latest version of HomeAssistant it is available as config_flow) and report to me if it works with the lumi.gateway.mieu01 model?
with the integration as it is now you schould be able to control the build in alarm, subdevice support is coming.
If you are able, also test the subdevice discovery using the phython-miio module by running this python code:
from miio import Gateway
gateway = Gateway("192.168.1.IP", "tokentokentoken")
gateway.discover_devices()
devices = gateway.devices
for dev in devices:
dev.update()
print(dev)
If so I will add zeroconf auto discovery
The new xiaomi_miio integration might be able to comunicate with the EU gateway (lumi.gateway.mieu01).
I can confirm that it's working with EU model.
But I can't test with python, sorry.
@javicalle so you can turn on/off the alarm of the gateway?
That is great, than the rest will probably also work (also zigbee subdevices)
I will add the lumi.gateway.mieu01 to zeroconf autodiscovery
@javicalle I just looked at the code and I think it schould have already been auto discovered by zeroconf.
Was this indeed the case?
so you can turn on/off the alarm of the gateway?
Yes, I can. But only works the "arm away" option.
"Arm home button" not working, and no logs.
Was this indeed the case?
Yes. It was autodiscovered and showed like a new integration avaliable.
Some tests here.
Disclaimer: _I am not an expert in Python, excuse me my mistakes_
I have updated the python-miio
library from my environment:
pip3 install --upgrade python-miio
After that when a call your script I get an error:
(venv)$ python /tmp/test_miio_gateway/gateway_devices.py
Traceback (most recent call last):
File "/tmp/test_miio_gateway/gateway_devices.py", line 5, in <module>
gateway.discover_devices()
File "/opt/DevelopmentSpace/hassio/home-assistant/venv/lib/python3.7/site-packages/miio/gateway.py", line 168, in discover_devices
devices_raw = self.get_prop("device_list")
File "/opt/DevelopmentSpace/hassio/home-assistant/venv/lib/python3.7/site-packages/miio/gateway.py", line 207, in get_prop
return self.send("get_device_prop", ["lumi.0", property])
File "/opt/DevelopmentSpace/hassio/home-assistant/venv/lib/python3.7/site-packages/miio/device.py", line 147, in send
command, parameters, retry_count, extra_parameters=extra_parameters
File "/opt/DevelopmentSpace/hassio/home-assistant/venv/lib/python3.7/site-packages/miio/miioprotocol.py", line 203, in send
self._handle_error(payload["error"])
File "/opt/DevelopmentSpace/hassio/home-assistant/venv/lib/python3.7/site-packages/miio/miioprotocol.py", line 263, in _handle_error
raise DeviceError(error)
miio.exceptions.DeviceError: {'code': -5005, 'message': 'params error'}
@javicalle that is a shame, that means the lumi.gateway.mieu01 uses a diffrent way to get the device list....
That basically means subdevice support that is comming wont work for the lumi.gateway.mieu01.
If you want to have subdevice support for the lumi.gateway.mieu01 I suggest you open an issue at https://github.com/rytilahti/python-miio and tag me in the issue, I can try and help you implement support. I know a command that we can try: get_device_list
, but that will involve changing the gateway.py file a bit.
I heared the get_device_list
works on the lumi.gateway.mgl03 so it might work on the lumi.gateway.mieu01...
Done.
@starkillerOG thanks a lot for all your efforts.
I will try to perform the necessary tests and help in any way I can, but I don't think I can get to the level of detail of those discussed in rytilahti/python-miio#699 (^_^;)
@javicalle you don't nearly have to have that level.
This issue is a better guideline for what needs to be done: https://github.com/rytilahti/python-miio/issues/650
Lets continue the rest of the discussion in https://github.com/rytilahti/python-miio/issues/728
The new xiaomi_miio integration might be able to comunicate with the EU gateway (lumi.gateway.mieu01).
I can confirm that it's working with EU model.
But I can't test with python, sorry.
How do you integrate it? xiaomi_miio integration ask me for token and if i try to use the (32 char lenght) HEX token i extract, responds with an error.
@sakara you schould indeed use the 32 char length token and just put in the characters in the field during config_flow.
Instructions for getting the token are here: https://www.home-assistant.io/integrations/vacuum.xiaomi_miio/#retrieving-the-access-token
Note that sometimes the Xiaomi Home app (Xiaomi Aqara Gateway, Android & iOS)
method does not provide the correct token and one of the alternative methods needs to be used.
@javicalle how did you get the correct token?
Hi,
I get the token through a custom version of the "Xiaomi Home" app. This version allows you to obtain information from the devices:
You need to create the "/sdcard/vevs/logs" folder before starting the app o make a full restart after you create it.
Once the app detects the folder, automatically collects information from devices during startup. Also log messages app <-> device. Among the generated data, the tokens of the devices can be obtained.
Regards.
@sakara you schould indeed use the 32 char length token and just put in the characters in the field during config_flow.
Instructions for getting the token are here: https://www.home-assistant.io/integrations/vacuum.xiaomi_miio/#retrieving-the-access-token
Note that sometimes theXiaomi Home app (Xiaomi Aqara Gateway, Android & iOS)
method does not provide the correct token and one of the alternative methods needs to be used.
@javicalle how did you get the correct token?
Ok sorry for the late reply, but it works... i mean, it recognize 1 device: lumi.gateway.mieu01-Linux and 1 entity: alarm_control_panel.xiaomi_gateway_alarm
There's no light.* entity, is it right?
@sakara you are correct, no light entity yet. The lib does already support it, but has not yet been added to HASS
@sakara you are correct, no light entity yet. The lib does already support it, but has not yet been added to HASS
ok thanks :)
@sakara I've tried to add the gateway in hassio like this:
alarm_control_panel:
platform: xiaomi_miio
host: LOCAL_IP
token: GATEWAY_TOKEN
I got the following error: "The xiaomi_miio platform for the alarm_control_panel integration does not support platform setup. Please remove it from your config."
Any Ideas?
@sakara I've tried to add the gateway in hassio like this:
alarm_control_panel: platform: xiaomi_miio host: LOCAL_IP token: GATEWAY_TOKEN
I got the following error: "The xiaomi_miio platform for the alarm_control_panel integration does not support platform setup. Please remove it from your config."
Any Ideas?
You have to add it with Home Assistant INTEGRATION (not manually), search for XIAOMI MIIO in integrations
@sakara I've tried to add the gateway in hassio like this:
alarm_control_panel: platform: xiaomi_miio host: LOCAL_IP token: GATEWAY_TOKEN
I got the following error: "The xiaomi_miio platform for the alarm_control_panel integration does not support platform setup. Please remove it from your config."
Any Ideas?You have to add it with Home Assistant INTEGRATION (not manually), search for XIAOMI MIIO in integrations
Done Thanks! :)
Is it possible to map the connected devices in Hassio as binary sensors?
@Frank802 what do you mean with:
Is it possible to map the connected devices in Hassio as binary sensors?
@starkillerOG amazing job!! Is there any plan/roadmap in order to add light.* and media_player.* entities support?
@salamandrabaita I just added illumination sensor support in this PR: https://github.com/home-assistant/core/pull/37959
Probably going to add gateway light very soon.
I am not going to implement media_player because the gateway only supports chinese radio stations as far as I am aware. Since I can't understand chinese there is really no point in trying to add it....
So someone else will probably need to implement the media_player although the python-miio lib can already control the radio, so only needs to be cleaned up a bit and added to HomeAssistant.
Subdevice support is already there for chinese version of the gateway.
subdevice support for the lumi.gateway.mieu01 is beeing worked on see the discussion here: rytilahti/python-miio#728
Still searching for someone that can translate the java code to python to get the device list from the cloud (see linked discussion)
@salamandrabaita I just added illumination sensor support in this PR: #37959
Probably going to add gateway light very soon.
wonderful! I will check it out immediately!
I am not going to implement media_player because the gateway only supports chinese radio stations as far as I am aware. Since I can't understand chinese there is really no point in trying to add it....
It should be possibile to play the built-in ringtones and media files (like different alarms/buzzers) by IDs.
See implementation by another user for hacked gateways here: https://github.com/cadavre/miio_gateway
Maybe not so useful in many cases but could be certainly a plus. Not sure about the effort needed though.
Hey All, I had to reset (holding button for 10 secs) my gateway as i had to change the server for Ikea light bulb compatibility, however, it seems like I cannot SSH into the gateway anymore. Any idea how I can enable SSH without having to solder again?
Thanks in advance.
@salamandrabaita I just added illumination sensor support in this PR: #37959
Probably going to add gateway light very soon.I am not going to implement media_player because the gateway only supports chinese radio stations as far as I am aware. Since I can't understand chinese there is really no point in trying to add it....
So someone else will probably need to implement the media_player although the python-miio lib can already control the radio, so only needs to be cleaned up a bit and added to HomeAssistant.
It would be awesome if you could firstly add the gateway light.
I have tried everything to integrate my EU "Mi Control Hub DGNWQ05LM".
Even opening it to use my UART to USB
But it simce like even if the model name is the same, the one coming from the "Mi Smart Sensor Set", has a complety different board than what I can see in the "How to open the Com port by soldering UART TX RX" tutorials.
All that to say my only solution could be to apply a corresping color to the Gateway from the MI home App when a sensor event occurs.
And then from HA, detect the gateway color changed and trigger my automations.
This is the only solution I have found yet.
Here are the logs I can see from my Android debug console when runing Mi Home v5.4.54
processResult in result=
{
"code":0,
"message":"ok",
"result":{
"list":[
{
"did":"My gateway did",
"token":"My working Miio token",
"longitude":"0.00000000",
"latitude":"0.00000000",
"name":"Mi Control Hub",
"pid":"0",
"localip":"192.168.1.31",
"mac":"My mac address",
"ssid":"My Wifi",
"bssid":"My bssid",
"parent_id":"",
"parent_model":"",
"show_mode":1,
"model":"lumi.gateway.mieu01",
"adminFlag":1,
"shareFlag":0,
"permitLevel":16,
"isOnline":true,
"desc":"Appareil en ligne ",
"extra":{
"isSetPincode":0,
"fw_version":"3.5.8_147",
"needVerifyCode":0,
"isPasswordEncrypt":0,
"mcu_version":"0143"
},
"uid":My Uid,
"pd_id":My pd_id,
"password":"",
"p2p_id":"",
"rssi":0,
"family_id":0,
"reset_flag":0
},
{
"did":"lumi.My Id",
"token":"",
"longitude":"0.00000000",
"latitude":"0.00000000",
"name":"Mi Window and Door Sensor",
"pid":"3",
"localip":"",
"mac":"",
"ssid":"My Wifi",
"bssid":"My bssid",
"parent_id":"My gateway did",
"parent_model":"lumi.gateway.mieu01",
"show_mode":0,
"model":"lumi.sensor_magnet.v2",
"adminFlag":1,
"shareFlag":0,
"permitLevel":16,
"isOnline":true,
"desc":"Fermer ",
"desc_new":"%s Fermer",
"desc_time":[
1595718314
],
"extra":{
"isSetPincode":0
},
"event":{
"event.close":"{\"timestamp\":1595718314,\"value\":[]}",
"event.no_close":"{\"timestamp\":1595717540,\"value\":[60]}",
"event.open":"{\"timestamp\":1595718309,\"value\":[]}",
"miot_bind_time":"1595714828",
"prop.close":"1",
"prop.device_log":"[1595718312,[\"event.close\",[]]]",
"prop.no_close":"0",
"prop.open":"0",
"prop.open_status":"1",
"prop.s_auth_config":"{\"privacyAuthed\":true}"
},
"uid":1831064495,
"pd_id":64,
"password":"",
"p2p_id":"",
"rssi":0,
"family_id":0,
"reset_flag":0
},
{
"did":"119109448",
"token":"My Light Tokeb",
"longitude":"0.00000000",
"latitude":"0.00000000",
"name":"Lumière cuisine",
"pid":"0",
"localip":"192.168.1.54",
"mac":"My mac",
"ssid":"My wifi",
"bssid":"My bssid",
"parent_id":"",
"parent_model":"",
"show_mode":1,
"model":"philips.light.hbulb",
"adminFlag":1,
"shareFlag":0,
"permitLevel":16,
"isOnline":true,
"desc":"Appareil en ligne ",
"extra":{
"isSetPincode":0,
"fw_version":"1.3.7_0029",
"needVerifyCode":0,
"isPasswordEncrypt":0
},
...
"My Gateway id":[
"prop.arming",
"prop.light",
"event.dev_online",
"event.dev_offline"
],
"My Light Id":[
"prop.bright",
"prop.power",
"event.dev_online",
"event.dev_offline"
]
...
"lumi.Id":[
"prop.open",
"event.dev_online",
"event.dev_offline"
]
}
...
@ThomasGorisse gateway light is already included in that same PR.
However it is using polling and not push, so do not know if it will give the results you hope for...
Basically it will update the gateway light states every (I think) 10 seconds, but not instantly, so not so good for automations with sensors...
There is a way to use push with python miio, but that is still in the development stage and has still quite some way to go....
see: https://github.com/rytilahti/python-miio/pull/709
@esc247 python-miio includes a command to open the telnet service to be able to SSH into the gateway: https://github.com/rytilahti/python-miio/blob/eef6b36b179917f0b59206b13d089836c2877528/miio/gateway.py#L364
You could try that....
@esc247 python-miio includes a command to open the telnet service to be able to SSH into the gateway: https://github.com/rytilahti/python-miio/blob/eef6b36b179917f0b59206b13d089836c2877528/miio/gateway.py#L364
You could try that....
Do you know how to run this command outside of HA?
use the following python script:
from miio import Gateway
gateway = Gateway("192.168.1.IP", "TokenTokenToken")
gateway.enable_telnet()
of course you have to install the latest python-miio version using: pip3 install --upgrade python-miio
use the following python script:
from miio import Gateway gateway = Gateway("192.168.1.IP", "TokenTokenToken") gateway.enable_telnet()
of course you have to install the latest python-miio version using:
pip3 install --upgrade python-miio
I tried to use the miio tool, but cound not find the correct command for that. Will try running this python script and feedback :)
use the following python script:
from miio import Gateway gateway = Gateway("192.168.1.IP", "TokenTokenToken") gateway.enable_telnet()
of course you have to install the latest python-miio version using:
pip3 install --upgrade python-miio
I tried to use the miio tool, but cound not find the correct command for that. Will try running this python script and feedback :)
Nope, cant figure it out. I installed the latest python-miio, and then stored the script as miio.py. then when I run python miio.py
, I get the following:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "miio.py", line 1, in <module>
from miio import Gateway
ImportError: cannot import name Gateway
Don't bother, enable_telnet doesn't work with DGNWQ05LM.
It seems once you have the device list everything is ready in python-miio. Did anybody manage to run the sample from https://github.com/rytilahti/python-miio/issues/728 up to the list? I'd like to give it a shot.
Most helpful comment
Hi,
I get the token through a custom version of the "Xiaomi Home" app. This version allows you to obtain information from the devices:
You need to create the "/sdcard/vevs/logs" folder before starting the app o make a full restart after you create it.
Once the app detects the folder, automatically collects information from devices during startup. Also log messages app <-> device. Among the generated data, the tokens of the devices can be obtained.
Regards.