-1

when I attempt to run this uvsensor.js script from this plot.ly tutorial I encounter this error message. What is the best way to resolve it?

uv-sensor-tutorial $ node uvsensor.js
1421612122362 Device(s) /dev/cu.usbmodem1411
1421612125588 Connected /dev/cu.usbmodem1411
1421612125588 Repl Initialized
>> { streamstatus: 'All Streams Go!',
  url: 'https://plot.ly/~micahstubbs/46',
  message: '',
  warning: '',
  filename: 'uv sensing nodey arduino!',
  error: '' }

/Users/m/workspace/arduino-projects/uv-sensor-tutorial/uvsensor.js:76
    refLevel.on("data", function() {
             ^
TypeError: Object 0 has no method 'on'
    at /Users/m/workspace/arduino-projects/uv-sensor-tutorial/uvsensor.js:76:14
    at /Users/m/node_modules/plotly/index.js:87:17
    at IncomingMessage.<anonymous> (/Users/m/node_modules/plotly/index.js:255:9)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)
1
  • 1
    The problem is clearly in the repository code, introduced by this commit. In these cases, you should report an issue in their repository before outsourcing the work to Stack Exchange. The repository maintainers are much more likely to know what they intended and where they gone wrong than us. Commented Jan 18, 2015 at 20:55

1 Answer 1

1

The best way to resolve it is to find out why refLevel is being assigned 0 instead of the object you think it should be.

1
  • this is the answer - the object is ref_3V3, not refLevel, which is a variable. sent plot.ly a pull request to fix this github.com/plotly/workshop/pull/3 Commented Jan 18, 2015 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.