maruel / dlibox

Home automation that does not depend on the internet
http://www.dlibox.com
Apache License 2.0
26 stars 1 forks source link

add support for C.H.I.P. #3

Closed tve closed 8 years ago

tve commented 8 years ago

This PR primarily adds support for NextThing Co's CHIP. It fixes some minor bugs in the pine64 header pins and in the parsing of /etc/os-release. The Allwinner R8 has some pins that the A64 doesn't have, I added these at the end. It wasn't clear to me whether the pin numbers had any meaning outside of matching up the Pins table with the mapping table. I can renumber so it's all sorted if that's OK. The detection for A64 vs R8 is crap. I spent quite some time looking into cpu_info and other stuff and have come out empty-handed. As far as I can tell the detection has to be driven by the device tree on ARM processors. In the DTS for CHIP it says:

        model = "NextThing C.H.I.P.";
        compatible = "nextthing,chip", "allwinner,sun5i-r8";

I have the faint hope that the compatible values end up somewhere that is accessible from user-space...

tve commented 8 years ago

I had forgotten to add CHIP's XIO pins and I'm not sure how to do it. See ab0d9be for a failed attempt. CHIP contains an I2C port extender that provides 8 "XIO" gpio pins. These appear as sysfs gpio pins 1016 thru 1023. Controlling them has to go through sysfs, so I thought I'd use sysfs.PinByNumber, but I then discovered that the sysfs pins get initialized concurrently with the chip pins, so that doesn't work. I'm not sure how you'd like to solve this.

tve commented 8 years ago

I'm available on the gophers slack as @tve if you want to chat, but I'm not in any hurry, this can all wait 'til tomorrow. Enjoy your race!

Dumb question: what is the motivation for upstreaming to exp/io? I guess the plus side is some sort of stamp of approval? To me the downside is that (a) that makes it so much harder to contribute, and (b) it splits the backbone of pio from the devices and hosts. Keeping it as one project may result in a lot more focused contributions that make it the go-to-place for I/O.

I personally have a bias against exp in that I have a hard time understanding the process and status. When there's a github project I know how to judge the project's attributes (activity, openness, quality, adoption, ...) and I know how to participate. With exp there's no top-level readme, no separate issue tracker, no clear ownership, no contributors list, ...

tve commented 8 years ago

Did you have some thoughts about the issue with CHIP's XIO pins?