Openwrt internet via USB from Huawei E5577 or similar devices

If you have a 3G/4G USB dongle, which is not battery operated, just a USB stick, you might want to check out the instructions here

The device I am using at the minute is the ZTE MF920U, I have also used a bunch of similar Huawei devices, they all work in exactly the same way

Start by installing a few packaged, hopefully you are familiar with loggin in with SSH, if not, you can get those packages from within the software section of the luci interface

opkg update && opkg install kmod-usb-net-rndis kmod-usb-net kmod-usb2 usb-modeswitch kmod-usb-net-cdc-ether

Once those are installed, reboot, then login to luci

Connect the 4G modem via USB, then Go to interfaces, then add a new interface, select the new eth device that appeared, give it a name, and you are all good to go

C16-PD-QI Power Bank from banggood

This review of the C16-PD-QI Removable 16-section Power Bank Shell Mobile Power Bank Assembly Kit Diy18650 Battery Box Wireless&Quick Charging Version also serves as a guide because I am not very good at keeping user’s manuals and data about the hardware I have.

Experiment number one, at what voltage does it stop charging, most chargers would stop at 4.2V which is the full voltage, while better chargers stop before that voltage, which is better for battery longevity !

Result: I had a few similar power banks that overcharged the batteries (Not good for the batteries), the C16-PD-QI bank stops charging at 4.2V on the dot, which is the maximum most batteries can handle, it’s not great, I would rather the charging stops at 4.18 for example (Or even lower)

Experiment number two, The wireless charger

Experiment number three, do any of the chips overheat

Does it accept a charge in QuickCharge

we already know it can quick charge devices, but also, on the box, multiple voltages are stated as input, so here I’m checking if it can get charged in quick charge

Specifications of the power bank !

The power bank specifications on the website seem to be different than the specifications on the back of the charger ! Close enough though

* Model: C16-PD-QI
* Wireless & Quick Charging Version: maximum power: 5V-3A 9V-2A 12V-1.5A 3.4V-5.5V-5A, wireless charging 10W
* Applicable battery: 18650 battery (length 6.5cm, straight down 1.8cm) But you could adapt other types of batteries as long as they are Lithium with similar chemistry !
* Note: The appearance of the battery should not be damaged, and the voltage should be between 3.2-4.2V. (Not sure what this is supposed to mean)
* Size: 44*80*186 mm

Backside of power bank

Power Bank
Model: C16-PD-Qi
OUTPUT: 9V-2A , 12V-1.5A , 4.5V-5A 5V-4A
WIRELESS CHARGING : 10W
INPUT: 5V-3A 9V-2A 12V-1.5A

Maximum charged battery voltage

I have previously bought power banks that are for laptops from this very same website, there was a little problem with those power banks, they charged the batteries above 4.2 volts, which is not good for the batteries, I would rather a power bank that charges my batteries a bit below the absolute maximum of most batteries, So here is my experiment with this power bank

The problem with used batteries connected in parallel

The best practice is to use factory matched batteries for this power bank, even though the actual capacity and internal resistance of the batteries is irrelevant (You can mix and match since they are in parallel), this does not apply to charging, lithium batteries are charged with a variable voltage depending on the current state of charge, batteries with less capacity will artificially deceive the chip into thinking we are at a higher state of charge, forcing the charger to up the voltage, where the better higher capacity batteries will suffer (The will produce more heat than designed, and cook themselves slowly to the capacity of the lower ones)

Remax TWS-10 Plus, not bad for $10 earphones

I got a pair of small speakers, the Remax-10 Plus which are priced at $10 !!! they come with a power bank to recharge the earpods, and a pair of earpods that simply work, the sound on the other end of the conversation is lower than when you are using the handset, but if you raise your voice a little, they work fine for me

the battery life is more than you might need, and the box (Power bank box) is small and can recharge the speakers a few times

the only thing that is annoying about it is that it charges with an iPhone cable, one of which is indeed shipped with the box, but i would have preferred a USB C cable !

Anyway, I am creating this post so that i can tell you a bit about the speaker, but more importantly because i need the user manual handy 😉 since i accidentally switched to Chinese and now i want to switch back again, so i had to look for the manual that came with it!

REVIEW: UGREEN HiTune X5 TWS earbuds

