Hi,
Im using a raspberry pi with the Openhab image to send emails with some of my cameras.
If i use the commandline to fetch the image i can see with one camera i first get a 401 error and then it download the image, with the other it just takes a bit longer to download.
But they both fetch the image.
when executing the commands seperatly i dont have a issue.
I can access the folder with openhabian in the terminal without issue, also.
Ive also tried to use /home/tmp after creating it but that also doenst work.
Working commandline:
wget http://user:password123@192.168.0.10/snap.jpg -O /home/openhabian/tmp/FrontDoorCam.jpg
–2022-08-07 16:01:20-- http://user:*password*@192.168.0.10/snap.jpg
Connecting to 192.168.0.10:80… connected.
HTTP request sent, awaiting response… 401 Unauthorized
Authentication selected: Digest realm=“Please log in with a valid username.”,nonce=“48e71c1546a52fa67af318f57ec3422e”,opaque=“”,stale=FALSE,algorithm=MD5,qop=“auth”
Connecting to 192.168.0.10:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 235500 (230K) [image/jpeg]
Saving to: ‘/home/openhabian/tmp/FrontDoorCam.jpg’
rule "Doorbell Pressed Closed"
when
Item GroundFloorHallwayDoorbell_DoorBellSensor changed from CLOSED to OPEN
then {
logInfo ("Door bell pressed closed", "doorbell pressed")
executeCommandLine("wget http://192.168.0.15/stream.jpg -O /home/openhabian/tmp/FrontDoorCam2.jpg")
Thread::sleep(10000) // 10 second wait
sendMail(getActions("mail","mail:smtp:ff634c00d8"), "myfirstemail@gmail.com", "the doorbell was pressed","mail body" , "file:///home/openhabian/tmp/FrontDoorCam2.jpg" )
}
end
Code 2:
rule "Doorbell Pressed Closed"
when
Item GroundFloorHallwayDoorbell_DoorBellSensor changed from CLOSED to OPEN
then {
logInfo ("Door bell pressed closed", "doorbell pressed")
executeCommandLine("wget http://user:mypassword@192.168.0.10/snap.jpg -O /home/openhabian/tmp/FrontDoorCam.jpg")
Thread::sleep(10000) // 10 second wait
sendMail(getActions("mail","mail:smtp:ff634c00d8"), "myfirstemail@gmail.com", "the doorbell was pressed","mail body" , "file:///home/openhabian/tmp/FrontDoorCam.jpg" )
}
end
- Platform information:
- Hardware: CPUArchitecture/RAM/storage
- OS: what OS is used and which version
- Java Runtime Environment: which java platform is used and what version
- openHAB version:3.2.0
- Issue of the topic: please be detailed explaining your issue
- Please post configurations (if applicable):
- Items configuration related to the issue
- Sitemap configuration related to the issue
- Rules code related to the issue
- Services configuration related to the issue
- If logs where generated please post these here using code fences:
`2022-08-07 17:09:06.325 [WARN ] [rg.openhab.core.io.net.exec.ExecUtil] - Error occurred when executing commandLine '[wget http://192.168.0.15/stream.jpg -O /home/openhabian/tmp/FrontDoorCam2.jpg]'
java.io.IOException: Cannot run program "wget http://192.168.0.15/stream.jpg -O /home/openhabian/tmp/FrontDoorCam2.jpg": error=2, No such file or directory`