Replies: 4 comments 2 replies
-
|
Hi @Styblo , It looks like a json error on parsing. There is a similar example with axparameter and civetweb here (without registering callbacks though), please have a look: Or share some code related. |
Beta Was this translation helpful? Give feedback.
-
|
@Styblo , that error normally happens when the Json parser receives "<" from an html tag, that the server is sending to your client/custom UI. I guess your js is expecting "{" from your server. Did you create a handler to handle the post request? IF you are only using the sample it will return the html file because it only listens to the root one "/". You can use Jansson lib in your acap to create and parse json payload in your handler function or associated function that handles the logic from your handler in charge of handling the post resquest. Could you share some code from the handler and function that writes back to the client? Or did the example helped? |
Beta Was this translation helpful? Give feedback.
-
|
Hello @losamtz, Do I undesrstand it right, that you need to have separate program for the webserver and your program but have it all compiled in one .eap file? Thank you for you time. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Styblo , the server runs on main() :
Parameter handler function:
Response/send_json() function to client UI:
Structure here:
Please check the example to see how it connects with axparameter. Client side js:
|
Beta Was this translation helpful? Give feedback.






Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am currently working on the project and I want for main program "example.c" to has web interface, where you can adjust or change the data (for example username and password for RTSP stream)
I combined my program with the program here:
https://github.com/AxisCommunications/acap-native-sdk-examples/tree/main/web-server
I also used the library <axsdk/axparameter.h> for shared variables between the program and web server, but I cant run it right. It can be compiled with docker and the "example.c" main program runs when i run it on the camera, but when I open the web interface and type the username and password, it returns me this error:
So the main problem is that the web server is not working correctly i think.
Do you have any suggestions or can you help me, what should I do to make it work?
Thank you. :)
Beta Was this translation helpful? Give feedback.
All reactions