{"id":340,"date":"2012-02-16T19:43:27","date_gmt":"2012-02-17T03:43:27","guid":{"rendered":"http:\/\/..\/?p=340"},"modified":"2012-02-16T19:43:27","modified_gmt":"2012-02-17T03:43:27","slug":"nodez2-javascript-for-the-zipit","status":"publish","type":"post","link":"https:\/\/blog.engine12.com\/?p=340","title":{"rendered":"NodeZ2  &#8211;  Javascript for the ZipIt"},"content":{"rendered":"<p><a href=\"..\/wp-content\/uploads\/2012\/02\/batNode.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignright\" src=\"..\/wp-content\/uploads\/2012\/02\/batNode-300x119.png\" alt=\"\" width=\"300\" height=\"119\" \/><\/a>NodeZ2 is a tiny rootfs for the ZipIt Z2 designed to fit into the onboard flash memory.\u00a0 It was created with the OpenWrt build system brought to the ZipIt by Projectgus&#8230; way to go bloke!<\/p>\n<p>After flashing&#8230; the partition layout will leave ~1Mb of space for your Javascript web app, or other desired packages.\u00a0 Additional packages can be added using the overlayfs and an SD card or USB memory.<\/p>\n<p><span style=\"color: #888888\">Note: NodeZ2 will only start on a ZipIt that has the &#8216;U-Boot&#8217; bootloader installed.<\/span><\/p>\n<p>To flash NodeZ2 onto your ZipIt follow these steps:<\/p>\n<ol>\n<li> Download <a href=\"http:\/\/engine12.com\/files\/nodejs-zipit\/NodeZ2_v3.tar.bz2\">NodeZ2<\/a> (md5sum fa9b838736ad74f36533bc8896c60772)<\/li>\n<li>make an ext2 partition at least 20 MB in size, mount it then cd to the new partition<\/li>\n<li>unpack with the following command &#8211;&gt;\u00a0 root@OpenWrt:\/# <span style=\"color: #ff9900\">sudo tar -xjpvf ~\/Downloads\/NodeZ2_rc2.tar.bz2<\/span><\/li>\n<li>insert the SD card and boot the ZipIt<\/li>\n<li>After booting run\u00a0\u00a0\u00a0 &#8211;&gt; root@OpenWrt:\/# <span style=\"color: #ff9900\">\/root\/flash_NodeZ2.sh<\/span><\/li>\n<li>poweroff, remove the SD card, and boot the ZipIt<\/li>\n<li>change password\u00a0\u00a0\u00a0\u00a0 &#8211;&gt; root@OpenWrt:\/# <span style=\"color: #ff9900\">passwd<\/span><\/li>\n<li>change mac address &#8211;&gt; root@OpenWrt:\/#<span style=\"color: #ff9900\"> nano \/etc\/config\/wireless <\/span><em>(option &#8216;disabled&#8217; should be &#8216;1&#8217;)<\/em><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #888888\">*******\u00a0\u00a0 WiFi settings can be configured by pressing the &#8216;Home&#8217; key followed by &#8216;c&#8217;\u00a0 *******<\/span><\/p>\n<p><span style=\"text-decoration: underline\">Included packages:<\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"color: #ffcc99\">B.A.T.M.A.N mesh networking<\/span><\/p>\n<p style=\"padding-left: 60px\">configure your meshnode with the included <span style=\"color: #ff9900\">batconnect<\/span> script<br \/>\n<del><\/del><\/p>\n<p style=\"padding-left: 60px\">root@NodeZ2:\/# <span style=\"color: #ff9900\">batconnect zipit 2412 192.168.11.235<\/span> &lt;&#8212; yields a static IP on channel 1<\/p>\n<p style=\"padding-left: 30px\"><span style=\"color: #ffcc99\">Node.js server side Javascript<\/span><\/p>\n<p style=\"padding-left: 60px\">root@NodeZ2:\/# <span style=\"color: #ff9900\">node \/root\/webserver.js<\/span> to start the example<\/p>\n<p style=\"padding-left: 60px\">**use nano to edit and create new scripts<\/p>\n<p style=\"padding-left: 30px\"><span style=\"color: #ffcc99\">tmux terminal multiplexer<\/span><\/p>\n<p style=\"padding-left: 60px\">root@NodeZ2:\/# <span style=\"color: #ff9900\">readme<\/span> for a list of hotkeys to use<\/p>\n<p style=\"padding-left: 30px\"><span style=\"color: #ffcc99\">mjpg_streamer webcam streaming server<\/span><\/p>\n<p style=\"padding-left: 60px\"><span style=\"color: #ffcc99\"> <\/span>root@NodeZ2:\/# <span style=\"color: #ff9900\">startWebCam<\/span> (uvc webcam and USB mod required)<\/p>\n<p style=\"padding-left: 30px\"><span style=\"color: #ffcc99\">mpg123 mp3 player (also plays shoutcast streams)<\/span><\/p>\n<p style=\"padding-left: 60px\">root@NodeZ2:\/# <span style=\"color: #ff9900\">mpg123 -b 1024 http:\/\/ice.somafm.com\/groovesalad<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 60px\">&nbsp;<\/p>\n<p style=\"padding-left: 60px\"><span style=\"color: #ff9900\"><br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>NodeZ2 is a tiny rootfs for the ZipIt Z2 designed to fit into the onboard flash memory.\u00a0 It was created with the OpenWrt build system brought to the ZipIt by Projectgus&#8230; way to go bloke! After flashing&#8230; the partition layout will leave ~1Mb of space for your Javascript web app, or other desired packages.\u00a0 Additional <a href='https:\/\/blog.engine12.com\/?p=340'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[7,11,13],"_links":{"self":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/posts\/340"}],"collection":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=340"}],"version-history":[{"count":0,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/posts\/340\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}