-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does it add snapcast functionality for Xioai device? #1
Comments
Hi @hillbicks , This set of scripts and patches removes all XiaoAI propietary software and allows to install other open-source programs, build during the process. This repo is for personal usage, but the end goal is to have a "local alexa-like smart speaker" powered by open source only (or mostly). |
Dude, that is huge news. There are so many people actually looking for a device like this. Decent speaker with voice assistant capabilities without cloud services attached to it. It's basically the missing hardware for a lot of software projects. I was not aware there is any hardware available which would be able to run snapcast, let alone one that is a smart speaker. I hope it's ok if I ask a couple more questions? If you're not comfortable, no worries, I understand, since it is just for your personal usage.
Let me know if that would be of interest to you, would love to help out here. EDIT: Another question: After looking at the files, I guess your building an image file and using the miio tools to deliver the image file as a software update after getting the token? |
I'm testing with LX06 originally. LX01 also works, but need some tweaks on the image/process. Voice audio can be powered by multiple TTS or just external audios. I'm playing around with espeak, nanotts, Google TTS... So, no Rhasspy, Kalliope, Leon or Mycroft. That's something a Raspberry Pi can provide, but that would force to change the whole board, and I'm just playing around with the speaker one. Of course I'm open to PRs and contributions if you want :) |
The process for installing this program, is to extract the original image - from same Flash Memory As I've told earlier, I'm removing all the propietary programs, so miio is also unavailable. But you can comment part of the process to keep that programs and run them. |
partition size makes sense, hadn't thought about that. Even having a wifi speaker with snapcast is still a huge improvement in terms of hardware and a good starting point I think. I thought you were already at the stage of development where you're flashing the updated image via miio, that's at least how I've done it for the xiaomi vacuums that I own. But I guess you're using the serial ports to access it, or in case of the L09G, trying to access it. Since I couldn't find the LX06, I ordered the L09G and see what I can figure out, although I don't have high hopes for that, since I have zero experience with this kind of hardware reverse engineering. I also took the liberty to ask in the dustcloud telegram channel if anybody is already working on a L09G. If we're lucky, one of the dudes responsible for originally rooting the xiaomi vacuum is interested. I already offered donating a device to him, since I'm profiting from his work for some time now (3 vacuums with rooted firmware) |
Yep, in this case the flashing is done by having access to serial port, to the Linux console. |
Oh wow, that is a good find! Really strange that this is listed as CVE. I just joined the telegram channel for dustcloud and linking the CVE resulted in the exact same reactions. WHY THE FUCK is that a CVE? I also wrote the authors of the CVE, asking whether they looked at the L09G. But judging from the responses I got in the telegram channel for dustcloud, I don't have high hopes for the L09G. It seems that xiaomi is cracking down on the new vacuums they're releasing, so we might have no luck there, but let's see. Have you enabled ssh on the fallback partition or how are you reflashing new builds onto the device? While I wait for the L09G to arrive, I'll read up on the dustcloud docs, they should give good insight into the xiaomi architecture. Any other resources you can recommend in the meantime? |
Beware this is not related to dustcloud, as that is meant only for vacuums. It would be possible to add some offline agent to have miio control anyway, but i'm not interested on it - yet. Maybe i'll need to rely on it for the Infrared control but still need to research more on that. At the moment I'm just focusing on what programs or services can I use to make the voice assistant itself. So far the combination would be something like: Porcupine > ALSA record (Opus?) > websocat > External Vosk API server > Probably need to deploy some small CLI/tools for Home Assistant, and I'm still having problems with If you check the scripts, you'll see the patching enables SSH on the image, so if you just flash the patched image on both partitions, you'll have SSH enabled permanently. |
Oh yeah, sure, I'm aware of that. I just mentioned it, because there are likely some similarities between the device groups that we can look at. And the miio tools should probably come into play if everything else is running and you want to go "public" with it. I guess flashing via UART is not a viable option for most people :p One step at a time I guess, I'm just excited about the possibilities this hardware can provide and most importantly for me personally, whether the L09G can even be accessed at all. That is going to be the first challenge and probably the biggest one. |
Alright, just got the L09G and took it apart, fortunately that's very easy. It seems the UART port on the front are not actually connected to the board, so I removed the board from the speaker and connected the actual pins on the back of the board. When you tried to connect via serial, did you use the holes on the front or the pins on the back? For my first test, I just used tape to attach TX, RX and GND and lo and behold, I got a serial connection. Well, sort of, it seems I can't get the serial speed right. Tried the usual ones: 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200. What are you using for the LX06? But I can see some boot messages, just not something that is readable and it stops after the boot is finished. I'll solder the pins for UART now, just taping it doesn't really cut it. UART Front UART Back EDIT: I got a serial connection. Using tape was a bad idea 😁 But the ground port is a bitch, solder point came loose again.
|
Alright, this is all I got now. Will have a more detailed look later.
|
Alright, last post for today. either minicom didn't work or I missed a parameter. Using putty/screen I was able to interrupt autoboot and get into the u-boot command line interface
I'm too tired to to look further today, but I think we're in business 🚀 |
I just relized the L09G runs android., so that's going to be interesting. I guess the LX06 runs GNU linux, right? |
Everything is GNU/Linux in the end 😂 |
Heya @hillbicks ! Do you have any news with this speaker? |
Hey, nope, unfortunately not. After several days of trial and error I gave up. I couldn't figure out a way to get past the autoboot prompt and start a shell with the device, but I'm pretty sure that's just due to my lack of knowledge and fear of bricking the damn thing. So, if you have any suggestions or tips to share, I'm all ears. As for the TTL connectors, maybe they learned and removed them? |
Not at all. They remain the 3 connectors, but somehow I burned my CP2102 by testing multiple pins. I'll try do another check to L09G but I expect the same certificate / signature protection set. If you want to implement this I suggest you find a LX06 and we can check if this is still working (no new firmware version installed with this signature protection) |
Well, if you're also testing the L09G as well, I guess I'll wait a bit and see if you're able to get further than me before I buy the LX06. I'm having a hard time finding the LX06 online, it only seems to be available in some shops in India. Do you already have the L09G? |
Yep, I have 5 different models :) |
Good work guys. |
@mah8050 Interesting, so the same model L09A (Art) is Chinese while the G is Global and the public name is different... |
@hillbicks from your post I'm checking that you have Uboot bootdelay enabled, so you can interrupt the boot process and get to the Uboot menu, you could do dump operations in there.
I'm not seeing this option at the moment, I didn't pair the speaker to Wifi, not sure about your setup. |
WOOOOT - looks like by switching off and on quick again I got into this |
Still testing. Here's some output. Don't run them at the moment, looks like if missing the "android" envs, device is kind of factory restarted?
|
still nothing. |
Some other output, but still can't write to the console. I'm starting to think that this will require soldering an USB header and do via adb? Hope not :(
|
Almost there! Looks like this time
|
Good progress |
@mah8050 uboot mentions |
Today I had time to poke around my speaker a bit
each time I enter a login name (like 'root') it makes different magic[release] code |
But you have this input from openwrt boot
How did you get this? |
Just connected serial port and hit enter while booting.
and typed root in login prompt
|
Right. So maybe the system is also different, like... Maybe this is Google provided, not Xiaomi image or content at all? |
clearly something is different:
and yours is:
That would make me sad, I really hope to make the speaker Speak in an understandable language :(( |
Don't get confused, thing here is that L09A may work with this repo project, while L09G not! 😂 After that, dump/backup all the mtd partitions in your computer, and analyze whether they are signed or not with |
Ok I'm in |
That's great news @mah8050 ! I suggest let's close this issue - no longer a "snapcast question", and let's work on this in a separate issue for L09A . Please create it and I'll detail you the operations to do. |
Is there anyone else trying to break the L09G? |
Hi radekson, |
Is there anything new about the L09G? |
No sorry not from my side! My I will have time after XMas to "restart" Do you have experience with buspirate 3.6 may I can get one |
The firmware is already located from several days ago. If any of you do any findings or progress in L09G, please open a new issue. |
For the people interested in L09G, you may want to have a look at #49 (comment) :) |
Hey David,
hope you don't mind that I open an issue to ask you question. I saw your comment on one of the snapcast issues.
I wasn't sure whether I understood your comment correctly. Is this patch really adding snapcast functionality (amongst other things) to the xioaAI device? Meaning, a standalone speaker that can act as a snapcast client? I would appreciate it, if you can elaborate a bit.
If that is really the case, that would be huge imho. Looking forward to your answer!
Thanks and BR
The text was updated successfully, but these errors were encountered: