TP-Link MR3040 Installation Trials and Tribulations

Posted by mdax 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
TP-Link MR3040 Installation Trials and Tribulations
April 30, 2013 03:02PM
Install Steps completed
1. Download the CURRENT non trunk .bin for the MR3040 (at the time of my install it was here)
*this is the MOST IMPORTANT step to not mess up other than /etc/config/network
2. Directly connect laptop to 3040, set laptop to IP 192.168.0.5, Turn off wireless on laptop
3. Browse 192.168.0.1 , logged in as admin/admin
4. System Tools -> Firmware Upgrade -> browse for bin -> install firmware -> system will reboot on it's own, don't mess with it.
*If you find the wrong .bin was installed and you can telnet/ssh into box then update it with 'mtd -r write nameOfBinary.bin firmware' However DON'T install the wrong .bin and save yourself agony
5. Set Laptop to 192.168.1.5 manual IP, Connect to 3040 via ethernet
6. Telnet 192.168.1.1 then set passwd ('passwd')
7. Edit your /etc/conf/network. This step is frequently messed up. Be sure to understand your router IP and network address scheme.
8. Turn off 3040 using 'poweroff' command, disconnect ethernet and plug 3040 directly into router, turn on wirless on laptop and restore original IP setting
9. ssh root@192.168.1.1
10. Install PirateBox 'opkg update && opkg install [piratebox.aod-rpg.de];
11. Disconnect PirateBox from ethernet
12. Test (device is now available at 192.168.1.1)

Lessons Learned

- Move slowly. Read ALL output. Stop immediately on any error and fix/understand it.
- If your router is at 192.168.1.0 you need to change it or /etc/config/network will barf on that .0
- The .bin used for the openWRT portion is critical. Ensure you are using a non trunk version.


Docs I'm using
http://daviddarts.com/piratebox-diy-openwrt/?title=PirateBox_DIY_OpenWrt
These instructions are for a 3020. YOU MUST USE A 3040 .bin FILE!

http://www.disk91.com/2012/technology/systems/installation-of-a-piratebox-on-t-link-mr3040/
Don't use the .bin linked at these instructions
Use the later piratebox install version in David Darts instructions at opkg install [piratebox.aod-rpg.de]





Re: TP-Link MR3040 Questions
April 30, 2013 03:53PM
Re: TP-Link MR3040 Questions
April 30, 2013 05:10PM
however it does look like wireless needs to be enabled by setting
option disabled 0 in /etc/config/wireless

This site has some instructions http://www.disk91.com/2012/technology/systems/installation-of-a-piratebox-on-t-link-mr3040/
Re: TP-Link MR3040 Questions
April 30, 2013 06:35PM
You should not use the stuff our of the "trunk" folder if possible. Try the Attitude Adjustment stuff.
Paul's HowTo above and David's are useful for this device. The only thing is, you don't have a switch and turn your head on smiling smiley Don't overwrite /etc/config/network completely.

But the PirateBox installation should switch the "option disabled" stuff for it's own.

MR3020 does not fit, but I have a custom image.. but this won't be accepted by the original UI. sad smiley (but later can be flashed via command line)
Re: TP-Link MR3040 Questions
April 30, 2013 07:08PM
What is the safest way to upgrade to the firmware at attitude adjustment?

http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin

I can log into the router and want the safest method after already bricking a 3020...I really don't want to have to install a serial port on the 3040

Could I wget the .bin file to the device and then use this?

ssh into the directory containing the .bin file

mtd -r write open*ar71*3040*.bin firmware
Re: TP-Link MR3040 Questions
April 30, 2013 08:53PM
correct
Re: TP-Link MR3040 Questions
April 30, 2013 10:04PM
hmmm
I cannot opkg to install usb and move the .bin file, cannot wget to an internet resource as it comes back "bad address" with my gateway and ip's setup correctly.
Any ideas on how to move the .bin to the openwrt 3040?

Language: PHP
root@OpenWrt:~# cat /etc/config/network config interface ';loopback'; option ifname ';lo'; option proto ';static'; option ipaddr ';127.0.0.1'; option netmask ';255.0.0.0';     config interface ';lan'; option ifname ';eth0'; option type ';bridge'; option proto ';static'; option ipaddr ';192.168.1.1'; option netmask ';255.255.255.0'; option gateway ';192.168.1.0'; list dns ';8.8.8.8';



Edited 6 time(s). Last edit at 05/01/2013 12:36AM by mdax.
Re: TP-Link MR3040 Questions
April 30, 2013 11:23PM
ha take that you dastardly 3040
scp to the rescue

Language: PHP
$ scp openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin root@192.168.1.1:/tmp/openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin root@192.168.1.1';s password: openwrt-ar71xx-generic-tl-mr3040-v1-squashfs- 100% 3840KB 1.9MB/s 00:02

