Hi all:
I am working in a Web App version of the Red Pitaya command line utiliti monitor.
The question is:
How can I get the data from the RedPitaya registers from a web application ?
Thanks.
Accessing to System and FPGA Register from Web App ?
-
- Posts: 7
- Joined: Fri Dec 26, 2014 8:32 am
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: Accessing to System and FPGA Register from Web App ?
All web apps can exchange data with the Red Pitaya by issuing GET / POST requests to the "http://<RedPitaya>/data" url.
The Red Pitaya's nginx is built with a custom module that forwards these requests to the controller.so library which belongs to the currently running app.
Every controller.so needs to export the following functions:
When a GET request is processed, rp_get_params() and rp_get_signals() will be called and the results are returned in a JSON container.
When a POST request is processed, rp_set_params() and rp_get_params() will be called, setting the parameters from the transmitted JSON container and returning the new parameters.
(see Bazaar/nginx/ngx_ext_modules/ngx_http_rp_module/src/rp_data_cmd.c for details)
The Red Pitaya's nginx is built with a custom module that forwards these requests to the controller.so library which belongs to the currently running app.
Every controller.so needs to export the following functions:
Code: Select all
/* module entry points */
int rp_app_init(void);
int rp_app_exit(void);
int rp_set_params(rp_app_params_t *p, int len);
int rp_get_params(rp_app_params_t **p);
int rp_get_signals(float ***s, int *sig_num, int *sig_len);
When a POST request is processed, rp_set_params() and rp_get_params() will be called, setting the parameters from the transmitted JSON container and returning the new parameters.
(see Bazaar/nginx/ngx_ext_modules/ngx_http_rp_module/src/rp_data_cmd.c for details)
-
- Posts: 7
- Joined: Fri Dec 26, 2014 8:32 am
Re: Accessing to System and FPGA Register from Web App ?
Ok.
But, How Can I do this ?
When I put http://<red_pitaya_ip>/data on my web browser, I get this:
{"app":{},"datasets":{},"status":"ERROR","reason":"Application not loaded"}
Regards.
But, How Can I do this ?
When I put http://<red_pitaya_ip>/data on my web browser, I get this:
{"app":{},"datasets":{},"status":"ERROR","reason":"Application not loaded"}
Regards.
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: Accessing to System and FPGA Register from Web App ?
This bit is important. An app must be loaded and initialized for the "/data" url to have something to fetch data from.Nils Roos wrote:... forwards these requests to the controller.so library which belongs to the currently running app.
You will need to have at least a skeleton version of your app installed on your Red Pitaya. After you run this app from the home screen, the requests to /data will result in calls to the functions exported by your controller.so .
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 82 guests