-
Notifications
You must be signed in to change notification settings - Fork 65
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
Port config request. #6
Comments
Here you go: https://github.com/banksy-git/lidl-gateway-freedom/releases/download/Release-1.1/serialgateway To select serial port use option -d. You can make it quiet by redirecting its output, e.g.:
Have fun! |
Thanks you very much !! I trying it out if i can getting it working and informing you how it working so you can using the knowledge if you like. Divertiti ! ! |
I have not putting one IKEA module inside but its looks working OK in the ZBGW side:
Or i taking one LIDL LED stripe controller that is having on EFR32MG21 but then i need some cooking one new firmware for it and i have abusing our firmware cooker to much the last mounts :-(( |
I was possible one time getting one IKEA ICC-A-1 module booting in to bootloader but its nearly impossible.
But normally the system is taking the port and opening the login prompt and distorting the sequence.
Normally its one Killing them is not helping then somthing is restarting them. Was seeing somthing in the tuya app logs but i cant finding wot is starting the service and kicking he 2 processes thru busybox commands that i listening to the comport and triggering the login screen on it. Do you have some where i can finding the service and deleting the login part of it ?? Thanks for help to Linux novice hardware users. |
There's a couple of things that might interfere:
If you get it wrong your device won't boot. Provided you used mtd2 you should still be able to get into the bootloader and fix it from there (TFTP the original back and then write to flash.).
That'll probably be sufficient for a quick hack. 😄 |
I think only comment out the /bin/login is enough if the kernel is not spamming the comport (its normally not doing then tuya app is deactivated and having network connected OK) .
Braking the link to /bin/login shall also working but then i think i cant login from SSH :-(( I have making one DD for all 5 partitions from SSH shell and uploaded them with TFTP to my laptop so shall being safe if the DD was making the bin files OK. Is the /dev/mtd2 "neutral" or is it having part of the encrypted root password ? I was baying one LIDL ZBGW yesterday (My first is one "Revolt" = one white label one) and its have the same HW version as yours so shall being identical. |
Do you think its possible changing the rights for accessing /dev/ttyS0 so the system cant accessing it and only the Socat ca do it ?? |
One silly question: the |
MTD2 MTD2 is the same across devices. (Or at least it was for the two images I've seen.) That said, for a couple of reasons, I think it would be better to share methodology than actual images. Using access controls The kernel doesn't use the filesystem to access the device. The init process runs as root so it'll bypass all the DACLs on the /dev/ttyS0 device node anyway. (The D in DACLs being discretionary.) Tell the kernel to release It might be possible to ask the kernel through some API to close its internal reference to the serial port. I'm not sure but I'm curious so I'll dig in the source later to see. Gut feeling is that it's probably not possible but worth a look! There's potentially some more hacky things we could do to bring about the same result. I'd like to build a fresh kernel at some point - if all the drivers (particularly networking) are present. |
If you have your method for modding and repacking the MTD2 i like testing it if you have it documented so its easy to do and redo if its not working so well. In witch of the dumped partitions is the encrypted root password ? One new kernel you can implanting wot you like and then its no problem overriding the inits you like and its one god way getting control of the HW and the SW. If you is getting some more or less crazy idea and like some to trying it out i can trying it out then i heaving one LIDL and one tuya clone too trying with. |
I think i have messing the local console up.
I think i have writing some bad in the system partition that is making the console being messed up by the serial server. I have doing one backup with DD of all 5 MTDs so shall being possible restoring the system but i dont knowing how. Can you pleas hinting how to writing back the system partition from the bootloader. Thanks in advance !! Mattias |
The restarting the ZBGW the console is writing:
So i think i have putting the wrong config in the start file. |
Disclaimer for those late to our party: You can brick your device with this so double check all things before pressing ENTER! If you have a backup you can restore with boot loader and TFTP:
Likely it's 192.168.1.6
The bootloader will output something like this:
Which indicates that your file was placed into RAM at address 80500000.
a) You need to select the address of the partition you're restoring. Helpfully these are output by the device when it boots as follows: 0x000000000000-0x000000020000 : "boot+cfg" First one is mtd0 and they go up. So if we're restoring mtd2 we select our address as 0x200000 DANGER: Select the proper address and double check you typed it correctly! Restoring mtd1, 2, 3, 4 and 5 should be fine but I recommend NOT trying to flash mtd0! b) Write the data in RAM to flash by issuing this bootloader command:
Where 200000 is the SPI flash address to write to, 80500000 is the RAM address to read from and the last 200000 is the size of the file in RAM. Good luck! (edit: tftp client transfers in ASCII mode.) |
Thanks for joining the party late or not !! ;-) The device is working OK with ZHA and have using it for sniffing little zigbee traffic. I trying flashing the rootfs in the weekend or in the next week. I informing you how its going so you knowing if more "normal" user can doing your deep hacking working :-)) And one more time thanks !! |
If you is interested getting the commands for booting to bootloder so have Silabs one python utility that can do it locally and i was using the commands from it with SSH for reboting the NCP. You is only need using v7 commands with original 6.5.0 or the 6.5.1 firmware that i have getting for going back to tuya app, and 6.7.8 you need using v8 commands. Its easy only some string to sending and you have rebooted the NCP but the format is different for the protocol versions. |
I found something interesting in /tuya directory.
it is not very useful if you do not have root access to the device . also i'm not sure uuid is the same as kek key or not |
I think tuya is having one "default" firmware on the ZBG that is being updated then connecting to the cloud but its must having some default root password for using those tools then first connecting and setting the keys in the flash (as your is ff and not connected to the cloud). I think its very interesting for @banksy-git looking in your original firmware for getting ore clues how tuya have cooking its ZBGW !! I have one of the square clones that is working OK but i was soft braking on newer LIDL with configurating the second com port and its interference with login both SSH and local on the terminals (login is OK but is being kicked out to login prompt then coming in the shell) and im too lazy re flashing the device with the dumped images. It working on the normal 8888 port for the normal com port but is having problems and loosing contact with ZHA and also is using it for sniffing zigbee traffic with bellows over the network. Thanks for sharing great information !!! |
I have working / testing ESPHome on MwMos D1 Mini with serial server to HA with one IKEA ICC-A-1 Zigbee module. I have implanted software commands in ESPHome with scrips for rebooting i to bootloader and its working great but must still using one terminal that can sending firmware with XModem and i was using ExtraPuTTY before and it was working OK with real serial ports but not with socket connected ports and one day later i was trying ZOC and it was working great. Then have trying your update script and its also working great to updating Zigbee modules in ESPHome !! But I is missing the software commands for rebooting the Zigbee module of all versions and not needing have bellows installed for doing it. First added:
And in the end before your run statement: Its one 110% copy and past work as im not one programmer but its working. I have trying updating EZSP 6.7.9.0, 6.9.2.0 and 6.4.0.0 (its V7) and changing protocol version for going to and from V7 and its working great. If you like you can using what is is good and fixing all bad things i have doing. Attaching one "updated" version of your script (ncp_blm.py) plus the ncp.py that is updated of ZHA devs and is the reference from Sillabs for sending commands without one real host system that is doing all the magic with the frames received / sent. |
One good thing can being sending one "2" before starting the reset of the NCP so if its in bootloader is restarting and running the EZSP app or better "detecting" if its in bootloader mode by sending one "enter" and looking if getting the bootloader prompt (that is done in the ncp.py) and dont need restarting the chip and also its working if the EZSP app cant running the APP and is starting the bootloader then hardware resetting / power on of the chip. Also one check if the file is one GBL file or not and exiting if its not one GBL file can being good. |
Thanks for for the great working restore instruction !! I was restoring MTD02 = "rootfs" = not helping Looking the the tuya folder and its was looking little interesting:
Its have tuya_start.original.sh = moded then hacking it first time but its not having the tuya_start.sh. One more time THNAKS for helping and getting our ZBGW working with our community systems !! |
24 hour test passed !!With with original EZSP 6.5.0.0 firmware it was not possible sniffing with bellows more then some minutes before the NCP was going i fault state and needed reset if little traffic on the zigbee network. |
I can see in the code that parameter p = TCP port and can being overridden then loading the application.
I like trying using the /dev/ttyS0 that is being used as local console for one IKEA ICC-A-1 module for sniffing Zigbee trafic.
Is it possible for you to implanting one parameter like "-S0" for starting Socat using /dev/ttyS0 ?
I think i can (with not so much Linux compiling experience) downloading toolchain and compiling one separate binary for it but then i also must have 2 95% identical version installed in the ZBGW.
Do you have some good advice to "muting" the log / debug out pot on the local console as much as possible ? Redirecting logs to dev null ?
The Zigbee sniffing is never starting at boot so that is not one problem (if not getting the NCP in blocking state beaus of boot logging) but its very nice done then having all that i need on J1 for doing good sniffings in full speed also in large networks.
PS: All EZSP NCP firmware (if not being stripped) is having one working mode for sniffing zigbee.
The text was updated successfully, but these errors were encountered: