HooToo HT-TM05, Recognize HW

Thanks! Will give it a try here, much appreciated!

1 Like

Hmmm ... no issue building sysupgrade images for this device, but struggling to build a "clean" image - that I can flash from U-Boot recovery. Any pointers / thoughts?

Thanks!

Get the OEM image and use binwalk and hexdump to explore it for clues

1 Like

Excellent suggestion - thanks! binwalk and some poking ... and it turns out that the sysupgrade.bin file can be used directly with U-Boot recovery on this router. Wow, that's awesome, and so easy.

Will start working on code additions, to get this HW added.

Thanks again!

1 Like

FYI, I have a build working - just cleaning up a few things. And a couple questions, in case anyone has seen this before ...

  1. Added the line below to target/linux/ramips/image/mt7620.mk, but it doesn't seem to "force" (add) these drivers / packages to the build (firmware). Is there a way I should be doing this?
    DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-i2c-ralink
  2. Once I have this working ... any information on how to submit a Pull Request (PR) to OpenWrt? I have done it before in Github, but this looks to be different.

Thanks!

Run ./scripts/checkpatch.pl and potentially shellcheck -s dash to catch any basic formatting or script issues you may have.

Review https://openwrt.org/submitting-patches and make any changes needed there. Then choose either to use git send-email or a GitHub PR.

Thanks! No issues noted that way - and the build works fine, loads and runs ... it's just that I want to add i2c drivers, to be able to read the battery. I can get this to work by manually forcing the driver (kmod-i2c-ralink) in menuconfig, but that's not right. It seems like DEVICE_PACKAGES is the way to go - but I see posts by others that it's not working?

Really, I just need to define kernel modules (kmod's) that need to be included in the build - for the particular hardware.

Thanks again.

I can't comment on that specific driver, as the devices I run OpenWrt on that have "exposed" I2C use the basic GPIO, "bit-bang" driver. It works well on the QCA SoCs I work with, at the typical 100 kbps rate.

Yes, adding to DEVICE_PACKAGES would be the way to add it to the build "by default". Be prepared to clearly indicate to your reviewer(s) why it is needed to enable on-board functionality that is of general value to users of the device. (I'm not suggesting that it isn't, but you may need to justify your choice.)

Yes, that makes sense - thanks! If I manually enable that driver (make menuconfig), and then it's in the build => life is all good ... I2C bus is recognized, and I can access the device I want (charging status, battery level). Works fine. But seems that putting it in DEVICE_PACKAGES doesn't get it on the device (in the build). I thought I needed to, for example, make defconfig ... to trigger it to reconfigure. But nope. Hmmm - still digging.

Thanks!

Try starting with an empty .config

OK, tried empty .config - won't boot now ... LOL. No biggie, will step back, re-flash from U-Boot recovery. Then see what is missing that is causing it. It is a bit more difficult not having a serial / debug port, but not a show stopper either.

Thanks!

1 Like

Dang it! Pulling my hair out (and not enough of that to spare ... LOL). I restarted, using the config.buildinfo file in OpenWrt downloads (I assume this is safe?). It worked just fine, no issues at all. And I can find my desired file (i2c-ralink.ko) in a few directories inside the build_dir, also inside the staging directory (path below) ... but it's not getting to the kernel, nor /lib/modules on the router. That's where I'm stumped - how to get it in one or the other (preferably the kernel).
./staging_dir/target-mipsel_24kc_musl/root-ramips/lib/modules/4.14.151/i2c-ralink.ko

Any suggestions would be appreciated. Thanks!

Especially when working on a new build, I find it safer to go with either a completely empty .config or a minimal seed. I keep my "seeds" in pieces, so I can cat them into .config As an example

$ cat ../openwrt_config/select/ar300m-nor 
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_nand=y
CONFIG_TARGET_ath79_nand_DEVICE_glinet_gl-ar300m-nor=y

I also keep my local build "standards"

$ cat ../openwrt_config/config/local 
CONFIG_DEVEL=y
CONFIG_BUILD_LOG=y
CONFIG_CCACHE=y
CONFIG_DOWNLOAD_FOLDER="/home/jeff/devel/openwrt_dl"

(and similarly for diagnostic tooling)
So with

cat ../openwrt_config/select/ar300m-nand ../openwrt_config/config/local ../openwrt_config/config/utils > .config
make defconfig

gets me ready to build that device and it's default packages, plus the tools I use to figure out what I broke.

On what's wrong, maybe a hint is in what you've modified already.

git diff --name-status master

and what's in your .config of note

./scripts/diffconfig.sh

Two comments up front ... :slight_smile:

  1. Sorry for the slow reply! I was off digging in to this, didn't want to reply until I made some progress.
  2. Thanks SO MUCH for the detailed thoughts and pointers. It really is appreciated.

Ok, so after I went through some pain with the master (snapshot), and now fell back to v19.07-rc1 (and am working again) ... I completely agree with your thoughts above about the config file, and CONFIG options. But (and I may be wrong here!) - I'm trying to get this to properly install needed kernel modules without changing the config file. I can make that work, it has been all along actually, but when the larger build is run (i.e. for the downloads on the OpenWrt site), config changes can't really be used - can they? Rather, the code (dts, sh files) needs to get the needed modules in to the build. Agreed? This is what I'm struggling with ... I add in needed kernel modules (i2c-ralink), and they build, but do not get into the kernel, nor the /lib/modules directory on the router.

Clear as mud?

Thanks again!

Wiping it off my glasses, yes...

DEVICE_PACKAGES is really the way to do this. Check your syntax if they aren't being added. From a board I'm working with right now

  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct \
                        kmod-usb2 kmod-usb-storage block-mount

OK, perfect! That's what I have been trying to use, and have been having issues - could be me though. Glad to hear that's the right way, and it's working for you.

Let me try this on v19.07, see if that helps (master has been some level of grief, as expected). To that end ... is there a "correct" branch to target?

Thanks again!

PS: Your glasses comment went over my head ... LMAO!

New development "always" is done on master


"Clear as mud?"
"Wiping it off my [mud-spattered] glasses, yes..."

OK, got it (glasses) ... LMAO! I'm just a tad slow today it seems.

master makes sense, no issues. But the issue I'm having - pulling my hair out! I have been doing exactly as you say, my update is as below,
DEVICE_PACKAGES := kmod-i2c-ralink kmod-usb2 kmod-usb-ohci

BUT ... the i2c driver is being compiled, however it's not in the kernel, not in /lib/modules, and not showing up in the manifest file. That's the crazy part I can't figure out ... why not?!?! Hmmm.

FYI, I have swapped the order, added in kmod-i2c-core manually also. No difference, it never gets in the kernel (or /lib/modules).

Thanks!

And I did try adding kmod-usb-storage also => I don't see it in the manifest. Do you?

Thanks!

"Works for me"

Try make V=s to get a closer look at what is happening (or not happening).