Go to advanced search

by jahboater
Thu Jan 14, 2016 5:23 pm
Forum: C/C++
Topic: CPU load on computer
Replies: 9
Views: 2636

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: 2636

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: 2636

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: 969

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: 74642

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
by jahboater
Wed Jan 13, 2016 8:37 am
Forum: C/C++
Topic: drand48 give segfault
Replies: 5
Views: 969

Re: drand48 give segfault

Works with gcc 5.3 on a Pi2.
Is your program multi-threaded by any chance?
by jahboater
Tue Jan 12, 2016 8:27 am
Forum: General discussion
Topic: Raspberry Pi on PC
Replies: 2
Views: 464

Re: Raspberry Pi on PC

Unlikely because Raspbian is for the ARM cpu architecture while your HP computer is probably Intel x86. There are however many (hundreds) of Linux distributions for x86 that you could install. Try Debian (that Raspbian is based on) or Ubuntu (that is based on Debian) perhaps. If your HP machine is v...
by jahboater
Tue Jan 12, 2016 7:57 am
Forum: Troubleshooting
Topic: Can't Change SSH Port
Replies: 10
Views: 4149

Re: Can't Change SSH Port

Its a linux/unix tradition: 'd' in the name means "daemon" which is the server. So ntpd refers to the Network Time Protocol server etc etc.

If you only use ssh or scp locally then you may well find it easer to edit BOTH files rather than using -p (for ssh) or -P (for scp) every time.
by jahboater
Mon Jan 11, 2016 6:15 pm
Forum: Troubleshooting
Topic: Can't Change SSH Port
Replies: 10
Views: 4149

Re: Can't Change SSH Port

Here is what my sshd_config file looks like: # This is the ssh client system-wide configuration file. See # ssh_config(5) for more information. This file provides defaults for # users, and the values can be changed in per-user configuration files # or on the command line. But that is the client fil...
by jahboater
Mon Jan 11, 2016 5:53 pm
Forum: Troubleshooting
Topic: Can't Change SSH Port
Replies: 10
Views: 4149

Re: Can't Change SSH Port

I think you have the client and server config files mixed up.
by jahboater
Sun Jan 03, 2016 7:06 pm
Forum: General programming discussion
Topic: Raspberry pi programming
Replies: 4
Views: 1022

Re: Raspberry pi programming

Rasbian (linux) provides a very powerful software development environment in its own right. The common languages such as Python and C/C++ are provided as standard. Nothing need be installed. Its not like Windows. You do not need any of this:- On an arduino, i create a program on a windows ide, then ...
by jahboater
Sun Jan 03, 2016 6:16 pm
Forum: Beginners
Topic: Can't set up Pizero (SOLVED)
Replies: 13
Views: 1776

Re: Can't set up Pizero

The cable is plugged into the zero via Magpi's usb adaptor.
Have you tried plugging it directly into the micro hdmi socket? (or was the "usb" bit a typo?).
by jahboater
Fri Jan 01, 2016 11:10 am
Forum: Beginners
Topic: Possible to use SD Card over 8GB?
Replies: 20
Views: 4032

Re: Possible to use SD Card over 8GB?

I'd try another card, I suspect yours is either faulty or a fake. It should never take 12 hours to wipe the partition table (which is within the first 512 bytes) or even to format it. On Linux (raspbian) you should be able to wipe it with something like: dd if=/dev/zero of=/dev/sdX bs=512 count=1 Do...
by jahboater
Thu Dec 31, 2015 4:50 pm
Forum: Beginners
Topic: SD Card Corruption
Replies: 4
Views: 877

Re: SD Card Corruption

If the directory is already a symlink (symbolic link) to an existing tmpfs file system then just leave it - its been done for you. On my Pi2 file /var/run reports that it is a symbolic link to /run as does /var/lock which is a symlink to /run/lock. As memory gets cheaper its more and more common for...
by jahboater
Thu Dec 31, 2015 11:56 am
Forum: Advanced users
Topic: Overclocking: do you do it & how do you check for stability?
Replies: 2
Views: 967

Re: Overclocking: do you do it & how do you check for stabil

I found memtester useful: "sudo apt-get install memtester". Then something like (for the Pi2): "sudo memtester 800m 10" Then add some small CPU bound processes to ensure all four cores are at 100% all the time (check "id" in top - it must be zero). You could also run multiple instances of memtester ...
by jahboater
Thu Dec 31, 2015 11:05 am
Forum: Beginners
Topic: SD Card Corruption
Replies: 4
Views: 877

Re: SD Card Corruption

For Pi2's with their 1GB of memory, I always add the two tmpfs filesystems. Normally when a file is read its last access time is recorded. This is rarely useful and means that for every "read" there is an additional "write". Adding "noatime" is a common optimisation to avoid this. proc /proc proc de...
by jahboater
Thu Dec 24, 2015 8:46 am
Forum: General discussion
Topic: catapult project ( raspberry pi ) - physics - need help
Replies: 98
Views: 12311

Re: catapult project ( raspberry pi ) - physics - need help

If we ignore air resistance, and the catapult launches the projectile at an angle and not vertically, then I presume, knowing the value of g, we could calculate all (maximum height, launch velocity) from the distance the projectile lands from the catapult? Since air drag is extremely difficult to ca...
by jahboater
Wed Dec 23, 2015 9:04 am
Forum: General discussion
Topic: catapult project ( raspberry pi ) - physics - need help
Replies: 98
Views: 12311

Re: catapult project ( raspberry pi ) - physics - need help

Perhaps this one from Adafruit might be of interest? 10 updates per second, built-in datalogging, works up to 32km apparently. http://makersify.com/products/adafruit-ultimate-gps-breakout-66-channel-w-10-hz-updates -165 dBm sensitivity, 10 Hz updates, 66 channels 5V friendly design and only 20mA cur...
by jahboater
Wed Dec 23, 2015 8:57 am
Forum: General discussion
Topic: Sandisk Extreme SD Card - WOW
Replies: 14
Views: 9692

Re: Sandisk Extreme SD Card - WOW

Perhaps the fast boot time was because of systemd which Jessie uses?
by jahboater
Tue Dec 22, 2015 9:03 am
Forum: Troubleshooting
Topic: Detect IP and MAC of headless PI
Replies: 6
Views: 1125

Re: Detect IP and MAC of headless PI

Try something like:-

Code: Select all

sudo nmap -sn 192.168.0.0/24
by jahboater
Tue Dec 22, 2015 8:26 am
Forum: General discussion
Topic: Raspberry fan needed?
Replies: 10
Views: 1698

Re: Raspberry fan needed?

Do I really need fan for raspberry if I overclock raspberry? does it matter if I don't have The chip (SoC) is similar to those used in mobile phones - think of it placed in a tiny unventilated case and that case then put in someone’s pocket. The Pi is very robust and you will not damage it easily. ...
by jahboater
Mon Dec 21, 2015 5:46 pm
Forum: General discussion
Topic: catapult project ( raspberry pi ) - physics - need help
Replies: 98
Views: 12311

Re: catapult project ( raspberry pi ) - physics - need help

Commercial GPS update rate will be too slow I think (about a second per measurement?). It also has issues with heights and speeds over a certain altitude (to stop it being used for rocket guidance). But perhaps worthwhile adding for completeness. Yes indeed, once per second - I agree it sounds unsu...
by jahboater
Mon Dec 21, 2015 1:34 pm
Forum: General discussion
Topic: catapult project ( raspberry pi ) - physics - need help
Replies: 98
Views: 12311

Re: catapult project ( raspberry pi ) - physics - need help

The last GPS I had with a barometer would (by default) auto calibrate the barometric altitude from the GPS! It was sensitive to very small changes in height compared to the GPS though. Modern 60+ channel GPS sets receiving both GPS and Glonass, with differential corrections, are fine for altitude (f...
by jahboater
Wed Dec 16, 2015 10:30 am
Forum: Off topic discussion
Topic: Your first time coding experience
Replies: 38
Views: 5482

Re: Your first time coding experience

Fortran IV on punched cards.
Later came Z80 machine code in hex (in my spare time).
by jahboater
Wed Dec 16, 2015 10:15 am
Forum: Beginners
Topic: How to mount SD card in SanDisk ImageMate 8 in 1?
Replies: 8
Views: 1756

Re: How to mount SD card in SanDisk ImageMate 8 in 1?

Plug the card reader in and then type "dmesg" - you might then see the device name within the last few lines even if the mount failed.

Go to advanced search