roleoroleo / onvif_simple_server

Light implementation of an onvif server intended for use in resource-constrained devices
GNU General Public License v3.0
35 stars 12 forks source link

libtomcrypt error found #15

Open sravich1 opened 4 weeks ago

sravich1 commented 4 weeks ago

Hi, I am trying to install onvif simple server for profile T bi-directional audio. getting the below error, kindly let me know how to proceed from here cc: error: extras/libtomcrypt/libtomcrypt.a: No such file or directory make: *** [Makefile:30: onvif_simple_server] Error 1

regards Ravi

sravich1 commented 4 weeks ago

Hi, I first tried to run the make file and got the error I listed in the last message. Below error I got when I ran ./build.sh in the extras folder.

cp: cannot stat 'mbedtls_config.h': No such file or directory make: *** No targets specified and no makefile found. Stop. ./build.sh: line 95: cd: extras: No such file or directory cp: cannot stat '../onvif_simple_server': No such file or directory ln: failed to create symbolic link '_install/www/onvif/device_service': No such file or directory ln: failed to create symbolic link '_install/www/onvif/events_service': No such file or directory ln: failed to create symbolic link '_install/www/onvif/media_service': No such file or directory ln: failed to create symbolic link '_install/www/onvif/ptz_service': No such file or directory cp: cannot stat '../device_service_files': No such file or directory cp: cannot stat '../events_service_files': No such file or directory cp: cannot stat '../generic_files': No such file or directory cp: cannot stat '../media_service_files': No such file or directory cp: cannot stat '../ptz_service_files': No such file or directory cp: cannot stat '../onvif_notify_server': No such file or directory

I need to know what all i require to enable to have profile T working in raspberry pi.Kindly let me know Thanks Ravi

bilby91 commented 3 weeks ago

I was able to successfully build the project in ubuntu. You need to download the libtomcrypt source and compile it. I think the libtomcrypt src needs to be in the extra directory.

roleoroleo commented 3 weeks ago

The script build.sh should download all needed libraries. If you want to build the server with libtomcrypt, edit build.sh and comment the line export HAVE_MBEDTLS=1 Tested on Deban 11.

sravich1 commented 2 weeks ago

Hi, run build.sh and copied all _install to /usr/local tried running the lighttpd in ubuntu , we are trying to access onvif device by running the client but it says no end point listening. after running lighttpd what needs to done to run the onvif_simple_server so that client can find this. Let me know what needs to run so that onvif server get started. regards Ravi

sravich1 commented 1 week ago

Hi roleo, Just to add to my previous question we are running the code in ubuntu machine then we need the same to be cross compiled to different environment

  1. Once we downloaded the code , we did run make followed by running the build.sh in extras folder
  2. we commented MBED_TLS and then ran the build.sh
  3. then we ran the /usr/local/bin/lighttpd -f /usr/local/etc/lighttpd.conf
  4. we are not seeing the onvif device in http://YOUR_IP:8080/onvif/device_service , the web page says 403 forbidden error
  5. should we run onvif_notify_server , then wsd_simple_server Kindly can you help in the next process to see the onvif_device discoverable and then check the audio. Thanks and regards Ravi
sravich1 commented 1 week ago

Hi,

  1. Notiify_server is running and we are seeing listening for events
  2. wsd_server command is not getting executed, do we need any other configuration or change in any files to run the WSD.
  3. After this will the onvif_simple_server needs to run
  4. Then once client is run we should see onvif_device visible in the client.
  5. Kindly let us know any change in the sequence of steps. Thanks Ravi
sravich1 commented 1 week ago

Hi ,

Just to add again with the above comments should we run all these to get the onvif discoverable in the onvif device manager?

for onvif_notify-server: sudo onvif_notify_server -c /etc/onvif_simple_server.conf -p /var/run/onvif_notify_server.pid -f -d 5 17:46:03 INFO onvif_notify_server.c:725: Listening for events...

for wsd_simple_server: sudo wsd_simple_server -i enx00e04c360b89 -x http://10.35.62.4/onvif/device_service -m "Model" -n "Manufacturer" -p /var/run/wsd_simple_server.pid -f -d 5 it is running without any message ...blank after running this command

for onvif_simple_server: How to handle post request as it was failing at this point (HTTP method not supported).This was seen in onvif_simple_server.log.

also need to know how lighthttpd is running..since we are not getting http::8080/onvif_device as 403 error

Kindly let us know the steps if we have missed so that we shall run the same and check Thanks Ravi

sravich1 commented 1 week ago

Hi, Makefile changes ifdef HAVE_MBEDTLS INCLUDE = -DHAVE_MBEDTLS -Iextras/mbedtls/include -ffunction-sections -fdata-sections -lrt LIBS_O = -Wl,--gc-sections extras/mbedtls/library/libmbedcrypto.a -lpthread -lrt LIBS_N = -Wl,--gc-sections extras/mbedtls/library/libmbedcrypto.a -lpthread -lrt else INCLUDE = -Iextras/libtomcrypt/src/headers -ffunction-sections -fdata-sections -lrt LIBS_O = -Wl,--gc-sections -L/usr/lib/x86_64-linux-gnu -ltomcrypt -lpthread -lrt LIBS_N = -Wl,--gc-sections -L/usr/lib/x86_64-linux-gnu -ltomcrypt -lpthread -lrt only in the else section where we have pointed to ubuntu libtomcrypt

in build.sh we have commented HAVE_MBEDTLS kindly let us know the order of execution if we have made any error. thanks ravi

sravich1 commented 1 week ago

I was able to successfully build the project in ubuntu. You need to download the libtomcrypt source and compile it. I think the libtomcrypt src needs to be in the extra directory.

Hi billy, Any suggestion for our Makefile and build.sh which we are trying in ubuntu environment.Let me know so that we will make necessary changes Thanks ravi

roleoroleo commented 1 week ago

Just to clarify some point.

The order of the execution is not important and onvif_notify_server is not necessary. You need only wsd_simple_server running. You don't need to run onvif_simple_server manually, the httpd server will run it. onvif_simple_server needs a configuration file.

How to handle post request as it was failing at this point (HTTP method not supported).This was seen in onvif_simple_server.log.

You need to use an onvif client to test the server. Try Onvif Device Manager.

About Makefile I don't understad if you want to cross-compile the project or not. Please let me know.

sravich1 commented 1 week ago

Hi roleo, thanks for your suggestion .Below is the log attached onvif_simple_server.log

we are running the lighttpd and then we observed http:method not found error when we ran the http::8080/onvif/device_service Kindly let us know if there any get or POST issues in the lighttpd method which we can solve. regards Ravi

roleoroleo commented 1 week ago

Hi roleo, thanks for your suggestion .Below is the log attached onvif_simple_server.log

This error happens when you try to call the onvif service with a GET method (for example using a browser). Onvif protocol is based on soap/xml and uses only POST method. To test the server you need to use an onvif client.

sravich1 commented 1 week ago

Hi roleo, After sending the request from onvif client we get following response. WhatsApp Image 2024-11-16 at 14 43 27_2569dac2 Let me know what does this error mean and where should we add the correction.

Thanks Ravi

sravich1 commented 1 week ago

lighttpd.conf.txt attached is the conf file for reference..let me know if we need to change anything here. Thanks Ravi modules.conf.txt

roleoroleo commented 1 week ago

It seems an error related to authentication but I don't understand exactly. About lighttpd.conf this is the minimal configuration you need:

server.document-root = "/usr/local/www/"

server.port = 8080

server.modules = ( "mod_cgi" )
cgi.assign = ( "_service" => "" )

The last line is important beacuse you need to write which files need to be trated as executable cgi. Try to start from this minimal configuration.

PS Pull the repo, I fixed a problem...

sravich1 commented 1 week ago

Hi roleo, As suggested by you we have freshly installed debian12 and followed the same build.sh and make, we got following error WhatsApp Image 2024-11-19 at 08 33 18_0e11a8f0

we did run the onvif client and wsd_simple server . we also made modification in cgi and got the following from the browser WhatsApp Image 2024-11-19 at 08 51 13_996a68ec

Let us know if there are any changes to be made to get over the content type. Thanks Ravi

sravich1 commented 1 week ago

Hi roleo, one more image with error WhatsApp Image 2024-11-19 at 22 12 48_b46c75e3 Let me know where we need to change in the conf file. Thanks ravi

roleoroleo commented 1 week ago

The "ELF" signature in the picture means that device_service is not treated as a cgi but it's downloaded as octect-stream. lighttpd.conf is not ok. Please post the content of lighttpd.conf.

sravich1 commented 6 days ago

Hi, here are the contents server.document-root = "/usr/local/www/"

server.port = 8080

server.modules += ( "mod_cgi" )

cgi.assign = ( "_service" => "" )

cgi.assign = ( ".sh" => "/bin/sh", ".cgi" => "", "" => ""
)

alias.url += ( "./onvif/" => "/var/www/cgi-bin" )

let us know the changes..on debian 12

Ravi

sravich1 commented 5 days ago

Hi roleo, we are now facing with this issue image

we moved from lighttpd to httpd. any possible reason why we are encountering this error so that we can get over let us know Thanks Ravi

roleoroleo commented 2 days ago

If you comment this line:

cgi.assign = ( "_service" => "" )

onvif will not work. Please, uncomment this and remove the other cgi.assign (if you don't need for other services).

Which httpd are you trying? busybox?

sravich1 commented 1 day ago

Hi, Thanks for your inputs. we will try this and let you know .we are trying the same in busybox-httpd. Hope this would ensure that both client and server audio flow would happen in both the ways. does this also have SIP to support the communication?..do we need SIP or will RTSP help us to get over things for audio both the way?..let me know. Thanks Ravi