Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

DIY WiFi Raspberry Pi Touchscreen Camera
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by JC_LaFleur on Mon Jun 08, 2020 6:34 pm

rockman55,

Which distro of Raspbian Buster are you using to get this running... Full or Lite? I need to use Lite since I am running this on an older Pi 2 and don't need a desktop environment running in the background hogging the system resources. Also, I need the extra disk space for the pictures as I only have a 16gb card at the moment and plan on running timelapse shots. It should work on Buster Lite, but I need to know what missing packages are causing this to fail. What changed between the 2020-02-13 Buster and the latest 2020-05-27 R-PiOS to prevent this from working? Does anyone have any ideas?

JC_LaFleur
 
Posts: 29
Joined: Thu May 28, 2020 10:29 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by rockman55 on Mon Jun 08, 2020 8:22 pm

I have tried to use the Lite version but this is the only way I could get it to work, I used Buster Desktop only. You might try the Lite version just to see.

rockman55
 
Posts: 100
Joined: Tue Apr 14, 2015 6:17 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by JC_LaFleur on Mon Jun 08, 2020 11:07 pm

I have tried re-running the entire install again as per rockman55's last post, and when I run the new copy of "cam.py" I get the error
Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "cam.py", line 17, in <module>
    import picamera
ImportError: No module named picamera

So obviously the "Easy Install" script for the DIY WiFi Raspberry Pi Touchscreen Camera software is not working like it should.

Manually trying to install the dependencies using
Code: Select all | TOGGLE FULL SIZE
sudo apt-get -y --force-yes install python-picamera python-pygame python-imaging

returns this error
Code: Select all | TOGGLE FULL SIZE
-picamera python-pygame python-imaging
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-imaging is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python-pil

W: --force-yes is deprecated, use one of the options starting with --allow instead.
E: Package 'python-imaging' has no installation candidate


I have to run the following installs manually in order to get the cam.py script to run without getting "ImportError: No module named 'modulename'" errors
Code: Select all | TOGGLE FULL SIZE
sudo apt update
sudo apt install python-pil
sudo apt install python-picamera
sudo apt install python-pygame


After this, running the new copy of the cam.py file still does not work.
The first time I ran it I got this error and then the LCD screen goes blank, and the only way to recover is a hard reboot...
Code: Select all | TOGGLE FULL SIZE
pygame 1.9.4.post1
Hello from the pygame community. https://www.pygame.org/contribute.html
Segmentation fault


The second time I ran cam.py after the reboot I got the camera preview image with the gear and arrow icons on the LCD, but it is shrunk down to the upper left 1/4 of the 240x320 screen and the rest of the screen is blank. Trying to click on either of the icons did nothing, clicking in the preview capture area starts taking an endless series of pictures with the "working" icon blinking on and off just like before.

Is there any way someone can please update the "DIY WiFi Raspberry Pi Touchscreen Camera" project page so that everything works with the latest R-Pi OS distro and python packages?

JC_LaFleur
 
Posts: 29
Joined: Thu May 28, 2020 10:29 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by rockman55 on Tue Jun 09, 2020 1:23 am

Sounds like you about have it all running. Go to the /boot/config.txt and be sure this line is in that file:
# --- end adafruit-pitft-helper Mon 08 Jun 2020 12:11:12 PM CDT ---
hdmi_cvt=320 240 60 1 0 0 0


Your file probably has the following:
hdmi_cvt=640 480 60 1 0 0 0

So change it as per the above example where hdmi_cvt =320 240 60 1 0 0 0. This should fix the problem with the small screen, I forgot to mention that. Good luck.
Be sure you disconnect the HDMI cable to the external monitor if you have it connected.

rockman55
 
Posts: 100
Joined: Tue Apr 14, 2015 6:17 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by JC_LaFleur on Tue Jun 09, 2020 3:25 am

No, it's still not working, in fact it's worse :-(
I have done yet another full reinstall, now I am using the full desktop version of Buster as you suggested along with the line "hdmi_cvt=320 240 60 1 0 0 0" added to my /boot/config.txt file.
And now the new copy of cam.py isn't doing anything. When I run it, it just hangs, the camera light comes on, but the preview screen never appears, the LCD screen just stays on the shell screen, doesn't go blank or show the preview, and I have to "Ctrl+c" to get the prompt again. And if I use the old version of cam.py I get the preview screen, but when you touch it anywhere it just starts taking endless pictures.
This seems to be the problem... the tutorial says this downgraded package is essential for some reason?
Code: Select all | TOGGLE FULL SIZE
apt-get -y --force-yes install libsdl1.2debian/wheezy

but you have to run it like this now...
Code: Select all | TOGGLE FULL SIZE
sudo apt --allow-downgrades install libsdl1.2debian/wheezy

And it returns this error saying the package can not be found.
Code: Select all | TOGGLE FULL SIZE
pi@RaspCam:~ $ sudo apt --allow-downgrades install libsdl1.2debian/wheezy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Release 'wheezy' for 'libsdl1.2debian' was not found

As I understand it, the file "libsdl1.2debian" is what lets the cam.py script access the video framebuffer and read touchscreen inputs on the LCD display... so without that downgraded file, how are we supposed to make this work?
One other question, what do you have the boot options set to on your Buster Full install? Are you having it auto-login to the CLI or the Desktop on boot?
I've now spent 3 days trying to make this work, this is getting really frustrating... why do they leave these "tutorials" up if they no longer work or update them, or at least mark them as "broken/outdated" so people don't waste their time? :-(

JC_LaFleur
 
Posts: 29
Joined: Thu May 28, 2020 10:29 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by rockman55 on Tue Jun 09, 2020 10:50 am

Sorry you are having so much trouble, I have been trying to get this going for weeks. I do log in to the Desktop, somehow I think this makes it all work. I am using a Raspberry Pi 3B+, not sure what Pi you have, so everything is working for me.
Go to this site and you will see where I was getting my info to revamp Adafruits DIY WiFi (camera.https://github.com/PiSupply/PiJuice/tre ... -shoot-cam). Here they are using their own components including the PiJuice Hat and the Media Center Hat. I have one that I built just like this and it works great, so I hacked their project and made it work with my Adafruit 2.8 in PITFT and with Adafruits Easy Install. Let me know if any of this helps.

rockman55
 
Posts: 100
Joined: Tue Apr 14, 2015 6:17 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by JC_LaFleur on Tue Jun 09, 2020 7:22 pm

Thank you Danny,
I'll dig into the other links you posted and also try booting with the desktop turned on. I'm just worried that trying to mix instructions from too many different places is only going to compound the problems I'm already having and make fixing this even more confusing :-(
I'm running this on a Pi Model B v1.2, so it's an older, slower pi, but the Adafruit tutorial clearly says that this software should run fine on all models (including the Model A) so I don't see why the model Pi I'm using should be an issue.
Here is my setup... as you can see the old 3.2" RaspCam board with the C-mount lens adapter and integrated 320x240 LCD is a perfect solution for attaching the Pi to almost any telescope. I was really excited to find out that the Adafruit driver works for this old screen, but really bummed that the touchscreen-camera software is now broken/outdated :-(
[https://scontent-lax3-2.xx.fbcdn.net/v/t1.0-9/103009408_1019624801795858_3863948819637951651_n.jpg?_nc_cat=106&_nc_sid=110474&_nc_ohc=kXxlWCKHOdoAX-j9ri3&_nc_ht=scontent-lax3-2.xx&oh=4fe176fc372e588b2ff4c3286253f26d&oe=5F05198A][/img]
Image
I also found the old ArduCam page that has some other touchscreen-camera software I may try as well... but it looks even more outdated than the Adafruit tutorial :-(
Code: Select all | TOGGLE FULL SIZE
https://www.arducam.com/raspcam-raspberry-pi-based-camera/

It would be nice to hear from any of the Adafruit Mods or Devs on this issue... are any of you out there following this thread? Can you folks please offer any solutions to making this software work again?
Thanks

JC_LaFleur
 
Posts: 29
Joined: Thu May 28, 2020 10:29 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by jbob on Wed Aug 12, 2020 3:13 am

You might try the solution given in the last post here viewtopic.php?f=50&t=58735

jbob
 
Posts: 8
Joined: Mon Aug 18, 2014 12:46 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by JC_LaFleur on Wed Aug 12, 2020 11:46 am

Thanks for the suggestion, but that no longer works because this disk image is no longer available...
https://learn.adafruit.com/adafruit-2-8-pitft-capacitive-touch/easy-install
Returns a 404 page not found error. :-(

Regardless, even if that image were still available, it would be a workaround, not a true fix as it would be using an old version of Raspbian from 2013 instead of the latest version of PiOS. :-(

JC_LaFleur
 
Posts: 29
Joined: Thu May 28, 2020 10:29 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by drano999 on Tue Sep 01, 2020 2:52 pm

Thank you for all the comments and suggestions on this post as they have been really helpful to a new user. As far as I can tell I have tried all the ideas posted on the tutorial and this forum post to get this project to work and have not been able to get it to work fully. I am having a few problems.

As I mentioned I have tried various setups, but my current set up is the closest to how I think it should work.
Pi2, 2.8" PiTFT Resistive Screen, 8MP Pi Cam, Raspbian Jesse 10/18/16

Problem 1 - When you try to take a picture by touching the middle of the touch screen the camera takes multiple pictures while the working symbol is in the the middle of the screen.
I found a work around by commenting out this line of code in cam.py:

os.putenv('SDL_MOUSEDEV' , '/dev/input/touchscreen')

Is there a better solution? or is this caused by something? Rockman55 wrote a new version of cam.py that eliminated this issue, bu the GPIO buttons on the screen do not work and the viewfinder image is sized small even with the fix in config.txt that was posted..


Problem 2 - The view and the onscreen buttons are orientated correctly on the screen as landscape, but the buttons don't respond correctly. The control for the buttons is as if it was oriented portrait. For example when looking at the screen the settings button appear to be on the bottom left of the screen, but you can only get in to settings by pressing the top left of the screen. The button on the bottom right to view pictures only works when you press the bottom left.

I believe the touchscreen is formatted correctly because in desktop mode where i press on the screen corresponds correctly to the image on the screen.

Does anyone have any thoughts of where in cam.py i can reorient the buttons to match the image on the screen?

Thanks

Mike

drano999
 
Posts: 4
Joined: Thu Aug 27, 2020 2:11 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by rockman55 on Tue Sep 01, 2020 3:55 pm

What is your memory size? Try at 256 mb and see if that fixes some of your problems. Let me know and I will try to guide you as best I can.

rockman55
 
Posts: 100
Joined: Tue Apr 14, 2015 6:17 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by drano999 on Tue Sep 01, 2020 5:41 pm

Thank you for helping. I went to raspi-config and the memory split was at 128mb, i changed it to 256mb. The problems still exist. If I was supposed to change the memory somewhere else, please let me know.

drano999
 
Posts: 4
Joined: Thu Aug 27, 2020 2:11 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by JC_LaFleur on Tue Sep 01, 2020 6:33 pm

Changing the video memory allocation isn't going to do anything to fix how the touchscreen processes inputs.
I've had the same problems with the input areas being in the wrong locations or not responding as they are supposed to, especially when trying to rotate the screen 180 degrees.
As I've stated in a previous post, this problem seems to be related to the file "libsdl1.2debian", or whatever library file is responsible for letting the cam.py script access the touchscreen inputs on the LCD display and correlate them to the proper screen positions related to the framebuffer video output.
This file is depreciated, and no longer available for updates on newer Raspbian OS distributions... nor is it available for the original older Raspbian version that this project was originally built upon. So even if you could find the original distro image for this project, if you run an update, it permanently breaks the functionality of the touchscreen. So until the Linux developers (or someone with the time and programming experience) can fix this bug or offer a properly functional library file that can correctly interpret inputs from touchscreens, it is unlikely this project will ever work correctly again.
This is why this project either needs to be properly updated, or marked as outdated and non-functional, so that people understand that they will be wasting a lot of time and effort trying to get it working, and probably won't be able to get it working unless they have fairly advanced programming skills.

JC_LaFleur
 
Posts: 29
Joined: Thu May 28, 2020 10:29 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by drano999 on Wed Sep 02, 2020 11:41 am

JC - Thank you for the thorough post. I know I don't have the programming skills to fix it. I did take your advice about an older distro. On the screen install instructions page towards the bottom there are older distributions that install the screens. I was able to use the "Raspbian Wheezy 2015/09/09-based image" distro and have the touch screen work correctly. The GPIO buttons didn't work as I understood though. I am going to test a few other of the distributions to see if they work as well. As you pointed out if I update any of them they will break.

Link to the screen install instructions I used.
Code: Select all | TOGGLE FULL SIZE
https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/easy-install-2


I will post to this thread with an update with what distributions I tried and what works and doesn't work.

As you pointed out it would be helpful if adafruit updated this tutorial with either directions that work or mark it as outdated.

Thanks again

drano999
 
Posts: 4
Joined: Thu Aug 27, 2020 2:11 pm

Re: DIY WiFi Raspberry Pi Touchscreen Camera

by drano999 on Mon Sep 07, 2020 9:22 am

I could only get the one distro to work as I expected it should. It is working well. I am able to get in to the menus, see the image full screen and upload pictures to dropbox. Below is the distro I used:

Code: Select all | TOGGLE FULL SIZE
http://adafruit-download.s3.amazonaws.com/2015-05-05-raspbian-wheezy-pitft28r_150909.zip

drano999
 
Posts: 4
Joined: Thu Aug 27, 2020 2:11 pm

Please be positive and constructive with your questions and comments.