Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to unload conflicting slot #47

Open
jadonk opened this issue Apr 25, 2018 · 3 comments
Open

Unable to unload conflicting slot #47

jadonk opened this issue Apr 25, 2018 · 3 comments

Comments

@jadonk
Copy link
Member

jadonk commented Apr 25, 2018

From @psiphi75 on December 11, 2015 4:37

I am running bonescript 0.2.5 (the latest) on a Beaglebone Black RevC. Running an up-to-date Debian 7 (7.9??) and kernel as follows:

Linux beaglebone 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l GNU/Linux

I get the following error when running the code listed here (http://beagleboard.org/support/BoneScript/ServoMotor/):

Unable to unload conflicting slot: Write to CapeMgr slots failed: Error: EEXIST, file already exists

I have determined that the file that "exists" in the error above is:

/sys/devices/bone_capemgr.9/slots

The code that I have provided a link to is:

var SERVO = 'P9_14';
var duty_min = 0.03;
var position = 0;
var increment = 0.1;

b.pinMode(SERVO, b.OUTPUT);
updateDuty();

function updateDuty() {
    // compute and adjust duty_cycle based on
    // desired position in range 0..1
    var duty_cycle = (position*0.115) + duty_min;
    console.log(duty_cycle);
    b.analogWrite(SERVO, duty_cycle, 60, scheduleNextUpdate);
    console.log("Duty Cycle: " +
        parseFloat(duty_cycle*100).toFixed(1) + " %");
}

function scheduleNextUpdate() {
    // adjust position by increment and
    // reverse if it exceeds range of 0..1
    position = position + increment;
    if(position < 0) {
        position = 0;
        increment = -increment;
    } else if(position > 1) {
        position = 1;
        increment = -increment;
    }

    // call updateDuty after 200ms
    setTimeout(updateDuty, 200);
}

Note, it took a bit of debugging to get the messages above. The actual error I get is:

/usr/local/lib/node_modules/bonescript/src/my.js:230
            callback(resp);
            ^
TypeError: undefined is not a function
    at onUnloadSlot (/usr/local/lib/node_modules/bonescript/src/my.js:230:13)
    at unloadSlot (/usr/local/lib/node_modules/bonescript/src/my.js:219:13)
    at onWriteSlots (/usr/local/lib/node_modules/bonescript/src/my.js:193:43)
    at onReadSlots (/usr/local/lib/node_modules/bonescript/src/my.js:182:13)
    at onFindCapeMgr (/usr/local/lib/node_modules/bonescript/src/my.js:157:9)
    at Object.exports.load_dt (/usr/local/lib/node_modules/bonescript/src/my.js:140:5)
    at onDTBOExists (/usr/local/lib/node_modules/bonescript/src/my.js:317:26)
    at onDTBOExistsTest (/usr/local/lib/node_modules/bonescript/src/my.js:264:13)
    at Object.exports.create_dt (/usr/local/lib/node_modules/bonescript/src/my.js:259:9)
    at Object.exports.setPinMode (/usr/local/lib/node_modules/bonescript/src/hw_capemgr.js:102:12)

Copied from original issue: jadonk#111

@vaishnavachath
Copy link

This issue does not occur with the latest version , tested on BeagleBone Black with
Linux beaglebone 4.9.88-ti-r111 and BeagleBoard.org Debian Image 2018-03-05

@jadonk
Copy link
Member Author

jadonk commented May 21, 2018

Latest probably uses hw_mainline.js. Keeping these hw_oldkernel.js, hw_capemgr.js and hw_universal.js was meant to try to support old kernels. I'm not sure if it is viable. You'd need to get old kernels to test these functions. Considering will-not-fix, but would need to explicitly state a series of supported kernels that were reasonable.

@vaishnavachath
Copy link

I will try to test out it on older kernels if possible , but give more priority to other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants