Open Shadab995 opened 1 year ago
What is the output of the base call without the part that extracts the tokens?
curl -s http://host-ip:59882/api/v2/device/name/Camera001/Profiles | jq .
it's showing this { "apiVersion": "v2", "message": "request failed, status code: 503, err: HTTP request timeout", "statusCode": 503 }
for others it's working properly to get the device name , etc and it's not working for stream uri as well. I use this command curl -s http://host-ip:59882/api/v2/device/name/Camera001/StreamUri?jsonObject=ewogICAiUHJvZmlsZVRva2VuIjogInByb2ZpbGVfMSIKfQ== | jq -r '"streamURI: " + '.event.readings[].objectValue.MediaUri.Uri'' : it's returning Null value
@Shadab995 Are you saying that other device commands that communicate with the camera are working? Getting device name sounds like an EdgeX command and not an Onvif command.
A 503 error code is typically something you get when the onvif device service is not able to communicate to the camera, or sends a command to the camera and does not get a response back. You say the services are running on an AWS EC2 instance. Where is the camera located? It needs to be accessible by the AWS EC2 instance for it to work properly. That means setting up port forwarding, using public ips, etc.
Ok , I need to check that how to connect onvif camera on ec2 instance because the document uses localhost and not server.
do you have any idea or any documentation that I can follow to solve this issue ?
@Shadab995 , are you running EdgeX and camera device service on ec2 instance and trying to connect to camera on a network the ec2 can connect to?
For now I followed the tutorial as mentioned in the latest video of EdgeXFoundry for connecting a device-onvif camera. I bought the same model as well C200 generate the docker file first and replace β127.0.0.1β with β0.0.0.0β and assigned the required port numbers to the security group.
so , after running docker.. The edge-ui is running fine . The commands to get the device name runs good. The command to fetch the deviceprofile doesnβt work for me And in the UI when I click on βtryβ to get the list of data , profiles and other details..it gives me 503 error.
@Shadab995 It sounds like you are trying to access a camera connected to your local WiFi network via an instance of EdgeX installed in the cloud. This is not a currently supported deployment method. You can probably make it work, but it is not recommended for security reasons.
What you should do (if possible) is install EdgeX on a machine (or VM) that is within your same local network.
Here is the not recommended way of getting it to work through the cloud. This will open your camera up publically to the entire internet so be warned.
Thank you sir.
Now , I am running Edgex on my local machine .
I followed that but then it gave me this error and I'm facing difficulties troubleshooting this.
can you please help me
code: 500 , message: request failed, status code: 500, err: {"apiVersion":"v2","message":"error reading DeviceResourece Profiles for Camera001 -\u003e failed to execute read command -\u003e invalid request for the function 'GetProfiles' of web service 'Media'. Onvif error: fault reason: Authority failure, fault detail: , fault code: SOAP-ENV:Sender ter:NotAuthorized ","statusCode":500}
Hello ,
Any inputs please. it's really important for me
Thank you
@Shadab995 That means that the username and password for the camera are incorrect.
Follow the video at https://youtu.be/vZqd3j2Zn2Y?t=200
Thank you for the response but it's correct because i can connect my camera with those credentials to VLC media player using rtsp and it' working fine.
But , I'll try creating new credentials and redo the process again.
Sir is their anyy other suggestions apart from this that can help me ?
@Shadab995 Go to consul and set Writable.LogLevel to DEBUG.
Also snoop around the InsecureSecrets folders to make sure everything is correct in there.
Send us some of the DEBUG logs after you try with the new password.
Thank you for the support . I looked into log level and found out that the MAC address and Username and Password were not in strings and added ("") to them to make them strings and then used it..Finally got output for some information but for others and for getting the profile token it's still showing error. Attaching the screenshots for better reference.
@Shadab995 Can you provide us with the DEBUG logs of the docker services?
For example:
docker logs $(docker ps -qf name=device-onvif-camera) > /tmp/onvif_logs.txt
As far as the strings issue, that sounds suspicious, as I do not know why that would happen. In the consul UI, did you modify the values of InsecureSecrets? Because the consul UI has a tendency to try and format the value as json and will complain if it does not have quotes, however you do not want quotes in them.
The reason why some commands may work and others not, is that some commands do not require authentication. I do not know if the ones you called don't or not. Definitely the DeviceInformation one does require it.
Another thing you can try is to change your password on the camera. Maybe there is some special character it does not like.
Hello @ajcasagrande
Yes , I changed the password and removed the special char as well.
Here is the log file for your reference. onvif_logs.txt
It didn't gave me a response for DeviceInformation for gave it for MetaData.
Thankyou so much for the help. Highly appreciated
I brought the camera just after watching the above video so that it can be easily implemented and also gave the deadline to the people.
Hence I request your support and assistance in understanding the errors so as to complete this project.
Thank you
@Shadab995 Yes it appears as though the credentials for the camera have not been properly configured within the system.
level=WARN ts=2022-09-14T22:41:38.3330915Z msg="failed to get credentials for camera Camera001, setting AuthMode to none for temporary client"
level=ERROR ts=2022-09-14T22:42:08.3328622Z msg="Failed to retrieve credentials for the secret path credentials001: Error, path (credentials001) doesn't exist in secret store"
Also, note that the quotes you added are messing up the values:
level=WARN ts=2022-09-15T20:29:36.4880022Z msg="Skipping invalid mac address \"28:87:BA:B1:B9:F2\": address \"28:87:BA:B1:B9:F2\": invalid MAC address"
At the root directory of device-onvif-camera
, run:
Note: fill in the
username
andpassword
with actual values. The other options should stay the same.bin/map-credentials.sh -u "username" -p "password" -P "credentials001" -A usernametoken -M "28:87:BA:B1:B9:F2"
Another thing you can try is within the edgex-compose
directory, run the make clean
command to stop EdgeX and remove ALL DATA. Then you can start over following the video from the start.
ok .. I'll do it . thanks a lot @ajcasagrande sir
Thanks a lot @ajcasagrande sir , it helped me in setting the proper credentials and it worked fine but while using ffplay and using mplayer as well , i get the error like :
ffplay
version 4.2.7-0ubuntu0.1 Copyright (c) 2003-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Could not initialize SDL - No available video device (Did you set the DISPLAY variable?) ``
I am trying to solve this from past 2 days but it's not working fine. i installed all the dependencies and the required packages like vlc , ffmpeg , build-essentials and not able to set the display variable as well.
Please help if possible .
thank you
@Shadab995 , do you still need help with this?
Yes please , it would be really good if ffplay can work in my system .
thank you
@ajcasagrande , fyi.
π Bug Report
Description and Minimal Reproduction [REQUIRED]
I'm running this command curl -s http://host-ip:59882/api/v2/device/name/Camera001/Profiles | jq -r '"profileToken: " + '.event.readings[].objectValue.Profiles[].Token'' and it's giving me the output as null but I have 2 profiles on my UI Dashboard.
can you please help me to solve this issue.
thank you
π₯ Exception or Error
π Your Environment
Deployment Environment:
EdgeX Version [REQUIRED]:
Anything else relevant?