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

Node v6.10.3 #73

Merged
merged 8 commits into from
Jun 20, 2017
Merged

Node v6.10.3 #73

merged 8 commits into from
Jun 20, 2017

Conversation

@@ -57,6 +57,7 @@ PACKAGES += mjpg-streamer
PACKAGES += madplay

# JavaScript
PACKAGES += libicu
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot this one, can remove (I thing).

--shared-zlib \
--shared-openssl \
--prefix=/usr \
--v8-options="--max_old_space_size=20 --initial_old_space_size=4 --max_semi_space_size=2 --max_executable_size=5 --optimize_for_size" \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Searched but cannot learn all memory stuff in a short time. Added --optimize_for_size for good, without knowing if its valuable.
Also: nodejs/node#7937

--prefix=/usr \
--v8-options="--max_old_space_size=20 --initial_old_space_size=4 --max_semi_space_size=2 --max_executable_size=5 --optimize_for_size" \
--without-inspector \
--without-dtrace \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we dont need debug features. But I cannot see any benefit

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would benefit from the inspector feature. We can actually use Chrome inspector for debugging.

@huseyinkozan
Copy link
Contributor Author

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
Copy link
Contributor

rwaldron commented May 24, 2017

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

@rwaldron
Copy link
Contributor

@rwaldron
Copy link
Contributor

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
Copy link
Contributor

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

@rwaldron
Copy link
Contributor

  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 [email protected]:/tmp/openwrt.bin

(Remember to change [email protected] to your Tessel's name, or just temporarily rename yours maria if you want to copy and paste)

  1. SSH to Tessel 2
t2 root
  1. 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: tessel/t2-cli#1243)

  1. 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...

  1. Return to local terminal and update the tessel module on the board:
cd t2-firmware/node
scp -i ~/.tessel/id_rsa tessel-export.js [email protected]:/usr/lib/node/tessel-export.js
scp -i ~/.tessel/id_rsa tessel.js [email protected]:/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 [email protected]:/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 [email protected]:/usr/lib/node/tessel.js
tessel.js                                               100%   75     6.7KB/s   00:00
  1. 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
Copy link
Contributor Author

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
Copy link
Contributor

rwaldron commented Jun 15, 2017

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
Copy link
Contributor

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

@rwaldron
Copy link
Contributor

I will try to run it overnight and capture the output

@rwaldron
Copy link
Contributor

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
Copy link
Contributor

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

@rwaldron
Copy link
Contributor

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: #72 (comment). I will set up the same scenario with that board and see what I can learn.

@rwaldron
Copy link
Contributor

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

@rwaldron
Copy link
Contributor

rwaldron commented Jun 16, 2017

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 rwaldron merged commit d3052fb into tessel:master Jun 20, 2017
@rwaldron
Copy link
Contributor

@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
Copy link
Contributor

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
Copy link
Contributor Author

Did you update openwrt submodule ?

@huseyinkozan
Copy link
Contributor Author

@rwaldron Is this patch exists, there

tessel/openwrt#2

@rwaldron
Copy link
Contributor

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

@rwaldron
Copy link
Contributor

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
Copy link
Contributor

rwaldron commented Jul 8, 2017

@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

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

Successfully merging this pull request may close these issues.

5 participants