Skip to content
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

UZ801 V3.0 Support #46

Open
ddscentral opened this issue Mar 27, 2023 · 110 comments
Open

UZ801 V3.0 Support #46

ddscentral opened this issue Mar 27, 2023 · 110 comments

Comments

@ddscentral
Copy link

ddscentral commented Mar 27, 2023

I have created this issue to serve as an instruction on how to get Debian working properly on UZ801 V3.0 boards.

I have recently acquired a couple of these from Aliexpress. One is left in stock condition, other is flashed with Debian.
This model appears to be pretty recent, the firmware build in it is dated February 2023. A quick google search shows someone has already made DTS files to support this model.
The rootfs from debian.zip file mostly works fine but requires some tweaks:

  1. For modem to work, you will need to dump modem firmware files from stock ROMs modem partition and copy them to /lib/firmware
    You need the following files: modem.* mba.mbn and likely also mcfg_sw.mbn (located in image/modem_pr, region specific).
    I would also suggest dumping and copying the WiFi firmware files (wcnss.*) as well.
    I'm not absolutely sure if these are also board specific but they do work fine in AP mode. I didn't test AP mode with the original files.
    With firmware files installed, LTE modem works fine.

  2. For WiFi to work in AP mode, you need to dump the NVRAM file /persist/WCNSS_qcom_wlan_nv.bin from the stock ROM and copy it to /lib/firmware/wlan/prima/. NVRAM file provided in the image only works in client mode without crashing.

  3. LEDs in the platform driver are not mapped correctly and do not work. You can manually toggle LEDs by exporting GPIO pins 6, 7 and 8 (offset is 390) as output and toggling their values. Proper integration requires a kernel rebuild.
    Restart button is GPIO pin 23 active low.

Other than the LEDs, everything works fine. The OS appears to be stable so far.
I will recompile the kernel with fixed LEDs (and probably also the reset button) and upload it here later.
If anyone needs files from the stock ROM for Modem and WiFi, I can also upload them here.

Information source:
https://lore.kernel.org/lkml/e924121c-4d3c-a200-cd7e-9d07deff80de@linaro.org/T/

@ddscentral
Copy link
Author

ddscentral commented Mar 29, 2023

Firmware files and the fixed kernel can be found here.
Kernel is in the "kernel" directory, firmware is in "modem_wifi". Kernel is built using sources from here.

First, install the *.deb packages using dpkg, then flash the provided boot.img to /dev/mmcblk0p12. Simple "dd" command should work.
Do triple check the partition number ! Flashing to the wrong one will soft-brick your stick !
Do fdisk -l /dev/mmcblk0 if you are not sure which partition contains boot.img (it should be 64M in size). But I believe the partition layout is the same on all devices.

Reboot after flashing. If everything went fine, you should see the red LED blinking, indicating that the system is running. Blue LED is set to trigger on WiFi TX, Green LED has no default trigger.

After rebooting, old kernel packages can be uninstalled to free up space.

@ppvan
Copy link

ppvan commented Apr 16, 2023

I'm just buy the stick and flash debian without any backup
Now my modem does not work, (sim-missing). But wifi, usb... are normal
How can i make my modem work please?

Every info i have now is this:

Show more info about it. Here is overview info on the device
SN: 1000000050797F
IMEI: 864686020681343
IMSI: 452040324276759
ICCID: 89840480003242767594
SSID: 4G-UFI-575C
Signal: -97
WAN IP: 21.61.175.108
HW Version: HW1.3
SW Version: UFI_003_V01_ZX_DD_221215
Web Version: WEB_V1.0.303#
Baseband: UFI003_CT 20220903

@ddscentral
Copy link
Author

Your board is UFI003. Firmware files in debian.zip are for UFI001 and (as you've witnessed) aren't fully compatible.
WiFi may work somewhat with the wrong firmware, but it may not be fully stable and may have broken AP mode.
Unfortunately, unless someone else uploads dumps for UFI003, there isn't much you can do to fix the modem.

You should have taken a full flash dump before flashing. Or grabbed a 2-pack, like I did. These sticks are dirt cheap.

@NesDev
Copy link

NesDev commented Apr 25, 2023

Hi, I followed all the steps, I copied the firmwares but when I check the modem information with mmcli -m 0, I get:

Status | lock: sim-pin2
| unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: enabling
| power state: off
| signal quality: 0% (cached)

if i try to start modem :

user@openstick:~$ mmcli -m 0 --enable
error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.libqmi.Error.Protocol.DeviceNotReady: Couldn't set operating mode: QMI protocol error (52): 'DeviceNotReady''

Do you have idea ? i try to make low cost lte proxy but with the stock firmware i have all the times crash etc (i have 200 dongles for this) my projet it's to pass my dongles to debian for more stability but lte don't work :/

@ddscentral
Copy link
Author

Does the SIM card have a PIN code ? It looks like it's locked.

@NesDev
Copy link

NesDev commented Apr 25, 2023

With the firmware uz801 https://github.com/OpenStick/OpenStick/releases i have this :
image
but i can't connect to the network :

user@openstick:~$ mmcli -m 0 --simple-connect="apn=internet.voo.be,user=,password="

error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.InProgress: Connection request forbidden: operation already in progress'

Do you have an idea ? i have FY_UZ801_V2.1 on the dongle

@NesDev
Copy link

NesDev commented Apr 25, 2023

With the v1 version the 3g work but i cannot active the connection with nmtui. I need to find the firmware for V2 version :/

@ddscentral
Copy link
Author

ddscentral commented Apr 26, 2023

Status shows "Status: lock: sim-pin2" Again, have you tried unlocking ?
You can try my UZ801 v3.0 firmware.
It seems that different revisions of UZ801 have different firmwares. File sizes differ in mine and the UZ801 one from the "Releases" section.

@lfgomez
Copy link

lfgomez commented May 11, 2023

@ddscentral May I ask you how did you generate the boot.img file? I compiled the last msm8916-mainline kernel release (v6.3: the change log says it should support the UF896 stick), but couldn't generate the boot.img. Thanks!

@ddscentral
Copy link
Author

@lfgomez You can find kernel build instructions on OpenStick's Chinese wiki (use Google translate). They are somewhat incomplete, but it's not hard to figure out the missing parts.
First, you will have to build kernel .DEB packages and install them on the stick. This will generate an initrd image. You can then build boot.img with mkbootimg tool using kernel+dtb and initrd images.
The wiki suggests to use QEMU and chroot to ARM rootfs, but this is unnecessary. Simply installing the DEB packages on the stick with existing Debian installation will work just fine to generate the initrd.

I have tested mainline kernel 6.3-rc4 (mainline, not the msm8916 fork) on my UZ801 v3.0 and it appears to crash on boot, even though a dev who submitted a PR to mainline kernel with the DTS file for UZ801 v3.0 claims that the stick should fully work with the mainline kernel.
Without access to UART console it's hard to tell what exactly is wrong with that kernel though, it could be just a simple configuration issue.
Maybe you'll have better luck with the msm8916 fork on your UF896.

@185264646
Copy link

@lfgomez You can find kernel build instructions on OpenStick's Chinese wiki (use Google translate). They are somewhat incomplete, but it's not hard to figure out the missing parts. First, you will have to build kernel .DEB packages and install them on the stick. This will generate an initrd image. You can then build boot.img with mkbootimg tool using kernel+dtb and initrd images. The wiki suggests to use QEMU and chroot to ARM rootfs, but this is unnecessary. Simply installing the DEB packages on the stick with existing Debian installation will work just fine to generate the initrd.

I have tested mainline kernel 6.3-rc4 (mainline, not the msm8916 fork) on my UZ801 v3.0 and it appears to crash on boot, even though a dev who submitted a PR to mainline kernel with the DTS file for UZ801 v3.0 claims that the stick should fully work with the mainline kernel. Without access to UART console it's hard to tell what exactly is wrong with that kernel though, it could be just a simple configuration issue. Maybe you'll have better luck with the msm8916 fork on your UF896.

I'm the one who maintains the mainstream dts, do you mind PM me about the details? I have only tested a mainlined pmOS, which works as intended. It's recommended to read the relevant pmOS wiki page.

@ddscentral
Copy link
Author

ddscentral commented Jun 26, 2023

@185264646 Not sure which details do you mean.
A mainline kernel is supposed to run with all distros, not just postmarketOS. If one distro works, others should work too if the kernel config is correct.
If like you say mainline kernel has worked for you, it would be good to get the config file that you've used so I can test your DTS with a Debian installation.
Let's hope pmOS doesn't use major out-of-tree hacks to get things going. Alpine is not on my list of favorite distros (except for Docker containers).

@185264646
Copy link

185264646 commented Jun 26, 2023

@185264646 Not sure which details do you mean. A mainline kernel is supposed to run with all distros, not just postmarketOS. If one distro works, others should work too if the kernel config is correct. If like you say mainline kernel has worked for you, it would be good to get the config file that you've used so I can test your DTS with a Debian installation. Let's hope pmOS doesn't use major out-of-tree hacks to get things going. Alpine is not on my list of favorite distros (except for Docker containers).

Basically we use the same config, that is make msm8916_defconfig pmos.config. it should be generic enough for any distro. Some people in a forum has tested mainline kernel and it works. I want to know what firmwares has been replaced. Because it's known that it must use sbl1 from db410c unlike ufi001c(which does not need sbl1 from db410c) or it reboots as soon as rmtfs is up.

@ddscentral
Copy link
Author

ddscentral commented Jun 26, 2023

The SBL1 binary in my modded stick is from base.zip. Not sure where it was taken from. I assume it's from the UFI001C.
Would dumping one from the factory ROM help ? I have a second identical stick with stock Android on it.

Also, is it safe to swap just the SBL1 partition or would I need to reflash other sensitive partitions as well (hyp, rpm, tz, cdt) ? Sorry if this sounds noob-ish, just don't want to end up with a brick.

@185264646
Copy link

The SBL1 binary in my modded stick is from base.zip. Not sure where it was taken from. I assume it's from the UFI001C. Would dumping one from the factory ROM help ? I have a second identical stick with stock Android on it.

Also, is it safe to swap just the SBL1 partition or would I need to reflash other sensitive partitions as well (hyp, rpm, tz, cdt) ? Sorry if this sounds noob-ish, just don't want to end up with a brick.

Well, flashing any sbl1 is quite safe AFAIK. You only need to be careful when flashing tz and hyp since they must be paired, i.e., stock tz + stock hyp / db410c tz + db410c hyp(qhypstub). It'll brick before aboot (which provides fastboot interface) if you use other combination like stock tz+db410c hyp or db410c tz + stock hyp. CDT seems like an unused partition.

The base.zip should be okay. If you already flashed base.zip, sbl1 shouldn't be an issue.

@185264646
Copy link

@lfgomez You can find kernel build instructions on OpenStick's Chinese wiki (use Google translate). They are somewhat incomplete, but it's not hard to figure out the missing parts. First, you will have to build kernel .DEB packages and install them on the stick. This will generate an initrd image. You can then build boot.img with mkbootimg tool using kernel+dtb and initrd images. The wiki suggests to use QEMU and chroot to ARM rootfs, but this is unnecessary. Simply installing the DEB packages on the stick with existing Debian installation will work just fine to generate the initrd.

I have tested mainline kernel 6.3-rc4 (mainline, not the msm8916 fork) on my UZ801 v3.0 and it appears to crash on boot, even though a dev who submitted a PR to mainline kernel with the DTS file for UZ801 v3.0 claims that the stick should fully work with the mainline kernel. Without access to UART console it's hard to tell what exactly is wrong with that kernel though, it could be just a simple configuration issue. Maybe you'll have better luck with the msm8916 fork on your UF896.

Have you ever tried msm8916-mainline/linux.git? Does it work? Would you please bisect it if this fork is working while mainline is not? There are not too many downstream commits there and most of them are just dts changes so it shouldn't consume too much time.

@ddscentral
Copy link
Author

Ok, I will give it a try and report back.

@lfgomez
Copy link

lfgomez commented Jul 19, 2023

@lfgomez You can find kernel build instructions on OpenStick's Chinese wiki (use Google translate). They are somewhat incomplete, but it's not hard to figure out the missing parts. First, you will have to build kernel .DEB packages and install them on the stick. This will generate an initrd image. You can then build boot.img with mkbootimg tool using kernel+dtb and initrd images. The wiki suggests to use QEMU and chroot to ARM rootfs, but this is unnecessary. Simply installing the DEB packages on the stick with existing Debian installation will work just fine to generate the initrd.
I have tested mainline kernel 6.3-rc4 (mainline, not the msm8916 fork) on my UZ801 v3.0 and it appears to crash on boot, even though a dev who submitted a PR to mainline kernel with the DTS file for UZ801 v3.0 claims that the stick should fully work with the mainline kernel. Without access to UART console it's hard to tell what exactly is wrong with that kernel though, it could be just a simple configuration issue. Maybe you'll have better luck with the msm8916 fork on your UF896.

Have you ever tried msm8916-mainline/linux.git? Does it work? Would you please bisect it if this fork is working while mainline is not? There are not too many downstream commits there and most of them are just dts changes so it shouldn't consume too much time.

Yes, I was able to generate the boot deb file for the kernel and the boot image using the info of the address that @ddscentral replied. But I was unable to boot the stick with this image. After flash it, I always get a red led on and nothing more. I was able to revive the stick using EDL mode to flash a functional boot image. I have no idea what is the error during the boot as I don't have the Serial terminal output yet. If anyone has any other ideas, I can try on my stick.

@ddscentral
Copy link
Author

ddscentral commented Jul 19, 2023

Sorry, I did not have time to test the mainline kernel myself due to lack of free time.

@lfgomez What did you see on boot after flashing the kernel ? With the correct DTS file, you should have at the very least get a blinking red LED after power on (this indicates that the kernel is running). It would also be useful to change the green (or blue) LED trigger in the DTS file to mmc0. This would allow you to see if there's any disk activity during boot.

BTW, I have a fixed aboot.img with GPIO pins correctly assigned to match the UZ801's configuration. With this, you can boot to fastboot by holding the reset key during power on. Useful for testing kernels.

@jongerenchaos
Copy link

jongerenchaos commented Jul 29, 2023

@ddscentral Thanks for all your work. I flashed succesfully my UZ801 V3.2 stick. After flashing with your very good manual https://zebra.ddscentral.org/pub/downloads/openstick/firmware/uz801_v30/README it works but there are three problems:

  • The wifi connection is very slow (in AP modes with hostapd) max 2MB/sec
  • Also the 4G/LTE connection is also very slow (also max 2MB/sec), tested with the USB ethernet connection and WIFI. With the original firmware i get 30MB/sec.
  • UPDATE ISSUE SOLVED (with linux not windows) ADB is not working anymore (i can't use it also not with holding the button on booting)
    I upgrade this stick to bookworm with a apt dist-upgrade command.

What can i do to resolve these issues?

WIFI config:
`interface=wlan0
driver=nl80211
ssid=example
channel=1
hw_mode=g
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0

wpa=2
wpa_passphrase=pass
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
obss_interval=1

ieee80211n=1
ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40][SMPS-STATIC][DSSS_CCK-40][MAX-AMSDU-3839]`

@ddscentral
Copy link
Author

ddscentral commented Aug 1, 2023

@jongerenchaos What's the overall stability of the device other than the issues you've mentioned ? Any spontaneous reboots/crashes ?
Also, what firmware did you use for WiFi and LTE ? Did you dump your own or used mine ?
ADB should run at boot, not sure why it doesn't work for you.
I've disabled ADB on my stick as I use USB in host mode with some extra storage connected.
For button to work at boot, you need to reflash the bootloader.
Glad to hear bookworm works :) Haven't tried any major OS upgrades on my stick yet.

My hostapd.conf looks like this

interface=wlan0
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface=/run/hostapd
ctrl_interface_group=0
country_code=**
hw_mode=g
channel=6
beacon_int=100
dtim_period=2
max_num_sta=10
rts_threshold=-1
fragm_threshold=-1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
ieee80211n=1
ht_capab=[SHORT-GI-20] [GF] [DSSS_CCK-40] [LSIG-TXOP-PROT]
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1
auth_algs=1
wpa=2
ssid=******
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_passphrase=******

I've replaced the sensitive bits with asterisks.

@jongerenchaos
Copy link

@jongerenchaos What's the overall stability of the device other than the issues you've mentioned ? Any spontaneous reboots/crashes ?

Yeps it is not stable. The LTE connection lost his connection after some minutes

Also, what firmware did you use for WiFi and LTE ? Did you dump your own or used mine ?

I used yours and i didn't make a backup. I ordered a new one to save this files and use them on this stick. So maybe that's the reason that this not work properly....

ADB should run at boot, not sure why it doesn't work for you. I've disabled ADB on my stick as I use USB in host mode with
some extra storage connected. For button to work at boot, you need to reflash the bootloader.

Flashboot works after some extra tests (only for me on linux), so i can reflash it...

Glad to hear bookworm works :) Haven't tried any major OS upgrades on my stick yet.
;)

I will try your wifi config and i let you know the results

@ddscentral
Copy link
Author

ddscentral commented Aug 2, 2023

@jongerenchaos WiFi issues may also be caused by mismatched firmware and/or NVRAM. You can try out my hostapd config. If it doesn't fix your WiFi issues, you will need to wait for the second stick to arrive to get the correct firmware and NVRAM from it.
As for LTE, you will need to wait for the second stick to dump the modem firmware.
Let's hope your second stick will have the same board revision.

@wokawoka
Copy link

wokawoka commented Aug 2, 2023

I have a UZ801 V3.0 stick that is still running the original firmware and I would like to get a dump of it.
Do you by chance know a link with some hints on how to do that with edl?
Thank you

@ge0rg
Copy link

ge0rg commented Aug 7, 2023

I've got two V3.2 sticks and was lucky enough to want a full test of the first one before flashing the second one, so it's still untouched beyond enabling adb via http://192.168.100.1/usbdebug.html . I have a root shell and adb access, and I'm willing to dump files from it. I'd be glad to get instructions, and will browse the rootfs otherwise when I find some time.

@jongerenchaos
Copy link

Full backup more info: https://forum.xda-developers.com/t/guide-full-phone-backup-without-unlock-or-root.1420351/

For only the files for using debian

  1. Enable ADB
  2. Backup WIFI firmware (adb pull persist) and copy them to the ddscentral image, step 2
  3. Backup Modem files (adb pull firmware) and copy them to the ddscentral image, step 1

@ge0rg
Copy link

ge0rg commented Aug 7, 2023

Thanks @jongerenchaos. I've pulled persist, and WCNSS_qcom_wlan_nv.bin is unchanged since 3.0 (same SHA1). I also get ~6MB/s over client-mode WiFi with that, as opposed to ~2MB/s with the one bundled with the Debian image.

EDIT: ATTENTION! The below is not from a V3.2 but from a V3.0 stick!

Quite a few files are changed in /firmware/image, I've dumped them to https://op-co.de/tmp/firmware-image-3.2.tar.xz and copied them over root@openstick:/lib/firmware/, and now the modem status is alternating between "enabling" and "disabled". With the 3.0 modem files, I was able to connect with one of two SIMs I tested, while the other SIM was (edit follows) showing as "enabled" but not providing an IP address on the wwan interface.

@ge0rg
Copy link

ge0rg commented Aug 8, 2023

Using the 3.0 firmware files, ModemManager is looping through this every minute for a while before giving up:

Aug 08 07:51:14 openstick ModemManager[308]: <info>  [modem0] 3GPP registration state changed (unknown -> idle)
Aug 08 07:51:37 openstick ModemManager[308]: <info>  [modem0] simple connect started...
Aug 08 07:51:37 openstick ModemManager[308]: <info>  [modem0] simple connect state (4/8): wait to get fully enabled
Aug 08 07:51:37 openstick ModemManager[308]: <info>  [modem0] simple connect state (5/8): register
Aug 08 07:51:53 openstick ModemManager[308]: <info>  [modem0] 3GPP registration state changed (idle -> unknown)
Aug 08 07:51:53 openstick ModemManager[308]: <warn>  [modem0] couldn't load operator code: Current operator MCC/MNC is still unknown
Aug 08 07:51:53 openstick ModemManager[308]: <warn>  [modem0] couldn't load operator name: Current operator id is still unknown

The SIM didn't need any special config with the original Android firmware on that dongle, so there must be something missing in the drivers or firmware or config.

@ddscentral
Copy link
Author

ddscentral commented Aug 8, 2023

@ge0rg Did you copy region-specific mcfg_sw.mbn from image/modem_pr ? I'm asking because this step is somewhat unuintuitive and easy to skip accidentally. I'm not entirely sure whether it's absolutely necessary though.

As for other issues, WiFi is indeed somewhat slow'ish, about 14-16mbits/s but I only tested using a WiFi to Ethernet bridge (repurposed cheap router) with a plasterboard wall between the stick and the bridge. Will try testing directly to see if performance remains the same.
Modem itself does about 5-16 mbits/s down (with speedtest-cli, depending on server) and about 1 mbits/s up. Not bad considering the poor reception and the quality of the stick's LTE antenna.

@ge0rg
Copy link

ge0rg commented Aug 8, 2023

@ddscentral I tried modem_pr/mcfg/configs/mcfg_sw/generic/common/default/default/mcfg_sw.mbn as well as common/row as there is no specific config file for EU/Germany, but it didn't have any effect, the error message remains the same. Neither did setting the APN via mmcli or qmicli help.

For reference, I was able to do LTE at 90Mbit/s down, 50Mbit/s up via USB rndis on the Android firmware. I'll post comparison numbers with Debian as soon as I get this SIM card to work, but I have zero experience with debugging mobile modems, all my Hayes knowledge is from the 1990s ;)

P.S: could you add Provides: wireguard-modules (= 1.0.0) to your kernel .deb next time you recompile? :)

@asvdvl
Copy link

asvdvl commented Jan 21, 2024

Can anyone please share a stock EDL dump for UZ801_v3.0 (board like the one on photo). My stock image is lost and SIM is constantly in "power state: off", no matter what I try.

I created this repository already half a year ago, the only thing is that the image is a little broken (read the release description) but overall it works

@cashin79
Copy link

I have both versions uz801_v3.0 and uz801_v3.2, I flashed them with Openwrt, they are actually both working good except for the WiFi speed which I noticed is slower than stock ROM, both sticks are identical and can run the same firmware just make sure to dump the modem.bin and restore later to /lib/firmware.
I noticed that v3.0 has an esim hardware unlike v3.2.
I heard getting esim to work under openwrt is a pain so I am going to restore the original android ROM of the stick and try to get it to work.

@ttimasdf
Copy link

WiFi speed which I noticed is slower than stock ROM

Maybe it's because openwrt is using open source drivers instead of the proprietary ones in Android. The driver issues also exists in many android phones and routers when community try to port Linux/AOSP to them..

@AlienWolfX
Copy link

AlienWolfX commented Mar 7, 2024

UZ801_v3_0

Can anyone please share a stock EDL dump for UZ801_v3.0 (board like the one on photo). My stock image is lost and SIM is constantly in "power state: off", no matter what I try.

I have a firmware dump with a board the same as you

@tytoalba99
Copy link

tytoalba99 commented Mar 18, 2024

Hi, I entered in adb mode by clicking /usbdebug.html just for curiosity but never planed to hack my UZ801 v3.0 device, and I didn't tried it.
Now the Wifi/4G leds work but no wifi network is created and the USB isn't recognized in my computer as a tethering device.

How can revert to functional state with stock rom as before ?

Thanks in advance

@asvdvl
Copy link

asvdvl commented Mar 18, 2024

Hi, I entered in adb mode by clicking /usbdebug.html just for curiosity but never planed to hack my UZ801 v3.0 device, and I didn't tried it. Now the Wifi/4G leds work but no wifi network is created and the USB isn't recognized in my computer as a tethering device.

How can revert to functional state with stock rom as before ?

Thanks in advance

As far as I know usbdebug.html is a temporary thing, and to get everything back you just need to reboot the modem by turning off the power from it, I can also say for sure that when usbdebug is turned on, the modem functionality continues to work and what you described clearly should not happen, unless you removed the system from emmc via fastboot or edl
If this is really the case, then all you have to do is use fastboot or edl to restore the modem

@ddscentral
Copy link
Author

I still have a stock unmodified UZ801 V3.0 stick. I will try to find some time to grab a full dump if anyone needs it.

@mikki8
Copy link

mikki8 commented Apr 27, 2024

IMG_20240427_170624495_1.jpg

Recoverable?

@gabronick
Copy link

gabronick commented Apr 27, 2024

I have both versions uz801_v3.0 and uz801_v3.2, I flashed them with Openwrt, they are actually both working good except for the WiFi speed which I noticed is slower than stock ROM, both sticks are identical and can run the same firmware just make sure to dump the modem.bin and restore later to /lib/firmware. I noticed that v3.0 has an esim hardware unlike v3.2. I heard getting esim to work under openwrt is a pain so I am going to restore the original android ROM of the stick and try to get it to work.

what version did you flash @cashin79 ?

@cashin79
Copy link

what version did you flash @cashin79 ?

Immortalwrt

@asvdvl
Copy link

asvdvl commented May 12, 2024

Sorry for being off-topic, but my modem’s wifi died, and I want to find something more reliable, can you please tell me where I can find lists of devices on which I can install aka mobian (the main thing is not openwrt, I’m tired of it, maybe something like debian) and use them As a portable 4G router, having a battery and working without a week of setup will be a plus. Thank you.

@pkkrusty
Copy link

pkkrusty commented Jul 6, 2024

@ddscentral you stated earlier in this thread:

For modem to work, you will need to dump modem firmware files from stock ROMs modem partition and copy them to /lib/firmware
You need the following files: modem.* mba.mbn and likely also mcfg_sw.mbn (located in image/modem_pr, region specific).
I would also suggest dumping and copying the WiFi firmware files (wcnss.*) as well.

How do I open up the modem.bin file that edl tool got for me? I dumped all partitions before flashing.

@AlienWolfX
Copy link

@ddscentral you stated earlier in this thread:

For modem to work, you will need to dump modem firmware files from stock ROMs modem partition and copy them to /lib/firmware You need the following files: modem.* mba.mbn and likely also mcfg_sw.mbn (located in image/modem_pr, region specific). I would also suggest dumping and copying the WiFi firmware files (wcnss.*) as well.

How do I open up the modem.bin file that edl tool got for me? I dumped all partitions before flashing.

You can extract it with binwalk

@ddscentral
Copy link
Author

@ddscentral you stated earlier in this thread:

For modem to work, you will need to dump modem firmware files from stock ROMs modem partition and copy them to /lib/firmware You need the following files: modem.* mba.mbn and likely also mcfg_sw.mbn (located in image/modem_pr, region specific). I would also suggest dumping and copying the WiFi firmware files (wcnss.*) as well.

How do I open up the modem.bin file that edl tool got for me? I dumped all partitions before flashing.

You can mount the image file in Linux.
Or use 7-zip.

@pkkrusty
Copy link

pkkrusty commented Jul 6, 2024

Ah got it. Renamed the file modem.iso and then sudo mkdir /mnt/test and then sudo mount -o loop modem.iso /mnt/test

Thanks!

@pkkrusty
Copy link

pkkrusty commented Jul 6, 2024

Next question: I was using wvthoog.nl's debian build (bookworm) but his file server is down currently. I have two Z801 V3.0 dongles, one with his debian version installed correctly, and one stock. I have dumped all partitions from the stock stick using edl and I'd like to flash with debian. Is there a way to copy from the finished debian stick to the stock stick? I dd'd the /dev/mmcblk0 from the debian stick, which pulled everything bit for bit, right? How would I flash that data to the stock stick?

@cashin79
Copy link

cashin79 commented Jul 6, 2024

Next question: I was using wvthoog.nl's debian build (bookworm) but his file server is down currently. I have two Z801 V3.0 dongles, one with his debian version installed correctly, and one stock. I have dumped all partitions from the stock stick using edl and I'd like to flash with debian. Is there a way to copy from the finished debian stick to the stock stick? I dd'd the /dev/mmcblk0 from the debian stick, which pulled everything bit for bit, right? How would I flash that data to the stock stick?

I believe edl has functions to read and write firmwares

edl rf flash.bin -> to dump whole flash for device with emmc

edl wf dump.bin -> to write the rawimage dump.bin to flash

@pkkrusty
Copy link

pkkrusty commented Jul 7, 2024

Can confirm that edl wf dump.bin worked correctly. Thanks!

@qbranchco
Copy link

Hi @ddscentral, I'm trying to build a new "known clean" debian image with the latest kernel to flash, as it seems that the current one that has had kernels appended to it has some weirdness, packages missing etc.

I'd be down to set up some form of Gitlab CI pipeline to pump these out on the regular, but don't know how where a known working kernel is, or how to get the first bit of image created and kernel installed.

Do you have any pointers?

Thank you!

@parzival-space
Copy link

is there somewhere a more up-to-date documentation on how to create an updated rootfs.img and boot.img for the current debian version?

@pkkrusty
Copy link

pkkrusty commented Aug 21, 2024

I'm continuing to run into the problem of the modem not working. The board has UZ801_V30 printed on it, but if I pull info from the modem using sudo mmcli -m ANY I get

Model: 4094
Revision: UZ801_V01R01B08 1 
SVN: 01

Does this match what other folks have? Should note that with stock firmware the modem works fine. I've even copied the recommended files over from the modem.bin that I pulled off my stick. Feels like it must be a modem driver issue. Are there no other files to copy over from the stock firmware other than the modem.* mba.mbn and likely also mcfg_sw.mbn?

Also note: I'm in West Africa, so maybe the SIM cards here are somehow different than Europe or US...but the fact that it all works with stock firmware makes me lean towards the firmware files being the problem.

@pkkrusty
Copy link

is there somewhere a more up-to-date documentation on how to create an updated rootfs.img and boot.img for the current debian version?

@parzival-space https://wvthoog.nl/openstick/ has done the work to update the image to bookworm.

@parzival-space
Copy link

is there somewhere a more up-to-date documentation on how to create an updated rootfs.img and boot.img for the current debian version?

@parzival-space https://wvthoog.nl/openstick/ has done the work to update the image to bookworm.

I know, but sadly they didn't document the process in doing so... I am currently able to build the Kernel and roots but fail to load the devicetree correctly.

@pkkrusty
Copy link

Followup: I flashed a openWRT image I found online, and that returns firmware revision: UZ801_V3.0_21_V01R01B10 when I do mmcli -m 0. The drivers listed for the modem are rpmsg_chrdev, bam-dmux. This differs from the debian image provided at wvthoog.nl site.

I can turn on and enable the modem, which is more than I could do before.

I'm continuing to run into the problem of the modem not working. The board has UZ801_V30 printed on it, but if I pull info from the modem using sudo mmcli -m ANY I get

Model: 4094
Revision: UZ801_V01R01B08 1 
SVN: 01

Does this match what other folks have? Should note that with stock firmware the modem works fine. I've even copied the recommended files over from the modem.bin that I pulled off my stick. Feels like it must be a modem driver issue. Are there no other files to copy over from the stock firmware other than the modem.* mba.mbn and likely also mcfg_sw.mbn?

Also note: I'm in West Africa, so maybe the SIM cards here are somehow different than Europe or US...but the fact that it all works with stock firmware makes me lean towards the firmware files being the problem.

Update: I needed to strictly follow directions from others, and actually copy the files from the modem partition to /lib/firmware. After I did that, the firmware version was more recent, and the modem was enabled. Now the problem is that the IMEI got lost. Seems like i can get it back by re-flashing stock firmware, but I need to get it re-written with the debian image. Then all my problems will be solved.

@pkkrusty
Copy link

Tried a different stick, starting from stock and IMEI was preserved. After moving modem.bin files into place, it works! Now I need to figure out routing for clients who join the hotspot to have net access.

@ddscentral
Copy link
Author

Congrats !
Setting up basic routing isn't complicated, there are tutorials available online.
For simple DHCP/DNS, dnsmasq will do the job.
I personally prefer BIND with encrypted DNS proxies (dnss and dnscrypt) as backends, but it's not trivial to setup.

@kinsamanka
Copy link

I've created a shell script that builds the latest debian image using the kernel provided by postmarketOS.

See here.

Note that the firmware blobs for the modem and wifi are not included. They must be extracted from the original firmware.

@ddscentral
Copy link
Author

ddscentral commented Sep 18, 2024

@kinsamanka Wow, great work. Well, mine still runs on 5.15 kernel and works fine, don't want to mess with it right now.
I have another one with stock firmware, perhaps will try on that one after creating a full flash dump.

It would be a good idea to add short instructions on how to run the build locally instead of the cloud. Not a problem for me (I can read scripts), but would still be useful as not everybody uses github or has an account. Also, some folks may just prefer building locally.

@Irshadsamejo
Copy link

I have both versions uz801_v3.0 and uz801_v3.2, I flashed them with Openwrt, they are actually both working good except for the WiFi speed which I noticed is slower than stock ROM, both sticks are identical and can run the same firmware just make sure to dump the modem.bin and restore later to /lib/firmware.
I noticed that v3.0 has an esim hardware unlike v3.2.
I heard getting esim to work under openwrt is a pain so I am going to restore the original android ROM of the stick and try to get it to work.

Hi i want to flash OpenWRT on my fy UZ801 v3.2 can you help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests