Thank you. I'll give that a shot to see if things match up. Maybe I'll figure out the SD card slot issues that way and resolve any possible cell module issues that may come up.
@hynman Do you know what ^@ is a reference to in there? I tried looking it up on Google, but it won't search for symbols. I believe it's a reference to the model name, but where does it pull from? Do I just use ^@ in DTS, or do I need to expand it? (I'd prefer to expand it to help others know what it means more easily.)
EDIT:
^@ looks more like a delimiter. I found that `/proc/device-tree/compatible contains this text:
mofinetwork,mofi5500^@mediatek,mt7621-rfb-nor^@mediatek,mt7621-soc^@
In my DTS, I expanded my above "compatible" flag to become:
compatible = "mofinetwork,mofi5500-5gxelte", "mediatek,mt7621-rfb-nor", "mediatek,mt7621-soc";
I can't find the module anywhere on LuCI using the stock firmware, and I think that's because the eBay seller shipped me the EM7565 instead of an EM7455. The MoFi 5500 stock firmware doesn't work with the EM7565, so I ordered the correct one on Amazon. As I'm probably going to have to locate a driver for that card (hopefully already written) then I'll see if I can support the new guy, too. No idea what this will take, but maybe it's just LuCI which they made hide menus if a certain card type doesn't show so they have less tech support requests.
I'll still want to test that with a known good so I know that the hardware should work properly. It arrives on Tuesday.
EDIT:
I have some great news! I was able to extract the DTS file from MoFi's firmware. I'm trying to compile the custom firmware with that and then I'll test it out.
The bad news is that I just spent the last few hours going over the source code for custom components MoFi made for the router, and it looks like the functionality for the modules is almost entirely custom... I personally don't plan to use the modules and only bought them to test my work, but I;m not sure if I can make them work without a huge amount of work I won't be willing to do to build all the parts of the system.
If you're reading this and plan to use the custom firmware and want to keep the cell module functionality, then assuming I don't manage to already make that work when I finish building this firmware, then you'll want to follow the instructions below. It's illegal for me to just willy nilly copy their code and package it up in my release, but the DTS file is just a descriptor for the hardware, and has to be written the same way to get the router working with OpenWRT completely. I don't think it's illegal for me to use that.
Anyway, here's what I did so you can replicate it as needed.
- Download the latest MoFi firmware.
- Install binwalk. (Ex.
sudo apt-get install binwalk
)
- Install extract-dtb with
pip install extract-dtb
, and install dtc with sudo apt-get install dtc
.
- Now, put the mofi firmware in a directory where you'd like to extract it. In a terminal, cd to that directory.
- Now run this command to extract the firmware.
binwalk -Me ./mofi-firmware.bin
- You now should have a directory with lots of stuff in it. The important bits that I've found are
/squashfs-root/
which contains all of the operating system files from the firmware, including MoFi's proprietary code. (I won't put any of that in my releases.) You also have a file named 40
in the root directory. (At least mine was named that.) The extractor couldn't name it, but using Bless Hex Editor, I examined it and it was compiled DTS code! Very useful.
- Now we extract the DTS (Device Tree Source) from the compiled DTB (Device Tree Binary) file. Before we can do that, though, we need to use a tool to truncate the file enough for
dtc
to recognize it. We extract the compiled dtb from that blob file by doing extract-dtb /my-file
. ("my-file" is the file named 40
I mentioned earlier. If yours is under a different name, use the correct name.)
- Now we can decompile the DTB file. To do that use
dtc -I dtb -O dts -o mofi.dts mofi.dtb
. You should now have a "mofi.dts" file with a bunch of data on the router.
My newly compiled firmware is ready for testing. I'll do that tomorrow. I also found a firmware config file (for make menuconfig
) located in /squashfs-root/proc/firmware.config
which will help me to find out which generally-available packages they've added to their firmware. It'll make things easier to replicate!