@xabolcs' custom builds for ramips/rt305x Sunvalleytek Tripmate devices: stock compatible flash layout for HooToo HT-TM01, HT-TM02 and RAVPower RP-WD02

About this custom build

See $subject and my comment from another thread:

About OpenWrt 22.03 and newer releases

They won't work without SPI kernel loader!
The hootoo_ht-tm02-kernel from the v22.03.1 ImageBuilder is 1629211 bytes long. :confused:

OpenWrt "oldstable": 21.02 and 19.07

You can find my relase firmwares below:

OpenWrt 21.02.7 - ported

OpenWrt 21.02.3 - ported

OpenWrt 19.07.10 - last of the 19.07.x line

1 Like

Placeholder

Current status

  • sysupgrade doesn't work: it starts upgrading, reboots but keeps the system intact
  • sysupgrading from Offical OpenWrt image is still possible :frowning:
    • should be avoided (to prevent bricked devices) with some compatible or something
    • or just disable sysupgrade.bin :upside_down_face:
  • the release GitHub Action doesn't work, so no repacked images for OpenWrt 19.07.8 service release
  • it's compatible with HT-TM02 clones, but doesn't supports any of the extras: battery reading, microSD slot, etc

Support for battery reading has been started and it doesn't work at first try. As usual! :see_no_evil:

Sysupgrade serial log:

Watchdog handover: fd=3
- watchdog -
killall: telnetd: no process killed
killall: ash: no process killed
Sending TERM to remaining processes ... dnsmasq ubusd askfirst urngd logd netifd odhcpd ntpd 
Sending KILL to remaining processes ... ntpd 
Switching to ramdisk...
Performing system upgrade...
Could not open mtd device: firmware
Can't open device for writing!
cat: write error: Broken pipe
sysupgrade abort[  670.661483] reboot: Restarting system

Which means a porting error to me.


Battery reading now had a progress:

[   22.237524] i2c /dev entries driver
[   22.259628] i2c-ralink 10000900.i2c: clock 100KHz, re-start support

@arrmo , where did you get your i2cset and i2cget addresses?
I got errors only:

root@OpenWrt:~# i2cset -y 0 0x0a 0x0a 0x10
Error: Write failed
root@OpenWrt:~# i2cget -y 0 0x0a 0x0a
Error: Read failed

and the i2cdump script below returns nothing for me:

for i in 0 1 2 3 4 5 6 7; do for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do i2cdump -y 0 0x${i}${j} 2>/dev/null|grep -v 0123456789abcdef|grep -v XXXXXXXXXXXXXXXX; done; done;

I'm hacking at my branch-19.07-ht-tm02-new-dts branch.

  • sysupgrade-tar will be the aid for the sysupgrade error
  • I'm unsure about the DTS changes (enabling i2c for HT-TM01, enabling mode switch for HT-TM02): they works, but ...
  • i2c driver loads but nothing else :roll_eyes: (as already commented)

Sorry for the slow reply! Been out of pocket a few days, just saw this.

Got the info two places (and of course, tested to confirm :stuck_out_tongue_winking_eye:),

  1. I found some similar code here, and then pulled the datasheet for the HT66F40 to debug.
  2. I got the source code for the Hootoo from the vendor. Quick look now and I can't find it, but it was in there somewhere. LOL.

Bummer, HT-TM01 has HT66F30. That's why it doesn't work. :confused:

Dang it! :frowning_face:

Wizard @jwmullally, as you already know I use your awesome Image Builder frontend to hack around with some ramips/rt305x HooToo images.

After successfully adding a new device, I'm having problems improving the Makefile futher, my Makefile-fu ended here. :sweat_smile:
Could you give me a few hint in the following topics?

Adding new device

touching $(TOPDIR)/target/linux/$(BOARD)/base-files

Adding a new device I had to touch some base-files files in $(TOPDIR)/target/linux/$(BOARD)/base-files.
These files don't make their ways into image, only with the Image Builder's FILES="path" parameter.:confused:
Any hint?

handling patch series

I added the new devices as a separate commit on my branch, so I would like to apply all the patch automatically instead of listing them in Makefile.

OpenWrt uses quilt to handle patch series, but in Image Builder only the wrapper is included. It's command list is empty:

$ ./staging_dir/host/bin/quilt 
Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ...
       quilt --version
Commands are:

Global options:

--trace
	Runs the command in bash trace mode (-x). For internal debugging.

--quiltrc file
	Use the specified configuration file instead of ~/.quiltrc (or
	/builder/shared-workdir/build/staging_dir/host/etc/quilt.quiltrc if ~/.quiltrc does not exist).  See the pdf
	documentation for details about its possible contents.  The
	special value "-" causes quilt not to read any configuration
	file.

--version
	Print the version number and exit immediately.

Should I install quilt at OS level instead trying to revive IB's wrapper?
Thankfully there is an answered question at SO related to Makefile and quilt. :+1:

multi-profile support

Now I have ht-tm02 and ht-tm01 and I'd like to build them in one make command.
Without hard coding $(PROFILE) and/or duplicating the whole line:

	cd $(BUILDER) && make image PROFILE="$(PROFILE)" EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" PACKAGES="$(PACKAGES)" FILES="$(FILES)"

could you give me some hint for magical rules to achieve this?

Thanks! :slight_smile:

RE: HT66F30

There is a post at doozan.com - NSA325 fan control, which I paste here:

Hi @xabolcs , good to hear the method is useful, it does look like a handy approach to maintaining custom OpenWRT images.

Yes, I found that too a few months ago. Originally I didn't need to modify anything in base-files so I hadn't noticed it. I think the issue is that with Image Builder, those files come from the already built base-files packages (e.g. here). I found the easiest solution was specifying FILES= as you suggest. Because those are applied at the end of the filesystem build, it means anything can be customized easily, which is nice.

You could try something simple like this in your Makefile. It would save you having to install quilt and update a list of patches.

    $(foreach file, $(sort $(wildcard patches/*.patch)), echo "Patch file $(file)";)

Image Builder seems designed around building one profile at a time (I think?), so I wasn't able to find any alternative that didn't look overly complex. In the end I just went with the simple approach).

You could use another loop like:

PROFILES_TO_BUILD := myprofile1 myprofile2

images:
        $(foreach profile, $(PROFILES_TO_BUILD), echo "Building this profile: $(profile)";)

Or something more complicated like this with a dynamic rule per profile, but IMHO its better to keep Makefiles simple and easy to maintain :slight_smile:

1 Like

It just simply awesome!

Practically I added a whole new device to Image Builder, so it can use the packages from the official releases. :+1:

Thanks for all the hints, will bake them into my fork! :ok_hand:

For the interested parties I pushed a few updates to my HooToo oldstable repository! :grinning:

  • updated v19.07 to v19.07.10, the last one from 19.07 line
    • built only for HT-TM01, but should run on any other Tripmate!
  • rebased the repo to @jwmullally's "simple approach" (thanks again! :pray:)
  • added v21.02 release as v21.02.3-0
    • built only the in-tree HT-TM02, but should run on any other Tripmate!
    • completely untested :see_no_evil:
1 Like

Doesn't work: looks like the mtd concat driver is inactive in ramips/rt305x target. :confused:

 ##### The CPU freq = 360 MHZ #### 
 estimate memory size =32 Mbytes
.
Initialize vs configure module
.Initialize GPIO
Input i key to enter menu 0 
........................## Booting image at 80500000 ...
   Image Name:   MIPS OpenWrt Linux-5.4.188
   Created:      2022-10-19  20:09:33 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1498700 Bytes =  1.4 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 32

Starting kernel ...

[    0.000000] Linux version 5.4.188 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16554-1d4dea6d4f)) #0 Sat Apr 16 12:59:34 2022
[    0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is HooToo HT-TM02
[    0.000000] Initrd not found or empty - disabling initrd
...
[    0.658311] spi spi0.0: force spi mode3
[    0.667949] spi-nor spi0.0: mx25l6405d (8192 Kbytes)
[    0.678147] 7 fixed-partitions partitions found on MTD device spi0.0
[    0.690916] Creating 7 MTD partitions on "spi0.0":
[    0.700560] 0x000000000000-0x000000030000 : "u-boot"
[    0.713018] 0x000000030000-0x000000040000 : "config"
[    0.725785] 0x000000040000-0x000000050000 : "factory"
[    0.738616] 0x000000050000-0x0000001d0000 : "kernel"
[    0.751294] 0x0000001d0000-0x0000001e0000 : "u-boot-env"
[    0.764548] 0x0000001e0000-0x000000200000 : "rootfs2"
[    0.777476] 0x000000200000-0x000000800000 : "rootfs1"
[    0.819484] rt3050-esw 10110000.esw: link changed 0x00
[    0.833815] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.851658] rt2880_wdt 10000120.watchdog: Initialized
[    0.865115] NET: Registered protocol family 10
[    0.885967] Segment Routing with IPv6
[    0.893730] NET: Registered protocol family 17
[    0.902879] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    0.928832] 8021q: 802.1Q VLAN Support v1.8
[    0.941567] /dev/root: Can't open blockdev
[    0.949932] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.964926] Please append a correct "root=" boot option; here are the available partitions:
[    0.981654] 1f00             192 mtdblock0 
[    0.981665]  (driver?)
[    0.994816] 1f01              64 mtdblock1 
[    0.994826]  (driver?)
[    1.007972] 1f02              64 mtdblock2 
[    1.007981]  (driver?)
[    1.021127] 1f03            1536 mtdblock3 
[    1.021137]  (driver?)
[    1.034319] 1f04              64 mtdblock4 
[    1.034328]  (driver?)
[    1.047477] 1f05             128 mtdblock5 
[    1.047486]  (driver?)
[    1.060635] 1f06            6144 mtdblock6 
[    1.060644]  (driver?)
[    1.073789] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.090276] Rebooting in 1 seconds..

I wanted to reuse those user and userbackup partitions as rootfs as extra 128K! :+1:

21.02.3-1 build is out! :smiley:

added HT-TM01

I2C doesn't start, again!

[   22.643980] kmodloader: loading kernel modules from /etc/modules.d/*
[   22.756931] i2c /dev entries driver
[   22.779565] rt2880-pinmux pinctrl: pin io1 already requested by pinctrl; cannot claim for 10000900.i2c
[   22.798337] rt2880-pinmux pinctrl: pin-1 (10000900.i2c) status -22
[   22.810758] rt2880-pinmux pinctrl: could not request pin 1 (io1) from group i2c  on device rt2880-pinmux
[   22.829743] i2c-ralink 10000900.i2c: Error applying setting, reverse things back
[   22.844615] i2c-ralink: probe of 10000900.i2c failed with error -22
[   22.952306] Loading modules backported from Linux version v5.10.110-0-g3238bffaf992
[   22.967767] Backport generated by backports.git v5.10.110-1-0-g1fbde860
[   23.101852] xt_time: kernel timezone is -0000
[   23.280760] urngd: v1.0.2 started.
[   23.501313] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "factory"
[   23.515869] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5350, rev 0500 detected
[   23.531480] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5350 detected
[   23.545590] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   23.657603] kmodloader: done loading kernel modules from /etc/modules.d/*

And I'm unsure about LEDs.

fixed sysupgrade!

It works from this version, but never tried from my 19.07.8-1 build!

added fancy extras :see_no_evil:

  • uboot-env: fw_printenv, fw_printsys, ...
  • sysinfo
  • color prompt

@xabolcs does your latest 21.02.3-1 build work in terms of basic router functions? Despite looking up what I2C is I don't know what the implications of it not starting are in terms of the router working. The LEDs not working isn't a concern.

I've been looking into upgrading various small routers including an HT-02 I have, and I find it strange that the current officially supported release of OpenWRT for the HT-02 and the other TripMates is 19.07.10, despite there being 3 other devices -- D-Link DIR-320 b1, Hame MPR-A2, Olimex RT5350F -- which all seemingly have the same specs but are supported by 22.03.04. If anyone can explain why that might be, I'm curious to know.

It doesn't have the ppp and ppp-mod-pppoe packages, so it won't work with PPPoE ISPs.
These devices have only one ethernet port, which is configured as LAN, so they are not really routers! :slightly_smiling_face:

Of course you could reconfigure the ethernet port to WAN or the other way around: use the devices as a wireless client.

And here is the new 21.02.7 release! :muscle:

BusyBox v1.33.2 (2023-03-30 12:18:04 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 21.02.7, r16847-f8282da11e
 -----------------------------------------------------
 | Machine: HooToo HT-TM01                           |
 | Uptime: 0d, 02:40:36                              |
 | Load: 0.42 0.12 0.04                              |
 | Flash: total: 3.4MB, free: 96KB, used: 97%        |
 | Memory: total: 27.2MB, free: 11.1MB, used: 59%    |
 | WAN:                                              |
 | LAN: 192.168.1.1, leases: 1                       |
 | radio0: mode: sta, ssid: OpenWrt, channel: 1, conn: 1 |
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@HT-TM01-E58 ~ # ping -c 4 forum.openwrt.org
PING forum.openwrt.org (139.59.210.197): 56 data bytes
64 bytes from 139.59.210.197: seq=0 ttl=49 time=23.248 ms
64 bytes from 139.59.210.197: seq=1 ttl=49 time=22.967 ms
64 bytes from 139.59.210.197: seq=2 ttl=49 time=22.608 ms
64 bytes from 139.59.210.197: seq=3 ttl=49 time=23.143 ms

--- forum.openwrt.org ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 22.608/22.991/23.248 ms

It's work in progress. The most that can happen, it will able to show the battery levels! :grinning:
But I'm clueless know. :woman_shrugging:

Nobody cares about them ... the 22.03 kernel are greater than 1536 KB, so I'm unsure if they are able to boot it.
For the HooToo HT-TM02 I intentionally disabled it. See below commit for details!

Back in the 21.02 day, the SNAPSHOT wasn't able to boot because of size problems. Fortunately the release version (of 21.02) is a little bit thinner and below 1536K and now I'm able to provide those new 21.02 releases! :muscle:

Just pushed to GitHub the release!

@xabolcs thanks for your continued work on this. I'm not a developer so some of what you discuss is over my head. On the networking side of things though I'm familiar with PPP and PPPoE so I know that I won't miss these on a router intended for travel use. :slight_smile:

Further, for I2C, since the HT-TM02 doesn't have a battery it sounds it not working shouldn't be an issue.

Do these builds have WireGuard support in the kernel? I see above that one of the previous releases used Linux kernel 5.4.188, and I know that WireGuard was backported to the 5.4 kernel, but beyond that I don't know how to tell if WireGuard is supported in this specific kernel. I'm aware the 360 MHz processor on these devices would be a huge bottleneck to WireGuard speeds, but for my purposes, even if it can hit 10 Mbps, that would prove useful for a travel router.

Also, if you feel like explaining that limit of 1536 kb for the kernel: is that due to the factory partition sizes, or is something else the reason for that limit?

Will the ht tm-02 image work on the ravpower wd-02. Its not entirely clear as the tile of this would indicate yes while the github page doesnt mention this device at all.