tessel / openwrt-tessel

OpenWrt build scripts and package feed for Tessel 2
Other
32 stars 14 forks source link

Node v6.10.3 #73

Closed huseyinkozan closed 7 years ago

huseyinkozan commented 7 years ago

I have used some build instructions from: https://github.com/tessel/openwrt-tessel/blob/bc3316cd4458a5359166daf5684e9906a9ef7851/package/node/node/Makefile

Image : https://huseyinkozan.com.tr/files/tmp/openwrt-ramips-mt7620-tessel-squashfs-sysupgrade-node-v6.10.3.bin https://huseyinkozan.com.tr/files/tmp/openwrt-ramips-mt7620-tessel-squashfs-sysupgrade-node-v6.10.3.bin.sha256

Tested using https://gist.github.com/tkrueger/3500612 for a few minutes.

Signing the Tessel license thing.

huseyinkozan commented 7 years ago

Where are we setting the version info ?

I am getting undefined, like:


$ t2 version
INFO Looking for your Tessel...
INFO Connected to t.
ERR! TypeError: Cannot read property 'version' of undefined
rwaldron commented 7 years ago

I will build and test this ASAP. Thanks for the continued effort!!

rwaldron commented 7 years ago

@tikurahul @HipsterBrown @wyze @johnnyman727 @tcr @kevinmehall @Frijol

Thoughts? Reviews?

rwaldron commented 7 years ago

I've been trying to test this today (sorry for the delay... too much going on, not enough time to do it). wget fails suddenly at the end of the download:

Cannot write to 'openwrt-ramips-mt7620-tessel-squashfs-sysupgrade-node-v6.10.3.bin' (Success).

:\

rwaldron commented 7 years ago

I am able to scp the file. More to come...

rwaldron commented 7 years ago
  1. Locally...

    cd ~/.tessel
    wget -O sysupgrade-node-v6.10.3.bin https://huseyinkozan.com.tr/files/tmp/openwrt-ramips-mt7620-tessel-squashfs-sysupgrade-node-v6.10.3.bin

    Once the download is complete...

    scp -i ./id_rsa sysupgrade-node-v6.10.3.bin root@maria.local:/tmp/openwrt.bin

    (Remember to change root@maria.local to your Tessel's name, or just temporarily rename yours maria if you want to copy and paste)

  2. SSH to Tessel 2

    t2 root
  3. Upgrade the OS

    cd /tmp
    sysupgrade openwrt.bin

    Which should look something like this...

    rwaldron in ~
    $ t2 root
    INFO Looking for your Tessel...
    INFO Connected to maria.
    INFO Starting SSH Session on Tessel. Type "exit" at the prompt to end.
    
    BusyBox v1.23.2 (2017-05-24 04:56:54 +03) built-in shell (ash)
    
    Tessel 2  /  Built on OpenWrt
    root@maria:~# cd /tmp/
    root@maria:/tmp# ls
    TZ                extroot           lock              resolv.conf       sysinfo
    dhcp.leases       hogsuspend        log               resolv.conf.auto
    dnsmasq.d         hosts             openwrt.bin       run
    etc               lib               overlay           state
    root@maria:/tmp# sysupgrade openwrt.bin
    Saving config files...
    killall: watchdog: no process killed
    Sending TERM to remaining processes ... logd rpcd netifd odhcpd dbus-daemon mdnsd dnsmasq mDNSResponder /sbin/sysupgrade: line 233: can't open /proc/1384/cmdline: no such file
    dns-sd ntpd ubusd askfirst
    Sending KILL to remaining processes ... askfirst
    Switching to ramdisk...
    Performing system upgrade...
    Unlocking firmware ...
    
    Writing from <stdin> to firmware ...
    Appending jffs2 data from /tmp/sysupgrade.tgz to firmwar
    Upgrade completed
    Rebooting system...

    Once rebooted, I confirmed Wifi and provisioning all that stuff, which brings me to:

    rwaldron in ~
    $ t2 list
    INFO Searching for nearby Tessels...
    USB maria
    LAN maria
    rwaldron in ~
    $ t2 version
    INFO Looking for your Tessel...
    INFO Connected to maria.
    INFO Tessel Environment Versions:
    INFO t2-cli: 0.1.4
    INFO t2-firmware: 59ca9c97a275e6a970c1ee668a5591514ab1cd74
    INFO Node.js: 6.10.3

    (This last command is how I discovered the bug illustrated and fixed here: https://github.com/tessel/t2-cli/pull/1243)

  4. Upgrade t2-firmware

    cd t2-firmware
    git checkout master && git pull upstream master
    make clean && make 

    (assumes you have a remote called "upstream" that points at https://github.com/tessel/t2-firmware)

    Once complete: unplug the Tessel 2, press and hold the button on the board while plugging back in. The board will now be in dfu mode

    dfu-util -aFlash -d 1209:7551 -D build/firmware.bin

    This should look something like this...

    rwaldron in ~/clonez/t2-firmware on master
    $ dfu-util -aFlash -d 1209:7551 -D build/firmware.bin
    dfu-util 0.9
    
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2016 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
    
    dfu-util: Invalid DFU suffix signature
    dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
    Opening DFU capable USB device...
    ID 1209:7551
    Run-time device DFU version 0101
    Claiming USB DFU Interface...
    Setting Alternate Setting #0 ...
    Determining device status: state = dfuIDLE, status = 0
    dfuIDLE, continuing
    DFU mode device DFU version 0101
    Device returned transfer size 256
    Copying data from PC to DFU device
    Download  [=========================] 100%        15072 bytes
    Download done.
    state(7) = dfuMANIFEST, status(0) = No error condition is present
    dfu-util: unable to read DFU status after completion

    The Tessel 2 is now rebooting. Once it's rebooted and the Wifi is connected...

  5. Return to local terminal and update the tessel module on the board:

    cd t2-firmware/node
    scp -i ~/.tessel/id_rsa tessel-export.js root@maria.local:/usr/lib/node/tessel-export.js
    scp -i ~/.tessel/id_rsa tessel.js root@maria.local:/usr/lib/node/tessel.js

    Which will look something like this...

    rwaldron in ~/clonez
    $ cd t2-firmware/node
    rwaldron in ~/clonez/t2-firmware/node on master
    $ scp -i ~/.tessel/id_rsa tessel-export.js root@maria.local:/usr/lib/node/tessel-export.jstessel-export.js                                        100%   50KB 133.7KB/s   00:00
    rwaldron in ~/clonez/t2-firmware/node on master
    $ scp -i ~/.tessel/id_rsa tessel.js root@maria.local:/usr/lib/node/tessel.js
    tessel.js                                               100%   75     6.7KB/s   00:00
  6. Test some code!

    I started with the t2 init script, modified to:

    const tessel = require('tessel');
    const { 2: green, 3: blue } = tessel.led;
    
    // Turn one of the LEDs on to start.
    green.on();
    
    // Blink!
    setInterval(() => {
    green.toggle();
    blue.toggle();
    }, 100);
    
    console.log("I'm blinking! (Press CTRL + C to stop)");

    Then I tried a few small applications that used pre-compiled binary modules, all of these worked as expected because our ABI detection code has been in place for months :)

    Then I ran a few tessel-av things, one of which looked like this...

huseyinkozan commented 7 years ago

Hey @rwaldron congrats, thanks.

And one thing about update, I was doing like this :

t2 update -v 0.0.14 --force
wget ...
$ t2 update --openwrt-path /tmp/openwrt-ramips-mt7620-tessel-squashfs-sysupgrade-node-6.5.0-without-intl.bin

These commands was old, of course.

Should we do like yours ?

rwaldron commented 7 years ago
t2 update --openwrt-path /tmp/openwrt-ramips-mt7620-tessel-squashfs-sysupgrade-node-> 6.5.0-without-intl.bin

LOL, I forgot about the --openwrt-path option. WHOOPS.

rwaldron commented 7 years ago

I've been running ping maria.local for the last two hours and there's been only one recorded timeout.

rwaldron commented 7 years ago

I will try to run it overnight and capture the output

rwaldron commented 7 years ago

Not overnight, but several hours again:

--- maria.local ping statistics ---
12613 packets transmitted, 12572 packets received, 0.3% packet loss
round-trip min/avg/max/stddev = 1.454/12.433/1346.655/28.291 ms

real    210m43.278s
user    0m0.205s
sys 0m0.869s
HipsterBrown commented 7 years ago

@rwaldron how does that compare with the Node 4.x.x performance?

rwaldron commented 7 years ago

how does that compare with the Node 4.x.x performance?

Unrelated. The comparison is to the Lede 17 network connection reliability that I started mentioning here: https://github.com/tessel/openwrt-tessel/pull/72#issuecomment-302214516. I will set up the same scenario with that board and see what I can learn.

rwaldron commented 7 years ago

Well... this isn't looking good already.

rwaldron commented 7 years ago

I took the dogs for a walk, came back and decided this was pointless.

--- lede.local ping statistics ---
1121 packets transmitted, 0 packets received, 100.0% packet loss

real    18m44.084s
user    0m0.016s
sys 0m0.078s
rwaldron commented 7 years ago

@huseyinkozan I just tried to do a release, but the build fails :(

What did I do wrong?

/tmp/release.Yc7cETE8/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.10.3/out/Release/obj.target/v8_base/deps/v8/src/assembler.o: In function `v8::internal::wasm::f32_nearest_int_wrapper(float*)':
assembler.cc:(.text._ZN2v88internal4wasmL23f32_nearest_int_wrapperEPf+0x18): undefined reference to `nearbyintf'
collect2: error: ld returned 1 exit status
make[6]: *** [/tmp/release.Yc7cETE8/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.10.3/out/Release/node] Error 1
make[6]: Leaving directory `/tmp/release.Yc7cETE8/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.10.3/out'
make[5]: *** [node] Error 2
make[5]: Leaving directory `/tmp/release.Yc7cETE8/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.10.3'
make[4]: *** [/tmp/release.Yc7cETE8/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.10.3/.built] Error 2
make[4]: Leaving directory `/tmp/release.Yc7cETE8/openwrt-tessel/package/node/node'
make[3]: *** [package/feeds/tessel/node/compile] Error 2
make[3]: Leaving directory `/tmp/release.Yc7cETE8/openwrt-tessel/openwrt'
make[2]: *** [/tmp/release.Yc7cETE8/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[2]: Leaving directory `/tmp/release.Yc7cETE8/openwrt-tessel/openwrt'
make[1]: *** [world] Error 2
make[1]: Leaving directory `/tmp/release.Yc7cETE8/openwrt-tessel/openwrt'
make: *** [world] Error 2
rwaldron commented 7 years ago

The error:

/tmp/release.Yc7cETE8/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.10.3/out/Release/obj.target/v8_base/deps/v8/src/assembler.o: In function `v8::internal::wasm::f32_nearest_int_wrapper(float*)':
assembler.cc:(.text._ZN2v88internal4wasmL23f32_nearest_int_wrapperEPf+0x18): undefined reference to `nearbyintf'
collect2: error: ld returned 1 exit status
huseyinkozan commented 7 years ago

Did you update openwrt submodule ?

huseyinkozan commented 7 years ago

@rwaldron Is this patch exists, there

https://github.com/tessel/openwrt/pull/2

rwaldron commented 7 years ago

Well... that might make a lot of sense :D

rwaldron commented 7 years ago

yay!

make[4] -C /tmp/release.Yc7cETE8/openwrt-tessel/package/node/node compile

With no errors!

Although, I forgot about icu...

 make[4] -C /tmp/release.Yc7cETE8/openwrt-tessel/package/openwrt-addpack/icu compile
rwaldron commented 7 years ago

@huseyinkozan I just wanted to thank you again for all of your hard work on getting this out the door. We obviously could not have done this without you <3