OpenWrt Forum Archive

Topic: Files and install instructions for HooToo HT-TM02 and HT-TM04(RT5350)

The content of this topic has been archived between 29 Mar 2018 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Now in the trunk! -


This is the main thread for installing OpenWRT HooToo HT-TM02 and HT-TM04 micro-routers. See other updates and notes at the bottom of this post before using these instructions....

A little background on the device.

This is nice little unit with approximately the same functionality, about the same performance, and TWICE the amount of FLASH (8mb vs 4mb). It's also considerably smaller and a bit cheaper (I paid $18 free shipping Amazon prime. Some have seen it for $15 or less).  Feature set is nearly identical to the 703..

- 8mb SPI Flash
- 32mb SDRAM
- USB host
- One ethernet
- 802.11n wifi
- reset button
- mode switch

Here's a view:

http://i1377.photobucket.com/albums/ah78/wingspinner/f89b0804-e78e-4833-9621-d4ce8008efc9_zpsd0caa282.jpg

Here's the top of the board

http://i1377.photobucket.com/albums/ah78/wingspinner/b1fdc3e1-82e8-4bdb-9bfd-135c1fc00790_zpscfd35d21.jpg

.. and the bottom. The serial console connections are the 4 large pads on the bottom edge - they are marked..
http://i1377.photobucket.com/albums/ah78/wingspinner/478e0d09-5abf-4319-bcf5-2219ef9c48ef_zps90d7a9f6.jpg

The wifi works amazingly well considering it only has a chip antenna. An external antenna is easily installed as it has both a proper impedance matching RF front-end as well as a stripline bandpass filter on the board. So far they've all worked well for me with just the chip antenna so I've found no need to modify them yet.

My patches (here and also in my github respository - link below) have support for both LEDs, the reset button and the slider switch. All works well including the USB port.


After some bit of effort to learn how to add a new device to buildroot for trunk (all the wiki docs are for AA), discovering the gpio/led connections on the board, and understanding the HooToo upgrade image format so I could build a "factory" openwrt upgrade image, I've developed a set of patches and images. I've submitted the patches to OpenWRT powers that be and haven't heard anything yet. I hope they'll eventually accept them and make this part of the trunk.  (UPDATE: My patchs are now part of the trunk except for the "factory" image which you can get from my github repository - link below). In the meantime, I want to share this with the community. All the files - patches, images, and board photos are over on github at https://github.com/wingspinner/HooToo-T … 02-OpenWRT. Below are my latest upgrade instructions  and how it all works but you'll need to go to the repository to get some of the files.

Just a note, I'm not affiliated with HooToo in any way and developed this independently. I have been lobbying HooToo to comply with the GPL for a couple of months. Recently they finally made available a sanitized and seemingly incomplete set of sources on their website (now apparently removed) which I thank them for however there isn't much useful in them. They did include the GPIO driver sources and includes though which allowed me to verify that I had got the LED and switch assignments correct. Unfortunately I received them only after I had already figured them out independently. Oh well!

To install OpenWRT on the TM02 I ended up replacing the UBoot bootloader with a version compatible with the OpenWRT partitioning scheme. There are several methods to replace UBoot:

1. If you have at least average soldering skills you can  solder a 3v USB<->Serial cable to the board, setup a tftp server and replace it using tftp, then reboot and use that to  burn the OpenWRT sysupgrade image to the correct MTD partition using tftp. That's how I did it the first time. Also, having a serial console connection is very useful as a debug and recovery tool. If you plan on doing a lot of experimenting I recommending this as it's an invaluable tool for configuration, debug, and recover - as long as you can solder the connections without ruining the board. The connections are well marked and it's not difficult at all. Same goes for the TM04. Both devices can be gently pried apart with a very thin screwdriver. Remove the bottom cover on the TM02 and carefully remove the board. The pads or on the bottom of the board near the edge (see photos).  The TM04 requires that you carefully remove the daughter board and then the three screws holding the base board in place. Again, the pads are on the edge of the board and marked.

2. I've discovered that the board is compatible with in-circuit programming of the flash chip using an external FLASH programmer which makes for easy debricking or upgrading of uboot. I use the "flashrom" app along with the TIAO Tumpa (USB Multi-Protocol Adapter), and one of these: http://www.ebay.com/itm/141377097279?_t … EBIDX%3AIT  . I've found the in-circuit method to be much quicker and easier than TFTP most of the time. This is for more advanced users. More notes on this below.

3. Since my initial upgrade, I have studied and now understand the factory HooToo upgrade images and that knowledge has enabled me to create OpenWRT "Factory" images that are compatible with the HooToo factory GUI software. In OpenWRT parlance a "Factory" image is the one you use to load OpenWRT on to the device for the first time while it's still running the manufacturer's original software. In this case, you load the "Factory" image from the HooToo upgrade menu. With the Factory image it's easy to do the conversion/upgrade without soldering and it shouldn't take more than 10-15 minutes. The factory image I prepared will load the new UBoot along with OpentWRT so it's a one step painless process and the recommended method. I've created a tool that enables advanced users to create their own factory images. More notes below.


REQUIREMENTS

- A 1gb or larger USB Flash stick (preferably an empty, new one )
- PC - any OS and browser
- Ethernet cable

INSTRUCTIONS


1. Connect the TM02 to power with it's mode switch in the AP mode. That's the switch selection that has the icon with an image of the world connected to a network. Wait for it to boot up as indicated by it showing up as an AP in your PC wifi scan. Connect to it. The passkey is "11111111" unless you've changed it.

2. Once you are connected, open your browser and browse to the IP address 10.10.10.254 . The Hootoo GUI should appear. Bypass the setup wizard by closing it's popup window.

3. Insert a USB flash memory stick (preferably an empty one you can dedicate to this purpose and > 1gb) into the TM02. Wait for the popup window confirming that the TM02 has recognized the stick. Make sure the stick is properly mounted by clicking on the "Explore" menu item and viewing the directory of the stick.

4. Now go to the "System" menu, select the firmware upgrade menu item, and then upgrade the TM02 using one of the following files from the "ramips_openwrt" directory of my repository
(https://github.com/wingspinner/HooToo-T … 02-OpenWRT):

openwrt-ramips-rt305x-ht-tm02-squashfs-factory-r44945-ws.bin
This is a well configured image with Luci, USB storage, USB serial, relayd and some other packages intended to make a solid base for experimentation. It's based on the most recent trunk revision (at the time of this writing) r44945. This is recommended for those with more basic knowledge since Luci is already installed for you.

openwrt-ramips-rt305x-ht-tm02-squashfs-factory-r44945-basic.bin
This image is based on the "sysupgrade" image from the trunk, revision r44945. It has only the most basic USB drivers and not much else. It's intended for more advanced users who want full control of what is in the image. Luci is not included. You'll need to log into this via telnet or using the serial console. Check the wiki for instructions.

openwrt-ramips-rt305x-ht-tm02-squashfs-factory-r42649.bin
This is the original "factory" image I built and released. It's configured similar to the first image in this list but is based on a much older trunk revision. I've included it here as reference and don't recommend using it for new installs.

5. WAIT until the timer popup times out (about 5 minutes) before disconnecting the TM02 power as it takes time to write and verify the entire on-board flash MTD. Do NOT interrupt the process in any way otherwise you'll brick your device and likely need to use an external FLASH programmer to recover) The loader issues a "reboot" command when it's done but apparently re-writing the entire flash crashes the HooToo Linux install and it doesn't reboot on it's own. After the timer times out remove power from the TM02.

6. Connect an ethernet cable between your PC and the TM02. Set your PC for DHCP and then power-on the TM02. If the upgrade worked, you'll see both LED's light up. That's the new UBoot. When it starts to boot the kernel they will go out. They may or may not come back on during the boot process. After about 30 seconds it should be booted into OpenWRT. It will issue an IP to your PC in the 192.168.1.xx range. Later, you can configure the LED's to do something more useful.

7. If you used the more fully configured factory image, uhttpd and LUCI should be up and running so browse to 192.168.1.1 and configure to your hearts content using LUCI. There are no requirements for any other upgrades - you're done!


INITIAL CONFIGURATION

The network is configured with OpenWRT defaults. That means you can't do much with it until you've done some reconfiguring. Default configuration is ethernet is set as "lan" and bridged to the wifi ("wlan") with no firewall inbetween. There are plenty of examples as to how to configure the network any number of ways in the OpenWRT Wiki "recipes" and on this forum. Search is your friend - and so is the wiki table of contents. ;-) Relayd is also present as part of the richer build so you can create that interface if you wish and adjust the firewall to everything as "accept" (again, use the Wiki instructions). I'm using a freshly upgraded TM02 as a client bridge with relayd as I write this.


WHAT HAPPENS DURING THE UPGRADE AND WHY YOU NEED A USB FLASH STICK

The TM02 with the factory software doesn't have enough free RAM to untar/ungzip and assemble the complete TM02 flash MTD image for the upgrade so it requires a USB flash stick to use as workspace. Having a clean USB flash stick plugged in is required for this reason.

The first thing the loader does is shutdown various services that might interfere with the flashing process and perhaps free up some RAM. Then it writes a complete backup of the factory flash MTD device to your USB flash stick. It copys the entire TM02 MTD device as one file to your flash stick as well as each separate partition as individual files. The files are named using the partition labels from the flash chip and will be under the "HT_FLASH" directory on the stick. You can use these files to revert back to factory if you wish. Reloading the original HooToo firmware is not difficult for a well versed embedded hardware/software hacker but it's "plug and play" and there aren't any specific instructions. If you are convinced that you want to use the HooToo firmware I recommend spending another $20 and buying a second unit rather than hassle going back and forth. In any case, a full backup is provided for you on the USB flash stick and,  if you feel you must go back, there are at least two methods to accomplish this: A. Using UBoot from the serial console. B. Use an external FLASH programmer such as the "Flashrom" app running on another Linux system, a hardware programmer ( I use the TIAO Tumpa USB Multi-Protocol Adapter), and one of these: http://www.ebay.com/itm/141377097279?_t … EBIDX%3AIT and simply reprogram the flash with the ALL.bin file in-circuit. You'll need to do some research and figure the details out. (Hint: Wiki, forum, search, google ;-) )

Next the loader extracts the OpenWRT sysupgrade image and the new UBoot image from the overall upgrade file and  ungzips and untars them. Then it assembles a new MTD device flash image which includes the new UBoot, the original HooToo "config" and "factory" MTD partitions, and the new OpenWRT sysupgrade image. This is then written to the TM02 MTD using mtd_write. A copy of this image is also written to your flash stick as "openwrt.bin" in case you should need it. Once that's done it executes a "reboot" command. (Note: As mentioned previously this doesn't appear to happen.)

I've found the HT-TM02 to be an extremely versatile little device with sufficient I/O and memory for many applications at a very low cost. I find myself using it as a replacement for many embedded applications where I might have, in the past, used a less capable dedicated embedded microcontroller that required much more software and hardware effort to get running. The biggest issue I've had is getting over the mindset that it's overkill for some of my applications given the fact that it's a full and robust Linux machine. It seems odd having a full-blown computer monitoring I/O's or a serial port but I find I must keep the price in perspective.

One of my apps is as a wireless serial protocol converter between a diesel engine and a PC that monitors it. Previously, the PC had to be connected directly to the engine controller using a $20 TTL serial to USB cable. That's been replaced by a $15 HT-TM02 - and now it's wireless! If I had to do this application with Arduino, ARM Cortex-M boards, etc I'd have a $100+ invested plus a substantial programming task by the time I assembled all the interfaces (WiFi, USB, serial, etc). Using the HT-TM02 and OpenWRT made this a 1 hour job (really!). OpenWRT helps make it possible - it's much more than a router OS.

Cheers,
Ron Curry
Wingspinner


ADDITIONAL NOTES, UPDATES, INSTRUCTIONS

10-2015 - To Upgrade Or Not To Upgrade
Now that my patches are part of the main OpenWRT trunk you may want to download the latest sysupgrade image and upgrade your unit. This is not a requirement and, in fact, not recommended unless you have a specific reason to do so. I've found the 42649 revision to work fine for most everything I'm doing. If things are working as you wish I recommend not upgrading.

However, the OpenWRT trunk images benefit from constant improvements and bug fixes and there may be good reasons to upgrade to the latest revision. There are risks though. As with all bleeding edge trunk revisions there may be new bugs and incompatibilities with your existing packages injected since trunk images are automated builds and no testing is done (you are the tester!). Make sure you have the ability to deal with that. Here are some situations where upgrading may be desirable:

- You need a kernel module that's not already installed and don't have access to a repository with the older revision modules (kernel modules are specific to a kernel version and may fail to install if mismatched).

- You want or need one a new feature or bug fix present in the latest Trunk revision.

- A particular package you plan to install is not compatible with the older Trunk revision kernel and libraries.

If you do decide to upgrade using the latest trunk image I recommend that you do not retain configuration files and redo your configuration from scratch as some of the config files may have changed as well.

To upgrade to the latest trunk image, follow the "Downloads" link on the openwrt.org website and download and install the latest trunk sysupgrade image using LUCI (or the command line sysupgrade script). Note that the powers that be decided to make all the images in the trunk downloads basic images with only the most basic kernel modules and packages. It's likely that you'll need more than that. In my "Factory" image there are several more kernel modules  to more fully support the built-in hardware and make for a more useful system so you may want to add those back in. Here is the original default configuration for reference. Use this list to add these back in via Luci or apt:

define Profile/HT-TM02
    NAME:=HOOTOO HT-TM02
    PACKAGES:=\
        wpad-mini \
        kmod-ledtrig-netdev kmod-ledtrig-timer kmod-leds-gpio kmod-ledtrig-default-on \
        kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-net usbutils \
        kmod-scsi-core kmod-scsi-generic kmod-fs-ext4 \
        kmod-usb-storage kmod-usb-storage-extras block-mount \
        kmod-usb-serial kmod-usb-serial-ftdi kmod-gpio-button-hotplug \
        kmod-nls-cp437 kmod-nls-iso8859-1 kmod-nls-utf8 luci luci-mod-admin-full \
        kmod-app-samba luci-theme-openwrt luci-proto-relay relayd nano \
        fstools
endef

One last note on this. If you have a desire/need to use the latest trunk revisions I strongly recommend setting up the OpenWRT build environment and building your own images. If you follow the wiki instructions for installing it it's actually pretty easy and it will save you a lot of headaches and time.


01-01-2015 - In-Circuit FLASH Programming
Note: This is an advanced topic and if you aren't familiar with FLASH programming and the associated tools it's probably best to skip this until you've done some additional research.

- I've discovered that the board is compatible with in-circuit programming of the flash chip which makes for easy debricking,  upgrading of uboot, or reverting back to the HooToo firmware. I use the "flashrom" app along with the TIAO Tumpa (USB Multi-Protocol Adapter) http://www.diygadget.com/tiao-usb-multi … erial.html, and one of these: http://www.ebay.com/itm/141377097279?_t … EBIDX%3AIT   I've found this to be sometimes quicker and easier than TFTP unless one keeps a TFTP server setup and ready to go whenever it's needed.

03-23-2015 - Repository Pathnames Have Changed
For some reason the OpenWRT team has changed the pathnames for the package repositories. Most of the newer revision packages work just fine (some don't and I plan on releasing a new "Factory" image based on the latest Trunk revision soon). You can repair this via Luci or the command line here's what they should be:

src/gz chaos_calmer_base http://downloads.openwrt.org/snapshots/ … kages/base
src/gz chaos_calmer_luci http://downloads.openwrt.org/snapshots/ … kages/luci
src/gz chaos_calmer_management http://downloads.openwrt.org/snapshots/ … management
src/gz chaos_calmer_packages http://downloads.openwrt.org/snapshots/ … s/packages
src/gz chaos_calmer_routing http://downloads.openwrt.org/snapshots/ … es/routing
src/gz chaos_calmer_telephony http://downloads.openwrt.org/snapshots/ … /telephony

03-24-2015 - New "Factory" images available
I've generated new factory upgrade images based on the latest (as of this writing) trunk sources - revision 44945. Also, I've provided a complete repository of packages so they'll available in the future. Please go to my github repository and read the readme files for more info: https://github.com/wingspinner/HooToo-T … 02-OpenWRT

03-24-2015 - Tool available to Create "Factory" Images
Ideally, this would be integrated with the OpenWRT Buildroot tool however I haven't gotten around to that yet. In the mean time I've created and released under the  Creative Commons Attribution-ShareAlike 3.0 Unported License a tool that will created a new "Factory" image compatible with the HT-TM02 and HT-TM04 (it may work for other HooToo devices and possibly some other non-HooToo devices sold under different names but I haven't personally verified this).  It's currently a somewhat complex shell script but if someone has the time to rewrite it in C I wouldn't mind. wink It requires as input a TM02/TM04 "sysupgrade" image and a UBoot image. More details are available on my GitHub site under the "tools" folder: https://github.com/wingspinner/HooToo-T … 02-OpenWRT.

03-25-2015 - HT-TM04 Compatibility Verified
I've verified that the TM02 images work just fine on the TM04 with no modifications. LED and switches are mapped identically. I used the MMC and SD kernel modules and the SD card works fine as well. As far as I can tell it's fully compatible with the TM02 and everything works fine. Have at it!

(Last edited by wingspinner on 25 Mar 2015, 17:27)

Patches for r42649..


These patches provide support for the Tripmate HT-TM02 personal router including LEDs and reset button. “Mode” switch is not supported. These patches install new buildroot profile a full set of packages (edit the patch prior to applying if you want a more basic initial config) required to enable LEDs, USB, and LUCI. Patches were applied against trunk snapshot r42649. Functionality has been tested in AP, basic wifi client, wifi router, and routed client "bridge" modes - all good so far..... Also, USB works great with storage devices as well as USB/Serial adapters. Lastly, even though it only uses a "chip" antenna they did a really nice job of putting a good front-end on the RF circuity and the receiver is very sensitive - i.e. WIFI works quite well. In fact, I'm using one of them as an wifi client bridge as I write this.

Anyhow, here are the patches:



diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index bf646ed..4cf49b5 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -112,6 +112,10 @@ case $board in
    hlk-rm04)
        set_wifi_led "rt2800pci-phy0::radio"
        ;;
+        ht-tm02)
+        ucidef_set_led_netdev "eth" "ETH" "ht-tm02:white:status" "eth0"
+        set_wifi_led "ht-tm02:blue:wifi"
+                ;;
    all0239-3g|\
    hw550-3g)
        set_usb_led "hw550-3g:green:usb"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index e027b3b..c462fd8 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -97,6 +97,12 @@ ramips_setup_interfaces()
        ucidef_add_switch_vlan "switch0" "2" "4 9t"
        ;;

+    ht-tm02)
+        ucidef_set_interface_lan "eth0.1"
+        ucidef_add_switch "switch0" "1" "1"
+        ucidef_add_switch_vlan "switch0" "1" "4 6t"
+        ;;
+
    3g-6200n | \
    dir-610-a1 | \
    dir-300-b7 | \
@@ -253,6 +259,7 @@ ramips_setup_macs()
    hlk-rm04 | \
    mpr-a1 | \
    mpr-a2 | \
+        ht-tm02 | \
    dir-300-b7 | \
    dir-320-b1 | \
    psr-680w |\
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 9ad7ccb..9752eb2 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -63,6 +63,9 @@ get_status_led() {
    hlk-rm04)
        status_led="hlk-rm04:red:power"
        ;;
+    ht-tm02)
+        status_led="ht-tm02:white:status"
+        ;;
    all0239-3g|\
    hw550-3g)
        status_led="hw550-3g:green:status"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index bb42ace..68ff509 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -157,6 +157,9 @@ ramips_board_detect() {
    *"HILINK HLK-RM04")
        name="hlk-rm04"
        ;;
+    *"HOOTOO HT-TM02")
+        name="ht-tm02"
+        ;;
    *"HAME MPR-A1")
         name="mpr-a1"
         ;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 407c218..4aec780 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -52,6 +52,7 @@ platform_check_image() {
    hw550-3g | \
    hg255d | \
    hlk-rm04 | \
+    ht-tm02 | \
    ip2202 | \
    m3 | \
    m4 | \
diff --git a/target/linux/ramips/dts/HT-TM02.dts b/target/linux/ramips/dts/HT-TM02.dts
new file mode 100644
index 0000000..1f456f0
--- /dev/null
+++ b/target/linux/ramips/dts/HT-TM02.dts
@@ -0,0 +1,104 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+    compatible = "HT-TM02", "ralink,rt5350-soc";
+    model = "HOOTOO HT-TM02";
+
+    palmbus@10000000 {
+
+               gpio0: gpio@600 {
+            status = "okay";
+               };
+               
+        spi@b00 {
+            status = "okay";
+            m25p80@0 {
+                #address-cells = <1>;
+                #size-cells = <1>;
+                compatible = "mx25l6405d";
+                reg = <0 0>;
+                linux,modalias = "m25p80", "mx25l6405d";
+                spi-max-frequency = <10000000>;
+
+                partition@0 {
+                    label = "u-boot";
+                    reg = <0x0 0x30000>;
+                    read-only;
+                };
+
+                partition@30000 {
+                    label = "u-boot-env";
+                    reg = <0x30000 0x10000>;
+                    read-only;
+                };
+
+                factory: partition@40000 {
+                    label = "factory";
+                    reg = <0x40000 0x10000>;
+                    read-only;
+                };
+
+                partition@50000 {
+                    label = "firmware";
+                    reg = <0x50000 0x7b0000>;
+                };
+            };
+        };
+    };
+
+    pinctrl {
+        state_default: pinctrl0 {
+            gpio {
+                ralink,group = "i2c", "jtag", "uartf";
+                ralink,function = "gpio";
+            };
+        };
+    };
+
+    ethernet@10100000 {
+        mtd-mac-address = <&factory 0x4>;
+    };
+
+    esw@10110000 {
+        ralink,portmap = <0x3f>;
+    };
+
+    wmac@10180000 {
+        ralink,mtd-eeprom = <&factory 0>;
+    };
+
+    ehci@101c0000 {
+        status = "okay";
+    };
+
+    ohci@101c1000 {
+        status = "okay";
+    };
+
+    gpio-leds {
+        compatible = "gpio-leds";
+        wifi  {
+            label = "ht-tm02:blue:wifi";
+            gpios = <&gpio0 7 1>;
+        };
+        status  {
+            label = "ht-tm02:yellow:status";
+            gpios = <&gpio0 12 1>;
+        };
+
+    };
+
+    gpio-keys-polled {
+        compatible = "gpio-keys-polled";
+        #address-cells = <1>;
+        #size-cells = <0>;
+        poll-interval = <20>;
+        wps {
+            label = "reset";
+            gpios = <&gpio0 10 1>;
+            linux,code = <0x198>;
+        };
+    };
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 35057e4..c365d9d 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -434,6 +434,8 @@ define BuildFirmware/HLKRM04/initramfs
endef
Image/Build/Profile/HLKRM04=$(call BuildFirmware/HLKRM04/$(1),$(1),hlk-rm04,HLKRM04,HLK-RM02)

+Image/Build/Profile/HT-TM02=$(call BuildFirmware/Default8M/$(1),$(1),ht-tm02,HT-TM02)
+
Image/Build/Profile/M3=$(call BuildFirmware/Poray4M/$(1),$(1),m3,M3)

Image/Build/Profile/M4=$(call BuildFirmware/PorayDualSize/$(1),$(1),m4,M4)
@@ -598,6 +600,7 @@ define Image/Build/Profile/Default
    $(call Image/Build/Profile/FREESTATION5,$(1))
#    $(call Image/Build/Profile/HG255D,$(1))
    $(call Image/Build/Profile/HLKRM04,$(1))
+    $(call Image/Build/Profile/HT-TM02,$(1))
    $(call Image/Build/Profile/HW550-3G,$(1))
    $(call Image/Build/Profile/IP2202,$(1))
    $(call Image/Build/Profile/M3,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/hootoo.mk b/target/linux/ramips/rt305x/profiles/hootoo.mk
new file mode 100644
index 0000000..bbb8143
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/hootoo.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+
+define Profile/HT-TM02
+    NAME:=HOOTOO HT-TM02
+    PACKAGES:=\
+        wpad-mini \
+        kmod-ledtrig-netdev kmod-ledtrig-timer kmod-leds-gpio kmod-ledtrig-default-on \
+        kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-net usbutils \
+        kmod-scsi-core kmod-scsi-generic kmod-fs-ext4 \
+        kmod-usb-storage kmod-usb-storage-extras block-mount \
+        kmod-usb-serial kmod-usb-serial-ftdi kmod-gpio-button-hotplug \
+        kmod-nls-cp437 kmod-nls-iso8859-1 kmod-nls-utf8 luci luci-mod-admin-full \
+        kmod-app-samba luci-theme-openwrt luci-proto-relay relayd nano \
+        fstools 
+endef
+
+define Profile/HT-TM02/Description
+    Package set for HOOTOO HT-TM02 board
+endef
+
+$(eval $(call Profile,HT-TM02))
+

INSTALLATION NOTES

Factory firmware update mechanism is not compatible with standard OpenWRT images. I’ve decoded the factory image format and have modified “factory” firmware upgrade images to enable telnet and change the root password as well as created a openwrt "factory" install image. 

I've tested various configurations but my primary use is as a routed/relayd client bridge and samba, ftp server using a 32gb USB memory stick. I've submitted the patches to the dev group and am assuming I must wait for them to accept them into the trunk before authoring a wiki hardware/installation page so these instructions will have to do for the moment.


Have at it!

Cheers,
Ron

(Last edited by wingspinner on 1 Oct 2014, 16:51)

Well, no one else here using those routers, maybe.

Your work is benefiting at least one other person.  Last weekend I cloned your repository and replaced my HT-TM02 firmware with one of the binaries.  As best as I can tell all seems to be working well.

I'm not new to software development but this is my first adventure into OpenWrt.  I'm hoping to use the HT-TM02 to learn more.  This weekend I'd like to get to where I can build my own images.  Along those lines, I have a question.  If my image turns out to be bad, how do I recover?  Before replacing the factory firmware, it looked like I could press the reset switch while powering up and the unit would hold in UBoot.  As long as I continued pressing the switch the unit continued to hold.  It appeared to be looking for an image to download via TFTP.  Does your UBoot work the same way?  If so, can I use one of your images at this point to recover?


Thanks in advance for the info and thanks for making this work!

The price has fallen to $15 on amazon, for those interested

http://www.amazon.com/gp/product/B00HZWOQZ6

Right now I am debating whether I'll have the time and drive to tinker with this in the foreseeable future, but your efforts are most certainly appreciated in principle.

I just wanted to chime in...  I just ordered one of these and will certainly be replacing the stock firmware.  So I will appreciate any updates!

I wanted to say that I am also very interested in this.  Mine just came in the mail.  I haven't done much with openwrt in a long time -- how do I install the patch that you posted?

Thank you!

I just ordered one of these, and I was thrilled to find this thread!

This is good work, especially figuring out how to make and install a factory image.  Interest will pick up when your work shows up in the trunk, and a few more people have reported success.  It's a chicken-and-egg problem.  If you build it, they will come.

is it possible to go back to Hootoo stock firmware after flashing with your firmware ?

Very good work,  thank you very much for taking the time to do this,  i saw the original post and found your hard work as well. 

I will be spending hours figuring out openwrt thanks to you

The work you did was the deciding factor for me to go for the HT-TM02 router (over MWR102, TL-WR702N, etc), and it is the highest ranking travel router on Amazon.com - I think it also have something to do with the work you have done on this device.

Thank you!

hootoo released their source as open source now.

baluvee wrote:

hootoo released their source as open source now.

I am having trouble finding the source drop from HooToo.  I don't see it on their download page: http://www.hootoo.com/downloads-HT-TM02.html

I see the source code for the TM01, is that same package?  Also, I have been having problems downloading anything from hootoo's website, seems I am getting connection timeouts after a small (128K or less) segment has downloaded.  Anyone else having more luck?

megahertzcoil wrote:
baluvee wrote:

hootoo released their source as open source now.

I am having trouble finding the source drop from HooToo.  I don't see it on their download page: http://www.hootoo.com/downloads-HT-TM02.html

I see the source code for the TM01, is that same package?  Also, I have been having problems downloading anything from hootoo's website, seems I am getting connection timeouts after a small (128K or less) segment has downloaded.  Anyone else having more luck?

I emailed them yesterday about it because I was trying to download their newest firmware.  Apparently they're having an issue with their servers and they're aware of it -- but support was glad to attach the file I asked for to an email.  Maybe give them a try?  (support@hootoo.com)  They also win for fastest support turnaround.  They've replied to me on multiple occasions, during normal business hours, within like 15 minutes.

can someone help me with reverting the stock firmware back on the TM02?  I have all the files from the USB drive. Thanks

I started playing around with this more today, only to find that the patches already appear in master as of 2 weeks ago.  That will certainly make things easier. 

I am in the process of setting up the device as an OpenVPN client that can create a private wifi network using a public ethernet or wifi network.  And a bonus if I can use USB tethering from my phone as the WAN.

Just a note to say I appreciate the work you did on this and the writeup, wingspinner. I've just placed an order for one of these for a boat project, If it isn't the cheapest device with a USB port, it's surely among the smallest. I may have my work cut out for me as I hope to multiplex some data from serial instruments using kplex code. https://github.com/CaesarSchinas/kplex-openwrt

I certainly congratulate you on your efforts to install more functional software on this excellent piece of hardware. I bought the TM02 several months ago when looking for a replacement for a bulky Netgear solution to bridge public wifi at various caravan sites. The supplied software was not able to cope with the majority of sites - however OpenWRT does.  Only one problem - I haven't found a way of configuring the box over Wifi if the bridged network is not available (or deleted first) - I have had to resort to connecting to a PC via Ethernet. 
Any suggestions?

firebush wrote:

Your work is benefiting at least one other person.  Last weekend I cloned your repository and replaced my HT-TM02 firmware with one of the binaries.  As best as I can tell all seems to be working well.

I'm not new to software development but this is my first adventure into OpenWrt.  I'm hoping to use the HT-TM02 to learn more.  This weekend I'd like to get to where I can build my own images.  Along those lines, I have a question.  If my image turns out to be bad, how do I recover?  Before replacing the factory firmware, it looked like I could press the reset switch while powering up and the unit would hold in UBoot.  As long as I continued pressing the switch the unit continued to hold.  It appeared to be looking for an image to download via TFTP.  Does your UBoot work the same way?  If so, can I use one of your images at this point to recover?


Thanks in advance for the info and thanks for making this work!


Glad to hear you got it working!

WRT to UBoot, I didn't build the UBoot image. It's the same UBoot image that's being passed around for use on several of the RAMIPS platforms and it's just a basic, standard UBoot configuration (which is why I found no reason to generate my own). The stock booter is a combination of UBoot and some additional customized scripts that have an incompatible MTD partitioning coded in which cannot be changed without some reverse engineering. As far as the button is concerned I don't know if it works that way but that sounds handy and I wasn't aware the stock booter worked that way but I'll try it (as you may want to do as well).

BTW, once you get in to UBoot you can change the boot delay to something longer if you wish. I changed my to 10 seconds because the default 3 secondes is just too short.

brownpaw wrote:

I wanted to say that I am also very interested in this.  Mine just came in the mail.  I haven't done much with openwrt in a long time -- how do I install the patch that you posted?

Thank you!


It's in the trunk now!

megahertzcoil wrote:

I started playing around with this more today, only to find that the patches already appear in master as of 2 weeks ago.  That will certainly make things easier. 

I am in the process of setting up the device as an OpenVPN client that can create a private wifi network using a public ethernet or wifi network.  And a bonus if I can use USB tethering from my phone as the WAN.


Yes, I just saw that the OpenWRT team accepted my patches and it's now officially part of the trunk. Awesome!

You'll need to install the appropriate kernel modules and other packages to do tethering. The trunk image is basic functionality.

Saqqara wrote:

Just a note to say I appreciate the work you did on this and the writeup, wingspinner. I've just placed an order for one of these for a boat project, If it isn't the cheapest device with a USB port, it's surely among the smallest. I may have my work cut out for me as I hope to multiplex some data from serial instruments using kplex code. https://github.com/CaesarSchinas/kplex-openwrt

Thanks for the info. Can you provide a link to something less expensive with the same (or better!) functionality? At $15 including the case we haven't found anything but are eager to know about it if there is! As with many of these small routers, the FLASH and RAM sizes can be a restriction. We have already bumped up against the 8mb flash size for one application (using ffmpg).