Piratebox 1.2 Testing hot smiley

Posted by Matthias 
Piratebox 1.2 Testing hot smiley
July 29, 2017 04:09PM
Some new development steps. I created two RPi images as an alpha version. You can find the download here [reshare.bitcave.cc] , the openwrt images can be found in development.piratebox.de

In addition, the OpenWrt/LEDE images are rebuild together with sftp server included. The sftp server is not yet tested by myself.. so if you can jump in, it is appreciated.

What can you expect:
CHANGELOG
Much changes. .. a bunch internal ones. Some cleanups.
A more obvious browse button...

There are still some points left to do(Mileston 1.2)

If you do testing, you may want to work with this Checklist.

I also want to know your feedback about the captive portal.

If you start testing, it is recommended to have a look into the 1.2 development log.

Would love to get some feedback.

Thanks Matthias



Edited 4 time(s). Last edit at 07/30/2017 09:15AM by Matthias.
Re: Piratebox 1.2 Testing hot smiley
July 30, 2017 01:50PM
Hi Matthias,

I just wanted to give this version a try, but now I found two different images for my gl-inet-v1 and I don't know which one to use or how to identify the correct version.
I used to go with gl-inet-v1 but now there are versions for (6408A-v1 and 6416A-v1) and I don't want to brick my device.

Any hints?

Regards,
Michael
Re: Piratebox 1.2 Testing hot smiley
July 30, 2017 02:54PM
Ok, I found the difference between these two which is basically the flash size.
Since the old gl-inet-v1 image from 2014 was 16 MB in size, I think it is save to use the 6416A image for my GL.iNet.

Regards,
Michael
Re: Piratebox 1.2 Testing hot smiley
July 30, 2017 05:32PM
Hi,
yes 95% of the Glinets are the 16MB version. Because the 8MB flash is coming out of the toolchain, I'll take it smiling smiley

Thanks for helping,
best regards
Matthias
Re: Piratebox 1.2 Testing hot smiley
September 02, 2017 03:25PM
Hi Matthias,

I tried the setup several times but I always end up with an empty /opt/piratebox folder.
After my first attempt I noticed that there was still the old web installed on my GL Inet and so I decided to start with a fresh usb stick only containing the auto_flash and the extracted install folder from the openwrt link in this topic.

After booting the GL Inet with this configuration I was not able to connect to the box even after some hours.
Connecting to the static ip was possible and I found no hints about what went wrong but the empty /opt/piratebox folder shows me that there is something missing.

How can I tell if the auto_flash was successful and if everything fits together?

root@piratebox:/mnt/usb/auto_flash# ls -la
drwxrwxrwx    2 root     root         16384 Jul 30 15:31 .
drwxrwxrwx    8 root     root         16384 Sep  2 15:11 ..
-rwxrwxrwx    1 root     root          4096 Jul 30 15:32 ._openwrt-lede-17.01.2-ar71xx-generic-gl-inet-6416A-v1-squashfs-factory.bin
-rwxrwxrwx    1 root     root      16252928 Jul 30 13:51 openwrt-lede-17.01.2-ar71xx-generic-gl-inet-6416A-v1-squashfs-factory.bin

root@piratebox:/mnt/usb/install# ls -la
drwxrwxrwx    3 root     root         16384 Sep  2 15:23 .
drwxrwxrwx    8 root     root         16384 Sep  2 15:11 ..
-rwxrwxrwx    1 root     root          4096 Sep  2 14:19 ._OpenWRT.img.gz
-rwxrwxrwx    1 root     root          4096 Sep  2 14:20 ._auto_package
-rwxrwxrwx    1 root     root          4096 Sep  2 14:19 ._cache
-rwxrwxrwx    1 root     root          4096 Sep  2 14:19 ._kareha_3.1.4.zip
-rwxrwxrwx    1 root     root          4096 Sep  2 14:19 ._piratebox_ws_1.2_img.tar.gz
-rwxrwxrwx    1 root     root        108542 Jul 29 14:27 OpenWRT.img.gz
-rwxrwxrwx    1 root     root           153 Jan  1  1980 auto_package_done
drwxrwxrwx    2 root     root         49152 Sep  2 14:19 cache
-rwxrwxrwx    1 root     root        222185 Jul 29 14:27 kareha_3.1.4.zip
-rwxrwxrwx    1 root     root        240582 Jul 29 14:27 piratebox_ws_1.2_img.tar.gz

