{"id":6813,"date":"2020-04-22T15:13:32","date_gmt":"2020-04-22T06:13:32","guid":{"rendered":"https:\/\/blog.obniz.io\/?p=6813"},"modified":"2021-04-02T11:11:38","modified_gmt":"2021-04-02T02:11:38","slug":"obniz-js-3-5-0-released","status":"publish","type":"post","link":"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html","title":{"rendered":"obniz.js 3.5.0 Released"},"content":{"rendered":"\n<p>This release includes adding 20 BLE device support and more robust communication with obniz device.<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/obniz\/obniz\/releases\" target=\"_blank\">GitHub<\/a><\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_11 counter-flat counter-numeric\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#New_Support_Devices\" title=\"New Support Devices\">New Support Devices<\/a><\/li><li class=\"ez-toc-page-1\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#Improvements\" title=\"Improvements\">Improvements<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"New_Support_Devices\"><\/span>New Support Devices<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">BLE<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/ENERTALK\/README.md\">ENERTALK<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/iBS01\/README.md\">iBS01<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/iBS01RG\/README.md\">iBS01RG<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/iBS01T\/README.md\">iBS01T<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/iBS02IR\/README.md\">iBS02IR<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/iBS02PIR\/README.md\">iBS02PIR<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/iBS03_iBS04\/README.md\">iBS03_iBS04<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/iBS03T\/README.md\">iBS03T<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/iBS03TP\/README.md\">iBS03TP<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/iBS04i\/README.md\">iBS04i<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/LogttaAccel\/README.md\">LogttaAccel<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/LogttaAD\/README.md\">LogttaAD<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/LogttaCO2\/README.md\">LogttaCO2<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/LogttaTemp\/README.md\">LogttaTemp<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/MINEW_S1\/README.md\">MINEW_S1<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/REX_BTPM25V\/README.md\">REX_BTPM25V<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/RS_SEEK3\/README.md\">RS_SEEK3<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/scbtgaaac\/README.md\">scbtgaaac<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/uprism\/README.md\">uprism<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/cir415a\/README.md\">cir415a<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/tm530\/README.md\">tm530<\/a><\/li><li><a href=\"https:\/\/obniz.com\/sdk\/parts\/tm551\/README.md\">tm551<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Improvements\"><\/span>Improvements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Common<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>async\/await response waiting functions now throw errors when obniz gone to offline or over timeout secs.<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">await obniz.spi0.writeWait([0x00]); \/\/ => will throw if obniz gone to offline or timeout occure.<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>i2c now throw error on i2c error occured.<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">const arr = await obniz.i2c0.readWait(0x11, 0x03); \/\/ => will throw if target is not connected or NAK responded.<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">BLE<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>ble.scan.start() and ble.scan.end() is now deprecated. Use startWait() and endWait()<\/li><li>ble.scan.onfinish() receive error object when scan fails some reason<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">obniz.ble.initWait(); \/\/ will throw error if fails.\nobniz.ble.scan.onfind = (peripheral) => {\n}\nobniz.ble.scan.onfinish = (peripherals, error) => {\n  if (error) {\n     \/\/ some thing error occured like obniz went to offline.\n  }\n}\nawait obniz.ble.scan.startWait(); \/\/ will throw error if start fails<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>peripheral.ondisconnect now pass <code>reason<\/code> arugument.<\/li><li>ADD <a href=\"https:\/\/obniz.com\/doc\/reference\/common\/ble\/central-pairing\">key pharase pairing<\/a> support<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">await obniz.ble.initWait({});\nobniz.ble.scan.onfind = function(peripheral){\nif(peripheral.localName == \"my peripheral\"){\n     peripheral.onconnect = async function(){\n         console.log(\"success\");\n         let passkeyCallback = await ()=>{\n             \/\/HTML prompt\n             let number = prompt(\"Please type passkey code.\"); \n             return number;\n         }\n         \/\/ pairing with user input passkey.\n         await peripheral.pairingWait({passkeyCallback}); \n     }\n     await peripheral.connectWait();\n    }\n }\n obniz.ble.scan.start();<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Today ,we are released obniz.js 3.5.0. This release includes adding 20 BLE device support and more robust communication with obniz device.<\/p>\n","protected":false},"author":4,"featured_media":10784,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"spay_email":"","_locale":"en_US","_original_post":"https:\/\/blog.obniz.io\/?p=6813","footnotes":""},"categories":[4,140],"tags":[],"class_list":["post-6813","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","category-update","en-US"],"jetpack_featured_media_url":"https:\/\/blog.obniz.com\/wp-content\/uploads\/2021\/03\/cat-update.png","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>obniz.js 3.5.0 Released - obniz\u516c\u5f0f\u30d6\u30ed\u30b0<\/title>\n<meta name=\"description\" content=\"Today ,we are released obniz.js 3.5.0. This release includes adding 20 BLE device support and more robust communication with obniz device.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"obniz.js 3.5.0 Released - obniz\u516c\u5f0f\u30d6\u30ed\u30b0\" \/>\n<meta property=\"og:description\" content=\"Today ,we are released obniz.js 3.5.0. This release includes adding 20 BLE device support and more robust communication with obniz device.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html\" \/>\n<meta property=\"og:site_name\" content=\"obniz\u516c\u5f0f\u30d6\u30ed\u30b0\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/obniz.io\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-22T06:13:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-02T02:11:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.obniz.com\/wp-content\/uploads\/2021\/03\/cat-update.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@obniz_io\" \/>\n<meta name=\"twitter:site\" content=\"@obniz_io\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"1 minute\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/blog.obniz.com\/#organization\",\"name\":\"obniz\",\"url\":\"https:\/\/blog.obniz.com\/\",\"sameAs\":[\"https:\/\/www.facebook.com\/obniz.io\/\",\"https:\/\/www.youtube.com\/channel\/UCp8JPDfWVlN7DU_9mMaEz1Q\",\"https:\/\/twitter.com\/obniz_io\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/blog.obniz.com\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/blog.obniz.com\/wp-content\/uploads\/2020\/03\/logo_square.png\",\"width\":550,\"height\":550,\"caption\":\"obniz\"},\"image\":{\"@id\":\"https:\/\/blog.obniz.com\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.obniz.com\/#website\",\"url\":\"https:\/\/blog.obniz.com\/\",\"name\":\"obniz\\u516c\\u5f0f\\u30d6\\u30ed\\u30b0\",\"description\":\"IoT\\u306e\\u305f\\u3081\\u306e\\u30cf\\u30fc\\u30c9\\u30a6\\u30a7\\u30a2\\u30af\\u30e9\\u30a6\\u30c9\\u30b5\\u30fc\\u30d3\\u30b9\\u300cobniz\\u300d\\u306e\\u6700\\u65b0\\u60c5\\u5831\\u3092\\u304a\\u4f1d\\u3048\\u3057\\u307e\\u3059\",\"publisher\":{\"@id\":\"https:\/\/blog.obniz.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/blog.obniz.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/blog.obniz.com\/wp-content\/uploads\/2021\/03\/cat-update.png\",\"width\":1200,\"height\":630},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#webpage\",\"url\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html\",\"name\":\"obniz.js 3.5.0 Released - obniz\\u516c\\u5f0f\\u30d6\\u30ed\\u30b0\",\"isPartOf\":{\"@id\":\"https:\/\/blog.obniz.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#primaryimage\"},\"datePublished\":\"2020-04-22T06:13:32+00:00\",\"dateModified\":\"2021-04-02T02:11:38+00:00\",\"description\":\"Today ,we are released obniz.js 3.5.0. This release includes adding 20 BLE device support and more robust communication with obniz device.\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.obniz.com\/\",\"url\":\"https:\/\/blog.obniz.com\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html\",\"url\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html\",\"name\":\"obniz.js 3.5.0 Released\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#webpage\"},\"author\":{\"@id\":\"https:\/\/blog.obniz.com\/#\/schema\/person\/8fd03a42148284fb4d0450539fa3c48a\"},\"headline\":\"obniz.js 3.5.0 Released\",\"datePublished\":\"2020-04-22T06:13:32+00:00\",\"dateModified\":\"2021-04-02T02:11:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#webpage\"},\"publisher\":{\"@id\":\"https:\/\/blog.obniz.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-5-0-released.html#primaryimage\"},\"articleSection\":\"News,Update\",\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.obniz.com\/#\/schema\/person\/8fd03a42148284fb4d0450539fa3c48a\",\"name\":\"obniz\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/blog.obniz.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fc18f7c518e893ff109574d4c4a413b19b797896cd5a1fb4c5497c952fd28c57?s=96&d=mm&r=g\",\"caption\":\"obniz\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","jetpack_shortlink":"https:\/\/wp.me\/paVgsL-1LT","jetpack-related-posts":[{"id":13151,"url":"https:\/\/blog.obniz.com\/en\/news\/update\/obniz-js-3-18-0-released.html","url_meta":{"origin":6813,"position":0},"title":"obniz.js 3.18.0 released,  and other December releases","date":"2021\u5e7412\u670817\u65e5","format":false,"excerpt":"obniz.js 3.18.0 has been released. New information\u2026","rel":"","context":"In &quot;News&quot;","img":{"alt_text":"","src":"https:\/\/i2.wp.com\/blog.obniz.com\/wp-content\/uploads\/2021\/12\/writer_main.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":10103,"url":"https:\/\/blog.obniz.com\/en\/blog\/release-obnizosobnis-js.html","url_meta":{"origin":6813,"position":1},"title":"obnizOS 3.4.4 & obniz.js 3.12.0 Released","date":"2021\u5e741\u670824\u65e5","format":false,"excerpt":"Meet New obnizOS, obniz.js. obnizOS was increase s\u2026","rel":"","context":"In &quot;Column&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":13732,"url":"https:\/\/blog.obniz.com\/en\/news\/obniz-js-3-23-0-released.html","url_meta":{"origin":6813,"position":2},"title":"obniz.js 3.23.0 released | Added \"MESH\" Blocks  to obniz Parts library","date":"2022\u5e748\u670831\u65e5","format":false,"excerpt":"obniz.js 3.23.0 has been released with BLE-related\u2026","rel":"","context":"In &quot;News&quot;","img":{"alt_text":"MESH\u30d6\u30ed\u30c3\u30af\u3068obniz\u306e\u9023\u643a","src":"https:\/\/i0.wp.com\/blog.obniz.com\/wp-content\/uploads\/2022\/08\/20220831_mesh-obniz.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":13761,"url":"https:\/\/blog.obniz.com\/en\/news\/update\/obnizos-4-1-0-released.html","url_meta":{"origin":6813,"position":3},"title":"obnizOS 4.1.0 Released","date":"2022\u5e749\u670828\u65e5","format":false,"excerpt":"obnizOS 4.1.0 released. The latest OS update is av\u2026","rel":"","context":"In &quot;News&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4655,"url":"https:\/\/blog.obniz.com\/en\/news\/todays-release-20191217.html","url_meta":{"origin":6813,"position":4},"title":"Todays Release.  \"obniz Board 1Y\" is on sale, JS\/OS ver3, obniz-noble","date":"2019\u5e7412\u670817\u65e5","format":false,"excerpt":"We start selling the new official device \u201cobniz Bo\u2026","rel":"","context":"In &quot;News&quot;","img":{"alt_text":"","src":"https:\/\/i1.wp.com\/blog.obniz.com\/wp-content\/uploads\/2021\/03\/cat-update.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":6820,"url":"https:\/\/blog.obniz.com\/news\/obniz-js-3-5-0-released.html","url_meta":{"origin":6813,"position":5},"title":"obniz.js 3.5.0 Released","date":"2020\u5e744\u670822\u65e5","format":false,"excerpt":"\u65b0\u305f\u306b20\u7a2e\u985e\u306eBLE\u30c7\u30d0\u30a4\u30b9\u3092\u30b5\u30dd\u30fc\u30c8\u3002\u5408\u308f\u305b\u3066BLE\u63a5\u7d9a\u306e\u5b89\u5b9a\u5316\u3068\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6a5f\u80fd\u306e\u8ffd\u52a0\u306a\u3069\u3001\u3044\u2026","rel":"","context":"In &quot;News&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/posts\/6813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/comments?post=6813"}],"version-history":[{"count":13,"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/posts\/6813\/revisions"}],"predecessor-version":[{"id":8622,"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/posts\/6813\/revisions\/8622"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/media\/10784"}],"wp:attachment":[{"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/media?parent=6813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/categories?post=6813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.obniz.com\/wp-json\/wp\/v2\/tags?post=6813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}