mendhak / waveshare-epaper-display

At-a-glance dashboard for Raspberry Pi with a Waveshare ePaper 7.5 Inch HAT. Date/Time, Weather, Alerts, Google/Outlook Calendar
https://code.mendhak.com/raspberrypi-epaper-dashboard/
438 stars 65 forks source link

Suddenly not working. #21

Closed mrdanjohnson closed 3 years ago

mrdanjohnson commented 3 years ago

Im not sure if this is where I can post this silly question, but I had this working the other day. Now when I run the run.sh script I get;

File "run.sh", line 2 . env.sh ^ SyntaxError: invalid syntax

My env.sh file seems totally fine.

mendhak commented 3 years ago

If you try that yourself outside run.sh, does it still fall?

It could indicate bad syntax inside env.sh

You can test each line in env by copy pasting and running it. Make sure there are no spaces between the key, equal and values in the env

mrdanjohnson commented 3 years ago

Even when using the env.sh directly from your repo, I still get the error. It just started happening yesterday. I can run waveshare's example files without error.

mendhak commented 3 years ago

Something doesn't look right. See,

image

Bash doesn't produce errors like this, with arrows pointing out the problem area. How are you running run.sh? It should just be ./run.sh

mendhak commented 3 years ago

Ah are you running it as a Python script like python3 run.sh? I just tried it arbitrarily and got the same 'error'

image

Since it's a .sh you should just run it as a normal bash script. Just do ./run.sh

image

mrdanjohnson commented 3 years ago

That totally worked. Did something change or am I loosing my mind. Has run always been a shell script?

While I have you here. Is there a way to keep it from flashing so many times when clearing or writing. I was expecting it to work more like a kindle.

mendhak commented 3 years ago

It's always been a shell script!

Right, the image flashes several times when rendering to screen. The Waveshare in general isn't as fast as the Kindles and other more commercial screens (and they're also different technologies, eink is a specific brand, it's a commercial patent encumbered technology, epaper is a generic term). You'll have noticed that the Waveshare Python samples are slow to render stuff to screen, I think about 20-30s.

But if you've tried the C samples they're a bit faster, although still not Kindle speed, I think it takes about 8s. So a way to write to screen faster would be to write a C version of the display script. I do have a C version from a while ago, but it quickly became clear that it wasn't working for most people who were getting the V2 screens. I don't have a V2 screen so I've had to switch to a basic Python script.

I also used to have a project ages ago which basically used a Kindle screen to display the dashboard: https://github.com/mendhak/Kindle-Time-and-Weather - it was definitely very fast. Only problem, the Kindle's wifi radio burnt out after a year or two, I guess it's not meant to do very frequent http requests.

mrdanjohnson commented 3 years ago

Wow, I have no idea where my mind went. I have no idea how I moved from working with the shell script and suddenly switching to python. I guess because I was jumping back and forth between waveshare and your project. I actually had bought their 5" display for a project that I no longer needed it for, and got it working with your script. I really love your project, and even my 10 year old is pretty impressed. She's been learning coding and thinks she's pretty smart.

Thanks for all your hard work, and for responding to my dumb question.