Jan  1 00:00:49 piratebox syslog.info syslogd started: BusyBox v1.19.4
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : executing run_test
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Testing requirements...
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : .. USB storage modules available
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : extendRoot package is installed
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : executing run_signaling_extendRoot_start
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : executing run_prepare_extendRoot
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : configure initi step for extendRoot
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : executing run_init_extendRoot
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : not running extendRoot init, because it already is
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : executing run_signaling_extendRoot_stop
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : executing run_test_installation_destination
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Testing if installation destination by extendRoot is available.
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Installation destination is available.
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : executing run_fake_opkg_update
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Getting main Repository from /etc/opkg.conf
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Doing fake opkg update (copy from cache folder (attitude_adjustment)
Jan  1 00:00:49 piratebox user.notice root: cp: can't stat '/mnt/usb/install/cache/Package.gz_main': No such file or directory
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : .. doing it for Piratebox repository (optional)
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : executing run_signaling_package_start
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh: line 26: can't create /sys/class/leds/*3g/trigger: nonexistent directory
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh: line 26: can't create /sys/class/leds/*usb/trigger: nonexistent directory
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : executing run_install_package
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Installing packge extendRoot-openssh-sftp-server 
Jan  1 00:00:50 piratebox user.notice root: Installing extendRoot-openssh-sftp-server (0.15.1-4) to ext...
Jan  1 00:00:50 piratebox user.notice root: Copying /mnt/usb/install/cache/extendRoot-openssh-sftp-server_0.15.1-4_all.ipk.
Jan  1 00:00:50 piratebox user.notice root: Collected errors:
Jan  1 00:00:50 piratebox user.notice root:  * satisfy_dependencies_for: Cannot satisfy the following dependencies for extendRoot-openssh-sftp-server:
Jan  1 00:00:50 piratebox user.notice root:  * 	openssh-sftp-server * 
Jan  1 00:00:50 piratebox user.notice root:  * opkg_install_cmd: Cannot install package extendRoot-openssh-sftp-server.
Jan  1 00:00:50 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:50 piratebox user.notice root: /bin/box_installer.sh : executing run_signaling_package_stop
Jan  1 00:00:50 piratebox user.notice root: /bin/box_installer.sh: line 26: can't create /sys/class/leds/*3g/trigger: nonexistent directory
Jan  1 00:00:50 piratebox user.notice root: /bin/box_installer.sh: line 26: can't create /sys/class/leds/*3g/brightness: nonexistent directory
Jan  1 00:00:50 piratebox user.notice root: /bin/box_installer.sh: line 26: can't create /sys/class/leds/*usb/trigger: nonexistent directory
Jan  1 00:00:50 piratebox user.notice root: /bin/box_installer.sh: line 26: can't create /sys/class/leds/*usb/brightness: nonexistent directory
Jan  1 00:00:50 piratebox user.notice root: /bin/box_installer.sh : Trying to find next step
Jan  1 00:00:50 piratebox user.notice root: /bin/box_installer.sh : executing exit
Jan  1 00:00:50 piratebox user.notice root: Multiple line auto_package found. Shifting 1st line to auto_package_done
---------------------------------------------

Best regards
Michael
Re: Piratebox 1.2 Testing hot smiley
September 02, 2017 10:22PM
Hi Michael,
what I wrote on Twitter is wrong, but let me explain what the issue is in your case:

Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : Doing fake opkg update (copy from cache folder (attitude_adjustment)
Jan  1 00:00:49 piratebox user.notice root: cp: can't stat '/mnt/usb/install/cache/Package.gz_main': No such file or directory
Jan  1 00:00:49 piratebox user.notice root: /bin/box_installer.sh : .. doing it for Piratebox repository (optional)
This is the first message I found.. but the issue is not that the file is missing. Between PirateBox 1.1 and Piratebox 1.2 I changed the structure of the install folder. The files are now named different:

$ ls *gz* -1
Package.gz_piratebox
Package.gz_reboot_base
Package.gz_reboot_core
Package.gz_reboot_luci
Package.gz_reboot_packages
Package.gz_reboot_routing
Package.gz_reboot_telephony

It seems that the auto_flash folder was not worked on, because the the image file
openwrt-lede-17.01.2-ar71xx-generic-gl-inet-6416A-v1-squashfs-factory.bin
should be renamed to openwrt-lede-17.01.2-ar71xx-generic-gl-inet-6416A-v1-squashfs-factory.bin.<num>

I say, that the auto_flash did not kick in. That may be a specific glinet issue.

What is the output of the following commands?
. /lib/ar71xx.sh
ar71xx_board_name

Let's try to debug the reason for this...

Thank you for your efforts,
Matthias
Re: Piratebox 1.2 Testing hot smiley
September 03, 2017 12:28AM
Hi Matthias,

thank you for your quick reply.
This is the result:

root@piratebox:~# . /lib/ar71xx.sh 
root@piratebox:~# ar71xx_board_name
gl-inet

Regards
Michael
Re: Piratebox 1.2 Testing hot smiley
September 03, 2017 11:56AM
Hi Matthias,

since the auto_flash feature did not kick in, I thought that I might have downgraded my GL-Init sometime in the past and tried to install the firmware update manually.
As a result I got a login prompt with the hostname LEDE and from the log I got the message there was no auto_package folder to be processed.

The previous run had some errors but renamed the auto_package directory to auto_package_done.

After renaming it back to auto_package and rebooting the box, it seems that the installation kicked in and is still running.
At this time the /opt/piratebox folder is not empty any more and the version is:
root@LEDE:~# cat /opt/piratebox/version 
piratebox-ws_1.2.0
## development...origin/development
9f46c66 Make note of changes

I would say, my GL-iNet was just running a version below 1.1 and created some unexpected results like

    [*] not running auto_flash
    [*] triggering the installation of packages without actually installing them but renaming the folder to auto_packacke_done instead of something like auto_package_error

The error was on my side confused smiley

Thank you
Michael
Re: Piratebox 1.2 Testing hot smiley
September 03, 2017 01:49PM
Feedback for OpenWrt version on GL-iNet

- Kahera board had to be installed manually as written in the other thread MT300A
+ chat post were possible from multiple devices
- file upload did not work as expected from MacOS using Safari or Firefox (the dialog did not open)
+ file upload worked from iPhone

reboot

+ WiFi is available
+ Connection could be established
- date did not match the previous set date (I used box_init to set the date and time)
- whenever the iPhone screen goes dark, I have to reselect the pirate box wifi - maybe it is because of the captive feature.

UI in General
- UI looks bad on MacOS because the browser has a fixed size due to the captive settings
- UI seems to be in a kind of modal state on MacOS - it was on top of all other windows

ImageBoard
+ posting new threads is working
+ reply to threads works, too
+ reply after revisit works also

Shoutbox
+ different color works in Shoutbox and usernames can be changed
+ sending some html did not break the chat



Edited 1 time(s). Last edit at 09/03/2017 01:53PM by BlueSpider.
Re: Piratebox 1.2 Testing hot smiley
September 05, 2017 09:18PM
@auto-flash bug.
Ok. The glinets did have a change with the 16MB and 8MB version.
On Piratebox 1.1, the corresponding code path is:

Language: Bash
auto_flash_supported(){ ## Load OpenWRT release file . /etc/openwrt_release SUPPORTED_AUTOFLASH="ar71xx/generic"   case "$DISTRIB_TARGET" in "ar71xx/generic"*) \ . /lib/ar71xx.sh model_type=$( ar71xx_board_name ) echo "$: Model Type ${model_type} identified" | logger return 0 ;; esac || return 1 }       if auto_flash_supported && ls -1 "${new_image_location}"/openwrt-*.bin >> /dev/null 2>&1 ; then ## Found image(s) at the download location found_images=$( ls ${new_image_location}/openwrt-*${model_type}*.bin | wc -w )   if [ "$found_images" -eq 1 ] ; then cnt=$( ls $new_image_location/openwrt-*${model_type}*.bin* | wc -w ) image_path=$( ls -1 ${new_image_location}/openwrt-*${model_type}*.bin ) echo "$0 : Creating backup of image file - name: ${image_path}.${cnt} " mv $image_path "${image_path}.${cnt}" echo "$0: Copy image to /tmp " filename=$(basename ${image_path} ) cp "${image_path}.${cnt}" "/tmp/${filename}" start-stop-daemon -b -S -x sysupgrade -- -n "/tmp/${filename}" 2>&1 echo "Backgrounded sysupgrade, exiting now." exit 0 else echo "$0 : More than one image found fitting to: " echo "$0 : modeltype: ${model_type} " ls ${new_image_location}/openwrt-*${model_type}*.bin fi else auto_flash_supported || echo "$0 : unsupported architecture for auto flash- ${DISTRIB_TARGET}" fi

If I go through the code, I am wondering what is happening... did the old version already include the auto-flash feature? confused smiley Looks weired to me, I can only imagibe sysupgrade fails - but if so ... the image file should be renamed.
Re: Piratebox 1.2 Testing hot smiley
September 05, 2017 09:25PM
[*] not running auto_flash <<< yes ... possible
[*] triggering the installation of packages without actually installing them but renaming the folder to auto_packacke_done instead of something like auto_package_error

!

Interesting point of view about the auto_package_error file. ! Never thought about that.

In fact, the auto installer moves the entry to _done after processing it.. without taking care about the outcome.

The error of the installer is a result of using the install zip from an higher version.

Question:
What should we do about that? Do a box-installer < - > install zip version cross check?
Re: Piratebox 1.2 Testing hot smiley
September 05, 2017 09:37PM
ok, it seems there is still an issue with the build environment. I opened issue #181 to track this issue.

Is it ok for you to open issues for you - points? some screenshots might be helpful, too.

> - whenever the iPhone screen goes dark, I have to reselect the pirate box wifi - maybe it is because of the captive feature
> - UI looks bad on MacOS because the browser has a fixed size due to the captive settings
maybe, did you "enter" the page? did the captive browser close? did you test captive portal browser only or a normal browser as well?

phew. Thanks,
Matthias
Re: Piratebox 1.2 Testing hot smiley
September 05, 2017 10:09PM
Hi Matthias,

thank you for your feedback.

I modified the box a bit including hostname, WiFi SSID and the strange behavior is not repeatable sad smiley

I renamed the host from piratebox.lan to box.lan
Is the captive feature bound to the hostname?

It is now possible to resize the window and I don't get the introduction text before using the web at all.

There is no captive feature restricting the iPhone now, either.

Any ideas what I have to change in order to get the captive feature up and running for the new hostname box.lan?

Regards,
Michael
Re: Piratebox 1.2 Testing hot smiley
September 05, 2017 10:26PM
Quote

I renamed the host from piratebox.lan to box.lan
Is the captive feature bound to the hostname?
Nope. How did you change the hostname?

Quote

It is now possible to resize the window and I don't get the introduction text before using the web at all.
..
There is no captive feature restricting the iPhone now, either.
Then your device is logged in. This is reset after a reboot or restart of the piratebox' init.d service.

After your device sent around 6 requests for captive portal answers, you are automatically logged in. If you delete the file /tmp/captive.sqlite and recreate an empty one with 777 permissions, the cache is cleared.

You can also see some debug log (enabled in development version) in /opt/piratebox/tmp

You can find the the relevant captive portal code in: /opt/piratebox/www/captive and for initiating the lease (or remove it) via dnsmasq /opt/piratebox/bin/captive_notify_lease.sh



Best regards Matthias
Re: Piratebox 1.2 Testing hot smiley
September 10, 2017 09:00PM
Hi Matthias,

I reinstalled the whole system and started from beginning.
I got the same results on my MacOS but I found some hints in the net about the captive portal feature in MacOS:

Quote
apple.stackexchange.com
whenever OS X detects a captive portal, it opens a WebView popup window

Quote
Mathias Bynens Apr 6 '12 at 5:53
That’s the thing — whenever OS X detects a captive portal, it opens a WebView popup window (not a real browser UI) with the login page.

Without digging deeper into this, I can confirm I cannot resize the window and there is no "enter" button visible.
But once I click on the forum link, I will be redirected to a new window in the safari browser. It is opening a new tab for the forum and from there on it is possible to resize the window and everything is fine.


UPDATE:
Do you still want me to open an issue for the portal feature on MacOS?
I think it is not a bug in your software. It is just the way, Apple implements captive portals in MacOS.

Regards,
Michael



Edited 1 time(s). Last edit at 09/10/2017 09:38PM by BlueSpider.
Re: Piratebox 1.2 Testing hot smiley
November 26, 2017 08:10AM
Hi,
I finally fixed that one
Quote

- Kahera board had to be installed manually as written in the other thread MT300A

I overworked the configuration handling of the auto_build script. It is now working with diff files like in this OpenWrt hotwo. MUCH more elegant.

Next issue, I'll tackle, is the not working timesave script on openwrt.

best regards Matthias
Re: Piratebox 1.2 Testing hot smiley
November 26, 2017 02:38PM
- date did not match the previous set date (I used box_init to set the date and time)
can you verify it with the latest image? It worked on my testbox



Edited 1 time(s). Last edit at 11/26/2017 02:38PM by Matthias.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically.
  *******   **     **  **     **  ********   ********  
 **     **  **     **  **     **  **     **  **     ** 
 **         **     **  **     **  **     **  **     ** 
 ********   **     **  *********  **     **  ********  
 **     **   **   **   **     **  **     **  **     ** 
 **     **    ** **    **     **  **     **  **     ** 
  *******      ***     **     **  ********   ********  
Message: