I have just successfully configured a one wire connection to a ds18b20 one wire sensor and can read the temperature in my plc program, and now I'm inspired to get the pi camera working.
I can easily go to the command line in the pi and type:
raspistill -o cam.jpg
And the camera will take a pic and save it under that file name in the root directory. Then I can use an FTP utility like FileZilla to view the file remotely which is all I need to do.
See attached screenshots for more detail
How can I trigger the camera from the plc program?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
there is an example in the delivery/package:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.1.0.0\Camera.project" </yourwindowsusername>
if you need a Stream:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.1.0.0\CameraStream.project"
for the Stream you need additional some apt-get install on the linux side.
Check:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.1.0.0\RaspberryPI_en.pdf"
for details... attention if you activate the stream.. raspistill reports an error you need to stop the cam stream to be "raspistill enabled" again</yourwindowsusername></yourwindowsusername>
this could either done by the webside (http://piIPAddress) or by the following commands:
cd RPi_Cam_Web_Interface/
./RPi_Cam_Web_Interface_Installer.sh stop
./RPi_Cam_Web_Interface_Installer.sh start
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh that's embarrassing... I didn't even know those demo programs were stored there!
My code was almost identical... See attached. Only difference is I included the command "raspistill" before -o file name.jpg... Also didn't toggle the trigger back off after turning it on.
Can you tell me where the file will get stored on the pi?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If i do a "find / -name cam.jpg 2>/dev/null" from the pi prompt the file "cam.jpg" doesn't show up, even though from what I've read that should search the entire system.. Yet when I go to the file browser as you suggest, there it is!
Yay!
Thanks for your help Edwin... That's really cool stuff
Les
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry... One more dumb question... Why cannot I not access that file?
If I double click nothing happens, and the << or >> arrows between the host and runtime windows appear greyed out... Is there something I need to do to enable access to files in that directory?
Les
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
select the file in the right windows (plc) ->the jpg.
then '<<' should be not greyed, move it to the left window (there you need to specify a directory with write access on your Windows machine)
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That was it... A valid directory (ie the root of c:) needed to be selected in the left hand pane, then the << button became un greyed and I could move the pic from the pi to my hard drive.
Thanks once again Edwin!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello forum users
I have just successfully configured a one wire connection to a ds18b20 one wire sensor and can read the temperature in my plc program, and now I'm inspired to get the pi camera working.
I can easily go to the command line in the pi and type:
raspistill -o cam.jpg
And the camera will take a pic and save it under that file name in the root directory. Then I can use an FTP utility like FileZilla to view the file remotely which is all I need to do.
See attached screenshots for more detail
How can I trigger the camera from the plc program?
Thanks!
Hi,
there is an example in the delivery/package:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.1.0.0\Camera.project" </yourwindowsusername>
if you need a Stream:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.1.0.0\CameraStream.project"
for the Stream you need additional some apt-get install on the linux side.
Check:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.1.0.0\RaspberryPI_en.pdf"
for details... attention if you activate the stream.. raspistill reports an error you need to stop the cam stream to be "raspistill enabled" again</yourwindowsusername></yourwindowsusername>
this could either done by the webside (http://piIPAddress) or by the following commands:
cd RPi_Cam_Web_Interface/
./RPi_Cam_Web_Interface_Installer.sh stop
./RPi_Cam_Web_Interface_Installer.sh start
BR
Edwin
Oh that's embarrassing... I didn't even know those demo programs were stored there!
My code was almost identical... See attached. Only difference is I included the command "raspistill" before -o file name.jpg... Also didn't toggle the trigger back off after turning it on.
Can you tell me where the file will get stored on the pi?
Thanks
Hi,
you could get it by the CODESYS filebrowser:
the directory is /root/
BR
Edwin
Wow... Very interesting
If i do a "find / -name cam.jpg 2>/dev/null" from the pi prompt the file "cam.jpg" doesn't show up, even though from what I've read that should search the entire system.. Yet when I go to the file browser as you suggest, there it is!
Yay!
Thanks for your help Edwin... That's really cool stuff
Les
Sorry... One more dumb question... Why cannot I not access that file?
If I double click nothing happens, and the << or >> arrows between the host and runtime windows appear greyed out... Is there something I need to do to enable access to files in that directory?
Les
Hi,
select the file in the right windows (plc) ->the jpg.
then '<<' should be not greyed, move it to the left window (there you need to specify a directory with write access on your Windows machine)
BR
Edwin
Yes!
That was it... A valid directory (ie the root of c:) needed to be selected in the left hand pane, then the << button became un greyed and I could move the pic from the pi to my hard drive.
Thanks once again Edwin!