mrmorphic / hwio

Go library for hardware I/O control, in the programming style of Arduino
BSD 3-Clause "New" or "Revised" License
328 stars 40 forks source link

Beaglebone errors if hostname is changed #36

Closed loansindi closed 9 years ago

loansindi commented 10 years ago

The test currently hinges on the string "beaglebone" being returned from $ uname -a

If a user has changed the hostname of the beaglebone, this string won't be returned.

mrmorphic commented 10 years ago

Yep, that's fair enough. I'll have a look at using /proc/cpuinfo to determine the board type instead, which should be more reliable. (It's already being used to detect raspberry pi revisions)

mrmorphic commented 9 years ago

Looks like /proc/cpuinfo does not include specific info that can be used. So, instead, I've refactored the driver detection to look for a specific file for BB that that driver uses, /sys/devices/bone_capemgr.*/slots.

I have pushed this to a branch called device-detection. It'd be great if a few people could test this works for them on a variety of device/os combinations, as I only have limited test devices here. If anyone does test it, add a comment here what you detected and if there were issues or not.

M

mrmorphic commented 9 years ago

There have been no issues reported on device-detection, so I've merged it back to master. This also includes device detection for the odroid c1 whose driver is now also present.