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

ramips: Add support for HooToo TM05 #2645

Closed
wants to merge 2 commits into from
Closed

Conversation

arrmo
Copy link
Contributor

@arrmo arrmo commented Dec 25, 2019

The HooToo TM05 is a battery powered router, with an Ethernet and USB port.
*** Build with small_flash, vendor U-Boot limited to 1.5 MB kernel size!

Specifications:
SOC: MediaTek MT7620N
BATTERY: 10400mAh
WLAN: 802.11bgn
LAN: 1x 10/100 Mbps Ethernet
USB: 1x USB 2.0 (Type-A)
RAM: 64 MB
FLASH: GigaDevice GD25Q64, Serial 8 MB Flash
LED: Status LED (blue after boot, green with WiFi traffic
4 leds to indicate power level of the battery (unable to control)
INPUT: Power, reset button

Tested and working:

  • Ethernet
  • 2.4 GHz WiFi (Correct MAC-address)
  • Installation from TFTP (recovery)
  • OpenWRT sysupgrade (Preserving and non-preserving)
  • LEDs (except as noted above)
  • Button (reset)

Installation:

  • Download the sysupgrade image (TFTP recovery handles directly!).
  • Place it in the root of a clean TFTP server running on your computer.
  • Rename the image to "kernel" be sure there is no file extension.
  • Plug the router into your computer via Ethernet.
  • Set your computer to use 10.10.10.254 as its IP address.
  • With your router shut down, hold down the power button until the first
    white LED lights up.
  • Push and hold the reset button and release the power button. Continue
    holding the reset button for 30 seconds or until it begins searching
    for files on your TFTP server, whichever comes first.
  • The router (10.10.10.128) will look for your computer at 10.10.10.254
    and install the kernel file. Once it has finished installation of the
    kernel file, it will search for a (nonexistent) rootfs file when it
    begins searching for this file, shut down the router by holding the
    power button normally.
  • Start up your router normally.

Signed-off-by: Russell Morris rmorris@rkmorris.us

Thanks for your contribution to OpenWrt!

To help keep the codebase consistent and readable,
and to help people review your contribution,
we ask you to follow the rules you find in the wiki at this link
https://openwrt.org/submitting-patches

Please remove this message before posting the pull request.

@ynezz ynezz added the target/ramips pull request/issue for ramips target label Dec 25, 2019
@adschm
Copy link
Member

adschm commented Dec 31, 2019

Please squash your changes into a single commit (git rebase -i ...) and force-push them to this PR (git push -f ...).
For the commit title, the first word after the prefix has to be lower case (Add -> add).

@arrmo
Copy link
Contributor Author

arrmo commented Dec 31, 2019

Trying! But when I get back to master - build errors, below (not related to my code I think ... LOL). This is why I had stayed "back" a bit. Thoughts? Thanks!

Package luci-mCollected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for base-files:
 * 	libubox20170601
 * opkg_install_cmd: Cannot install package base-files.
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for odhcp6c:
 * 	libubox20170601
 * opkg_install_cmd: Cannot install package odhcp6c.
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for urngd:
 * 	libubox20170601
 * opkg_install_cmd: Cannot install package urngd.

@adschm
Copy link
Member

adschm commented Dec 31, 2019

@arrmo make clean

@arrmo
Copy link
Contributor Author

arrmo commented Dec 31, 2019

Did that (already) ... LOL. And make dirclean. It's somehow related now to the new Linux version. Working on it ... :-)

@arrmo
Copy link
Contributor Author

arrmo commented Dec 31, 2019

Found it! Seems the latest updates changed the image .mk file syntax. Aligned, and builds now.

@981213 981213 removed the blocked pull request blocked by/waiting for another change label Sep 2, 2020
@adschm
Copy link
Member

adschm commented Sep 2, 2020

@arrmo @981213 I've tidied up the rest and pushed it on top of the lzma-loader changes here:
https://git.openwrt.org/?p=openwrt/staging/adrian.git;a=shortlog;h=refs/heads/hootoo

@adschm
Copy link
Member

adschm commented Sep 2, 2020

Hmm, I'm getting a lot of

Makefile:229: warning: overriding recipe for target '/data/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/loader-hootoo_ht-tm05.bin'
Makefile:229: warning: ignoring old recipe for target '/data/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/loader-hootoo_ht-tm05.bin'

with this ...

@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

Hi,

Should I try this on my build as well (and remove my last commit) - or let @981213 check this first?

Thanks!

@adschm
Copy link
Member

adschm commented Sep 2, 2020

@arrmo Do you also get these warning I just posted? I get them with both your and my version?

@xabolcs
Copy link
Contributor

xabolcs commented Sep 2, 2020

@adschm I got it too, but didn't checked any ath79 OKLI device

@xabolcs
Copy link
Contributor

xabolcs commented Sep 2, 2020

And hacking in the lzma-loader directory (e.g. flash addresses, steps, ...) doesn't trigger automatic rebuild that loader.bin!

One should delete it manually!

@adschm
Copy link
Member

adschm commented Sep 2, 2020

@adschm I got it too, but didn't checked any ath79 OKLI device

I compared the instructions with the recently added ath79 engenius devices and didn't find any relevant differences. When building them, I don't see the messages, though (I build-tested before merge). This is some hidden redefinition, we just have to find it.

Edit: make clean doesn't help, I obviously tried that, as well removing .config and tmp directory.

@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

Yes, I flagged this a while back ... see here,
https://forum.openwrt.org/t/hootoo-tm-05-add-lzma-loader/67687/60

I admit, not sure what is causing it - thoughts?

@adschm
Copy link
Member

adschm commented Sep 2, 2020

Well, it caused by what is says:
There are two (or more) "recipes" that create the same file:
build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/loader-hootoo_ht-tm05.bin

So, we have to find both of them and then eliminate one.

@adschm
Copy link
Member

adschm commented Sep 2, 2020

Hmm, since this message is printed that often, it looks to me like something is just not defined in DEVICE_VARS properly, so the definition will be taken over for all other devices.

@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

Hi,

I did add (LOADER_FLASH_OFFS) - at least I recall this ... I think 🤣,

DEVICE_VARS += LOADER_TYPE LOADER_FLASH_OFFS

to target/linux/ramips/image/Makefile. Is this not correct? I thought it was needed, as this is used as a variable in the Makefile.

Thanks!

@adschm
Copy link
Member

adschm commented Sep 2, 2020

Err, can't test it right now, but I suspect it's terribly simple, and we just need to add
COMPILE :=
to Device/Default in image/Makefile.

If this is not set as a "default" value, all devices will just copy the COMPILE value set last, i.e. from the hootoo device.

Edit: That one is present for ath79, so that's why we don't see the warning there.

@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

Err, can't test it right now, but I suspect it's terribly simple, and we just need to add

Trying it here - seems to be the fix. Thanks!

@xabolcs, work for you as well?

@xabolcs
Copy link
Contributor

xabolcs commented Sep 2, 2020

Ummm, I can't test it right now, too! 😅
Will check it later!

@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

LOL - NP! Should I try to remove my last commit, pull in the changes from @981213? Or I can wait for you to check the change above, no issue.

@adschm
Copy link
Member

adschm commented Sep 2, 2020

LOL - NP! Should I try to remove my last commit, pull in the changes from @981213? Or I can wait for you to check the change above, no issue.

I will test in a few hours and update my branch referenced above. You don't need to push changes here anymore, but just tell me what I should change in my branch then.

@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

Sorry, just to make sure I understand - you mean to fix the item above? I just added your noted change to target/linux/ramips/image/Makefile. To make it clear, in that file now has,

define Device/Default
  PROFILES = Default
  KERNEL := $(KERNEL_DTB) | uImage lzma
  SOC := $(DEFAULT_SOC)
  DEVICE_DTS_DIR := ../dts
  DEVICE_DTS = $$(SOC)_$(1)
  IMAGES := sysupgrade.bin
  SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
  sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs
  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size
  COMPILE :=
endef

Thanks!

@adschm
Copy link
Member

adschm commented Sep 2, 2020

Okay, I've updated and build-tested my staging tree.

https://git.openwrt.org/?p=openwrt/staging/adrian.git;a=shortlog;h=refs/heads/hootoo

@arrmo Please do a final run-test based on the changes there; either pull my tree directly and build from it or take the three relevant patch on top of a local tree.

@xabolcs
Copy link
Contributor

xabolcs commented Sep 2, 2020

- mtd-concat functionality is included, to leave a "hole" for u-boot-env,
   combining the OEM kernel and rootfs partitions (config 4.14, 5.4)

Please adjust "Notes" in the commit message! You just dropped the 4.14! 👍

@adschm
Copy link
Member

adschm commented Sep 2, 2020

- mtd-concat functionality is included, to leave a "hole" for u-boot-env,
   combining the OEM kernel and rootfs partitions (config 4.14, 5.4)

Please adjust "Notes" in the commit message! You just dropped the 4.14!

Done.

@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

Please do a final run-test based on the changes there; either pull my tree directly and build from it or take the three relevant patch on top of a local tree.

Trying! This is where git kills me 😞. The coding is "easy", not so much git ... LOL!

@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

Figured it out, did,

git pull https://git.openwrt.org/openwrt/staging/adrian.git hootoo

Then fixed merge conflicts (used your changes fully). Building now ...

Thanks!

@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

Builds and works great, thanks! I did a sysupgrade (after pull above, make clean to be sure, then make). Settings are all preserved, and it's on 5.4.61 now (so another check).

In case you want, the serial log,
https://paste.ubuntu.com/p/DxVZGxybfm/

@adschm
Copy link
Member

adschm commented Sep 2, 2020

Okay, thanks, so I will close this and talk to @981213 when to merge.

And we are still 2 comments short of the 500 ...

@adschm adschm closed this Sep 2, 2020
@arrmo
Copy link
Contributor Author

arrmo commented Sep 2, 2020

Thanks, appreciate the help! Please just let me know (so I can delete my branch, get back to the master).

And we are still 2 comments short of the 500 ...

Glad to see a sense of humor still 🤣.

@arrmo arrmo deleted the hootoo-tm05 branch September 2, 2020 17:02
@mpratt14
Copy link
Contributor

mpratt14 commented Sep 3, 2020

I wanted to be the 500th comment :P

thanks, Adrian and others for all that you're doing :D

Congratulations Russell for your first PR here, and a rough one too lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changes target/ramips pull request/issue for ramips target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants