[inky] Add Inky Impression 7.3" support#75
Conversation
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (0.0%) is below the target coverage (40.0%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #75 +/- ##
=======================================
+ Coverage 49.8% 51.3% +1.5%
=======================================
Files 91 102 +11
Lines 11867 13201 +1334
=======================================
+ Hits 5914 6774 +860
- Misses 5695 6135 +440
- Partials 258 292 +34 ☔ View full report in Codecov by Sentry. |
|
I just saw the PR as it is a draft. Can you fix the linter errors? You'll need to rebase. |
|
@fstanis I updated the PR to the current head of periph.io/devices and addressed a minor lint error. Did you ever get a chance to test this? |
maruel
left a comment
There was a problem hiding this comment.
This looks fine to me but I'd like a confirmation this still work first. Thanks!
Co-authored-by: Olivier Mengué <dolmen@cpan.org>
|
Wow as was actually looking exactly for this :D Looking forward to be able to use this. Thanks |
|
Any way I can help to merge this ? I do own the display |
maruel
left a comment
There was a problem hiding this comment.
Okay I'll commit, I would have preferred a formal confirmation that it works but I guess I'll YOLO it.
|
Great thanks :) |
|
Hmm I could not make it work so far, I found a few issues so far:
Which apparently correspond to this : pimoroni/inky#205
This is the code I am using: https://github.com/kedare/dashink/blob/main/pkg/hardware/host.go Thanks |
|
For the size always set to It should be this I guess if o.Width != 0 && o.Height != 0 {
d.width = o.Width
d.height = o.Height
} |
|
@kedare I'm assuming you're using a Raspberry Pi. Is that correct? Can you tell us what version of periph.io/x/host is listed in your go.mod file? The latest version has updates to the WaitForEdge() calls. Can you try testing with different pin names? For each required pin, ensure that they are prefixed with "GPIOXX". E.G. for the reset pin, pass "GPIO27". |
|
Yes, I am using a Raspberry Pi Zero 2W, I can use the official python code without problem (just with the warning about busy wait but that is not blocking it from working) This is what I have in my Tried with the last revision from master, I don't get the logs anymore but same issue. I was using the |
|
@kedare Thanks for posting that. The error you're getting seems to be coming out of the GPIO subsystem. Unfortunately, I don't have one of those displays and they're on the expensive side. Just to narrow it down, could you change how you're getting the GPIO pins and see if you're still getting the ioctl errors? |
|
Thanks I will try that and let you know Do you know if there is something like tcpdump that can be used for SPI or GPIO ? I could capture the python run and the go run so we can compare them. |
|
I tried with your GPIO method, I am getting the same issue (randomly throwing the error or not throwing the error, when it's not throwing it, it then pause like if it was drawing on the screen but nothing actually happen). I posted the info there : https://gist.github.com/kedare/dab9dbb19d9d681c514d221e57f63235 Do you want me to setup the |
|
@kedare I've looked through the code, and I'm not seeing where the file descriptor is getting closed. Just to confirm the operation of the library, I ran some sample code on a pi zero, and it's working. I'd like to understand why the file descriptor error is happening. I would be interested in log output of the file descriptor value when errors happen, and don't. It seems like a longshot, but it would confirm things. If that doesn't offer anything really obvious, I would either run the program under strace and look for the close of the file descriptor, or run it under a debugger and see what I could notice. FWIW, here's some code that inits and it gets the GPIO IOCTL pins via the bcm283x registration. package main
import (
"fmt"
"time"
"periph.io/x/conn/v3/driver/driverreg"
"periph.io/x/conn/v3/gpio"
"periph.io/x/conn/v3/gpio/gpioreg"
"periph.io/x/host/v3"
_ "periph.io/x/host/v3/bcm283x"
"periph.io/x/host/v3/gpioioctl"
)
func main() {
fmt.Println("Calling driverreg.init")
if _, err := driverreg.Init(); err != nil {
fmt.Println("Failed to initialize periph:", err)
return
}
if _, err := host.Init(); err != nil {
fmt.Println("Failed to initialize periph:", err)
return
}
outPin := gpioreg.ByName("GPIO2")
inPin := gpioreg.ByName("GPIO10")
inPin.In(gpio.PullDown, gpio.RisingEdge)
fmt.Printf("inPin=%s, Type: %#v\n", inPin, inPin)
fmt.Printf("outPin=%s Type: %#v\n", outPin, outPin)
go func() {
l := gpio.Low
for {
l = !l
fmt.Println("setting outPin to ", l)
outPin.Out(l)
time.Sleep(1000 * time.Millisecond)
}
}()
for {
if inPin.WaitForEdge(0) {
fmt.Println("Received edge")
} else {
fmt.Println("WaitForEdge() unblocked without receiving edge.")
}
}
}Output |
|
This is the kernel I am currently using (on RPI Zero 2W) For the strace, I attached one when I don't have the error (but it doesn't draw anything), and one when it give the ioctl error. trace-no-error.log Cases happens randomly. Somehow I had some issues getting the strace, it would hangs up most of the time before even being at the drawing step. |
|
From your code (I just ran it without any change), this is what I get (not sure if this expecting some wiring or manual operation?) |
|
@kedare It would need a jumper between GPIO2 and GPIO10 for the edge on inpin to trigger. |
|
Thanks, there you have |
|
That's working as expected then. I've got a display on order. If you leave your repo up, I'll take a look. It will take at least a week, I'm sure for it to arrive. |
Inky Impression 7.3" is a larger e-ink display that unlike smaller variants is based on AC073TC1A rather than UC8159.
This PR is effectively a port of pimoroni/inky#158 since the difference is primarily in the reset and update commads.
(draft until I have a chance to properly test)