beagleboard / bonescript

Scripting tools for the BeagleBoard and BeagleBone
http://beagleboard.org
MIT License
32 stars 9 forks source link

Ran into a weird error: EAGAIN #27

Open jadonk opened 6 years ago

jadonk commented 6 years ago

From @GuySawyer on June 27, 2014 12:18

Everything was working fine, until out of the blue I started getting this error which crashed my app:

fs.js:476
  var r = binding.read(fd, buffer, offset, length, position);
                  ^
Error: EAGAIN, resource temporarily unavailable
    at Object.fs.readSync (fs.js:476:19)
    at Object.fs.readFileSync (fs.js:310:28)
    at Object.exports.readAIN (/usr/local/lib/node_modules/bonescript/hw_capemgr.js:214:30)
    at Object.f.analogRead (/usr/local/lib/node_modules/bonescript/index.js:229:15)
    at null.<anonymous> (/home/debian/node_modules/thing-client/beagle1.js:647:18)
    at wrapper [as _onTimeout] (timers.js:252:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

Any idea how I can get through this?

Regards Guy

Copied from original issue: jadonk/bonescript#89

jadonk commented 6 years ago

From @GuySawyer on August 1, 2014 10:11

Is anyone maintaining this library?

jadonk commented 6 years ago

From @damonmaria on September 5, 2014 20:20

Hi Guy. I've run into exactly the same error while trying to async readAnalog on the BeagleBone Black. The more analog pins I read from the more often this error happens.

If you look into EAGAIN it's an error that is basically saying "try again". So you can safely ignore it and try your analogRead again. Unfortunately you end up with a whole lot of log messages about the error tho.

If you look at https://github.com/isaacs/node-graceful-fs they retry 10 times if they readFile returns EAGAIN.

@jadonk Possible solutions to this is to:

Which path would you prefer?

jadonk commented 6 years ago

From @adityapatadia on September 15, 2014 7:42

Try https://github.com/theoctal/octalbonescript It is fork of bonescript with a lot of improvements. We have crushed many bugs and have changes a lot of things under the hood to make it more stable.