UPDATE: After around 2 months of using the earbuds, I am facing no problem, calls are clear, battery life is good, the difference in price between those and the $10 remax speakers is definitely worth it ! if i have one complaint about them is that using the touch button (the whole part of the speaker outside the ear is a button) takes some getting used to, I will also post the instructions on how to use them here.

After trying the $10 Remax TWS-10 Plus, i decided to check out and review the $40 UGREEN HiTune X5 TWS earbuds with Qualcomm aptX

The earbuds come with 4 sizes of ear tips, x-small, small, medium and large

  • HiTune X5 True Wireless Stereo Earbuds
  • Qualcomm chipset: True Wireless Mirroring  tech with the Qualcomm QCC 3040
  • Version: Bluetooth 5.2
  • ENC noise cancelling
  • Frequency range: 20Hz-20KHz
  • Latency: 70ms
  • 4 microphones with cVc 8.0 Noise Cancelling Technology
  • Ipx5 waterproof
  • 70ms ultra low delay  for  game mode
  • Profiles: HSP, HFP, AVRCP, A2DP
  • Bluetooth Frequency: 2400MHz-2483.5MHz
  • Bluetooth Range: 10m
  • Codec: Qualcomm® aptXâ„¢, AAC, SBC
  • Speaker Impedance: 32Ω±15%
  • Speaker Sensitivity: 100±3dB
  • Driver Speaker (Dynamic driver): 10mm PU + Peek Diaphragm
  • Operating Time: 7h music play on a single charge, 21h case, total 28h music play with charging case
  • Charging case capacity: 400 mAh
  • Earbud battery capacity: 40 mAh
  • Charging case input: 5V=320mA
  • Charging case output: 5V=100mA
  • lithium polymer battery
  • Charging port: USB-C
  • Fully charge the earbuds: 1.5H
  • Fully charge the case: 2H
  • Earbuds dimensions: 21.926.328.6mm
  • Package Dimensions: 100*139*44mm
  • Net Weight: 5.1g(0.18oz)
  • Total Weight: 47.6g(1.68oz) in the box
  • Waterproof: IPX5

with the HiTune X5 earbuds, the box contains 4 x Interchangeable Ear Caps, a charging cable, a charging case, and a user’s manual

Up to now, the Microphone is much nicer than the Remax, in the car, with the AC on at medium, the other party had no complaint’s about sound quality.

Even though the processor, the Qualcomm QCC 3040 is the most relevant chip in the earbuds, the truth is, the quality of the other components is very important, the microphones, the speakers, the power bank, etc… so it is very hard to endorse any other pair of earbuds simply because they have the same chipset.

A simple google search yeilded many other earbuds that use the same chipset, but again, having the same chipset does not mean much…

  • EarFun Free 2
  • Tribit Qualcomm QCC3040
  • Tronsmart Onyx Ace Pro
  • SoundPEATS Air3

Shrinking a disk partition under Debian 11 bullseye

As usual, I will start by getting to the bottom of it, then explain everything

first, you need to first shrink the file system, then the partition where the filesystem resides, replace /dev/sda4 with whatever you partition is named

1- Shrinking the filesystem

Unmount the partition to be resized,

umount /mountpoint

otherwise you will get a message such as

Filesystem at /dev/sda4 is mounted on /mountpoint; on-line resizing required
On-line shrinking from 30453104 to 98098 not supported.

The following commands are relevant to the program resize2fs, they are hands on examples of use, take a close look at the description of what each does before you proceed by picking how you want to use the command.

* Show the minimum size we can squeeze this partition to without losing data
resize2fs -P /dev/sda4
* do the filesystem resize to the MINIMUM possible size (the number you ended up with in the previous command)
resize2fs -M /dev/sda4

The command above moves all data to the beginning of the filesystem/drive, then shrinks it to the smallest possible size.

2- Shrinking the partition

2.1- Find the boundaries of the file system with fdisk

3- You are DONE

If this is it, why is there much more in this tutorial, Simply put, what is above does very little explaining, if you want to understand what we did, you will need a bit more

the assumption, I have a partition that only has 5% data, I would like to shrink the partition to ten percent of it’s size.

Unlike windows, where your luck of where the data resides, you can always shrink a Linux partition to whatever size fits the data that is on it (without losing data)

in this tutorial, I will assume the partition is /dev/sda4, you will need to replace that with whatever your partition is.

1- collecting information about our partition

fdisk /dev/sda
then the p command for print

df -h
this should show you all the partitions, info about them and where they are mounted and how much space is used

the file system can be shrunk with resize2fs

the command “resize2fs -M” should first move the data to the beginning of the drive, then shrink it

first, how large is the file system ATM
tune2fs -l /dev/sda2 then multiply by block size

New firmware for my Western Digital “My Book Live” NAS storage device

The WD My Book Live is a NAS device based on Debian Linux, Since Debian stopped supporting this processor (APM82181), the device has received no updates and will probably never, so the next best thing to do in my opinion is to install openWRT.

WARNING: I recently got a second MyBook Live device, tried installing 23.05.0 but for some reason, i could not get networking to work, So i simply installed V21, then upgraded to 23… there was probably just something I was missing, but i could not be bothered figuring it out, this was a faster way…

Before you start

1- Only the first few paragraphs of this tutorial (STEPS 1 THROUGH 6) are the instructions you need, the remaining is just for extra reference and in short you don’t need to read it to have your device running, but I do recommend YOU SKIM THE WHOLE THING BEFORE YOU START.
2- This procedure requires you to take the disk out and install it on a PC to switch the firmware, then put it back
3- The upgrade will delete all your data, You will need to move your data that is already on your WD NAS drive somewhere else while the upgrade is ready.

Step 1: Move any existing data BEFORE TAKING APART.

Move any data you may have on the drive to a temporary location outside the NAS drive. this has to be done before taking the drive apart as the unconventional 64 kB block size of the disk will be nothing but trouble if you want to extract the data while mounting the disk to a linux PC for example.

Step 2: Take the disk apart

I have included photos to help you do that, it is not rocket science.

Step 3: Mount the disk on a linux PC (Windows and MAC should work)

and mount it to a linux PC (Windows might work with software such as etcher, but i have no guarantees).

Step 4: Download the openWRT firmware

Go to the drive’s page on the openwrt website (Here), and download it to your Linux (Or windows) PC

Step 5: Write the firmware to the disk.

Decompress the file, then copy it to the drive with a command similar to the command below, but make 100% sure to replace sdx with your own drive designation

 dd if=/root/wdsata.img of=/dev/sdx bs=64k

Write the firmware to the disk, overwriting it, and effectively loosing any data you did not backup in step 1

Step 6: Put the drive back in the enclosure

Nothing to say here, this is the reverse of step 2

Once it is in the enclosure, you can not just connect it to your router as it in itself has this port defined as 192.168.1.1 and is serving dhcp !

Step 8: Create the data partition

At this stage, your device will boot, but you will need to create/expand the data partition, the partition that should not be overwritten when you upgrade the firmware for example.

opkg update
opkg install gdisk blkid openssh-sftp-server block-mount
gdisk -i /dev/sda

As soon as gdisk opens, you may be presented with the following message, if so

Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT

Chose 1 to maintain the 2 partitions we have, Now hit the command (w) to write and confirm, then quit, gdisk has just switched your disk to GPT from MBR, now run gdisk again the same way (gdisk -i /dev/sda)

n for new partition, accept the (3) for partition number, use the number (2097152) for alignment with 4K sector advanced format nearest to the 1GB mark

mkfs.ext4 /dev/sda3
mkdir /share
blkid /dev/sda3

You might find a file named fstab in /etc, this is not the file that needs to be edited, the one you are seeking is in /etc/config/fstab in my case, the UUID was as follows UUID=”9643bd00-f117-4074-a252-7ea30a5174e2″ yours will certainly be different, so in my fstab i added the following lines near the end

config mount
option target '/share'
option uuid '9643bd00-f117-4074-a252-7ea30a5174e2'
option enabled '1'

Now, network sharing is what i was originally interested in when i got this unit, and it is why I am replacing it’s firmware, so to installing samba

opkg update && opkg install samba4-server luci-app-samba4

Now, add the following line to /etc/passwd to add me as a user to the system

yazeed:*:1000:65534:yazeed:/var:/bin/false

Or, if you do not want to add the user manually, you can install the adduser package, and add the users through it like so

opkg install shadow-useradd
useradd yazeed
Unfortunately, this command won't do and you will have to edit it in the passwords file

Now, for either method from the above, run the command

passwd yazeed
smbpasswd -a yazeed

Now, since this is a NAS device, disk tools may be a good idea

opkg install hd-idle luci-app-hd-idle hdparm

To check if disk is spinning, try the command
hdparm -C /dev/sda
The responce active/idle means it is spinning

You are done.

FAQ

Is the hardware and the new openWRT firmware compatible with my 8TB hard drive

Yes it is, I have found many people asking if the hardware supports drives over 2TB, the answer is yes, but you will have to use the GPT rather than the MBR (See steps above)

about the original firmware

What is that vulnerability about

it comes from WDs cloud service, bottom line is that many devices were completely wiped remotely by malicious users and it is unknown if the data itself leaked, so yes, it is very serious

What is the difference between quick factory restore and full factory restore

Quick factory restore is probably what you are looking for, the later seems to do a zero fill on the hard drive after performing a factory restore to disallow data retrieval (For example before you sell it), you can verify this by logging in using SSH, and by the fact that the tool tips state something to that effect.

Inspecting the device

To begin with, I logged in via SSH and inspected some stuff, to enable SSH access on the My Book Live original firmware, you will need to visit a page at a URL such as http://mybooklive/UI/ssh or http://192.168.2.116/UI/ssh (Replace the IP with your own)

the system is based on the following CPU

CPU
processor       : 0
cpu             : APM82181
clock           : 800.000008MHz
revision        : 28.130 (pvr 12c4 1c82)
bogomips        : 1600.00
timebase        : 800000008
platform        : PowerPC 44x Platform
model           : amcc,apollo3g
Memory          : 256 MB

With that out of the way, A look at /etc/apt/sources.list revealed that it is a Debian Distro, the only problem with this is that debian stopped supporting this CPU some time ago, so you can’t go past Debian 8 (Jessie)

deb http://ftp.us.debian.org/debian/ squeeze main
deb http://ftp.us.debian.org/debian/ wheezy main
#deb-src http://ftp.us.debian.org/debian/ wheezy main
#deb http://ftp.us.debian.org/debian/ sid main

Checking the disk info with hdparm revealed that the disk is a WDC WD20EARX-00PASB0, which is as i expected a Caviar Green (SMR disk)

parted (The new fdisk so to speak) shows the following partition scheme for the existing system.

Model: ATA WDC WD20EARX-00P (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name     Flags
 3      15.7MB  528MB   513MB   linux-swap(v1)  primary
 1      528MB   2576MB  2048MB  ext3            primary  raid
 2      2576MB  4624MB  2048MB  ext3            primary  raid
 4      4624MB  2000GB  1996GB  ext4            primary

And a “df -h” reveals

Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              1.9G  555M  1.3G  31% /
tmpfs                 5.0M     0  5.0M   0% /lib/init/rw
udev                   10M  6.7M  3.4M  67% /dev
tmpfs                 5.0M     0  5.0M   0% /dev/shm
tmpfs                 100M  4.6M   96M   5% /tmp
ramlog-tmpfs           20M  4.5M   16M  23% /var/log
/dev/sda4             1.9T  2.1G  1.9T   1% /DataVolume

A good alternative for this Gigabit Lan network attached storage might be openWRT, the same firmware I use for my routers !

there are things you need to know in advance though, first of which is that changing the firmware will require you to delete everything on the drive ! as Western Digital have used an unconventional bunch of things such as a 64 kB block size !

With that out of the way, you can skip down to the installing openWRT about the upgrade process step by step (Including backing up your system), then come back to why etc…

What if i want to revert back to the WD software ?

That is indeed a good question, and to make it easy to do that, I have already backed up the entire disk to another while I am sure that i don’t want to go back. Also worth mentioning that the latest firmware on the WD website dates back to 2015 ! which is at the time of writing 6 years ago !

Where can i find the up to date openWRT distribution for this drive ?

OpenWRT has a page dedicated to this drive, both the single and the Duo here (https://openwrt.org/toh/western_digital/mybooklive)

What are the benefits of the NAS box (enclosure), why not just take out the hard drive and put it in a PC somewhere.

The Western Digital My Book Live has a super low power CPU, and when the disk is spun down, it consumes very little energy (Not a significant load to your UPS for example), It is also fan-less, so it is with the exception of the spinning drive when it is spinning silent, which is also a nice thing, So i would argue that keeping it by updating it’s software is a good idea

Another reason is the amount of relevant software provided through openWRT packages, covering many more things than the original firmware (miniDLNA included).

Errors and resolution

1- I have this error that i have not resolved yet

mv: setting attribute 'user.DOSATTRIB' for 'user.DOSATTRIB': Permission denied

2- The NAS box will not accept many files that windows creates such as Thumbs.db, to allow such files to be stored, This can easily be resolved by editing the samba template and commenting the “veto” files line, then make sure the config is regenerated from the template

How do i keep the system up to date

If you come from a debian background, you would normally apt-get update then apt-get upgrade and that is that, in OpenWRT, there is no such upgrade command, the upgrade command in openWRT is meant to upgrade 1 package specified by name, so the solution is the following line

 opkg list-upgradable | cut -f 1 -d ' ' | xargs -r opkg upgrade

Bluetooth Audio Transmitter from 3.5 Audio Jack

I have an android TV box with no Bluetooth, installing Bluetooth dongles to it does not work, So i got a nice little Bluetooth transmitter that receives audio from a regular headphones jack, and transmits it to a Bluetooth speaker ! the YET-TX9 (Amazon for $19 but i have my doubts it is the best option)

Please note: As an Amazon Associate I earn from qualifying purchases such as the one above.

There is no user’s manual inside, the instructions are, as you can see, printed on the box.

Will come here and add the details as soon as i try it out

Forcing color change for visited links

Do you remember the days when your browser would always tell you what links you have followed before ?

For a very long time now, CSS has allowed webmasters to chose the same color for the link that has been visited as the link you have never visited, favoring aesthetics over functionality, well that is okay, but i don’t like it that way, so what to do

As a firefox user, I have an option to create a file inside my firefox profile ({firefoxProfile)/chrome/userContent.css), but it will not work out ofg the box, you also need to open about:config, then switch “toolkit.legacyUserProfileCustomizations.stylesheets” to true

That’s it, but you might also need to restart FireFox

Getting started with water cooling

I am no expert on water cooling a PC, but i have done a bit of research, and I am keeping things here for my reference

1- Do use distilled water, there is nothing wrong with it, unlike what people who sell coolant will try to tell you, it is working perfectly for me, I added about 20% car coolant to it for both color and other relevant properties

2- BOIL the distilled water to get the oxygen out of it, otherwise, over time the water will become still in the system, forming bubbles.

My pump already has a small reservoir

The system is very simple, Pump to block to radiator then back to pump, took much less time to assemble than i thought

Seagate Backup Plus HUB internal disk

I got an external USB3 8TB disk from Costco, namely the STEL8000401 Seagate Backup Plus Hub, the enclosure includes a USB3 HUB, and an 8TB 3.5 inch hard drive inside

upon opening the shell, I was presented with an 8TB SATA 3 6Gb/s drive with the model number ST8000DM004

According to the datasheet of the hard drive, this is an SMR drive *(Shingled magnetic recording)

Seagates markets this hard drive as a desktop hard drive, but beware, SMR drives are slow on writing, so when you are using the drive for a mostly read scenario, it may be good, but if your application is write intensive, this is not a good hard drive for that purpose

Also, from the datasheet, this drive spins at 5400RPM, opposite to my older seagate barracuda 8TB (ST8000DM002) which is a 7200 and is not an SMR drive

I will be doing some more experimentation with this drive in a bit, and post the results here

Sequential Write

The lowdown: 130 MiB/s sequential Write, and 132 sequential read ! the older drive has a 230MiB/s sequential read

The first experiment is using PV, for those who do not know, PV is like DD but somewhat more advanced, I will be copying the drive ST8000DM002 to the new ST8000DM004, after passing the 10GB mark, the transfer speed from one disk to the other was around 130 MiB/s (Speed of writing to the new SMR drive). Again, regardless of the data, this is a byte for byte copy including blank areas, therefore this is an example of a sequential write. for comparison, writing the same data to /dev/null (read on the old drive) results in 230 MiB/s meaning the bottleneck is writing to the SMR drive. reading from the newer SMR drive to /dev/null results in 132 MiB/s which is surprisingly similar to its read speed.