Updating firmware worked great
mtd -r write open*ar71*3040*.bin firmware



Edited 1 time(s). Last edit at 05/01/2013 12:41AM by mdax.
Re: TP-Link MR3040 Questions
May 01, 2013 12:40AM
I am able to ssh as root into the 3040 however I cannot access any external network resources.

Language: PHP
root@OpenWrt:/etc/config# cat /etc/config/network config interface ';loopback'; option ifname ';lo'; option proto ';static'; option ipaddr ';127.0.0.1'; option netmask ';255.0.0.0';   config globals ';globals'; option ula_prefix ';fd5c:5916:8584::/48';   config interface ';lan'; option ifname ';eth0'; option type ';bridge'; option proto ';static'; option ipaddr ';192.168.1.1'; option netmask ';255.255.255.0'; option ip6assign ';60'; option gateway ';192.168.1.0'; list dns ';192.168.1.0'; list dns ';8.8.8.8';   root@OpenWrt:/etc/config# head -25 firewall config defaults option syn_flood 1 option input ACCEPT option output ACCEPT option forward REJECT <-SHOULD THIS BE ACCEPT # Uncomment this line to disable ipv6 rules # option disable_ipv6 1 config zone option name lan option network ';lan'; option input ACCEPT option output ACCEPT option forward REJECT <-SHOULD THIS BE ACCEPT   config zone option name wan option network ';wan'; option input REJECT <-SHOULD THIS BE ACCEPT option output ACCEPT option forward REJECT <-SHOULD THIS BE ACCEPT option masq 1 option mtu_fix 1   config forwarding

/etc/config/firewall may need updating but it had no effect on being able to ping google.com....
Language: PHP
root@OpenWrt:/etc/config# ping google.com ping: bad address ';google.com';

Previous posts indicate wanting to see the dmesg output
Language: PHP
root@OpenWrt:~# dmesg [ 0.000000] Linux version 3.8.9 (openwrt@OpenWRTBuild) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2012.12 r36485) ) #1 Mon Apr 29 08:34:35 MST 2013 [ 0.000000] MyLoader: sysp=fa89c804, boardp=69cd3b24, parts=31a09c82 [ 0.000000] bootconsole [early0] enabled [ 0.000000] CPU revision is: 00019374 (MIPS 24Kc) [ 0.000000] SoC: Atheros AR9330 rev 1 [ 0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 02000000 @ 00000000 (usable)       [ 0.080000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104) [ 0.080000] pid_max: default: 32768 minimum: 301 [ 0.080000] Mount-cache hash table entries: 512 [ 0.090000] NET: Registered protocol family 16 [ 0.090000] MIPS: machine is TP-LINK TL-MR3040 [ 0.350000] bio: create slab <bio-0> at 0 [ 0.360000] Switching to clocksource MIPS [ 0.360000] NET: Registered protocol family 2 [ 0.370000] TCP established hash table entries: 512 (order: 0, 4096 bytes) [ 0.370000] TCP bind hash table entries: 512 (order: -1, 2048 bytes) [ 0.370000] TCP: Hash tables configured (established 512 bind 512) [ 0.380000] TCP: reno registered [ 0.380000] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.390000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.400000] NET: Registered protocol family 1 [ 0.400000] PCI: CLS 0 bytes, default 32 [ 0.420000] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.420000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 0.430000] msgmni has been set to 56 [ 0.440000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253) [ 0.480000] ath79-spi ath79-spi: master is unqueued, this is deprecated [ 6.200000] eth0: link up (100Mbps/Full duplex) [ 6.860000] jffs2: notice: (449) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 12 of xref (0 dead, 2 orphan) found. [ 7.080000] eth0: link down [ 7.890000] compat-drivers backport release: compat-drivers-2013-03-28-5 [ 7.900000] Backport based on wireless-testing.git master-2013-04-16 [ 7.910000] compat.git: wireless-testing.git [ 8.290000] NET: Registered protocol family 10 [ 8.540000] usbcore: registered new interface driver usbfs [ 8.540000] usbcore: registered new interface driver hub [ 8.550000] usbcore: registered new device driver usb [ 9.220000] ath: EEPROM regdomain: 0x0 [ 9.220000] ath: EEPROM indicates default country code should be used [ 9.220000] ath: doing EEPROM country->regdmn map search [ 9.220000] ath: country maps to regdmn code: 0x3a [ 9.220000] ath: Country alpha2 being used: US [ 9.820000] nf_conntrack version 0.5.0 (452 buckets, 1808 max)   [ 15.470000] eth0: link up (100Mbps/Full duplex) [ 15.470000] br-lan: port 1(eth0) entered forwarding state [ 15.480000] br-lan: port 1(eth0) entered forwarding state [ 15.480000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 15.490000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready [ 17.480000] br-lan: port 1(eth0) entered forwarding state



