e-ink 2.13 demo not running unless connected to PC

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
tomalt
Posts: 2
Joined: Mon Apr 26, 2021 3:59 am

e-ink 2.13 demo not running unless connected to PC

Post by tomalt » Mon Apr 26, 2021 4:21 am

Hi everyone.
Pi Pico with a Pico-specific e-Paper-2.13 from waveshare.
I have Thonny, and when the pico is usb connected to my Windows PC I can get different scripts to run. When swapping to a "wall powered" USB plug the demo script for the ePaper doesn't run but simple "blink the pico led" ones do - same usb cable etc used. This cable and powersource has run my pi3 and other heavier things at times so I'm sure it's getting enough juice to activate the e-ink screen lol.

Step 1: main.py on pico is LED blink script - runs connected to PC
Step 2: main.py on pico - epaper demo - runs connected to PC.
Step 3: main.py on pico is LED blink script - runs connected to wall power.
Step 4: main.py on pico - epaper demo - doesn't run connected to wall power.

I'm assuming it's something in the epaper demo script that requests info from the computer to start the demo, but I can't figure it out. I was hoping someone had come across this or could point me to a better tutorial to start interacting with the e-ink screens on pico. Obviously my web searches haven't found anything so any advice or pointers will be very much appreciated.

The demo script is https://www.waveshare.com/wiki/Pico-ePaper-2.13 under Resources - Demo Codes. I'm using /python/Pico_ePaper-2.13.py

This is the module https://core-electronics.com.au/wavesha ... white.html

hippy
Posts: 130
Joined: Sat Feb 20, 2021 2:46 pm
Location: UK

Re: e-ink 2.13 demo not running unless connected to PC

Post by hippy » Tue Apr 27, 2021 6:03 pm

tomalt wrote:
Mon Apr 26, 2021 4:21 am
I'm assuming it's something in the epaper demo script that requests info from the computer to start the demo, but I can't figure it out.
There was nothing in the code I could see which requires it to receive anything from a PC before it will work so I would presume it's a power supply issue; getting enough power to run the LED program, but not enough to support using the e-paper display.

Perhaps try a different wall-wart.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: e-ink 2.13 demo not running unless connected to PC

Post by pythoncoder » Wed Apr 28, 2021 12:09 pm

Always worth a try but ePaper displays are usually very economical on power, even when updating.
Peter Hinch
Index to my micropython libraries.

tomalt
Posts: 2
Joined: Mon Apr 26, 2021 3:59 am

Re: e-ink 2.13 demo not running unless connected to PC

Post by tomalt » Fri Apr 30, 2021 4:54 am

Thanks for the suggestion, I've tried it and it still doesn't work though but I think I'm getting closer!

I did some more troubleshooting today. I added the blink led script to the start of the program and that runs plugged into the computer and it runs the screen as well. Interestingly when using wall power the LED blinks but the screen still doesn't come on. So at least I know the pico is up and running the code.

If I plug the pico into the computer usb port with Thonny closed, the LED blink starts but the screen doesn't come on. I have to open Thonny, grab the main.py from the pico and then tell it to run the script and then the screen works. The LED is blinking though, so it's already running the script. I know that port can power the screen too. So it still feels like something about the code or the way that screen part of the code is started needs a manual intervention.

The shell in Thonny has that "init busy release busy" messaging in it, so I'm going to look into the code and learn more about what that's asking. I don't see the screen work unless that's running so I am guessing I just need to learn more about the coding/programming side of the pico. I'll run myself through some tutorials and google and see if it helps. If nothing else it might give me more clues!

JimShap
Posts: 1
Joined: Fri Jun 18, 2021 12:22 pm

Re: e-ink 2.13 demo not running unless connected to PC

Post by JimShap » Fri Jun 18, 2021 12:28 pm

Did you manage to resolve this?

I am having the same issue with the 2.9" ePaper display on the Pico.
Everything runs fine when started through Thonny but won't run without it.
The display will start to refresh but then either stops or I get a garbled mess.
I don't think power is the issue because I have tried with the same USB port I use for connecting to Thonny, phone charger and power bank.

lostinpico
Posts: 1
Joined: Sat Jul 10, 2021 5:23 pm

Re: e-ink 2.13 demo not running unless connected to PC

Post by lostinpico » Sat Jul 10, 2021 6:32 pm

I had the same issue and the problem solved thanks to other forum article.
(https://forum.core-electronics.com.au/t ... 13/10029/9)
According to it, moving 'self.dc_pin = Pin(DC_PIN, Pin.OUT)' to after self.spi.init() is the solution.

The modified code looks like this.
'2in9' must be replaced with 2in13 if you use 2.13 inch.

class EPD_2in9(framebuf.FrameBuffer):
def __init__(self):
self.reset_pin = Pin(RST_PIN, Pin.OUT)
self.busy_pin = Pin(BUSY_PIN, Pin.IN, Pin.PULL_UP)
self.cs_pin = Pin(CS_PIN, Pin.OUT)
self.width = EPD_WIDTH
self.height = EPD_HEIGHT

self.lut = WF_PARTIAL_2IN9

self.spi = SPI(1)
self.spi.init(baudrate=4000_000)
self.dc_pin = Pin(DC_PIN, Pin.OUT)

Post Reply