kidoman / embd

Embedded Programming Framework in Go
http://embd.kidoman.io
MIT License
1.28k stars 156 forks source link

bbb, detect.go, func nodeName(): host name limited to beaglebone #16

Closed gritty closed 9 years ago

gritty commented 9 years ago

I have a number of Beaglebone Black computers, not a single one is still named "beaglebone". Is there some other way besides "uname -n" that the actuall computer can be verified as a beaglebone computer? I really don't want to hack the code on my computer just so I can run "embd".

szabba commented 9 years ago

I was using a non-default hostname on a Raspberry Pi before embd cried out about the hostname. I feel it's even worse since I cannot set the Host and revision separately, and revision detection on the Pi actually hase some logic behind it.

benjamind commented 9 years ago

Perhaps using /proc/cpuinfo might be more appropriate?

On a BBB you would have a model name containing ARMv7, and a Hardware line containing AM33XX. On a Raspberry Pi you would have Hardware line containing BCM2708 and you could use the Revision line to determine pi version.

kidoman commented 9 years ago

It should be good now. Thanks to @benjamind for contributing the fix.