Edited 5 time(s). Last edit at 05/02/2013 01:23AM by mdax.
Re: TP-Link MR3040 Installation Trials and Tribulations
May 01, 2013 03:41PM
Hi, the problem is a wrong gateway and dns address:

option gateway '192.168.1.0'
list dns '192.168.1.0'

0 is like an alias for the network 192.168.1.x

So you have to find out, what the IP adress of your internet-router is. .. if it is 192.168.1.1 you should choose a different IP adress for installing the piratebox like 192.168.1.2
Re: TP-Link MR3040 Installation Trials and Tribulations
May 01, 2013 06:00PM
My internet router/dsl modem is on my home network at IP address 192.168.1.0 and I was using 192.168.1.1 for the pirate box.
I've never had a problem running my router at the 192.168.1.0 address but can totally move it to 192.168.1.1 and use .2 for the pirate box....seems odd but I'll try it as it'll only take me a short effort.


WooHoo! You were totally correct....I reset router to new ip, modified /etc/config/network and shazaaam I can ping those google people
Language: PHP
root@OpenWrt:~# ping -c1 google.com PING google.com (74.125.229.225): 56 data bytes 64 bytes from 74.125.229.225: seq=0 ttl=54 time=82.722 ms   --- google.com ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 82.722/82.722/82.722 ms root@OpenWrt:~#



Edited 1 time(s). Last edit at 05/01/2013 11:52PM by mdax.
Re: TP-Link MR3040 Installation Trials and Tribulations
May 02, 2013 12:00AM
Sigh, each step seems to have something unique to play/deal with...but I don't seem to have bricked it yet! I have no idea why I seem to be an error magnet with this 3040...it's got to be the user!

Language: PHP
root@OpenWrt:~# opkg install kmod-usb-uhci Installing kmod-usb-uhci (3.8.10-1) to root... Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/kmod-usb-uhci_3.8.10-1_ar71xx.ipk. Multiple packages (kmod-usb-core and kmod-usb-core) providing same name marked HOLD or PREFER. Using latest. Collected errors: * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-uhci: * kernel (= 3.8.10-1-d1439517a92860b492bf085353ea16b5) * * opkg_install_cmd: Cannot install package kmod-usb-uhci.   root@OpenWrt:~# insmod usbcore insmod: can';t insert ';usbcore';: File exists   root@OpenWrt:~# insmod uhci   root@OpenWrt:~# opkg install kmod-usb-ohci Multiple packages (kmod-usb-ohci and kmod-usb-ohci) providing same name marked HOLD or PREFER. Using latest. Upgrading kmod-usb-ohci on root from 3.8.9-1 to 3.8.10-1... Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/kmod-usb-ohci_3.8.10-1_ar71xx.ipk. Multiple packages (kmod-usb-core and kmod-usb-core) providing same name marked HOLD or PREFER. Using latest. Collected errors: * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-ohci: * kernel (= 3.8.10-1-d1439517a92860b492bf085353ea16b5) * * opkg_install_cmd: Cannot install package kmod-usb-ohci.   root@OpenWrt:~# insmod usb-ohci

However ehci indicates it has love for my usb stick when it's plugged in via dmesg output
Language: PHP
[ 94.100000] usb 1-1: new high-speed USB device number 2 using ehci-platform



Edited 3 time(s). Last edit at 05/02/2013 12:14AM by mdax.
Re: TP-Link MR3040 Installation Trials and Tribulations
May 02, 2013 04:22AM
Hi,
the problem is the following line:
kernel (= 3.8.10-1-d1439517a92860b492bf085353ea16b5) *

This is because the trunk images are not stable...

Try this image-version / download-link instead:

Language: PHP
http://downloads.openwrt.org/attitude_adjustment/12.09-rc2/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3040-v1-jffs2-factory.bin
(I always recommend using the last stable version. In this case it is called "attitude-adjustment 12.09 RC2)


edit: BTW, I have one MR3040 for my own and I installed more than 3 for others on CryptoParty 5 (confirmed as working....)



Edited 2 time(s). Last edit at 05/02/2013 04:26AM by Matthias.
Re: TP-Link MR3040 Installation Trials and Tribulations
May 02, 2013 04:35AM
or you use my image:
Language: PHP
http://piratebox.aod-rpg.de/mesh_test/openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin
This has all needed drivers included, so you can step directly to opkg install piratebox..
Re: TP-Link MR3040 Installation Trials and Tribulations
May 02, 2013 02:22PM
Matthias I very much appreciate your assistance.

Updating WRT to non trunk version!
Language: PHP
root@OpenWrt:~# cd /tmp root@OpenWrt:/tmp# wget http://piratebox.aod-rpg.de/mesh_test/openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin Connecting to piratebox.aod-rpg.de (87.237.121.137:80) openwrt-ar71xx-gener 100% |*******************************************************************************| 3840k 0:00:00 ETA root@OpenWrt:/tmp# ls TZ overlay dhcp.leases resolv.conf etc resolv.conf.auto lock run log state openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin sysinfo root@OpenWrt:/tmp# mtd -r write openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin firmware
Re: TP-Link MR3040 Installation Trials and Tribulations
May 02, 2013 03:44PM
THANK YOU MATTHIAS!!!
You need to set up a "Buy Matthias A Beer" paypal link!
Re: TP-Link MR3040 Installation Trials and Tribulations
May 02, 2013 08:39PM
I'll be using this box at remote locations or local spots with no internet while cave diving. We have teams that need to share information regarding scheduling, tables and other files. It will sit on site for several days while teams are in and out of the cave.

I purchased a Joos Orange to provide extra battery/solar power and can't wait to test how long the Joos battery and internal will work.





Edited 1 time(s). Last edit at 05/02/2013 08:40PM by mdax.
Re: TP-Link MR3040 Installation Trials and Tribulations
May 03, 2013 01:01AM
Is there a way to query the battery level on the 3040?
I'd like to run a cron job every hour and check it, if the level is outside satisfactory parameters then poweroff....
Re: TP-Link MR3040 Installation Trials and Tribulations
May 03, 2013 04:38AM
mdax Wrote:
-------------------------------------------------------
> THANK YOU MATTHIAS!!!
> You need to set up a "Buy Matthias A Beer" paypal
> link!

Did you know, that I had this already and PayPal closed my complete account because of this?
You can still send donation to my bitcoin adress or amazon gift-cards to my email.

I would love to have a battery-level check too :/
But MR3040 runs with the stock battery around 6-8 hours (depending on the usage).

Very cool idea !!!! grinning smiley


This is only my signature.
Re: TP-Link MR3040 Installation Trials and Tribulations
May 07, 2013 06:27AM
Got my piratebox up and working with a MR3040 v2 and a 32GB usb micro stick in it!

Used a modified bin file from this thread [forum.openwrt.org] which worked great. Had it all opened up ready to try the serial route.

mdax, was yours a v1 or v2?
Matthias, after trying to install the version from
"[downloads.openwrt.org];

After the reboot, my device seems bricked. I cannot see the piratebox share freely, though if I lan connect to the 3040, it shows unidentified network.
I am beginning to think I need to reflash using serial, could you provide me step by step instructions for setting up a serial debrick? (It may not even be bricked, though I cannot access it via lan directly, through network, or telnet, ssh/putty into it. It seems stuck in the middle of upgrading or something. Haha, I understand how busy you are, and any help would be appreciated. I have poured through forums, serial console wikis, etc, and still am unsure.
Ok,

I've installed to the point of :

/opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard

It gives me a "failed to download downloads/openwrt.org .... , wget returned 1.
Error: not Internet connection

What now?
Re: TP-Link MR3040 Installation Trials and Tribulations
October 23, 2013 04:58PM
ensure that you internet connection works and you can ping 8.8.8.8 ?!
Morning

I can ping. I read about changing my ipaddr in vi /etc/config/network to my original ip that works on home network, mine is 192.168.100.111

I have laptop connected to home network, and MR3040 plugged into the home network,

I can ssh in through laptop using putty

I have just pinged various ip and urls.

But when I use

/opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard

It takes an age and then gives me the error message

Can't connect to remote host (192.168.1.1) : connection timed out
* opkg download: failed to download [downloads.openwrt.org], wget returned 1
ERROR:not internet connection
Re: TP-Link MR3040 Installation Trials and Tribulations
October 23, 2013 05:39PM
Hey,
you forgot to start with

/etc/init.d/piratebox nodns

that enables your box having internet access
Thanks for the reminder... Got nothing. ,

It just listed

Root@ address ~#
Re: TP-Link MR3040 Installation Trials and Tribulations
October 23, 2013 05:48PM
the nodns command has no output, but after that the dns resolution won't always point to 192.168.1.1 anymore like:


>> Can't connect to remote host (192.168.1.1) : connection timed out
>> * opkg download: failed to download [downloads.openwrt.org], wget returned 1
>> ERROR:not internet connection
Dude! you didn't tell me I had to do it as two separate commands

:-)

I've read it is putting in one line

Now done as separate lines now and it worked.

But now it is saying

Start stop daemon : warning : killing process : killing process 842: no such process
1
Stopping lighttpd
1
Unmount: can't unmount /opt/piratebox: device or resource busy

I feel I am closer to the finish, but still not sure.
Re: TP-Link MR3040 Installation Trials and Tribulations
October 23, 2013 06:01PM
what was the last command you ran?
I thought you are installing kareha board? uhm... why does it stop the runnng processes?
Hi, yes that was the

/etc/init.d/piratebox nodns

Then the imageboard install