Kamis, 14 Juli 2022

Extroot and install luci in firmware OpenWrt Compilation

Tp-Link MR3420 v2 when viewed on the openwrt web https://openwrt.org/toh/tp-link/tl-mr3420 does not support OpenWrt 19.07.5.Only release until openwrt 17.01.7.

But by getting a modified firmware without luci and ppp, OpenWrt 19.07.5 can be installed on TP-Link MR3420 v2.4. 
The following is how to Extroot and install luci web on openwrt TP-Link MR3420 v.24 with firmware Compilation results for OpenWrt 19.07.5, TPLINK 3420 v2, USB-NET-WiFi, without LuCI, PPP.bin which can be obtained from the web in English Russia.



 Detail play Vdeo and activated feature CC/Subtitle to see detail intruction

firmware Compilation results for OpenWrt 19.07.5, TPLINK 3420 v2, USB-NET-WiFi, without LuCI, PPP.bin

- openwrt-ar71xx-tiny-tl-mr3420-v2-squashfs-factory.bin

- openwrt-ar71xx-tiny-tl-mr3420-v2-squashfs-sysupgrade.bin

firmware Link  https://bit.ly/3Bl94pB

How to download on this blog:

If the "Take Me" page appears, just click "Take Me" and follow the next instructions

Before extrooting the flash drive,we first create a partition using the Mini Partition Wizard tools.

Flashdisk (Minimum 2GB or Higher)

First primary partition:

- Create a 512MB swap partition to free up ram

Second primary partition:

- Create an ext4 partition, use all the remaining partitions to be made to ext4

Access 192.168.1.1 in the browser. No Luci yet.

Because this firmware is Non Luci and PPP

Previously, the Flashdisk that had been partitioned "sda1 Linux Swap" and "sda2 Ext4" was plugged 

into the router's usb port

find out the number of Router's default ROM

root@OpenWrt:~#df -h

To find out UUID flash

root@OpenWrt:~#block info

Example output:

/dev/mtdblock2: UUID="9fd43c61-c3f2c38f-13440ce7-53f0d42d" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"

/dev/mtdblock3: MOUNT="/overlay" TYPE="jffs2"

/dev/sda2: UUID="fdacc9f1-0e0e-45ab-acee-9cb9cc8d7d49" VERSION="1.4" TYPE="ext4"

/dev/sda5: Version="1" TYPE="swap"

Run WinSCP

Access 192.168.1.1 user root password root

Find folder /etc/config/fstab

Output :

config 'global'

        option anon_swap  '0'

        option anon_mount '0'

        option auto_swap  '1'

        option auto_mount '1'

        option delay_root '5'

        option check_fs   '0'

For UUID copy your Flasdisk UUID Ext4 obtained in PuTTy when checking "block info"

/dev/sda2: UUID="fdacc9f1-0e0e-45ab-acee-9cb9cc8d7d49" VERSION="1.4" TYPE="ext4"

Change or edit like this :

config 'global'

        option anon_swap  '0'

        option anon_mount '1'

        option auto_swap  '1'

        option auto_mount '1'

        option delay_root '5'

        option check_fs   '0'

config 'swap'

        option device '/dev/sda1'

        option enabled '1'

config 'mount'

        option target '/mnt/sda2'

        option device '/dev/sda2'

        option uuid 'fdacc9f1-0e0e-45ab-acee-9cb9cc8d7d49'

        option enabled '1'

        option fs_type 'ext4'

        option options 'rw,sync'

Click SAVE and CLOSE

Open PuTTy type :

root@OpenWrt:~#block mount

root@OpenWrt:~#tar -C /overlay -cvf - . | tar -C /mnt/sda2 -xf -

root@OpenWrt:~#mkdir -p /tmp/cproot

root@OpenWrt:~#mount --bind / /tmp/cproot

root@OpenWrt:~#tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda2 -x

Wait until the process is complete

root@OpenWrt:~#umount /tmp/cproot

Open WinScp find and edit /etc/config/fstab

Change or edit like this :

config 'global'

        option anon_swap  '0'

        option anon_mount '1'

        option auto_swap  '1'

        option auto_mount '1'

        option delay_root '5'

        option check_fs   '0'

config 'swap'

        option device '/dev/sda1'

        option enabled '1'

config 'mount'

        option target '/overlay'

        option device '/dev/sda2'

        option uuid 'fdacc9f1-0e0e-45ab-acee-9cb9cc8d7d49'

        option enabled '1'

        option fs_type 'ext4'

        option options 'rw,sync'

        option is_rootfs '1

SAVE AND CLOSE

Reboot Router

root@OpenWrt:~#reboot

Wait for the router to finish rebooting

Open PuTTy Access back 192.168.1.1 user root password root

root@OpenWrt:~#df -h

If the display looks like this,

EXTroot is successful,

dev/sda2/overlay matches the capacity of the previously created EXT4 partition.

Open WinScp and check folder

The /mnt/sda2 folder already exists

Install LUCI

First connect the router with an internet source

eth0 = WAN means that the router's WAN port is connected to your internet source 

so that the opkg update can run

root@OpenWrt:~#opkg update

Wait until the process is complete

Install Luci by typing

root@OpenWrt:~#opkg install luci

Wait for the Luci webui installation process to finish

The Luci installation process is complete

Open Browser access 192.168.1.1 user root password root

EXTroot capacity and install luci is appropriate


Rabu, 12 Januari 2022

Tutorial Install MQQT Broker on OpenWrt 19.07.5

Detail play Vdeo and activated feature CC/Subtitle to see detail intruction



 

Step by Step intruction :

Login router with PuTTy

root@OpenWrt:~# opkg update

root@OpenWrt:~# opkg install mosquitto-ssl

root@OpenWrt:~# opkg install mosquitto-client-ssl libmosquitto-ssl

Open WinSCP 
Find and edit the mosquitto.conf file in /etc/mosquitto/mosquitto.conf

Edit the mosquitto.conf file to be like this
# ===========================
# General configuration
# ===========================
# Port to use for the default listener.
port 1883
# anonymous
allow_anonymous false
# persistence
persistence true
# name of the file for persistence
persistence_file mosquitto.db
# location of the file for persistence
persistence_location /mnt/sda2/mosquitto/
#how often to save to the persistence file
autosave_interval 1800
log_timestamp true
log_dest file /mnt/sda2/mosquitto/mosquitto.log
log_dest stdout
password_file /mnt/sda2/mosquitto/passwords.txt
===============================
SAVE dan Close
root@OpenWrt:~# /etc/init.d/mosquitto enable
root@OpenWrt:~# /etc/init.d/mosquitto restart

Create MQTT User1 
root@OpenWrt:~# mosquitto_passwd -c /mnt/sda2/mosquitto/passwords.txt keishax1 <<<< Edit you user 
Password :              <<<< type the password 
Reenter Password :      <<<< type the password again

If it happens like that, because the passwords.txt file in /mnt/sda2/mosquitto/passwords.txt doesn't exist yet

Open WinScp 
Find Folder /mnt/sda2
Make file :
passwords.txt
mosquitto.log
Make Folder : mosquitto <<< set permision 0777

Move the passwords.txt and mosquitto.log files to the 
/mnt/sda2/mosquitto/ folder

Repeat for MQTT user and password 
Create MQTT User1

root@OpenWrt:~# mosquitto_passwd -c /mnt/sda2/mosquitto/passwords.txt keishax1 <<<<<< Edit you user
Password :              <<<< type the password
Reenter Password :      <<<< type the password again

root@OpenWrt:~# /etc/init.d/mosquitto stop

root@OpenWrt:~# mosquitto -c /etc/mosquitto/mosquitto.conf

If error unable Open

Open WinScp
Find file mosquitto.log in folder /mnt/sda2/mosquitto/mosquitto.log set permision to 0755
mosquitto.log set permision to 0777

root@OpenWrt:~# mosquitto -c /etc/mosquitto/mosquitto.conf

If there is no error, it looks like this

1604592752: mosquitto version 1.6.12 starting
1604592752: Config loaded from /etc/mosquitto/mosquitto.conf.
1604592752: Opening ipv4 listen socket on port 1883.

MQTT Broker is already running 
Can check in the mosquitto.log file and saving memory is stored in mosquitto.db

If you want to set MQTT via Luci Web Install MQTT Luci

root@OpenWrt:~# opkg install luci-app-mosquitto

Refresh Luci web and check in the Services menu mosquitto
Service Mosquitto already installed

If MQTT Broker is already set via WinScp, you don't need to set MQTT via Luci service mosquitto

Test with a laptop using MQTT Explorer to access the web temperature chart MQTT ESP8266
Testing MQTT ESP8266 temperature

Featured Post

Extroot and install luci in firmware OpenWrt Compilation