SD card image with Debian 8.0, Red Pitaya web server and SDK

Just about everything about Red Pitaya
Post Reply
hamster
Posts: 2
Joined: Mon Oct 05, 2015 10:46 pm

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by hamster » Tue Oct 13, 2015 6:44 pm

I must be missing something simple. I can't seem to get any bazaar apps to install. I click install, I see the files show up in /opt/www/apps, but they never show on the web page of my RP. I also note that the IP address of my RP doesn't update on my equipment list in my account. Thoughts?

I'm pretty excited you have the SPI interface enabled. Hopefully I can use the apps including the new scope app too :)

pavel
Posts: 789
Joined: Sat May 23, 2015 5:22 pm

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by pavel » Tue Oct 13, 2015 7:10 pm

fbalakirev wrote: What is minimal amount of RAM does Debian need, in either your configuration or RP .94? I'm asking because I have your older .92 configuration, based on BusyBox I believe, that I shrunk to 128MB with your help to free up the RAM for sample buffering.
128 MB is enough for Debian.

I'd say that difference in memory usage between Debian and BusyBox is withing 10%. BusyBox services consume less memory but there is the RAM disk.

The same Linux kernel can be used with both Debian and BusyBox. You can just copy new uImage to your SD card and that's it.

I'm using Debian to be able to compile my programs directly on Red Pitaya and to install packages from the Debian repository. If it's not required for your project, then there is now reason to switch to Debian.

pavel
Posts: 789
Joined: Sat May 23, 2015 5:22 pm

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by pavel » Tue Oct 13, 2015 7:19 pm

hamster wrote:I must be missing something simple. I can't seem to get any bazaar apps to install.
Normally, all the 0.92 bazaar apps are already pre-installed.

If you're trying to install the 0.94 apps, then it's normal that it does not work. The 0.94 apps are compiled for armhf and the 0.92 apps are compiled for armel.
hamster wrote:I'm pretty excited you have the SPI interface enabled. Hopefully I can use the apps including the new scope app too :)
If you need the SPI interface and the 0.94 apps, then you can copy the /boot/uImage and /boot/devicetree.dtb files to the 0.94 SD card.

fbalakirev
Posts: 73
Joined: Thu Sep 03, 2015 6:56 pm

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by fbalakirev » Thu Oct 22, 2015 1:02 am

Hi Pavel,

I've been trying to install a development machine with your ubuntu preseed in a virtualbox on a PC behind an HTTP proxy. It could not resolve url=git.io/FwVS beacause of proxy. Is there a workaround available?

pavel
Posts: 789
Joined: Sat May 23, 2015 5:22 pm

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by pavel » Thu Oct 22, 2015 9:46 am

fbalakirev wrote:It could not resolve url=git.io/FwVS beacause of proxy. Is there a workaround available?
As a workaround, I can propose to copy this file to the computer where you're installing the virtual machine and run a small web server to make this file available to the OS installer.

For example, here is a very simple web server with an Exit button that I regulatory use to solve this kind of problems:

Code: Select all

proc Serve {chan addr port} {
  fconfigure $chan -translation auto -buffering line

  set line [gets $chan]
  set path [file join . [string trimleft [lindex $line 1] /]]
  
  
  if { [catch {set file [open $path]} err] } {
	  puts $chan "HTTP/1.0 404 Not Found"
  } else {
    fconfigure $file -translation binary
    fconfigure $chan -translation binary

    puts $chan "HTTP/1.0 200 OK"
	  puts $chan "Content-Type: text/html"
	  puts $chan ""
    fcopy $file $chan
	  close $file
  }
  close $chan
}

set sk [socket -server Serve 5151]

button .exit -text {Exit} -command {exit}
pack .exit
If you have Tcl/Tk installed (for example, via Cygwin) you can run this server with the following command:

Code: Select all

wish server.tcl
Then you can replace 'url=git.io/FwVS' with 'url=ip_of_your_computer/ubuntu.seed'.

fbalakirev
Posts: 73
Joined: Thu Sep 03, 2015 6:56 pm

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by fbalakirev » Thu Oct 22, 2015 4:01 pm

Thanks Pavel! I guess the install won't work behind proxy anyway since it needs to get various distros from the web. There're might be some ways to set proxy in starting string, but it's not clear to me at the moment. I figured it's easier to physically move the PC to a location without proxy at this point.

pavel
Posts: 789
Joined: Sat May 23, 2015 5:22 pm

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by pavel » Thu Oct 22, 2015 4:54 pm

You can specify the proxy server in the ubuntu.seed file:

Code: Select all

d-i mirror/http/proxy string http://proxy.server.com:XX

adam.polak
Posts: 37
Joined: Mon Jul 28, 2014 11:32 am

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by adam.polak » Fri Oct 23, 2015 2:28 pm

Hi Pavel,

First of all - i'd like to thank you for your work - this SD card seem to be a great development!

I'm a newbie in developing software in C but I'm motivated to get started, with specific projects in mind. But as a newbie I'm often having set of questions that others takes for granted as a basic knowledge and I'm often having problems to find the answer in the internet

I'm sure that you have plenty of other things to do, but if you could look on my questions and try to describe a bit how to deal with them it would save me probably long hours or days of try and error approach.

I have installed your SD card image according to the guide you've made and after placing it in my RedPitaya it worked nicely to see all the pre-developed software. What I want to do now is start to make my examples, but I'm still confused how to start...
- how can I develop C programs directly on the Red Pitaya board? I mean - after having the card in my RP and being connected to that board, how can I get into the files to create/modify c files with program code? (worth to notice that I'm also newbie with Linux)
- you gave example how to compile all the files in the examples folder - could you extend this command example to show how to compile specific single file?
- how to run compiled applications?

- in the second stage I'd like to develop web interface for my program - can i do it also directly on RP with your card image? are there somewhere written suggestions how to do it?

I know that all these are for you very basic questions and may be for you as a waste of time.. I will keep trying to solve it somehow, but any help will very highly appreciated!!!

pavel
Posts: 789
Joined: Sat May 23, 2015 5:22 pm

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by pavel » Fri Oct 23, 2015 9:26 pm

Hi Adam,

In the following I'll try to answer your questions.
adam.polak wrote: how can I develop C programs directly on the Red Pitaya board? I mean - after having the card in my RP and being connected to that board, how can I get into the files to create/modify c files with program code? (worth to notice that I'm also newbie with Linux)
Could you please explain how you normally develop C programs? Most probably, it would be possible to use the same approach for Red Pitaya.

Since Red Pitaya runs Linux, all the tutorials and guides explaining how to write C programs under Linux would also work for Red Pitaya. Google finds quite a few tutorials:
http://www.google.com/search?q=how+to+d ... nder+linux
http://www.codecoffee.com/tipsforlinux/articles/18.html
http://www.linfo.org/create_c1.html

Here are some ways to write/edit C programs:
  • work directly from the command line and edit C programs using editors such as vi, emacs, nano, etc
  • use GNU Midnight Commander (mc) visual file manager and its built-in editor (mcedit), you can install mc with the following command:

    Code: Select all

    apt-get install mc gettext
    then you can start it just by typing

    Code: Select all

    mc
    and here is a link to a Midnight Commander Guide
  • edit C programs on a PC and then copy them to Red Pitaya
  • under MS Windows you can use WinSCP to transfer files to/from Red Pitaya or open them directly in your preferred editor
The command to compile a simple program is:

Code: Select all

gcc -o program program.c
adam.polak wrote: you gave example how to compile all the files in the examples folder - could you extend this command example to show how to compile specific single file?

Code: Select all

gcc -I/opt/include -L/opt/lib -Wl,-rpath,/opt/lib -lrp -lm -o blink_diode blink_diode.c
adam.polak wrote: how to run compiled applications?

Code: Select all

./blink_diode
adam.polak wrote:in the second stage I'd like to develop web interface for my program - can i do it also directly on RP with your card image? are there somewhere written suggestions how to do it?
Yes, it's possible but I'm not sure if it's a good idea.

Personally, I think that writing web interfaces for data acquisition programs is a bad idea. Recently, I tried to capture a signal from the Red Pitaya SPI interface using the Red Pitaya oscilloscope application and found its interface completely unusable. I spent around 5 minutes (if not more) zooming and panning with mouse before I could see all the pulses I wanted to see. With normal oscilloscope it takes less than 10 seconds.

I'd suggest to write the user interface using a GUI framework (or tools like GNU Radio or LabVIEW) that you are most familiar with. Then the user interface would be just a program running on a PC and communicating with Red Pitaya via network.

Actually, it's how the Red Pitaya web based applications are written. They are basically programs written in JavaScript, running in the web browser and communicating with the server applications running on Red Pitaya using the WebSocket protocol.

But again, in my opinion, JavaScript is not the most suitable tool for writing interfaces for data acquisition applications.

Cheers,

Pavel

adam.polak
Posts: 37
Joined: Mon Jul 28, 2014 11:32 am

Re: SD card image with Debian 8.0, Red Pitaya web server and

Post by adam.polak » Mon Oct 26, 2015 6:05 pm

Hi Pavel!

Thank you very much for your post! All the info you gave me really helped me to start getting some useful progress!! it's a HUGE thank you!!

As mentioned before - i have no big experience in C and before I wrote only some simple things in gedit, without including extra libraries so simple gcc compilation was enough. The biggest issue for me was compilation on RP with inclusion of extra stuff during compilation (everything required to work with RP) - i had problems with SDK form main web page and that how I got to your SD card - but your suggestions let me compile first things! Thank you again!!

As for web interface - i agree with you in here, and for normal data acquisition I'm going to use plink to Matlab (since this is the environment I usually work with), but final deliverable of this project is for observation only by non-scientists and that's why I was thinking about web-interface.. but I'll still consider that.

I'd like to ask few more questions about your ecosystem
- can I still use wifi dongle and make RP as access point as it was available in standard 0.92 version? when I plug in my dongle i see RP network and i can connect to it, but have no idea on what address to communicate with RP - standard 192.168.128.1 seems not working.. (right now I'm using only direct LAN connection - if I plug it to network then RP webpage cannot find it via MAC :| )
- is it possible to remote control RP with your Ecosystem? I still have plenty of my previous code where i use directly Matlab via SCPI to talk with RP, but i fail to connect to set SCPI server with your ecosystem - does it support SCPI server? what's the command to set it (nor the old nor the new one seem to work for me :( )
- when I go via ssh to RP then first few lines say about linux being free and no warranty etc, but then it says that last login from 192.168.1.101 (my address on static IP) was on 1 Jan 1970 - never mind how many times I've logged in already - do you think that there something funny with my settings?
- I noticed that for compiling all the examples you use 'make' command. I tried it for individual file and then it gives warning that "File 'Makefile' has modification time 143270569 s in the future", "myfile is up to date", "Clock skew detected. Your build may be incomplete". Again as above - I'm worried that some of my settings are wrong - could you advise? (however - when I just use the gcc command with all the parameters as you suggested in above post it compiles without errors so it's not a big issue - just curious).

- the last questions and at the same time the one which give me most worries right now - I'm busy with the code using setting values to slow analog outputs and reading from slow analog input. i managed to write what I thought as a correct c file, but whatever I do, reading values from slow AI always fail (most of the time give value 0V, sometimes some strange value not related to anything i would expect). I tried to check it with very simple code - set value on AO pin and read it on AI but I have nothing - the same result again. (it is also the case with the read analog voltage example from examples folder). I checked setting value with multi-meter, and this works ok, only read AI gives problems. I checked many times my code and physical connections and do not know what may be the reason of this issue. Have you noticed anything like this before? I expect that it's me making some mistakes but I don't know where i could make them - when I change SD card for the one with ecosystem 0.92 and run the same task with SCPI in Matlab then it works ok.
I'm really puzzled and wonder if there may be something deeper in ecosystem preventing me reading slow AI??....

I would be (again!!) grateful for your opinion!

All the best
Adam

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