Re: MR3020 does not serve home page any more [Solved]

Posted by iamarf 
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
Re: MR3020 does not serve home page any more [Solved]
July 08, 2014 07:36AM
Using PB a lot for a month: really smart (involving teachers in italy: here and here).

Yesterday wanted to add some mods:
    [*] RESET_CHAT="no" -> ok
    [*] UPLOADFOLDER="$SHARE_FOLDER/Upload" -> troubles began

At first I made it wrong by creating the Upload directory in the wrong place, but then I put it in /mnt/usb/PirateBox, but the problem remained: the wireless network is there - all devices sees it, DHCP lease was correct - but the PB home was not reachable.

Basically, what I see:
    [*] dmesg tells about difficulties in mounting EXT4-fs
    [*] ps: no python is running
    [*] ps: no lighttpd

I would like to understand what's going on and, if possible solve in a more clever way than, eventually, reinstalling - with mtd write -r openwrt<TAB> firmware (correct?)

Here the output, that I compared with your example

***
mount
***
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlayfs (rw,relatime,lowerdir=/,upperdir=/overlay)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda1 on /mnt/usb type vfat (rw,sync,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/loop0 on /mnt/ext type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
/dev/loop1 on /opt/piratebox type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
none on /proc/bus/usb type usbfs (rw,relatime)

***
ls -la /mnt/
***
drwxr-xr-x    1 root     root             0 Jan  1 00:01 .
drwxr-xr-x    1 root     root             0 Jan  1 00:00 ..
drwxr-xr-x    4 root     root          1024 May 29  2014 ext
drwxrwxrwx   11 root     root         16384 Jan  1 00:00 usb

***
ls -la /mnt/usb (yes, I have other stuff there, but it did not create problems till now...)
***
drwxrwxrwx   11 root     root         16384 Jan  1 00:00 .
drwxr-xr-x    1 root     root             0 Jan  1 00:01 ..
drwxrwxrwx    4 root     root         16384 Apr 27  2014 .Spotlight-V100
drwxrwxrwx    4 root     root         16384 Jun  8  2014 .Trash-1000
drwxrwxrwx    2 root     root         16384 Apr 27  2014 .Trashes
-rwxrwxrwx    1 root     root          4096 Apr 27  2014 ._.Trashes
-rwxrwxrwx    1 root     root          4096 May 25  2014 ._video ISIA
drwxrwxrwx    2 root     root         16384 Apr 27  2014 142704_pollock
drwxrwxrwx    5 root     root         16384 Jan  1  1980 PirateBox
-rwxrwxrwx    1 root     root     216148461 Jan  1  1980 PirateBox.tgz
drwxrwxrwx    2 root     root         16384 Jan  1 00:06 debug
drwxrwxrwx   12 root     root         16384 Jan  1  1980 etc
drwxrwxrwx    2 root     root         16384 Jan  1  1980 external_fs
drwxrwxrwx    3 root     root         16384 Jan  1  1980 install
-rwxrwxrwx    1 root     root         50925 Jan  1  1980 install.log
-rwxrwxrwx    1 root     root       3932160 Jun  6  2014 openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin

***
ls -la /mnt/usb/PirateBox
***
drwxrwxrwx    5 root     root         16384 Jan  1  1980 .
drwxrwxrwx   11 root     root         16384 Jan  1 00:00 ..
drwxrwxrwx    6 root     root         16384 Jan  1  1980 Shared
drwxrwxrwx   11 root     root         16384 Jan  1  1980 board
-rwxrwxrwx    1 root     root        156504 Jan  1  1980 cerco-messaggio
-rwxrwxrwx    1 root     root          4876 Jan  1  1980 index-da-opt-piratebox-www.html
-rwxrwxrwx    1 root     root          4554 Jun  9  2014 index.html
-rwxrwxrwx    1 root     root      52428800 Jan  1 00:00 pbIMG_ws.img
drwxrwxrwx    2 root     root         16384 Jan  1  1980 tmp

***
ls -la /opt/piratebox
***
drwxr-xr-x   10 root     root          1024 Jan  1 00:00 .
drwxr-xr-x    3 root     root             0 Jan  1 00:04 ..
drwxr-xr-x    3 root     root          1024 May 29  2014 bin
drwxr-xr-x    3 root     root          1024 Jan  1 00:00 conf
drwxr-xr-x    2 root     root          1024 May 29  2014 init.d
drwx------    2 root     root         12288 Jan 16  2014 lost+found
drwxr-xr-x    2 root     root          1024 Jan  1 00:02 python_lib
lrwxrwxrwx    1 root     root            18 Jan  1 00:00 share -> /mnt/usb/PirateBox
drwxr-xr-x    2 root     root          1024 Jan  1 00:02 src
drwxr-xr-x    2 nobody   nogroup       1024 Jan  1 00:00 tmp
-rw-r--r--    1 root     root            19 May 29  2014 version
drwxr-xr-x    4 nobody   nogroup       1024 Jan  1 00:02 www

***
ls -la /opt/piratebox/www
***
drwxr-xr-x    4 nobody   nogroup       1024 Jan  1 00:02 .
drwxr-xr-x   10 root     root          1024 Jan  1 00:00 ..
-rwxr-xr-x    1 nobody   nogroup       1458 May 29  2014 .READ.ME.htm
lrwxrwxrwx    1 root     root            27 Jan  1 00:04 Shared -> /opt/piratebox/share/Shared
lrwxrwxrwx    1 root     root            26 Jan  1 00:04 board -> /opt/piratebox/share/board
drwxr-xr-x    2 nobody   nogroup       1024 May 29  2014 cgi-bin
-rw-r--r--    1 nobody   nogroup        810 Jan  1 00:00 chat_content.html
-rwxr-xr-x    1 nobody   nogroup       1406 May 29  2014 favicon.ico
-rwxr-xr-x    1 nobody   nogroup        254 Jan  1 00:04 forum.html
-rwxr-xr-x    1 nobody   nogroup       4876 Jan  1 00:16 index.html
-rw-r--r--    1 nobody   nogroup       3773 Jan  1 00:08 index.html.bak
-rw-r--r--    1 nobody   nogroup       4416 Jan  1  1970 index.html.ita.bak
-rwxr-xr-x    1 nobody   nogroup      94840 May 29  2014 jquery.min.js
drwxr-xr-x    3 nobody   nogroup       1024 May 29  2014 library
-rw-r--r--    nogroup       2992 May 29  2014 menu.png
-rw-r--r--    1 nobody   nogroup         15 May 29  2014 ncsi.txt
-rw-r--r--    1 nobody   nogroup       6607 May 29  2014 piratebox-logo-horizontal-white.png
-rwxr-xr-x    1 nobody   nogroup      12637 May 29  2014 piratebox-logo-small.png
-rwxr-xr-x    1 nobody   nogroup        201 Jan  1  1970 redirect.html
-rwxr-xr-x    1 nobody   nogroup       3715 May 29  2014 scripts.js
-rw-r--r--    1 nobody   nogroup       5056 May 29  2014 style.css

***
cat /opt/piratebox/version
***
piratebox-ws_1.0.0

***
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'

***
cat /etc/config/wireless
***
config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11ng'
	option macaddr '10:fe:ed:4c:c7:52'
	option htmode 'HT20'
	list ht_capab 'SHORT-GI-20'
	list ht_capab 'SHORT-GI-40'
	list ht_capab 'RX-STBC1'
	list ht_capab 'DSSS_CCK-40'
	option disabled '0'

config wifi-iface
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option encryption 'none'
	option ssid 'PirateBox - Share Freely'

***
cat /etc/openwrt_release
***
DISTRIB_ID="OpenWrt_backports"
DISTRIB_RELEASE="12.09.2"
DISTRIB_REVISION="r40431"
DISTRIB_CODENAME="attitude_adjustment"
DISTRIB_TARGET="ar71xx/generic"
DISTRIB_DESCRIPTION="OpenWrt_backports Attitude Adjustment 12.09.2"
DISTRIB_BACKPORT="V0.2"

***
cat /etc/pbx_custom_image 
***
PBX_auto_Image_2.1

***
dmesg | tail -n 20
***
[   35.140000] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null)
[   35.300000] EXT4-fs (loop1): couldn't mount as ext3 due to feature incompatibilities
[   35.310000] EXT4-fs (loop1): couldn't mount as ext2 due to feature incompatibilities
[   35.340000] EXT4-fs (loop1): mounted filesystem with ordered data mode. Opts: (null)
[   36.950000] ADDRCONF(NETDEV_UP): eth0: link is not ready
[   36.950000] device eth0 entered promiscuous mode
[   36.960000] ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   37.410000] eth0: link up (100Mbps/Full duplex)
[   37.410000] br-lan: port 1(eth0) entered forwarding state
[   37.420000] br-lan: port 1(eth0) entered forwarding state
[   37.420000] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   37.450000] ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   39.420000] br-lan: port 1(eth0) entered forwarding state
[   44.010000] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   44.010000] device wlan0 entered promiscuous mode
[   44.030000] br-lan: port 2(wlan0) entered forwarding state
[   44.040000] br-lan: port 2(wlan0) entered forwarding state
[   44.040000] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   46.040000] br-lan: port 2(wlan0) entered forwarding state
[   47.590000] Adding 32764k swap on /mnt/usb/external_fs/OpenWRT.swap.  Priority:-1 extents:1 across:32764k 

***
ps
***
  PID USER       VSZ STAT COMMAND
    1 root      1504 S    init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    5 root         0 SW   [kworker/u:0]
    6 root         0 SW<  [khelper]
   63 root         0 SW   [sync_supers]
   65 root         0 SW   [bdi-default]
   67 root         0 SW<  [kblockd]
   96 root         0 SW   [kswapd0]
  144 root         0 SW   [fsnotify_mark]
  173 root         0 SW<  [ath79-spi]
  184 root         0 SW   [mtdblock0]
  189 root         0 SW   [mtdblock1]
  194 root         0 SW   [mtdblock2]
  199 root         0 SW   [mtdblock3]
  204 root         0 SW   [mtdblock4]
  209 root         0 SW   [mtdblock5]
  250 root         0 SW   [kworker/0:1]
  390 root         0 SW   [kworker/0:2]
  442 root         0 SWN  [jffs2_gcd_mtd3]
  472 root         0 SW   [khubd]
  481 root         0 SW   [scsi_eh_0]
  482 root         0 SW   [usb-storage]
  483 root         0 SW   [kworker/u:2]
  507 root      1504 S    init
  540 root         0 SW<  [cfg80211]
  615 root         0 SW<  [bat_events]
  642 root      1508 S    /sbin/syslogd -C16
  644 root      1488 S    /sbin/klogd
  646 root       872 S    /sbin/hotplug2 --override --persistent --set-rules-file /etc/hotplug2.rules --set-coldplug-cmd /sbin/u
  654 root       872 S    /sbin/ubusd
  725 root         0 SW<  [loop0]
  730 root         0 SW   [jbd2/loop0-8]
  731 root         0 SW<  [ext4-dio-unwrit]
  751 root         0 SW<  [loop1]
  756 root         0 SW   [jbd2/loop1-8]
  757 root         0 SW<  [ext4-dio-unwrit]
  762 root      1468 S    /sbin/netifd
  931 root         0 SW   [flush-8:0]
 1206 root      1640 S    hostapd -P /var/run/wifi-phy0.pid -B /var/run/hostapd-phy0.conf
 1354 root      1500 S    /sbin/watchdog -t 5 /dev/watchdog
 1467 root      1152 S    /usr/sbin/dropbear -P /var/run/dropbear.1.pid -p 22
 1505 nobody     956 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf
 1522 root      1500 S    /usr/sbin/ntpd -n -p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp.org -p 3.o
 1523 root      1220 S    /usr/sbin/dropbear -P /var/run/dropbear.1.pid -p 22
 1524 root      1524 S    -ash
 1573 root      1496 R    ps



Edited 1 time(s). Last edit at 07/14/2014 07:07AM by iamarf.
Re: MR3020 does not serve home page any more
July 09, 2014 06:56PM
Hi,
no no no - No reflash required!

Simply check manually what the droopy issue is. Login to your box and run

/etc/init.d/piratebox stop
/etc/init.d/piratebox start

The upload folder should be placed (in the config above)

/opt/piratebox/share/Shared/Upload

Verify that with

ls -l /opt/piratebox/share/Shared/

Be sure the foldername is capitalized correctly.

Double check as well, if you have a missing hyphen in piratebox.conf (maybe post it here)

Regards
Matthias


This is only my signature.
Re: MR3020 does not serve home page any more
July 09, 2014 10:55PM
Thanks Matthias, you are doing great work...

I tried but the problem is... the piratebox script is not where it is supposed to be eye popping smiley (see last edit at the end)

/etc/init.d/piratebox stop
-ash: /etc/init.d/piratebox: not found

oh, let me see...
ls -la /etc/init.d/piratebox
lrwxrwxrwx    1 root     root            30 Jan  1 00:03 /etc/init.d/piratebox -> /mnt/ext//etc/init.d/piratebox

why those double slashes?
anyway in /mnt/ext/ all I have is
ls -la /mnt/ext/
drwxr-xr-x    4 root     root          1024 May 29  2014 .
drwxr-xr-x    1 root     root             0 Jan  1 00:01 ..
drwx------    2 root     root         12288 Jan 16  2014 lost+found
drwxr-xr-x    3 root     root          1024 May 29  2014 usr

Here the piratebox.conf - give up to the alternative upload folder for a while, want to recover the situation first...

#########
## Config for pirate-box WWW Release
##  written by Matthias Strubel  (matthias.strubel@aod-rpg.de) 2011-02-22 
##  licenced by gpl ; feel free to improve or send me feedback
##
##  2012-04-12 Created
##  2012-06-08 Changed IP Stuff to generating dnsmasq.conf stuff
##             ADDed SubConfig for IPV6 config
##             Changed Order of config
##  2013-08-14 Added timesave url
##  
########

#######
## Configuration help
##    If you plan to use one laptop as the piratebox:
##        Set DO_IFCONFIG , USE_APN, USE_DNSMASQ to yes
##    If you plan to run a two component setup (one router and one providing the storage+website)
##     connected with ethernet:
##        Set DO_IFCONFIG , USE_APN, USE_DNSMASQ  to no
##        Configure your ethernet eth0 (or whatever) to a static IP
##        force your router to publish the  HOST Option with your static IP; in case of dnsmasq add the /etc/hosts entrys 
##        Have a look at [wiki.daviddarts.com] for futher instructions
##    
##    You may deactivated severall option as needed. It's flexible.


#----------------- Folder Configuration  -------------------#

PIRATEBOX_FOLDER="/opt/piratebox"
WWW_FOLDER="/opt/piratebox/www"

#Do not change untill really needed.
PIRATEBOX_PYTHONPATH="$PIRATEBOX_FOLDER/python_lib"


#Datafolder  , where is you usb-stick // drive mounted
SHARE_FOLDER="$PIRATEBOX_FOLDER/share"

#Upload Folder
# Change this if you want to user uploaded data in a subfolder
#   Make sure the folder exists
#UPLOADFOLDER="$SHARE_FOLDER/Upload"
UPLOADFOLDER="$SHARE_FOLDER/Shared"

#----------------- Startup Configuration  -------------------#
# Which Steps has to be done

#Do network config 
DO_IFCONFIG="no"

#Do IW config - setting up a wlan0 interface with iw
#  for some wifi-cards required
DO_IW="no"
#Iw physical interface  
PHY_IF="phy0"

# Check if interface exists
#  should be set to yes if you use a USB wifi card
PROBE_INTERFACE="no"
#  wait how many seconds until throw an error
PROBE_TIME=10

#Start services...
#   act like a apn  / <yes|no>
#    please have a look @ hostapd.conf ; you may need to change some options, regarding wifi-card 
USE_APN="no"
#   act like dns&dhcp (dnsmasq) 
USE_DNSMASQ="yes"

#HOSTNAME  ... if you really want to change it, plz change:
#    bin/droopy
#    conf/hosts
HOST="piratebox.lan"

#----------------- Configuration for DNSMASQ & IF-Setup  -------------------#
# Name of the wlan interface
INTERFACE="wlan0"
# On which interface DNSMASQ should listen. -i is the parameter for dnsmasq
# Make it empty to disable
DNSMASQ_INTERFACE="br-lan"

#Brdige add interfacce (setr yes to enable bridging)
DO_BRIDGE="no" 
BRIDGE="br-lan"

#Network
NET=192.168.1

#IP-SHORT (is stringed together)
#  Which IP is your Box??  i.e. 1 => 192.168.1.1
IP_SHORT=1

#DHCP LEASE Start
START_LEASE=10
#DHCP LEASE End Range
END_LEASE=250
#Leasetime  (When should the client renew it's IP)
LEASE_DURATION=12h

# Where is the leasefile stored to?
LEASE_FILE_LOCATION=$PIRATEBOX_FOLDER/tmp/lease.file


# Define the netmask
NETMASK=255.255.255.0

#SET IP for ifconfig stuff - DON'T CHANGE
IP=$NET.$IP_SHORT 

#Load Config about ipv6 stuff - DON'T CHANGE
 . $PIRATEBOX_FOLDER/conf/ipv6.conf


#----------------- Configuration for the pure piratebox -------------------#
## droopy, webserver, shoutbox- and forum-server 

## Timesave file for non RTC devices
TIMESAVE="$PIRATEBOX_FOLDER/share/timesave_file"

#Start droopy? - Enable upload?
DROOPY_ENABLED="yes"
#Image-SRC
IMAGENAME="piratebox-logo-small.png"
IMAGE="$PIRATEBOX_FOLDER/src/$IMAGENAME"
DROOPY_TXT=""
DROOPY_PORT="8080"
DROOPY_USERDIR=""
# Uncomment line below for adding directory feature
#DROOPY_USERDIR=" -u True "

#Use UserId from lighttpd for droopy  (use on ext-filesystems)
DROOPY_USE_USER="no"

#Configuration for chat  (If you decide to move the chat folder, you have to change /opt/piratebox/chat/cgi-bin/py* files )
CHATFILE="$WWW_FOLDER/cgi-bin/data.pso"

#Generated File
GEN_CHATFILE="$WWW_FOLDER/chat_content.html"

# Reset Shoutbox on Startup?
RESET_CHAT="yes"

#Inititiation Chat-Message
CHATMSG="<div class='message'><date>00:00:00</date> <name>PirateBox:</name> <data class='def'>Chat and share files anonymously!</data></div>" 

#Activate Global chat
# Still experimentall!
GLOBAL_CHAT="no"

#On which broadcast address should it send
#  Take care on the syntax!!
GLOBAL_DEST="[ #255.255.255.255# , #10.255.255.255# , #$NET.255# ]"

#------------------------ Additional configuration for lighttpd 
LIGHTTPD_USER=nobody
LIGHTTPD_GROUP=nogroup


#------------------------ Hook in user-config
.  $PIRATEBOX_FOLDER/conf/hook_custom.conf


EDIT 12:18PM 10 July

Oh... I found a previous thread (HELP: Can't Open PirateBox in Browser, by TXTCL55) with the same problem, basically. In that case the problem was solved by reflashing the device.

However the stuck point was the same:

-ash: /etc/init.d/piratebox: not found

and, therefore, the same problem: whereis the link...

/etc/init.d/piratebox -> /mnt/ext//etc/init.d/piratebox

gone? Why have TXTCL55 and me lost some content of /mnt/ext? Is this question silly posed? What should we study to understand this?

No hurry, just want to learn enough in order to be able to help some 20-30 teachers that are waiting the PirateBox I'm going to prepare for them... a bit crazy but i really like the idea spinning smiley sticking its tongue out



Edited 2 time(s). Last edit at 07/10/2014 10:28AM by iamarf.
Re: MR3020 does not serve home page any more
July 12, 2014 04:26PM
needing to have the box running
saved USB stuff
reflashed (upgrading procedure)
ok
smiling smiley
thanks
Re: MR3020 does not serve home page any more [Solved]
July 13, 2014 02:49PM
Forgot to declare solved the issue. Sorry.

Even if the solution was simple - it is really easy to save your stuff, then perform the upgrading procedure - still would like to understand how could have happened that, playing with the location of the Upload directory, it turned out to have the /mnt/ext/lib, /mnt/ext/usr, /mnt/ext/tmp and all the content in /mnt/ext/etc wiped?

If I'll undestand this I'll tell on this thread :-)
Re: MR3020 does not serve home page any more [Solved]
July 21, 2014 07:15PM
Quote

still would like to understand how could have happened that, playing with the location of the Upload directory, it turned out to have the /mnt/ext/lib, /mnt/ext/usr, /mnt/ext/tmp and all the content in /mnt/ext/etc wiped?
You didn't run /etc/init.d/ext init , did you? I wonder about that too. That connection makes no sense to me...

I'm glad you got it working.


This is only my signature.
Re: MR3020 does not serve home page any more [Solved]
July 21, 2014 09:04PM
No, I didn't run /etc/init.d/ext init. Actually, the connection makes no sense.

Lesson learned so far: enthusiastic, I was doing things too fast => one has to act as an administrator even if the box is small! Double think, double check, save before changing...

Thanks for coming back Matthias