Skip to content

Pinedio support#73

Open
githubnemo wants to merge 1 commit into
pyMC-dev:devfrom
githubnemo:issue/pinedio-fixes
Open

Pinedio support#73
githubnemo wants to merge 1 commit into
pyMC-dev:devfrom
githubnemo:issue/pinedio-fixes

Conversation

@githubnemo
Copy link
Copy Markdown

@githubnemo githubnemo commented May 16, 2026

Pinedio uses the CH341F pin 7 for DIO1 (receive interrupt) and can, with modification, make use of pin 6 and 5 (DIO2 + DIO3). Those pins fall in the second GPIO control bit which was not supported in the CH341 GPIO manager.

This commit also introduces the pinedio radio type which is basically just a variation of ch341 with a different pinout. For this change I took the time to refactor the available radio types from the examples into a common, imported list to minimize the chance of forgetting radio types that are added in the future.

[Pinedio](https://pine64.org/documentation/Pinedio/_full/) uses the
CH341F pin 7 for DIO1 (receive interrupt) and can, with modification,
make use of pin 6 and 5 (DIO2 + DIO3). Those pins fall in the second
GPIO control bit which was not supported in the CH341 GPIO manager.

This commit also introduces the pinedio radio type which is basically
just a variation of ch341 with a different pinout. For this change
I took the time to refactor the available radio types from the examples
into a common, imported list to minimize the chance of forgetting
radio types that are added in the future.
Copy link
Copy Markdown
Collaborator

@rightup rightup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a really nice job, I like the consolidation of the radio types.

I will test on the handful of ch341 I have and merge!

Top work!

Thanks

@rightup rightup changed the base branch from main to dev May 18, 2026 08:27
@rightup
Copy link
Copy Markdown
Collaborator

rightup commented May 18, 2026

Thanks for working on this. I like the direction, but I’m not fully convinced this is safe to merge yet.

The new PinEDIO support relies on CH341 GPIO pins 10 and 11, but from the implementation it still looks like GPIO direction/output handling is only writing the lower 8 bits. If that’s the case, the new upper-pin support may not be fully working end-to-end yet.

The existing tests pass, which is good, but there doesn’t seem to be any focused coverage for this new CH341 upper-pin behavior. Has this been tested on the actual device? I’d be more comfortable merging once that assumption is confirmed, either with real hardware validation or a targeted test.

@githubnemo
Copy link
Copy Markdown
Author

The new PinEDIO support relies on CH341 GPIO pins 10 and 11, but from the implementation it still looks like GPIO direction/output handling is only writing the lower 8 bits. If that’s the case, the new upper-pin support may not be fully working end-to-end yet.

As far as I understand, in synchronous serial mode only the first 5 GPIO lanes can be configured as either input or output while the rest are input-only which is why we only need to write one direction byte. I might be wrong, of course, documentation about this is rather sparse, sadly.

Also note that GPIO 10 and 11 are used as inputs which is the default setting as far as I understand.

The existing tests pass, which is good, but there doesn’t seem to be any focused coverage for this new CH341 upper-pin behavior. Has this been tested on the actual device? I’d be more comfortable merging once that assumption is confirmed, either with real hardware validation or a targeted test.

I couldn't find any existing tests for CH341 and without a mock device I'm not sure whether there is a lot that we can do for useful tests but if you have some ideas I can certainly implement some. I have verified on my pinedio that discover_nodes.py does modem communication and is sending discovery messages but since I don't have much nodes around and my other meshcore device is in shambles I did not discover nodes yet. This might be masking an error, of course. I will try to confirm communication but this might take some time.

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

Successfully merging this pull request may close these issues.

2 participants