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

Beaglebone question #2

Closed
Gonzih opened this issue Oct 7, 2016 · 5 comments
Closed

Beaglebone question #2

Gonzih opened this issue Oct 7, 2016 · 5 comments

Comments

@Gonzih
Copy link

Gonzih commented Oct 7, 2016

Hi, I made small temperature service for my own use on beaglebone https://github.com/Gonzih/temperature-service. Originaly i wanted ot use your library but it did not work. I looked at Adafruit labrary https://github.com/adafruit/Adafruit_Python_DHT and main difference that I saw is /dev/gpiomem usage instead of /dev/mem on beaglebone. Do you think it is possible to adjust this labriary in a way that it will work on Beaglebone also? Their implementation should work on beaglebone black, but also works on my beaglebone white board.

Thanks!

@d2r2
Copy link
Owner

d2r2 commented Oct 26, 2016

Hi Gonzih,

Miss your letter, so want to apologize for late response.

Huh, first, I never work with beaglebone device (this software tested with few models of RaspberryPI, as well as BananaPI), so not ready to talk what could be a reason, why this library not working with beaglebone hardware.
Second, this software use standard Linux GPIO subsystem to work with external devices via binary logic input/output pins. So, your device should have /sys/class/gpio/ directory structure used here as interface to interact with sensor (you may find this in dht.go.h). I do not use devices such /dev/gpiomem or /dev/mem, as you describe in your mail. Could you check, that directory /sys/class/gpio/ is present on your device?

If you have more specific information about issue (including error output), let me know - perhaps I can find root cause of an issue.

Regards,
Denis

@Gonzih
Copy link
Author

Gonzih commented Dec 12, 2016

Hi Denis, thanks for your reply.

Yeah beaglebone gpio system is similar to pi one, but is also different a bit. I suspect main differente can be seing in those files from adafruit library. https://github.com/adafruit/Adafruit_Python_DHT/blob/master/source/Beaglebone_Black/bbb_mmio.c https://github.com/adafruit/Adafruit_Python_DHT/blob/master/source/Raspberry_Pi_2/pi_2_mmio.c

I will poke around trying to port your codebase to beaglebone, but for now I just shell out to python script to read data.

@d2r2
Copy link
Owner

d2r2 commented Feb 7, 2017

Hi Gonzih,

As I know there are two approach how we can work with GPIO in linux. In the code provided by your GPIO handled via "memory mapped" device (/dev/mem), which better in respect of speed, but worse for compatibility between various RPI clones (Raspberry, Bananian, Orange, BeagleBone and so on). As I remember, almost each RPI clone has their own registers (memory addresses) not equals to other clone (that is why, for instance, for popular python GPIO library exists separate version for BananaPi: https://github.com/LeMaker/RPi.GPIO_BP; if you try to use regular python lib "import RPi.GPIO" for BananaPI - it will not work).

In my Golang DHT (c code) I use "device tree" approach, where all GPIO pins mapped to /sys/class/gpio/... virtual file system files. It slower, but better compatible between RPI clones.

It's pity, that I have no BeagleBone system near me, because perhaps BeagleBone have some issue with "device tree" GPIO, and I have not possibility to check if there is some problem there...

UPDATE: It seems there are some challenges with GPIO device tree config on BeagleBone system, starting from 3.8 kernel. Watch the video: https://www.youtube.com/watch?v=wui_wU1AeQc

@Gonzih
Copy link
Author

Gonzih commented Feb 11, 2017

@d2r2 thanks a lot for the explanation, now it is clear to me what is going on! Thanks a lot again, sorry for wasting your time like that :)

@Gonzih Gonzih closed this as completed Feb 11, 2017
@d2r2
Copy link
Owner

d2r2 commented Feb 19, 2017

@Gonzih, thank you for paying attention to my project! When I will have free time, I will fork and adapt your temperature-service project back to dht library ;)

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

No branches or pull requests

2 participants