Accessing to System and FPGA Register from Web App ?

Applications, development tools, FPGA, C, WEB
Post Reply
SEUTec
Posts: 7
Joined: Fri Dec 26, 2014 8:32 am

Accessing to System and FPGA Register from Web App ?

Post by SEUTec » Sat Jan 10, 2015 3:45 pm

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.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Accessing to System and FPGA Register from Web App ?

Post by Nils Roos » Sun Jan 11, 2015 8:19 pm

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:

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 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)

SEUTec
Posts: 7
Joined: Fri Dec 26, 2014 8:32 am

Re: Accessing to System and FPGA Register from Web App ?

Post by SEUTec » Mon Jan 12, 2015 2:53 pm

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.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Accessing to System and FPGA Register from Web App ?

Post by Nils Roos » Mon Jan 12, 2015 3:05 pm

Nils Roos wrote:... forwards these requests to the controller.so library which belongs to the currently running app.
This bit is important. An app must be loaded and initialized for the "/data" url to have something to fetch data from.

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 .

Post Reply
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 85 guests