Hi, everyone

The issue turned out to simply be a matter of a misnamed pin, combined with 
some changes to how you configure the BeagleBone. The Beaglebone's Debian 
OS is now much simpler to setup, so some of our directions needed to be 
removed, as they were also interferring with the newer distro.

Updates to Gobot have already been committed and released. Thanks again for 
eveyone who chimed in.

Regards,
Ron

On Tuesday, February 13, 2018 at 4:24:32 PM UTC+1, Ranjib Dey wrote:
>
> From what I recall gobot uses sysfs bases GPIO driver that writes to 
> /sys/class/gpio/* (using mmaped GPIOs is another way) using standard file 
> io. If I am you, I would start with simply using the digitalinput or button 
> driver (https://godoc.org/gobot.io/x/gobot/drivers/gpio) straight. I 
> think its missing on exporting the pin before it starts reading. In sysfs 
> based gpio manipulation the pins need to be exported first, followed by 
> setting its direction (input in this case) , and then you can start reading 
> it, its somewhat like this in shell
> ```
> echo <PIN> >/sys/class/gpio/export
> echo input > /sys/class/gpio/gpio<PIN>/direction
> cat /sys/class/gpio/gpio<PIN>/value
> ```
> So, you can check manually whats going on, if the pin is being exported, 
> if its direction is set correctly etc. You can also strace your executable 
> to check what its doing, look for the specific write calls against those 
> file path. gobot author is active in the mailing list as well, probably 
> he'll respond soon (i noticed the opencv bindings from him recently, great 
> person).
>
> I dont have beaglebone with me, but i have tried with RPi,
> hth
>
> On Tue, Feb 13, 2018 at 6:09 AM, Marc-Antoine Ruel <mar...@chromium.org 
> <javascript:>> wrote:
>
>> Gobot is great if you want to delegate the "event loop".
>>
>> If you want to keep control, you may want to take a look periph.io, 
>> which supports interrupt based edge detection 
>> <https://periph.io/x/periph/conn/gpio#example-PinIn>, so no need to do a 
>> busy loop. Which library to use depends about how you want to structure the 
>> control loops, and that's why the two libraries are so different.
>>
>> Side note; if you care about high performance GPIO 
>> <https://periph.io/news/2017/gpio_perf/>, we're looking to have PRU 
>> support <https://github.com/google/periph/issues/200> which I feel is 
>> more useful on T.I. CPUs than memory mapped GPIO 
>> <https://periph.io/x/periph/host/pmem>, unlike for Broadcom and 
>> Allwinner CPUs.
>>
>> Thanks,
>>
>> M-A
>>
>> 2018-02-12 8:36 GMT-05:00 Silviu Capota Mera <silviu...@gmail.com 
>> <javascript:>>:
>>
>>> If you have more time to spare on this project, try to circumvent the 
>>> events / subscriber functionality. Try to see if you can read directly from 
>>> the adaptor:
>>>
>>>
>>> https://github.com/hybridgroup/gobot/blob/master/platforms/beaglebone/beaglebone_adaptor.go#L151
>>>
>>> so inside your work function, you would do:  
>>> *dVal, err := beagleboneAdaptor.DigitalRead("P8_8")*
>>> *if err != nil {*
>>> *  fmt.Println("Error reading the pin: ", err)*
>>> *  return*
>>> *}*
>>> *fmt.Println("Pin read correctly, the value is: ", dVal)*
>>>
>>> Then you would run the program while holding the button on, and off, 
>>> respectively. This way you can tell whether the most basic part of the 
>>> gobot subsystem does its job. That would be a first start at debugging.
>>> Otherwise, just circumvent it, and read the /sys/class/gpio/[your 
>>> number] through the file system api
>>>
>>>
>>>
>>> On Mon, Feb 12, 2018 at 1:41 AM, Curtis Paul <curti...@gmail.com 
>>> <javascript:>> wrote:
>>>
>>>> I'm at a loss...
>>>>
>>>> https://godoc.org/gobot.io/x/gobot#Eventer
>>>>
>>>> I think the first thing is that I'm not sure I understand how to 
>>>> diagnose this code....how to validate it's doing what I think it may or 
>>>> may 
>>>> not be doing.
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to a topic in the 
>>>> Google Groups "golang-nuts" group.
>>>> To unsubscribe from this topic, visit 
>>>> https://groups.google.com/d/topic/golang-nuts/y6ZYXVsfvS0/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> golang-nuts...@googlegroups.com <javascript:>.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to golang-nuts...@googlegroups.com <javascript:>.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to