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

Need more pins because Raspberry Pi 3 has more #11

Open
erkantaylan opened this issue Apr 10, 2019 · 7 comments
Open

Need more pins because Raspberry Pi 3 has more #11

erkantaylan opened this issue Apr 10, 2019 · 7 comments

Comments

@erkantaylan
Copy link

No description provided.

@barkermn01
Copy link
Contributor

Thanks for that statement.

Next time please provide a description with some information in it even if it was just the "Pi 3 now has support for x number of pins would you be able to add support for that".

I will now go off and research the new pin count and find a way if identifying what version of pi the code is running on so that the project can prevent someone trying to access a pin that does not exist on Pi 2.

@barkermn01
Copy link
Contributor

barkermn01 commented Apr 10, 2019

image

Line 86 of Bifrost.Devices.Gpio/GpioController.cs

if (pinNumber < 1 || pinNumber > 26)
{
        throw new ArgumentOutOfRangeException("Valid pins are between 1 and 26.");
}

@erkantaylan
Copy link
Author

I rebuilt with pinNumber > 40 and work for me so far and we are using Raspberry Pi 3

May be you can do the same or I can make pull request, I think simplest way to implement would be RaspberryPi2GpioController implements GpioController with 26 pins and RaspberryPi3GpioController implements GpioController with 40 pins. May be something like this

RaspberryPi2GpioController : GpioController {
    RaspberryPi2GpioController() : base(26) {
        ...
    }      
}
RaspberryPi3GpioController : GpioController {
    RaspberryPi2GpioController() : base(40) {
        ...
    }      
}

@barkermn01
Copy link
Contributor

barkermn01 commented Apr 12, 2019

Wait stop!!!!!

You should not have access to all 40 pins, some of them pins are 3.3v and 5v others are ground and you should not have programmable control over them doing so could seriously damage your pi or the equipment your building off it, you can't just use the pins willy nilly, if you send a volt line back down another volt line you will destroy the controller chip

So as an example me and a friend build a light sensor when the beam is broken we wanted to know, so we had a 3.5v (live to the LED) negative out of that to GND, 3.5v to live of the sensor, and the negative of the sensor went to a GPIO because that is the only one I needed to read data from also known as the control/state wire.

And yeah the 3.5v went to multiple sources this was via a plugboard.

But my point is out of 4 wires only 3 went to the pi and only 1 of them 3 were connected to a GPIO pin on the header

@erkantaylan
Copy link
Author

erkantaylan commented Apr 12, 2019

Thank you reminding sir, but I have a project to finish by tomorrow 😞 and all pins we need will be staticly embeded to code, so everything will be fine until next programmer 😄

@viniciusmiguel
Copy link

I was reading this lib code to use outside the raspberry pi platform, this code restriction really sucks, if you wanna create a cross-platform lib you should not restrict to only one hardware platform.
If you wanna protect the gpio some platform selection should be developed, so the developer is able to define specific restrictions without changes in the lib.

@barkermn01
Copy link
Contributor

barkermn01 commented May 9, 2019

@viniciusmiguel
What are you on about this uses technology specifically implemented in the raspberry pi, clearly, you have no idea how hardware communication works the GPIO is not directly tied into the OS as Raw ports. It goes through a GPIO controller chip on the Rasberry Pi. In this case, that controller chips' Drivers use a File System handler this library sits on top of that Driver.

It is not a Low-Level cross-platform driver and just so your aware they are impossible no hardware on this planet has a cross-platform driver you have them developed for each OS and each instruction set.

Just so you know this lib uses Paths they are different on Nix to Windows because the Whole Filesystem structure is different on nix to windows, /home/{user} vs C:\Users{user}, Alos this lib is built using .Net Core which is cross-platform. it can be run on Ubuntu and Windows for Pi as I have run it on both for testing if windows or Ubuntu was faster for what I was using this project for on both OSes. It is Open Source so people can add to it GitHub is not here to do your work for you, your lazy if you think that. this has not got a release website saying come use this. it is here so developers can use and provide updates that they need and think would be useful.

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

No branches or pull requests

3 participants