Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this support linkit smart 7688? #8

Closed
yangpu opened this issue Mar 14, 2017 · 60 comments
Closed

Does this support linkit smart 7688? #8

yangpu opened this issue Mar 14, 2017 · 60 comments

Comments

@yangpu
Copy link

yangpu commented Mar 14, 2017

You may save my time if this support linkit smart 7688.

@nxhack
Copy link
Owner

nxhack commented Mar 14, 2017

I don't have linkit smart 7688. Please try it and Please report it.
Regards

@nxhack
Copy link
Owner

nxhack commented Mar 15, 2017

@yangpu
Compile was successful.
But because I don't have target machine, I am unable to run test.

LEDE trunk r3748-48ae44d
CONFIG_TARGET_BOARD="ramips"
CONFIG_TARGET_SUBTARGET="mt7688"
CONFIG_TARGET_PROFILE="DEVICE_LinkIt7688"
CONFIG_TARGET_ARCH_PACKAGES="mipsel_24kc"

@jcrben
Copy link

jcrben commented Jun 12, 2017

@nxhack I noticed that Atheros AR933x has a caveat - but what hardware are you testing or developing on?

@nxhack
Copy link
Owner

nxhack commented Jun 12, 2017

@jcrben
It is running on "Arduino Yun". Of course kernel FPU emulation is enabled.

system type             : Atheros AR9330 rev 1
machine                 : Arduino Yun
cpu model               : MIPS 24Kc V7.4

@nxhack
Copy link
Owner

nxhack commented Jul 13, 2017

There was a report that it was running at "ramips". So I will close this issue.

@nxhack nxhack closed this as completed Jul 13, 2017
@Cleanshooter
Copy link

I would love to test this I have a LInkit 7688 lying around but I'm not sure how to run the compiler... Any getting started tips? Would it require me to flash my LinkIt with LEDE or can it run directly on OpenWRT?

@nxhack
Copy link
Owner

nxhack commented Jul 19, 2017

Hi @Cleanshooter

https://lede-project.org/toh/hwdata/mediatek/mediatek_linkit_smart_7688
Please read the nice documentations : https://lede-project.org/faq/before_installation
(make a kernel with CONFIG_MIPS_FPU_EMULATOR=y)
Read this for building custom packages for node.js.
Custom packages can be installed with luci.
Enjoy!

@nxhack nxhack reopened this Jul 20, 2017
@nxhack
Copy link
Owner

nxhack commented Jul 20, 2017

If you want to rebuild mediatek 's firmware.

Read 'Build the firmware from source codes'
https://docs.labs.mediatek.com/resource/linkit-smart-7688/en/tutorials/firmware-and-bootloader/build-the-firmware-from-source-codes

and use https://github.com/nxhack/openwrt-node-packages/tree/for-15.05

Hopefully it may work. I will try a some. wait a moment.

@Cleanshooter
Copy link

@nxhack thanks for the reply... yeah I was looking at the first few links for lede and I'm just not well versed enough with the project to understand it's setup. Plus all the getting started stuff looked like I needed to install it on my device which I'd rather avoid.

I'm going to try rebuilding the MediaTek firmware just to ensure compatibility. I'll let you know how it goes.

@nxhack
Copy link
Owner

nxhack commented Jul 21, 2017

Hi @Cleanshooter
MediaTek Build the firmware from source codes + add some modifications.

  1. Install prerequisite packages to build the firmware:
sudo apt-get install git g++ libncurses5-dev subversion libssl-dev gawk libxml-parser-perl unzip wget

1-1. Make working directory

mkdir Build_Path_Some_Where
cd Build_Path_Some_Where
  1. Download the OpenWrt CC source codes:
git clone git://git.openwrt.org/15.05/openwrt.git
  1. Prepare the default configuration file for feeds:
cd openwrt
cp feeds.conf.default feeds.conf
  1. Add the LinkIt Smart 7688 development board's feed:
echo 'src-git linkit https://github.com/MediaTek-Labs/linkit-smart-7688-feed.git' >> feeds.conf

4-1. Add the node.js packages feed:

echo 'src-git node https://github.com/nxhack/openwrt-node-packages.git;for-15.05' >> feeds.conf
  1. Update the feed information for all available packages to build the firmware:
./scripts/feeds update

5-1. Change the packages installed as default:

wget https://gist.githubusercontent.com/nxhack/7ced4d866a59ebc72737589b49a220f8/raw/1bebfe9f6091f55a5856bc4af00da456a4995b09/mtk-linkit.patch
patch -p1 < mtk-linkit.patch

5-2. Copy kernel objects for support kernel 3.18.45:
see : MediaTek-Labs/linkit-smart-7688-feed#37

cp ./feeds/linkit/mtk-sdk-wifi/wifi_binary/mt_wifi.ko_3.18.44 ./feeds/linkit/mtk-sdk-wifi/wifi_binary/mt_wifi.ko_3.18.45
cp ./feeds/linkit/mtk-sdk-wifi/wifi_binary/mt_wifi.ko_3.18.44_all ./feeds/linkit/mtk-sdk-wifi/wifi_binary/mt_wifi.ko_3.18.45_all

5-3. Fix build error of depend on node.js version:

wget https://gist.githubusercontent.com/nxhack/4357d51918ba8f3cb5cc00080ad0815c/raw/e96758224ade8cb224523aedf5ea3249a6a59425/MRAA.patch
patch -p1 < MRAA.patch

5-4. Prepare for building node.js(patch to toolchain)

patch -p1 < ./feeds/node/for_building_latest_node.patch

5-5. FIX: git submodule command not work properly.

wget https://gist.githubusercontent.com/nxhack/78fa1df0a1224a168191dd1ab5b3336e/raw/94b6ded945c61809103e529ddbc41cb4cb757792/fix-git-submodule.patch
patch -p1 < fix-git-submodule.patch
  1. Install all packages:
./scripts/feeds install -a

6-1. Use node.js custom packages:

rm ./package/feeds/packages/node
rm ./package/feeds/packages/node-arduino-firmata
rm ./package/feeds/packages/node-cylon
rm ./package/feeds/packages/node-hid
rm ./package/feeds/packages/node-serialport
./scripts/feeds install -a -p node
  1. Prepare the kernel configuration:
make menuconfig

Select the following options:

Target System: Ralink RT288x/RT3xxx
Subtarget: MT7688 based boards
Target Profile: LinkIt7688

7-1. Select optional packages of node.js custom feed.
You can select version of node.js and modules that you need.

Save and exit (use the default configuration file without any modification)

  1. Start the compilation process:
make V=99

Add toolchain patch steps. 28/07/2017
Add fix git submodule not work 16/08/2017

@Cleanshooter
Copy link

@nxhack You found some of the pieces I was missing... I got some of them but not all the stuff you did above.

I just finished a build of my own and right now and I'm trying to flash it... but it just won't take.

I'm going to start a new build with some of your suggestions and let it run over night...

@Cleanshooter
Copy link

Cleanshooter commented Jul 22, 2017

7-1. Select optional packages of node.js custom feed.

Save and exit (use the default configuration file without any modification)

How do I do this? In the makeconfig? What menu options do I need to use?
Do I go to Languages and select Node.js and then select all those libraries?
Not super familiar with this utility.

@nxhack
Copy link
Owner

nxhack commented Jul 24, 2017

Hi @Cleanshooter

7-1. Select optional packages of node.js custom feed.

Save and exit (use the default configuration file without any modification)

How do I do this? In the makeconfig? What menu options do I need to use?
Do I go to Languages and select Node.js and then select all those libraries?
Not super familiar with this utility.

In the node custom feed, if there is a module you want, select it.

make menuconfig

Languages -> Node.js -> (Select module that you want)

If '*' it will be put into firmware. 'M' will be only built, not put into firmware.

@Cleanshooter
Copy link

Cleanshooter commented Jul 24, 2017

Hey I just wanted you to know this works great! Would you have any objections to me posting the built image on my blog for people to download and flash to their firmware or would you rather host it in the repo?

Also, I'm curious what the patches would look like to do a v6 build... is it possible to do a build for Nodejs v6 (current LTS). I was checking the other posts and @cooboyno111 mentioned that he pulled it off...

I successfully compiled nodejs6. on Chaos Calmer(15.05) . You need to change toolchain from uclibc0.9 to uclibc-ng 1.0.6. You need to remove ICU support. The librpc version of the library that needs to be modified is 2015-11-04.
Uclibc-ng 1.0.6 adds support for C99, which is required by nodejs6.
If you use glibc to compile openwrt, CC might be passed.

