-
Notifications
You must be signed in to change notification settings - Fork 11
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
Serial Access including RS232 (Feature request) #12
Comments
@jabdoa2 and @alexander3771, Please is there anyway someone could assist me with this request? I know Asyncio, but not so confident in it. Even if the code is just a patch together, at least it gives me a start and I could walk via it, if its buggy; so no need to spend so much time on it. Thanks |
Hello, @Odianosen25! I didn't make anything with apigpio since my last commit, but I worked on other asyncio-projects :) As far as I understand, you want to connect to your gpio via serial port. Hope it helped, btw I can review your code :) |
Oh thanks for your response. Thanks for the examples, and I am aware of the serial over asyncio, but that's not really want I want. Not that I want to read the GPIO from serial, but I want to use the apigpio to read the serial port on the Raspi which is part of the GPIO ('/dev/ttyAMA0' to be precise). As the pigpio supports that with some I am working on a project, and I want to use the pigpio daemon via asyncio to read my GPIO using python. So that was what brought me here. I noticed you made a PR, which I have downloaded, and I want to make some modes to it, so I can read not just the pins, but also the serial port. I also what to use the pipe option over Thanks for the offer to review my code, and I will go via that option so I don't use up your time. I am already presently making some modes already, so once done will send it over. Thanks and regards |
Hello @alexander3771, I have made some changes to your files, in which I added the i2c changes made by @jabdoa2 and some serial by myself. You can see the files here. Please can you kindly go via it and confirm I didn't do anything naughty? Thanks and kind regards |
Looks good to me. Can you create a PR against this or my repo? That would allow us to merge it later. |
Ok thanks @jabdoa2, I will do just that now and create a PR also against your repo. Regards |
It's ok for me too. But let me wrap this code in + async def __aenter__(self):
+ await self.connect()
+ return self
+
+ async def __aexit__(self, exc_type, exc_val, exc_tb):
+ await self.stop() because of #10 (comment) |
Elmm @alexander3771 I honestly have no clue what you saying, but I believe you can make changes to it right? So I will wait till tomorrow, before using the code in my project so I will be certain I have the latest. Thanks and kind regards |
@Odianosen25 just use the older syntax (yield from and asyncio.coroutine) like the other functions |
@jabdoa2, thanks, but I have just started learning to use asyncio, and I am actually so much more used to If its about the conversion as the linked comment, I will actually prefer that, as I am kind of more comfortable with the new way of doing it, since that is my first way I learnt it. Thanks once again |
Hello @PierreRust,
Many thanks for your work. Please is it possible to kindly add support for the Serial interface? I went via the doc on the pigpio library, and it seems to support serial.
I have a serial interface at “/dev/ttyAMA0”, and was hoping to be able to access it asynchronously using your code. Also support for RS485 will be great as mine is on “/dev/ttyRS485”.
Thanks and regards
The text was updated successfully, but these errors were encountered: