How to enable Watchdog on Linkit7688 Openwrt 15.05.1

Hi
I am using Linkit7688 with Openwrt version 15.05.1 for an IOT project.
I am facing kernel crashes while my application is running but the watchdog does not trigger.
Do i need to setup the watchdog beforehand or do I need to upgrade the version of Openwrt?

15.05.1 is an unsupported version of OpenWrt at this time. Its Linux kernel is known to be insecure, along with 802.11 protocols and much of the third-party applications that make up the OS release. It should not be used for any application that has wireless or wired connectivity to any other devices.

Upgrading to a current release would be required to make any changes to the kernel or watchdog. Simply upgrading to a current, supported release or "snapshot" build may solve the problem.

Assuming that https://openwrt.org/toh/seeed/linkit7688 is your device, there are links to current OpenWrt there.

I tried to update to the latest Openwrt but I need libmraa for my applications which is not present on the latest Openwrt and building a new image failed due to build issues.

http://downloads.openwrt.org/releases/18.06.2/targets/ramips/mt76x8/openwrt-18.06.2-ramips-mt76x8-LinkIt7688-squashfs-sysupgrade.bin
and
http://downloads.openwrt.org/snapshots/targets/ramips/mt76x8/openwrt-ramips-mt76x8-LinkIt7688-squashfs-sysupgrade.bin

tell me that the build is "good" when properly executed.

I would make sure that your build environment and technique is correct.

You will need to update the package if it is not available at this time. The package source should still be available, though it should be updated to the current upstream source(s) for the library.

packages$ git log -- libs/libmraa indicates that the package is present and even has two commits in the last ten days. Prior to that

commit bae4f3edb
Author: Rosen Penev <redacted>
Date:   Sat Oct 13 11:16:50 2018 -0700

    libmraa: Update to 2.0.0
    
    Switched to codeload for simplicity and easier package bumping.
    
    Rearranged Makefile for consistency with other projects.
    
    All of the patches seem to have been upstreamed.
    
    Signed-off-by: Rosen Penev <redacted>

15.05.1 is not supported.

When I tried to install or build libmraa on the latest Openwrt

Looks like the node package is broken. You'll need to fix that first, it seems, or at least provide enough information to someone who is motivated enough to fix it for you.

Or build off master, where it seems to build properly

Note that the fail logs for 18.06 indicate it is still the 0.8.0 version

Note also that Python 2 is EOL and will not be actively supported by OpenWrt going forward (when it breaks, its broken and dead).

I will try and build master branch
lets see how it goes

Do I need to include mediatek feed?

Unlikely as the builds by the builtbots are self-sufficient from the OpenWrt code.

I tried to build the master branch using the following steps

git clone https://git.openwrt.org/openwrt/openwrt.git/ -b master
cd openwrt/
cp feeds.conf.default feeds.conf
./scripts/feeds update
./scripts/feeds install -a
make menuconfig
make defconfig
make kernel_menuconfig
make menuconfig
make -j1 V=99

I got following error while compiling node

In file included from ../src/node.cc:37:0:
../src/node_crypto.h:747:3: error: 'EC_POINT' does not name a type; did you mean 'DIST_POINT'?
   EC_POINT* BufferToPoint(char* data, size_t len);
   ^~~~~~~~
   DIST_POINT
../src/node_crypto.h:753:9: error: 'EC_GROUP' does not name a type
   const EC_GROUP* group_;
         ^~~~~~~~
../src/node_crypto.h: In destructor 'virtual node::crypto::ECDH::~ECDH()':
../src/node_crypto.h:723:7: error: 'EC_KEY_free' was not declared in this scope
       EC_KEY_free(key_);
       ^~~~~~~~~~~
../src/node_crypto.h:723:7: note: suggested alternative: 'EVP_PKEY_free'
       EC_KEY_free(key_);
       ^~~~~~~~~~~
       EVP_PKEY_free
../src/node_crypto.h:725:5: error: 'group_' was not declared in this scope
     group_ = nullptr;
     ^~~~~~
../src/node_crypto.h:725:5: note: suggested alternative: 'group_req'
     group_ = nullptr;
     ^~~~~~
     group_req
../src/node_crypto.h: In constructor 'node::crypto::ECDH::ECDH(node::Environment*, v8::Local<v8::Object>, EC_KEY*)':
../src/node_crypto.h:734:9: error: class 'node::crypto::ECDH' does not have any field named 'group_'
         group_(EC_KEY_get0_group(key_)) {
         ^~~~~~
../src/node_crypto.h:734:16: error: 'EC_KEY_get0_group' was not declared in this scope
         group_(EC_KEY_get0_group(key_)) {
                ^~~~~~~~~~~~~~~~~
../src/node_crypto.h:734:16: note: suggested alternative: 'EVP_PKEY_get0_asn1'
         group_(EC_KEY_get0_group(key_)) {
                ^~~~~~~~~~~~~~~~~
                EVP_PKEY_get0_asn1
In file included from ../src/util-inl.h:27:0,
                 from ../src/node_internals.h:28,
                 from ../src/node_javascript.h:27,
                 from ../src/node.cc:24:
../src/node_crypto.h:736:14: error: 'group_' was not declared in this scope
     CHECK_NE(group_, nullptr);
              ^
../src/util.h:110:44: note: in definition of macro 'UNLIKELY'
 #define UNLIKELY(expr) __builtin_expect(!!(expr), 0)
                                            ^~~~
../src/util.h:135:24: note: in expansion of macro 'CHECK'
 #define CHECK_NE(a, b) CHECK((a) != (b))
                        ^~~~~
../src/node_crypto.h:736:5: note: in expansion of macro 'CHECK_NE'
     CHECK_NE(group_, nullptr);
     ^~~~~~~~
../src/node_crypto.h:736:14: note: suggested alternative: 'group_req'
     CHECK_NE(group_, nullptr);
              ^
../src/util.h:110:44: note: in definition of macro 'UNLIKELY'
 #define UNLIKELY(expr) __builtin_expect(!!(expr), 0)
                                            ^~~~
../src/util.h:135:24: note: in expansion of macro 'CHECK'
 #define CHECK_NE(a, b) CHECK((a) != (b))
                        ^~~~~
../src/node_crypto.h:736:5: note: in expansion of macro 'CHECK_NE'
     CHECK_NE(group_, nullptr);
     ^~~~~~~~
../src/node.cc: In function 'void node::DebugPause(const v8::FunctionCallbackInfo<v8::Value>&)':
../src/node.cc:3715:14: warning: 'static void v8::Debug::DebugBreak(v8::Isolate*)' is deprecated: No longer supported [-Wdeprecated-declarations]
   v8::Debug::DebugBreak(args.GetIsolate());
              ^~~~~~~~~~
In file included from ../deps/v8/include/v8.h:26:0,
                 from ../src/node.h:63,
                 from ../src/node_buffer.h:25,
                 from ../src/node.cc:22:
../deps/v8/include/v8-debug.h:152:29: note: declared here
                 static void DebugBreak(Isolate* isolate));
                             ^
../deps/v8/include/v8config.h:318:3: note: in definition of macro 'V8_DEPRECATED'
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/node.cc:3715:42: warning: 'static void v8::Debug::DebugBreak(v8::Isolate*)' is deprecated: No longer supported [-Wdeprecated-declarations]
   v8::Debug::DebugBreak(args.GetIsolate());
                                          ^
In file included from ../deps/v8/include/v8.h:26:0,
                 from ../src/node.h:63,
                 from ../src/node_buffer.h:25,
                 from ../src/node.cc:22:
../deps/v8/include/v8-debug.h:152:29: note: declared here
                 static void DebugBreak(Isolate* isolate));
                             ^
../deps/v8/include/v8config.h:318:3: note: in definition of macro 'V8_DEPRECATED'
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
make[5]: *** [/home/developer/Documents/BuildMach/18/openwrt/build_dir/target-mipsel_24kc_musl/node-v8.16.0/out/Release/obj.target/node_lib/src/node.o] Error 1
rm b5d4767ab1a80a83fb5e31f1c38993bfc2cc4eb4.intermediate
make[5]: Leaving directory `/home/developer/Documents/BuildMach/18/openwrt/build_dir/target-mipsel_24kc_musl/node-v8.16.0/out'
make[4]: *** [node] Error 2
make[4]: Leaving directory `/home/developer/Documents/BuildMach/18/openwrt/build_dir/target-mipsel_24kc_musl/node-v8.16.0'
make[3]: *** [/home/developer/Documents/BuildMach/18/openwrt/build_dir/target-mipsel_24kc_musl/node-v8.16.0/.built] Error 2
make[3]: Leaving directory `/home/developer/Documents/BuildMach/18/openwrt/feeds/packages/lang/node'
time: package/feeds/packages/node/compile#2.15#0.21#2.54
make[2]: *** [package/feeds/packages/node/compile] Error 2
make[2]: Leaving directory `/home/developer/Documents/BuildMach/18/openwrt'
make[1]: *** [/home/developer/Documents/BuildMach/18/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/developer/Documents/BuildMach/18/openwrt'
make: *** [world] Error 2

Am I doing something wrong?

Try something simple first

rm .config
rm -rf tmp/
rm feeds.conf # and any other changes you made that git may not revert
git checkout master
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig # and select the LinkIt 7688
make -jN clean download world

There is typically no need to run defconfig or kernel_menuconfig

V=s is what is needed for a verbose build, or V=sc

2 Likes

If I dont select libmraa then I am able to generate the firmware image albeit without all the packages.

If you follow the steps above, not whatever you have done to mess up the build system, it should build, unless a package is broken. If you are changing the configuration so drastically, and failing to follow the required steps, you are on your own.

1 Like

okay it is building
will update you as soon as i get any error

edit
got following warnings

developer@VirtualBox:~/Documents/BuildMach/18/openwrt$ make menuconfig
Collecting package info: done
Collecting target info: done
WARNING: Makefile 'package/feeds/packages/libevhtp/Makefile' has a dependency on 'oniguruma', which does not exist
WARNING: Makefile 'package/feeds/packages/seafile-server/Makefile' has a dependency on 'oniguruma', which does not exist
WARNING: Makefile 'package/feeds/packages/slang2/Makefile' has a dependency on 'oniguruma', which does not exist

Common errors, generally not a concern if you’re not using those packages. Almost always a sequence thing and resolved automatically, which can be seen by running ./scripts/feeds install -a again

Firmware image compiled successfully.
But i guess i missed something as it's size is only 3MB

1 Like

Probably luci etc. ( note: 18.06.2 url might vary from your release )

wget http://downloads.openwrt.org/releases/18.06.2/targets/ramips/mt76x8/config.seed -O seed.online
diff ./.config seed.online

yeah you are right had missed both luci and libstdcpp

Now I have OpenWrt 18.06.2 flashed on my hardware
how should i enable hardware watchdog?

Have you confirmed that you still have a problem?

On both master and openwrt-18.06, the WDT appears already enabled in openwrt/target/linux/ramips/dts/mt7628an.dtsi which is included by LINKIT7688.dts

                watchdog: watchdog@100 {
                        compatible = "ralink,mt7628an-wdt", "mediatek,mt7621-wdt";
                        reg = <0x100 0x30>;

                        resets = <&rstctrl 8>;
                        reset-names = "wdt";

                        interrupt-parent = <&intc>;
                        interrupts = <24>;
                };

I am not able get my application run as GPIO's have changed hence cant test the watchdog