I'm guessing this would mean another patch to the openwrt repo...

@nxhack
Copy link
Owner

nxhack commented Jul 25, 2017

Hey I just wanted you to know this works great! Would you have any objections to me posting the built image on my blog for people to download and flash to their firmware or would you rather host it in the repo?

Congrats! And Now, You are not a beginner of OpenWrt!
Open your knowledge is wonderful.
But I don't know license issue of LInkit firmware. Please ask mediatek.

I'm guessing this would mean another patch to the openwrt repo...

https://github.com/nxhack/openwrt-node-packages/blob/for-15.05/README.md
Chaos Calmer(15.05) still not supported?

Please try, Please challenge.

@cooboyno111
Copy link

cooboyno111 commented Jul 25, 2017

I can run nodejs v6 on mt7628 chip。
I don't have a mt7688 device on this side。
linkit-smart-7688-feed.git dependency GDB 7.8 server.
GDB 7.8 server cannot compiler in openwrtcc with unlibc-ng。
I'm trying to compile using the uclibc0.9.33.2 patch。
patch -p1 < ./feeds/node/for_building_latest_node.patch
make toolchain/clean
linkit-smart-7688-feed.git pass
I remove GDB 7.8 server from Package/mtk-linkit compiler pass in openwrtcc with unlibc-ng。

@Cleanshooter
Copy link

Cleanshooter commented Jul 25, 2017

@cooboyno111

I'd love to know what changes to made to this repo to compile in node v6.

Did/could you fork this repo so that I could look at your changes?

@nxhack
Copy link
Owner

nxhack commented Jul 27, 2017

@Cleanshooter
The 'for-15.05' branch is modified.
Prepared necessary patches for build latest node.js version.

Please following steps.

./scripts/feeds update node
make oldconfig
patch -p1 < ./feeds/node/for_building_latest_node.patch
make toolchain/clean
make

You can select version of node.js in menuconfig.
(default version is v6)

Since the npm module has been separated, please select it if necessary.

@Cleanshooter
Copy link

DUDE!!! The updates you've made are great! I'm running the build right now. I'll let you know how it goes. It took me a while to find the version selector in the make menuconfig but I see you defaulted to v6 (<-- Thx).

@nxhack You made my day. I'm hoping with this I'll finally be able to run my app on my LinkIt 7688. I was really bummed out when I saw that openWRT only had Node 0.12.7 OOTB and it took a lot of digging to find your wonderful repo. Thank you so much for sharing it! A lot of my code and dependencies needed Node v6, which I only found out after a few failed compile attempts.

@Cleanshooter
Copy link

Worked! I'm about to test my app on it now. I would note to others that you can't fit all the packages on the LinkIt 7688 though. The entire thing has to be under 30MB (I think) and if you add too many node libraries it will blow up on you. All I added was NPM and it came out to 25MB.

@nxhack
Copy link
Owner

nxhack commented Jul 27, 2017

@Cleanshooter
If you want extend target machine's filesystem, You can use extroot mechanizm.
https://docs.labs.mediatek.com/resource/linkit-smart-7688/en/tutorials/file-storage/mounting-the-root-fs-on-an-sd-card

@cooboyno111
Copy link

@Cleanshooter remove ICU,remove NPM. LinkIt 7688 9.4M

@nxhack
Copy link
Owner

nxhack commented Jul 28, 2017

Oh, libmraa, libupm build will fail in situation of node.js v8.x.
But I do not care at this point. ;)

@Cleanshooter
Copy link

@cooboyno111 I might remove them but for some that might not be a viable option as npm is used by some packages/software during run time.

@cooboyno111
Copy link

@Cleanshooter In ejdb, for example, you need to understand the file structure of node_modules and what can be streamlined.
i remove 3 line
add 1line
//var binary = require('node-pre-gyp');
//var path = require('path');
//var ejdblib_path = binary.find(path.resolve(path.join(__dirname, './package.json')));
var ejdblib = require('./ejdb_native.node');
Only three files were eventually committed to the firmware
ejdb.js ejdb_native.node package.json
Original program 45m。
Streamlined 1.5m

@nxhack nxhack closed this as completed Feb 14, 2018
@tcpipchip
Copy link

Does it works to LEDE ? I Got illegal instruction when runs Node

@tcpipchip
Copy link

I mean node 8 on lede on linkit smart 7688

@nxhack
Copy link
Owner

nxhack commented Mar 28, 2018

@tcpipchip

Please tell me the result of executing this command on your target machine.

ls -l /sys/kernel/debug/mips/fpuemustats
node --version
npm --version

@tcpipchip
Copy link

I compiled again node v8 to linkit smart 7688, but now on ubuntu 17. And i had to remove some package dependencies of node! I guess that now will works! https://github.com/MediaTek-Labs/linkit-smart-7688-feed?files=1
Tomorrow i will test!

@tcpipchip
Copy link

Now all is working! Linkit running LEDE with NODE V8 :)

@tcpipchip
Copy link

Btw, thank you for all the help! next step to see if libmraa compile

@tcpipchip
Copy link

LIBMRAA not works on LEDE.
Did you get some progress there ?

@tcpipchip
Copy link

Still no success on LIBMRAA here :(

btw, about
node-node-red-contrib-gpio
How can i do the NODE-RED see this NODE in the NODE-RED WEB ?

@nxhack
Copy link
Owner

nxhack commented Apr 12, 2018

@tcpipchip
Copy link

tcpipchip commented Apr 12, 2018

Thank you so much! Doing now the compile!

@tcpipchip
Copy link

make[4]: Entering directory '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb'
make[4]: 'libhidapi-libusb.so' is up to date.
make[4]: Leaving directory '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb'
mv /home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb/libhidapi-libusb.so /home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb/libhidapi-libusb.so.0
mv: '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb/libhidapi-libusb.so' and '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb/libhidapi-libusb.so.0' are the same file
Makefile:77: recipe for target '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/.built' failed
make[3]: *** [/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/.built] Error 1
make[3]: Leaving directory '/home/osboxes/Lede/linkit-smart-7688-lede/feeds/packages/libs/hidapi'
package/Makefile:105: recipe for target 'package/feeds/packages/hidapi/compile' failed
make[2]: *** [package/feeds/packages/hidapi/compile] Error 2
make[2]: Leaving directory '/home/osboxes/Lede/linkit-smart-7688-lede'
package/Makefile:101: recipe for target '/home/osboxes/Lede/linkit-smart-7688-lede/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.package_compile' failed
make[1]: *** [/home/osboxes/Lede/linkit-smart-7688-lede/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/osboxes/Lede/linkit-smart-7688-lede'
/home/osboxes/Lede/linkit-smart-7688-lede/include/toplevel.mk:205: recipe for target 'world' failed
make: *** [world] Error 2

@tcpipchip
Copy link

Second time

make[4]: Entering directory '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb'
make[4]: 'libhidapi-libusb.so' is up to date.
make[4]: Leaving directory '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb'
mv /home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb/libhidapi-libusb.so /home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb/libhidapi-libusb.so.0
mv: '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb/libhidapi-libusb.so' and '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/libusb/libhidapi-libusb.so.0' are the same file
Makefile:77: recipe for target '/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/.built' failed
make[3]: *** [/home/osboxes/Lede/linkit-smart-7688-lede/build_dir/target-mipsel_24kc_musl-1.1.16/hidapi-0.8.0-rc1/.built] Error 1
make[3]: Leaving directory '/home/osboxes/Lede/linkit-smart-7688-lede/feeds/packages/libs/hidapi'
package/Makefile:105: recipe for target 'package/feeds/packages/hidapi/compile' failed
make[2]: *** [package/feeds/packages/hidapi/compile] Error 2
make[2]: Leaving directory '/home/osboxes/Lede/linkit-smart-7688-lede'
package/Makefile:101: recipe for target '/home/osboxes/Lede/linkit-smart-7688-lede/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.package_compile' failed
make[1]: *** [/home/osboxes/Lede/linkit-smart-7688-lede/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/osboxes/Lede/linkit-smart-7688-lede'
/home/osboxes/Lede/linkit-smart-7688-lede/include/toplevel.mk:205: recipe for target 'world' failed
make: *** [world] Error 2

@tcpipchip
Copy link

Removed HIDLIB from menuconfig and compiled. need to test the bin :)

@tcpipchip
Copy link

libupm, libmraa installed! I need to test with node-red

@nxhack
Copy link
Owner

nxhack commented Apr 18, 2018

@tcpipchip
Did the running test succeed?
If it works, I will send pull request it in the official package of OpenWrt.

@tcpipchip
Copy link

tcpipchip commented Apr 18, 2018

@nxhack
I can today 18/04 make import the LIBUPM libs from python.
Next step is make NODE import too...
And config the LIBMRAA to view the GPIOS, I2C, SPI...
For example
pin = mraa.Gpio(44)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/mraa.py", line 734, in init
this = _mraa.new_Gpio(pin, owner, raw)
ValueError: Invalid GPIO pin specified
Can you help us ?

@nxhack
Copy link
Owner

nxhack commented Apr 19, 2018

I do not have mt7688, so I can not confirm it.
Please check first that gpio is recognized by OS.

ls -l /sys/class/gpio/

@tcpipchip
Copy link

Only 3 gpios!
Is there some option to enable on make menuconfig ?

@nxhack
Copy link
Owner

nxhack commented Apr 19, 2018

check

ls -l /sys/devices/platform

@nxhack
Copy link
Owner

nxhack commented Apr 19, 2018

@tcpipchip
Copy link

ls -l /sys/devices/platform
drwxr-xr-x 13 root root 0 Jan 1 1970 10000000.palmbus
drwxr-xr-x 3 root root 0 Jan 1 1970 10100000.ethernet
drwxr-xr-x 2 root root 0 Jan 1 1970 10110000.esw
drwxr-xr-x 3 root root 0 Jan 1 1970 10120000.usbphy
drwxr-xr-x 3 root root 0 Jan 1 1970 10130000.sdhci
drwxr-xr-x 3 root root 0 Jan 1 1970 101c0000.ehci
drwxr-xr-x 3 root root 0 Jan 1 1970 101c1000.ohci
drwxr-xr-x 5 root root 0 Jan 1 1970 10300000.wmac
drwxr-xr-x 2 root root 0 Jan 1 1970 alarmtimer
drwxr-xr-x 2 root root 0 Jan 1 1970 bootstrap
drwxr-xr-x 2 root root 0 Jan 1 1970 clkctrl
drwxr-xr-x 2 root root 0 Jan 1 1970 cpuintc@0
drwxr-xr-x 2 root root 0 Jan 1 1970 gpio-keys-polled
drwxr-xr-x 2 root root 0 Jan 1 1970 gpio-leds
drwxr-xr-x 2 root root 0 Jan 1 1970 gpio-wifi
drwxr-xr-x 2 root root 0 Jan 1 1970 pinctrl
drwxr-xr-x 2 root root 0 Apr 19 10:50 regulatory.0
drwxr-xr-x 2 root root 0 Jan 1 1970 rstctrl
drwxr-xr-x 2 root root 0 Jan 1 1970 serial8250
-rw-r--r-- 1 root root 4096 Apr 19 10:50 uevent

@tcpipchip
Copy link

I will update the KERNEL version to see if works!

@tcpipchip
Copy link

no sucess! is there anybody here and make the LEDE works with LIBMRAA. Compiles, install, but not recognizers gpios, i2c, spi, pwm, etc :(

@tcpipchip
Copy link

"Removed HIDLIB from menuconfig and compiled. need to test the bin :)"

If you dont install HIDLIB, what cant i do with lede ? Access to gpios ?

@nxhack
Copy link
Owner

nxhack commented Apr 22, 2018

@tcpipchip

Please continue to ...
nxhack/openwrt-intel-iot-devkit#1

@nxhack
Copy link
Owner

nxhack commented Jul 4, 2018

For the latest information, please refer to wiki.
https://github.com/nxhack/openwrt-node-packages/wiki

@tcpipchip
Copy link

Did you port to Chaos Calmer too ?

@nxhack
Copy link
Owner

nxhack commented Jul 16, 2018

Official OpenWrt Chaos Calmer 15.05.1 isn't supported and deprecated.
I will never port my patches to official CC repository.

@tcpipchip
Copy link

I asked you because i see this
git clone https://github.com/openwrt/chaos_calmer.git

@nxhack
Copy link
Owner

nxhack commented Jul 17, 2018

Oh,

See this issue : #330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants