Closed psiphi75 closed 8 years ago
I will take a look on both errors this weekend and solve it.
Can you post some documentation about MicroBus Cape? I am unaware of what pins it will use. I will need to take a look into its dtb file.
I got the dts file, I will take a look and let you know next week.
Hi, why would you like to unload universal cape and load microbus cape before writing to P8_13? Isn't it something you can do with universal cape itself? I am trying to understand microbus cape so your help will be appreciated.
It appears I can't load both the universal and MikroBus capes at the same time. But I would like to load the MikroBus cape because that is how my devices are configured. The universal cape does not work for me, I cannot load the UARTs with the universal cape.
I digress here a little, but ultimately the following solution would work for me: The end result I would like is to have many devices connected using a custom DTO. I believe OBS should be able to create a custom DTO (although I'm not saying it's easy). I could imagine a function is created that assigns a pin to a GPIO/PWM/UART, etc.
For example:
var obs = require('octalbonescript');
obs.assignPin('P9_14', 'PWM1A');
obs.assignPin('P9_16', 'PWM1B');
obs.assignPin('P9_11', 'UART4_RX');
obs.assignPin('P9_13', 'UART4_TX');
obs.assignPin('P9_15', 'GPIO_48');
// This would apply the assign pins by compiling the DTO and loading the cape
obs.applyAssignments();
b.pinMode('P9_14', b.OUTPUT, function (err, result) { console.log(err, result); });
This is a hypothetical example, but it would allow you to fully customise which pins are assigned which functionality. My knowledge of OBS, DTOs and the BeagleBone Black is limited, so this may not be possible.
Hi, what you explain is already possible with OBS universal cape. The rationale behind developing universal cape was to eliminate any need to load any other cape.
Let me give real world example from your hypothetical one.
var obs = require('octalbonescript');
obs.pinMode("P9_14", obs.ANALOG_OUTPUT); //makes the pin PWM
obs.pinMode("P9_15", obs.OUTPUT); // makes the pin GPIO
obs.serial.open('/dev/tty01'); // makes the pins UARTs
For more information on serial ports, refer this: https://github.com/theoctal/octalbonescript/wiki/Serial-Port
Let me know if you need further help.
Could this solve issue for you?
Yes, it did. Now I get how OBS works, it's great! But I had to use slightly different code. Because I wanted to enable the serial port (not use it), I had to use the enable
function. Here is the code that worked for me:
var obs = require('octalbonescript');
obs.pinMode("P9_14", obs.ANALOG_OUTPUT, function () {});
obs.pinMode("P9_15", obs.OUTPUT, function () {});
obs.serial.enable('/dev/ttyO2', function() {
console.log('enabled serial');
});
Thanks a lot for your support.
I am glad that it worked. Feel free to ping in future in case of any issues.
I am trying to get OBS (octalbonescript) working together with the MikroBus Cape (http://www.mikroe.com/click/mikrobus-cape/). There is a Device Tree Overlay (DTO) for the MikroBus cape can be compiled using the instructions on this page: http://www.libstock.com/projects/view/1525/remote-weather-station
I use the following code:
It gives me the following error: