Self compiled RedPitaya web-application not loaded

Applications, development tools, FPGA, C, WEB
Post Reply
georgwild
Posts: 8
Joined: Fri May 06, 2016 2:22 pm

Self compiled RedPitaya web-application not loaded

Post by georgwild » Fri Sep 02, 2016 11:09 am

Hello everyone,

I am having troubles with the RedPitaya web interface in combination with my self compiled spectrum analyzer application.

The reason I am compiling the spectrum analyzer application is, that I want to write my own applications later on that use the RedPitaya web interface and I thought that this would be a good place to start.

This is the error I keep getting, so if you know what's wrong you don't need to read the whole post.

Image

This is the nginx error log, if that is helpful.

Code: Select all

  /opt/redpitaya/www/conf/lua/online.lua: in function </opt/redpitaya/www/conf/lua/online.lua:1>, client: 192.168.1.14, server: , request: "HEAD /check_inet HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.1$
2016/09/02 09:26:13 [error] 1384#0: *64 open() "/opt/redpitaya/www/apps/favicon.ico" failed (2: No such file or directory), client: 192.168.1.14, server: , request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.17"
2016/09/02 09:26:13 [error] 1384#0: *67 open() "/opt/redpitaya/www/apps/favicon.ico" failed (2: No such file or directory), client: 192.168.1.14, server: , request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.17"
2016/09/02 09:34:36 [notice] 1634#0: signal process started
2016/09/02 09:36:09 [alert] 1358#0: *22 the http output chain is empty, client: 192.168.1.14, server: , request: "GET /bazaar?apps=^@_=1472808967826 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/"
2016/09/02 09:36:14 [error] 1358#0: *59 Application not loaded, client: 192.168.1.14, server: , request: "GET /data?_=1472808973369 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:36:14 [alert] 1358#0: *59 the http output chain is empty, client: 192.168.1.14, server: , request: "GET /data?_=1472808973369 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:36:15 [alert] 1358#0: *60 the http output chain is empty, client: 192.168.1.14, server: , request: "GET /bazaar?start=spectrum^@HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:36:15 [alert] 1358#0: *61 the http output chain is empty, client: 192.168.1.14, server: , request: "POST /data HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:36:15 [error] 1472#0: *63 Application not loaded, client: 192.168.1.14, server: , request: "GET /data?_=1472808973370 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:36:15 [alert] 1472#0: *63 the http output chain is empty, client: 192.168.1.14, server: , request: "GET /data?_=1472808973370 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:45:30 [alert] 1472#0: *64 the http output chain is empty, client: 192.168.1.14, server: , request: "GET /bazaar?stop=^@HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:45:30 [alert] 1472#0: *65 the http output chain is empty, client: 192.168.1.14, server: , request: "GET /bazaar?apps=^@_=1472809529321 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/"
2016/09/02 09:45:33 [error] 1472#0: *70 Application not loaded, client: 192.168.1.14, server: , request: "GET /data?_=1472809532674 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:45:33 [alert] 1472#0: *70 the http output chain is empty, client: 192.168.1.14, server: , request: "GET /data?_=1472809532674 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:45:33 [alert] 1472#0: *71 the http output chain is empty, client: 192.168.1.14, server: , request: "GET /bazaar?start=spectrum^@HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:45:33 [alert] 1472#0: *72 the http output chain is empty, client: 192.168.1.14, server: , request: "POST /data HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:45:34 [error] 1541#0: *74 Application not loaded, client: 192.168.1.14, server: , request: "GET /data?_=1472809532675 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
2016/09/02 09:45:34 [alert] 1541#0: *74 the http output chain is empty, client: 192.168.1.14, server: , request: "GET /data?_=1472809532675 HTTP/1.1", host: "192.168.1.17", referrer: "http://192.168.1.17/spectrum/?type=run"
I think it has something to do with the 'controllerhf.so' not being loaded by the webserver.

So here is exactly what I am doing:
  • Clone the RedPitaya Repository to the RedPitaya (master branch)
  • Go to the spectrum app source code and compile it using 'make all'. I think there is nothing wrong with the output.

    Code: Select all

    make -C src
    make[1]: Entering directory '/root/RedPitaya/apps-free/spectrum/src'
    make -C ./external/kiss_fft
    make[2]: Entering directory '/root/RedPitaya/apps-free/spectrum/src/external/kiss_fft'
    gcc -DVERSION=0.94-0 -DREVISION=devbuild -Wall -Werror -g -fPIC -I./external/kiss_fft -I/include -I/include/api2 -I/include/apiApp -I/rp_sdk -Wall -Werror -g -fPIC   -c -o kiss_fft.o kiss_fft.c
    gcc -DVERSION=0.94-0 -DREVISION=devbuild -Wall -Werror -g -fPIC -I./external/kiss_fft -I/include -I/include/api2 -I/include/apiApp -I/rp_sdk -Wall -Werror -g -fPIC   -c -o kiss_fftr.o kiss_fftr.c
    make[2]: Leaving directory '/root/RedPitaya/apps-free/spectrum/src/external/kiss_fft'
    gcc -DVERSION=0.94-0 -DREVISION=devbuild -Wall -Werror -g -fPIC -I./external/kiss_fft -I/include -I/include/api2 -I/include/apiApp -I/rp_sdk   -c -o main.o main.c
    gcc -DVERSION=0.94-0 -DREVISION=devbuild -Wall -Werror -g -fPIC -I./external/kiss_fft -I/include -I/include/api2 -I/include/apiApp -I/rp_sdk   -c -o fpga.o fpga.c
    gcc -DVERSION=0.94-0 -DREVISION=devbuild -Wall -Werror -g -fPIC -I./external/kiss_fft -I/include -I/include/api2 -I/include/apiApp -I/rp_sdk   -c -o worker.o worker.c
    gcc -DVERSION=0.94-0 -DREVISION=devbuild -Wall -Werror -g -fPIC -I./external/kiss_fft -I/include -I/include/api2 -I/include/apiApp -I/rp_sdk   -c -o dsp.o dsp.c
    gcc -DVERSION=0.94-0 -DREVISION=devbuild -Wall -Werror -g -fPIC -I./external/kiss_fft -I/include -I/include/api2 -I/include/apiApp -I/rp_sdk   -c -o waterfall.o waterfall.c
    gcc -o ../controllerhf.so main.o fpga.o worker.o dsp.o waterfall.o ./external/kiss_fft/kiss_fft.o ./external/kiss_fft/kiss_fftr.o -DVERSION=0.94-0 -DREVISION=devbuild -Wall -Werror -g -fPIC -I./external/kiss_fft -I/include -I/include/api2 -I/include/apiApp -I/rp_sdk -shared -L/lib -L/rp_sdk
    make[1]: Leaving directory '/root/RedPitaya/apps-free/spectrum/src'
    
  • Make the RedPitaya filesystem writeable with 'rw' and copy the spectrum folder to '/opt/redpitaya/www/apps'
  • Add four lines in the 'idfile.id' inside the directory where also the spectrum app-folder is. I do this so that the app shows up in the web interface.

    Code: Select all

                    {
                            "app_id" : "spectrum",
                            "app_name" : "Spectrum Analyzer",
                    }
    
  • Reboot the RedPitaya
Edit: Add the image on imgur. Attachment is not working.
You do not have the required permissions to view the files attached to this post.

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

Re: Self compiled RedPitaya web-application not loaded

Post by Nils Roos » Fri Sep 02, 2016 2:16 pm

Hi,

there are a couple of dependency problems with the controllerhf.so of the spectrum app, but they don't show up during compilation because it is a shared object. These problems are:
  • In waterfall.c there is an inline function "__rp_spectr_wf_limit". Apparently it is not a good idea to inline functions that start with double underscore, the compiler removes them. Simply get rid of the "inline" (maybe replace it with "static").
  • Missing dependencies for libm, libpthread, libjpeg: add a line "LIBS += -lm -lpthread -ljpeg" to spectrum/src/Makefile after the other LIBS lines.
When you rebuild the controller with these changes, the app functions normally. For future app-problems of this kind, you can find helpful information in /var/log/redpitaya_nginx/debug.log .

ps: there is nothing wrong with the attachment, but it is only visible to people who are logged in (I could see it before you put the imgur link in).

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 87 guests