Skip to content

Commit

Permalink
Merge pull request #9 from ffac/separate_reload
Browse files Browse the repository at this point in the history
ffac-mt7915-reload: separate reload package from reboot package
  • Loading branch information
maurerle authored Jul 25, 2024
2 parents e3e0d7f + f219596 commit 443bdac
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 19 deletions.
18 changes: 3 additions & 15 deletions ffac-mt7915-hotfix/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
mt7915 hotfix
=============

This script reloads mt7915-firmware twice a day on targets ramips-mt7621
This script reboots the device if the mt7915-firmware hangs on ramips-mt7621
and mediatek-filogic. It's meant as a hotfix for the mcu timeout issue:
https://github.com/freifunk-gluon/gluon/issues/3154
The issue popped up with Gluon v2023.2, earlier releases are not affected.

v1 is currently just a workaround
v2 might become an actual hotfix hence the name

A first idea for a hotfix was proposed by blocktrron:
https://github.com/freifunk-gluon/gluon/pull/3212

Create a file `modules` with the following content in your `./gluon/site/`
directory and add these lines:

Expand All @@ -35,12 +29,6 @@ still accessible via ssh.
On most devices it will take days or weeks for this issue to manifest,
while others are affected daily. This is due to the difference in clients
that are connecting to it on a frequent base. The more people frequent
the device the more it goes offline.
Twice a day might seem exaggerated to some but the it's fast so why not.
I want to minimize downtime and therefore reload wifi right before heavy
use. Once for sunrise (daytime) and and once before dawn (when bars open).
the device the more probable it is to go offline.

It's not clear whether this fix is required on mediatek-filogic.
Freifunk Aachen is only testing it on ramips-mt7621 currently.
mediatek-filogic is unstable enough that I suggest rebooting the target
3 times a day. See package [ffac-threetime-reboot](https://github.com/freifunk-gluon/community-packages/tree/master/ffac-threetime-reboot)
Also see https://github.com/freifunk-gluon/gluon/issues/3154
5 changes: 2 additions & 3 deletions ffac-mt7915-hotfix/files/usr/lib/micron.d/mt7915-hotfix
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# run every day at 05:45 and 17:45
45 5,17 * * * /lib/gluon/mt7915/hotfix.sh
* * * * * /lib/gluon/mt7915/reboot-on-error.sh
# run every second minute
*/2 * * * * /lib/gluon/mt7915/reboot-on-error.sh
21 changes: 21 additions & 0 deletions ffac-mt7915-reload/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Felix Baumann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 37 additions & 0 deletions ffac-mt7915-reload/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: 2024 Felix Baumann (FFAC)
# SPDX-License-Identifier: MIT
include $(TOPDIR)/rules.mk

PKG_NAME:=ffac-mt7915-hotfix
PKG_VERSION:=1
PKG_RELEASE:=1

PKG_LICENSE:=MIT

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(TOPDIR)/../package/gluon.mk

define Package/$(PKG_NAME)
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=reload mt7915-firmware twice a day
DEPENDS:=@(TARGET_mediatek_filogic||TARGET_ramips_mt7621) kmod-mt7915e +gluon-core +micrond
MAINTAINER:=Freifunk Aachen <[email protected]>
endef

define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef

define Build/Configure
endef

define Build/Compile
endef

define Package/$(PKG_NAME)/install
$(CP) ./files/* $(1)/
endef

$(eval $(call BuildPackage,$(PKG_NAME)))
21 changes: 21 additions & 0 deletions ffac-mt7915-reload/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mt7915 reload
=============

This script reloads mt7915-firmware twice a day on targets ramips-mt7621
and mediatek-filogic.
It's meant as a hotfix for https://github.com/freifunk-gluon/gluon/issues/3305
The issue popped up with Gluon v2023.2, earlier releases are not affected.

Create a file `modules` with the following content in your `./gluon/site/`
directory and add these lines:

```
GLUON_SITE_FEEDS="community"
PACKAGES_COMMUNITY_REPO=https://github.com/freifunk-gluon/community-packages.git
PACKAGES_COMMUNITY_COMMIT=*/missing/*
PACKAGES_COMMUNITY_BRANCH=master
```

Now you can add the package `ffac-mt7915-reload` to your site.mk
(`*/missing/*` has to be replaced by the github-commit-ID of the version you
want to use, you have to pick it manually.)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
logger -t "ffac-mt7915-hotfix" -p err "reloading wifi firmware now"
logger -t "ffac-mt7915-reload" -p err "reloading wifi firmware now"
rmmod mt7915e
# fix for ffac-ssid-changer to remove old hostapd config files
rm /var/run/hostapd-*.conf*
Expand Down
2 changes: 2 additions & 0 deletions ffac-mt7915-reload/files/usr/lib/micron.d/mt7915-reload
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# run every day at 05:45 and 17:45
45 5,17 * * * /lib/gluon/mt7915/reload.sh

0 comments on commit 443bdac

Please sign in to comment.