<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ManaS KumaR</title>
    <description>The latest articles on DEV Community by ManaS KumaR (@manas_kumar_b7fe833b52a4c).</description>
    <link>https://dev.to/manas_kumar_b7fe833b52a4c</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1087988%2Ff9ef17d4-0ada-4673-8560-57320a976274.png</url>
      <title>DEV Community: ManaS KumaR</title>
      <link>https://dev.to/manas_kumar_b7fe833b52a4c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manas_kumar_b7fe833b52a4c"/>
    <language>en</language>
    <item>
      <title>Nodemcu with johnny-five</title>
      <dc:creator>ManaS KumaR</dc:creator>
      <pubDate>Tue, 23 May 2023 14:07:22 +0000</pubDate>
      <link>https://dev.to/manas_kumar_b7fe833b52a4c/nodemcu-with-johnny-five-51jf</link>
      <guid>https://dev.to/manas_kumar_b7fe833b52a4c/nodemcu-with-johnny-five-51jf</guid>
      <description>&lt;p&gt;const { EtherPortClient } = require("etherport-client")&lt;br&gt;
const { Board, Led, Pin } = require("johnny-five")&lt;br&gt;
const keypress = require("keypress")&lt;/p&gt;

&lt;p&gt;const board = new Board({&lt;br&gt;
  port: new EtherPortClient({&lt;br&gt;
    host: "192.168.43.18",&lt;br&gt;
    port: 3030,&lt;br&gt;
  }),&lt;br&gt;
  repl: false,&lt;br&gt;
})&lt;/p&gt;

&lt;p&gt;keypress(process.stdin)&lt;br&gt;
const LED_PIN = 14&lt;/p&gt;

&lt;p&gt;board.on("ready", () =&amp;gt; {&lt;br&gt;
  console.log("Board ready")&lt;br&gt;
  var led = new Led(LED_PIN)&lt;br&gt;
  console.log("Use Up and Down arrows for On and Off. Space to stop.")&lt;/p&gt;

&lt;p&gt;process.stdin.resume()&lt;br&gt;
  process.stdin.setEncoding("utf8")&lt;br&gt;
  process.stdin.setRawMode(true)&lt;/p&gt;

&lt;p&gt;process.stdin.on("keypress", (ch, key) =&amp;gt; {&lt;br&gt;
    if (!key) {&lt;br&gt;
      return&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (key.name === "q") {
  console.log("Quitting")
  process.exit()
} else if (key.name === "up") {
  console.log("Blink")
  led.blink()
} else if (key.name === "down") {
  console.log("Stop blinking")
  led.stop()
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;})&lt;br&gt;
})&lt;/p&gt;

&lt;p&gt;am getting bellow error&lt;/p&gt;

&lt;p&gt;D:\manas\carrier-work\johnny-five&amp;gt;node index.js&lt;br&gt;
1684850459534 SerialPort Connecting to host:port: 192.168.43.18:3030 &lt;br&gt;
1684850459536 Connected Connecting to host:port: 192.168.43.18:3030 &lt;br&gt;
1684850469537 Device or Firmware Error A timeout occurred while connecting to the Board. &lt;/p&gt;

&lt;p&gt;Please check that you've properly flashed the board with the correct firmware.&lt;br&gt;
See: &lt;a href="https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting"&gt;https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the board, wait approximately 11 seconds for complete reset, then run your program again. &lt;br&gt;
node:events:381&lt;br&gt;
    throw err; // Unhandled 'error' event&lt;br&gt;
    ^&lt;/p&gt;

&lt;p&gt;Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({&lt;br&gt;
  type: 'error',&lt;br&gt;
  timestamp: 1684850469537,&lt;br&gt;
  class: 'Device or Firmware Error',&lt;br&gt;
  message: 'A timeout occurred while connecting to the Board. \n' +&lt;br&gt;
    '\n' +&lt;br&gt;
    "Please check that you've properly flashed the board with the correct firmware.\n" +&lt;br&gt;
    'See: &lt;a href="https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting%5Cn"&gt;https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting\n&lt;/a&gt;' +&lt;br&gt;
    '\n' +&lt;br&gt;
    "If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the board, wait approximately 11 seconds for complete reset, then run your program again.",&lt;br&gt;
  data: null&lt;br&gt;
})&lt;br&gt;
    at new NodeError (node:internal/errors:371:5)&lt;br&gt;
    at Board.emit (node:events:379:17)&lt;br&gt;
    at Board.log (D:\manas\carrier-work\johnny-five\node_modules\johnny-five\lib\board.js:637:8)&lt;br&gt;
    at Board. &lt;a href="//D:manascarrier-workjohnny-fivenode_modulesjohnny-fivelibboard.js:648:14"&gt;as error&lt;/a&gt;&lt;br&gt;
    at Timeout._onTimeout (D:\manas\carrier-work\johnny-five\node_modules\johnny-five\lib\board.js:384:14)&lt;br&gt;
    at listOnTimeout (node:internal/timers:557:17)&lt;br&gt;
    at processTimers (node:internal/timers:500:7) {&lt;br&gt;
  code: 'ERR_UNHANDLED_ERROR',&lt;br&gt;
  context: {&lt;br&gt;
    type: 'error',&lt;br&gt;
    timestamp: 1684850469537,&lt;br&gt;
    class: 'Device or Firmware Error',&lt;br&gt;
    message: 'A timeout occurred while connecting to the Board. \n' +&lt;br&gt;
      '\n' +&lt;br&gt;
      "Please check that you've properly flashed the board with the correct firmware.\n" +&lt;br&gt;
      'See: &lt;a href="https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting%5Cn"&gt;https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting\n&lt;/a&gt;' +&lt;br&gt;
      '\n' +&lt;br&gt;
      "If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the board, wait approximately 11 seconds for complete reset, then run your program again.",&lt;br&gt;
    data: null&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
