Raspberry Pi camera module

sony
Posts: 28
Joined: Wednesday 14th June 2017 12:28am

Re: Raspberry Pi camera module

Post by sony » Friday 09th February 2018 12:40am

Hi Charlie,
It's like a beginner tech to teacher :)
I think you must log in to root

1st problem, you should have 'param.par' file in the home folder.
par_file_folder.PNG
par_file_folder.PNG (76.64 KiB) Viewed 20 times
2nd problem, you must create the 'tmp1' ram drive
create_RAM_drive.PNG
create_RAM_drive.PNG (37.05 KiB) Viewed 20 times

User avatar
cogier
Site Admin
Posts: 135
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Raspberry Pi camera module

Post by cogier » Sunday 11th February 2018 3:08pm

OK. I suggest you add the following code at line 79 to create 'param.par' if it does not exist
If Not Exist(User.home &/ "param.par") Then File.Save(User.home &/ "param.par", "")


I changed all references to the RamDrive to /tmp (not /tmp1) and added the following 'Sub' which I took from 'PiCam'.
Public Sub CreateRAMDrive()                                         'To create a RAM drive to hold the SSH Preview picture
Dim sFstab As String                                                'To store the details in the fstab file

If Not Exist("/var/tmp") Then Mkdir "/var/tmp"                      'Does this folder exist, if not create it

sFstab = File.Load("/etc/fstab")                                    'Load the contents of fstab into sFstab

If Not InStr(sFstab, "tmpfs /var/tmp tmpfs nodev,nosuid,size=3M 0 0") Then 'If the string we need to create the 3Meg RAM drive is not there then..
  sFstab &= "\ntmpfs /var/tmp tmpfs nodev,nosuid,size=3M 0 0\n"     'Add the string to the end of the file
  File.Save(User.Home &/ "fstab", sFstab)                           'Save the file to the Home folder
  Shell "sudo mv ~/fstab /etc/fstab"                                'Move the file to the 'etc' folder
  Shell "sudo mount -a"                                             'Mount all drives including our new one
Endif

End
Then call that the 'Sub' : -
Public Sub Form_Open()

CreateRAMDrive

If (wiringPiSetup() = -1).............
I get a picture taken in the RamDrive but I am not sure what is supposed to happen next, I have changed all the values and clicked everything but nothing seems to happen. Are you still trying to display video output?

sony
Posts: 28
Joined: Wednesday 14th June 2017 12:28am

Re: Raspberry Pi camera module

Post by sony » Monday 12th February 2018 2:58am

It's about how to setting the parameter. For test just add a button with code like picture below:
new_button.PNG
new_button.PNG (13.86 KiB) Viewed 10 times
IF you run the program then click the button will shot the camera like below:
sample1.PNG
sample1.PNG (79.43 KiB) Viewed 10 times
Now you can fill the parameter. Size mean size area copied of image from left to right area, Pos mean position area copied of image from left to right area.

for example if you want capture the position of image with the writing SIMATIC you must set the paramater Pos with value like image below,
press copy button you will copy the necessary position to right area.
samplepos10-65.PNG
samplepos10-65.PNG (95.85 KiB) Viewed 10 times
After that if you press 'calculate' will count differential pixel color in the image copied area.

If you give different value in Pos parameter and try step like above will give different pixel count. Just if trigger active and picture shot by camera automatically and if Actual pixel count less then limit the output will be energize.

User avatar
cogier
Site Admin
Posts: 135
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Raspberry Pi camera module

Post by cogier » Saturday 17th February 2018 4:36pm

Matt and I have done some work for you. Have a look at the attached program.

When you want to 'Copy' just use the mouse to select the area to copy and when you release the mouse button it will copy across automatically.

Hope you like it.
PiCamera.png
PiCamera.png (187 KiB) Viewed 2 times
PiCamera.tar.gz
(36.89 KiB) Not downloaded yet

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest