/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
part-number = "BB-W1";
version = "00A0";
/* state the resources this cape uses */
exclusive-use =
/* the pin header uses */
"P9.22",
/* the hardware IP uses */
"gpio0_2";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
dallas_w1_pins: pinmux_dallas_w1_pins {
pinctrl-single,pins = < 0x150 0x37 >;
};
};
};
fragment@1 {
target = <&ocp>;
__overlay__ {
onewire@0 {
compatible = "w1-gpio";
pinctrl-names = "default";
pinctrl-0 = <&dallas_w1_pins>;
status = "okay";
gpios = <&gpio1 2 0>;
};
};
};
};
exclusive-use =
/* the pin header uses */
"P9.22",
/* the hardware IP uses */
"gpio0_2";
should be:
exclusive-use =
/* the pin header uses */
"P9.22";
The comment is also wrong, but whatever, it shouldn't hurt anything.
Second:
fragment@1 {
target = <&ocp>;
__overlay__ {
onewire@0 {
compatible = "w1-gpio";
pinctrl-names = "default";
pinctrl-0 = <&dallas_w1_pins>;
status = "okay";
gpios = <&gpio1 2 0>;
};
The code in bold is wrong. The gpio bank for this pin is bank0:
gpios = <&gpio0 2 0>; would be the correct assignment.
Lastly, your overlay "compatible" assignment is wrong for your board. It should look like this:
https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-W1-P9.12-00A0.dts#L18
In all of the examples that I have seen, the P9.x -> GPIO bank.port translates to GPIO (bank +1).port between lines in the overlay script.
root@beaglebone:/firmware# python test.py
Traceback (most recent call last):
File "test.py", line 4, in <module>
pir = mraa.Gpio(73)
File "/usr/lib/python2.7/dist-packages/mraa.py", line 912, in __init__
this = _mraa.new_Gpio(pin, owner, raw)
ValueError: Invalid GPIO pin specified
import mraa
import time
pir = mraa.Gpio(73)
pir.dir(mraa.DIR_IN)
while True:
print (pir.read())
time.sleep(1)
Thanks William. I'll try out your instructions on Mon.
Is that safe? I'd think the 5V would influence the swing of the data
line, and I thought the BBB is supposed to only have 3.3V on the inputs.
Again, thanks Williams... that was it.I commented everything about P9.22 in ./bb.org-overlays/src/arm/univ-bbgw-00A0.dtsThen build and install with your instruccions :)Which is an elegant way to mount the w1 overlay automatically after reboot?
In my mind, using Debian Jessie, creating a systemd service is the correct way to go about this. But in case that turns out to be too difficult, or cumbersome for your needs. Technically LSB sysv type services are also possible in Jessie. These are also rather hard to understand at first too. So writing a script, and then calling it from rc.local is probably the easiest way - Initially.
Cron jobs, in my mind are not really the right way to go. Because again, in my mind, cron jobs are meant to run something repeatable. Meaning running something multiple times. Once a day at a specific time, Once every hour, minute, whatever you like. However, it is possible to run a cron job once every reboot. . . .
I would however recommend that you read up on systemd services, and use that method.
Tried your workflow today without success. Everything is OK up to the lsmod | grep w1 step. I only get the w1_gpio entry. I am not a Linux kernel expert, so I don't know how to troubleshoot why the other entries aren't showing up.I didn't see any activity on the oscilloscope either.