Go to advanced search

by jahboater
Mon Jan 25, 2016 6:59 pm
Forum: Beginners
Topic: cpu usage run 100%
Replies: 2
Views: 431

Re: cpu usage run 100%

Could you help me please? I do my project with raspberry pi , processing but I am facing a problem. when I run code, it show that cpu usage run 100%. My question is 1. Can I resolve problem (cpu usage run 100%) anyway? If I change SD card that can help me? or I have only one way to adapt my code? 2...
by jahboater
Mon Jan 25, 2016 12:19 pm
Forum: C/C++
Topic: How to cross-compile and debug a C program?
Replies: 8
Views: 2440

Re: How to corss-compile and debug a C program?

For debugging use "gdb" which is included with raspbian.

If there is no documentation (man pages) for gdb or gcc do:-

Code: Select all

sudo apt-get update
sudo apt-get install gcc-4.9-doc gdb-doc
by jahboater
Mon Jan 25, 2016 11:02 am
Forum: C/C++
Topic: How to cross-compile and debug a C program?
Replies: 8
Views: 2440

Re: How to corss-compile and debug a C program?

Time to compile a large single source file (not recommended - use make -j4 with multiple small files). 15,400 lines of code. 4GHz PC 1.63 sec 1GHz Pi2 20.08sec 1GHz Pi0 52.05 sec Of course the quad core Pi2 would do better with make -j which can compile multiple source files at once using all the co...
by jahboater
Mon Jan 25, 2016 10:45 am
Forum: General discussion
Topic: Block size & lots of small files
Replies: 20
Views: 6267

Re: Block size & lots of small files

The reason I used individual files rather than a large file(s) is that the packets need to be read out of the file one by one, sent to the server and then deleted. As I understand doing this requires you to read the whole file into memory read the first line, remove it and then write the whole file...
by jahboater
Mon Jan 25, 2016 10:15 am
Forum: Advanced users
Topic: Overclocking
Replies: 1125
Views: 605704

Re: Overclocking

I tried 550Mhz again this time with over_voltage_sdram=5 and it failed in memtester early on. I tried over_voltage_sdram=6 which also failed. For 500Mhz on a different Pi2, the overclock survived 11 hours of stress testing - which is a "result", that Pi was never stable with the old firmware. The sd...
by jahboater
Mon Jan 25, 2016 9:45 am
Forum: C/C++
Topic: How to cross-compile and debug a C program?
Replies: 8
Views: 2440

Re: How to corss-compile and debug a C program?

My purpose is to develop / debug on my computer, and do not keep the operation on Raspberry. Is there any particular reason why you want to develop the code on you PC? The Raspberry Pi is itself a highly capable "computer" easily able to develop / debug a small C program. Because the Pi is credit c...
by jahboater
Mon Jan 25, 2016 8:31 am
Forum: Beginners
Topic: Resistors and physical computing.
Replies: 6
Views: 1102

Re: Resistors and physical computing.

Google "ohms law" or see the wikipedia entry - its actually very simple.
by jahboater
Sun Jan 24, 2016 10:31 pm
Forum: Advanced users
Topic: Overclocking
Replies: 1125
Views: 605704

Re: Overclocking

Does sdram_freq=550 work for you? It didn't for me with the new firmware. memtester 800m and about six small cpu bound processes failed after about 20 mins. over_voltage=2 over_voltage_sdram=2 arm_freq=1000 core_freq=500 sdram_freq=550 That's on a cherry picked Pi2 with a heatsink on the sdram chip...
by jahboater
Sun Jan 24, 2016 12:51 am
Forum: C/C++
Topic: Creating Script to Log "top" Command Output
Replies: 8
Views: 1309

Re: Creating Script to Log "top" Command Output

Back in the early days of Linux I wrote a resource monitor in C that kept track of load level, network utilization, page rate and memory used. This involved reading files in proc In the really early days (UNIX), much more fun was to get the kernel symbol table, open /dev/kmem, find the process tabl...
by jahboater
Sat Jan 23, 2016 12:22 am
Forum: C/C++
Topic: Creating Script to Log "top" Command Output
Replies: 8
Views: 1309

Re: Creating Script to Log "top" Command Output

Rather than trying to interpret the output of top, perhaps another way might be to get the source and modify it.
by jahboater
Fri Jan 22, 2016 7:01 pm
Forum: General discussion
Topic: Block size & lots of small files
Replies: 20
Views: 6267

Re: Block size & lots of small files

I think a design involving a million small files is inherently flawed. Modern file systems such as ext4 can cope I am sure, but its bound to hit some limit somewhere. What if the number of i-nodes have been restricted, or the user tries something daft like FAT16. There may be smaller limits on the n...
by jahboater
Thu Jan 21, 2016 6:49 pm
Forum: General discussion
Topic: Pi2 is flaky and keeps crashing
Replies: 51
Views: 5337

Re: Pi2 is flaky and keeps crashing

The usb and network locks up (no ssh access), lots of cpu messages on the screen and only a hard reset will bring it back to life.
What exactly are these "cpu messages" ?
by jahboater
Thu Jan 21, 2016 8:55 am
Forum: General discussion
Topic: Pi2 is flaky and keeps crashing
Replies: 51
Views: 5337

Re: Pi2 is flaky and keeps crashing

Have you tried Jessie yet?

The Pi is a very reliable platform.
Many people use them as servers running 24/7 for long periods without issue.

Perhaps you could give us more details of your little program and about the failures and maybe someone here could help?
by jahboater
Wed Jan 20, 2016 9:15 am
Forum: C/C++
Topic: Baffled why program would suddenly start randomly exiting
Replies: 3
Views: 730

Re: Baffled why program would suddenly start randomly exitin

Static memory is always initialised to zero. static int parsedData[50]; is all that's needed. Adding "= { 0 };" makes it explicit, and more readable (I think) but will not change resulting code (unless you have -fno-zero-initialized-in-bss - see man gcc). The compiler will fill in the remaining 49 z...
by jahboater
Sun Jan 17, 2016 7:22 pm
Forum: Advanced users
Topic: Overclocking
Replies: 1125
Views: 605704

Re: Overclocking

To help the sdram stability you could try "disable_pvt=1" which sets a fixed conservative dram refresh rate (otherwise the sdram temp is measured twice per second and a more optimal refresh rate set dynamically). It worked for me, but later I added heatsinks to the sdram and the SoC and it was no lo...
by jahboater
Sat Jan 16, 2016 11:59 am
Forum: Raspbian
Topic: How to compile Gnuradio 3.7.9
Replies: 9
Views: 3796

Re: How to compile Gnuradio 3.7.9

Gnuradio is supported on the Pi2.
Only version 3.7.5 though.
Should be fast though if its making good use of neon.
by jahboater
Sat Jan 16, 2016 10:26 am
Forum: Raspbian
Topic: How to compile Gnuradio 3.7.9
Replies: 9
Views: 3796

Re: How to compile Gnuradio 3.7.9

Have a look at http://svr-acjf3-armie.cl.cam.ac.uk/main.cgi
The insn is in a file
volk/kernels/volk/asm/neon/volk_32f_x2_dot_prod_32f_neonasm_opts.s
Neon is not supported on the Pi1.
There must be a build option somewhere to replace this optimization with portable code.
by jahboater
Sat Jan 16, 2016 9:24 am
Forum: Raspbian
Topic: How to compile Gnuradio 3.7.9
Replies: 9
Views: 3796

Re: How to compile Gnuradio 3.7.9

sbfx is supported by "as" on the Pi2 (ARMv7)
Are you sure sbfx is available on the ARMv6 - it looks like its thumb2, or came in with thumb2?
by jahboater
Sat Jan 16, 2016 12:22 am
Forum: Troubleshooting
Topic: Python is barely usable on Raspbian
Replies: 31
Views: 7365

Re: Python is barely usable on Raspbian

if you have Python 3, and post the times from both machines? Real times 4GHz Core i7-3770k 16GB SSD Intel PC pip -h 0.182 pip3 -h 0.301 Pi2 (Jessie Lite) pip -h 1.225 pip3 -h 1.791 Does it make any significant difference with only one ssh session and no top? Adding another ssh session with top runn...
by jahboater
Thu Jan 14, 2016 6:29 pm
Forum: Troubleshooting
Topic: Python is barely usable on Raspbian
Replies: 31
Views: 7365

Re: Python is barely usable on Raspbian

My Pi2 executes the python3 script in 0.246 seconds.
About 17 times slower than my PC which cost 45 times as much, and uses about 150 times as much electricity. The Pi2 is a bargain!
by jahboater
Thu Jan 14, 2016 5:23 pm
Forum: C/C++
Topic: CPU load on computer
Replies: 9
Views: 2695

Re: CPU load on computer

/proc is your friend. See "man 5 proc" and look down for /proc/stat which will give you details of each field. The file "/proc/stat" appears as a normal text file. It may be opened in the usual way (fopen) (you can also look at it with your favourite editor for example) and read with scanf. Read and...
by jahboater
Thu Jan 14, 2016 1:41 pm
Forum: C/C++
Topic: CPU load on computer
Replies: 9
Views: 2695

Re: CPU load on computer

top seems to use percentage of one CPU for individual processes but percentage of all CPUs for the totals at the top. munin seems to use percentage of one CPU for total usage I prefer top's convention. munin would say the Pi2 CPU is 100% utilized when in fact 75% of the CPU resource is idle. I pres...
by jahboater
Thu Jan 14, 2016 12:53 pm
Forum: C/C++
Topic: CPU load on computer
Replies: 9
Views: 2695

Re: CPU load on computer

Is this a Raspberry Pi2 or one of the other Pi's. The Pi2 has four CPU's so a program using 100% of its CPU may be considered a 25% overall CPU load, but on a B+ it would be 100% overall load. Experiment with top! A more useful value is the load average (again see top, or uptime) from /proc/loadavg ...
by jahboater
Wed Jan 13, 2016 9:14 pm
Forum: C/C++
Topic: drand48 give segfault
Replies: 5
Views: 994

Re: drand48 give segfault

Most pseudo rng's save the state between calls in static memory.
Glad it works now!
by jahboater
Wed Jan 13, 2016 2:01 pm
Forum: Advanced users
Topic: How to speed up boot time if run headless?
Replies: 28
Views: 75174

Re: How to speed up boot time if run headless?

To measure boot time for Jessie, try systemd-analyze
On its own it just gives details of the total boot time.
add "blame" to get a list of the individual unit's boot times, longest first
add "plot" to create a plot similar to bootchart.
"man systemd-analyze" tells all

Go to advanced search