Closed flxkid closed 3 years ago
@flxkid thanks for the feeback and I look forward to your PR! Feel free to ping me if you have any other issues or changes. I can certainly help get it to work. I've also been exploring using the libgpiod. However, I'm not sure it's ready for prime-time just yet.
But if we used libgpiod
then all this code in gpio.c
could go away and it get's replaced with better library API calls. Anyways, getting your PR in would be great.
Setting the 3 pins for the GPIO to something other than the defaults needs to be tackled. Do you think the best way would be to pass into the command as options what to set? I was thinking that, or maybe, a configuration file since another TODO is to set the parameters: address, channel ... This would end up being A LOT of options into the command.
Yeah, I don't know that libgpiod is quite ready. I built it for armbian just the other day and it works well enough, but the use here is somewhat limited overall. I don't know that it's worth the effort right now. When the time comes though it will get rid of a ton of mostly "busy work" code.
I tend to think for this case, a config file option is probably best.
This is a fun little project and small enough that I think I can dig in on your code and really get to understanding it well. Thanx!
I'd like to be able to do SSH over the connection at some point. Have you tried anything like this with socat maybe?
I like the idea of using socat
. Currently, the software will open a socket but it's a Unix Datagram Domain Socket. I could try to open a stream socket and see how it behaves. My concern is the 19.2kbps is already so slow and we're limited to the 512 byte buffer. I'll try to play around a little and report back.
Had a heck of a time getting this working on something other than a raspberry pi. I was getting buffer overflow errors. Finally got it working on a Pine64 and Orange Pi Zero. Had to make a couple of code changes:
On devices other than a raspi the gpio pins can be 3 digits (on mine I'm using gpio231 and gpio362), so...
I've never done a pull request on an open source project, but I will work on getting one ready with these changes. I also had to change the default pins it uses to work on my project because I haven't quite figured out why your logic for exporting pins isn't working on armbian even with root privileges.
Anyways, sent a message for the first time today finally. Looking forward to play more with this. Thanx!