Go to advanced search

by swampdog
Fri Apr 12, 2019 2:38 am
Forum: Troubleshooting
Topic: Raspberry Pi 3 B+ experiencing tons of kernel oops when compiling over NFS
Replies: 8
Views: 537

Re: Raspberry Pi 3 B+ experiencing tons of kernel oops when compiling over NFS

My memory may not be correct on this but I *think* I had this problem ages ago. In case it helps.. [email protected]:~ $ dfh 192.168.1.20:/mnt/nfsd/pi05 63G 45G 16G 75% / mmcblk0p1 43M 22M 21M 52% /boot mmcblk0p2 3.6G 3.1G 382M 89% /swap [email protected]:~/usr/src/gcc $ lc -h /swap/dphys -rw------- 1 root root 1...
by swampdog
Thu Apr 11, 2019 12:28 am
Forum: Beginners
Topic: [SOLVED] Trouble configuring Raspbian Lite for pubkey auth SSH with PUTTY (Windows) generated key
Replies: 9
Views: 158

Re: Trouble configuring Raspbian Lite for pubkey auth SSH with PUTTY (Windows) generated key

I've had no end of wierd problems with PuTTY over the years. If you are able you'll find it much less painful to install cygwin and its "ssh client". Just run 'ssh-user-config'. Thereafter it's just like linux. Here's how to manually set up ssh on your rpi. We'll create a throwaway account. $sudo su...
by swampdog
Wed Apr 10, 2019 11:23 pm
Forum: C/C++
Topic: std::thread not working with clang in rpi3
Replies: 3
Views: 149

Re: std::thread not working with clang in rpi3

I don't know much about clang. However, I needed to build LLVM and built clang (6.01) as most of the work was done. Mine isn't "installed" properly and thus requires LD_LIBRARY_CONFIG which *might* help with your problem. I also have multiple "gcc" versions and for this I used gcc (8.2.0) and they a...
by swampdog
Thu Apr 04, 2019 7:44 pm
Forum: Raspbian
Topic: What is the small partition visible to Windows?
Replies: 25
Views: 768

Re: What is the small partition visible to Windows?

Are you able to give some insight into the complex reasons? Maybe i should explain what I’m trying to do. Using Raspbian (Stretch, or whatever is the current version), Volumio, or perhaps another music player oriented op system, I’m building a dedicated music player like an iPod. All this device ne...
by swampdog
Thu Apr 04, 2019 4:33 pm
Forum: Raspbian
Topic: What is the small partition visible to Windows?
Replies: 25
Views: 768

Re: What is the small partition visible to Windows?

Windows can't natively see most of the sdcard. The small bit that windows can see is used to boot raspbian. The rest of the sdcard is raspbian itself and uses a linux filesystem (ext4). Windows has a nasty habit of stomping over filesystems it doesn't recognise so for the time being just assume the ...
by swampdog
Thu Apr 04, 2019 4:18 pm
Forum: C/C++
Topic: missing X libraries
Replies: 2
Views: 1239

Re: missing X libraries

A couple of useful tools when coding.. $sudo apt-get install mlocate apt-file The first allows you to "sudo updatedb" then "man locate" to find files present on your system. The latter "sudo apt-file update" (do it after an "apt-get update") updates a database of every file in every package. eg: $ a...
by swampdog
Thu Apr 04, 2019 3:48 pm
Forum: C/C++
Topic: C/C++ Memory Usage Code
Replies: 21
Views: 2076

Re: C/C++ Memory Usage Code

I simply googled and went from this.. https://stackoverflow.com/questions/19949283/seek0-on-linux-proc-sys-pseudo-files ..rather than personal knowledge of how the kernel acts in that respect. However, as you're into overly excessive optimisation ;-) It "works" on my rpi so it's fair game. It's poss...
by swampdog
Wed Apr 03, 2019 3:54 pm
Forum: C/C++
Topic: why does this error occurs?
Replies: 5
Views: 1391

Re: why does this error occurs?

This is probably where you're going to have to work it out for yourself. Add "-g" (debug flag). Example of a segfault.. $cat core.c #include <stdio.h> int main() {char *p=NULL; printf("Beg\n"); printf("%s\n",p); printf("End\n"); return 0; } Now we'll enable coredumps for this login and add debug inf...
by swampdog
Mon Apr 01, 2019 7:55 pm
Forum: C/C++
Topic: Help with "typedef statements for ARMV6 (32bit) CPU
Replies: 28
Views: 2517

Re: Help with "typedef statements for ARMV6 (32bit) CPU

Not that it "matters" for the project because you need to compile it "as-is" but fwiw, generically the idiom is.. int ch; while (EOF != (ch = fgetc(fp))) { /* stuff */ } /* ferror/clearerr */ That is, you must test for EOF before doing anything else. Perhaps the logic of the code does not require it...
by swampdog
Mon Apr 01, 2019 7:22 pm
Forum: C/C++
Topic: [SOLVED] Stripping a library?
Replies: 9
Views: 1549

Re: [SOLVED] Stripping a library?

As an addendum you likely don't need to bother doing this yourself "man 1 install" noting the "-s" option.
by swampdog
Mon Apr 01, 2019 7:14 pm
Forum: C/C++
Topic: why does this error occurs?
Replies: 5
Views: 1391

Re: why does this error occurs?

You can get the compiler errors into a text file thus.. $ gcc -lm -o final final.c >z 2>&1 $ cat z ..saves having to take screenshots and attachments. $ apt-cache search wiring | grep ^w wiringpi - The wiringPi libraries, headers and gpio command ^^^ you probably haven't got this installed. $ sudo a...
by swampdog
Mon Apr 01, 2019 5:02 pm
Forum: C/C++
Topic: C/C++ Memory Usage Code
Replies: 21
Views: 2076

Re: C/C++ Memory Usage Code

You could use fseek(file,0,SEEK_SET) rather than keep reopening the file and "/1024" is the same as ">> 10" though it wouldn't surprise me if gcc worked out the latter for itself.

Yeah. I'm an erratic poster!
by swampdog
Sat Mar 16, 2019 12:22 am
Forum: C/C++
Topic: How to assign a variable value from a text file
Replies: 6
Views: 1549

Re: How to assign a variable value from a text file

We need an example. In lieu of that.. [email protected]:~ $ apropos strto strtod (3) - convert ASCII string to floating-point number strtof (3) - convert ASCII string to floating-point number strtoimax (3) - convert string to integer strtok (3) - extract tokens from strings strtok_r (3) - extract tokens fr...
by swampdog
Thu Mar 14, 2019 11:56 pm
Forum: Raspbian
Topic: Webmin or an alternative
Replies: 8
Views: 415

Re: Webmin or an alternative

Looks like I failed to make a note of the procedure Ah. Looks like it's still in the history of my "printer" rpi.. $ sudo dpkg -i webmin_1.831_all.deb $ sudo systemctl status webmin $ wget wget http://www.webmin.com/jcameron-key.asc $ sudo apt-key add jcameron-key.asc $sudo apt-get update $sudo apt...
by swampdog
Thu Mar 14, 2019 11:41 pm
Forum: Raspbian
Topic: Webmin or an alternative
Replies: 8
Views: 415

Re: Webmin or an alternative

I've got "sarge" webmin running under jessie just fine and it will update. [email protected]:~ $ cat /etc/apt/sources.list | grep webm deb http://download.webmin.com/download/repository sarge contrib Looks like I failed to make a note of the procedure but if you google how to install it for debian you'll l...
by swampdog
Thu Mar 14, 2019 2:32 am
Forum: Advanced users
Topic: What is the latest MySQL on Pi?
Replies: 7
Views: 298

Re: What is the latest MySQL on Pi?

This idea may not be suitable for your needs: you could install a virtual machine on your PC with an older version of mysql workbench running in it.
by swampdog
Wed Mar 13, 2019 9:12 pm
Forum: C/C++
Topic: New to Raspberry, old to programming
Replies: 34
Views: 3349

Re: New to Raspberry, old to programming

It would be more trouble than it's worth trying to do anything from WinXP with it being out of support. Like the others have suggested, you can develop quite easily on the rpi directly. You can certainly use your XP machine for the display etc (hint: VNC/putty) ... though before you dive into that i...
by swampdog
Tue Mar 12, 2019 9:08 pm
Forum: Troubleshooting
Topic: Mount ssd usb as pi, not as root.
Replies: 2
Views: 60

Re: Mount ssd usb as pi, not as root.

Are you sure you want to do it that way round? If the disk isn't being shared elsewhere then I'd just mount it as root then "chown" it. /dev/sda1 /media/raspi ext4 defaults 0 0 $ sudo su - # mount /media/raspi # cd /media # chown -Rv pi:pi raspi/ #^D $ ls -l /media/ ..now user pi can access it.
by swampdog
Mon Mar 11, 2019 10:32 pm
Forum: C/C++
Topic: C/C++ Memory Usage Code
Replies: 21
Views: 2076

Re: C/C++ Memory Usage Code

Would like to see other methods and compare. I have a feeling that the one I posted is not that efficient. Well, as I had some unexpected free time today I thought I'd try the bloaty approach. This is because I watched a youtube vid last night about old games - Dungeon Keeper & Theme Hospital so I'...
by swampdog
Mon Mar 11, 2019 4:04 am
Forum: C/C++
Topic: How to get CPU load in C
Replies: 15
Views: 1278

Re: How to get CPU load in C

Out of curiosity I went hunting for the 'top' source code. Oh what a merry trail that led me on! Suffice it to say "man 5 proc" is the easiest way to get the information although if you guys really want to get go to town "apt-cache search libprocps" and install the corresponding dev library then (sa...
by swampdog
Mon Mar 11, 2019 2:32 am
Forum: Raspbian
Topic: [BASH-SCRIPT] Building a headless Raspberry Pi
Replies: 2
Views: 178

Re: [BASH-SCRIPT] Building a headless Raspberry Pi

You might want to check 'dialog' exists early on or the user is going to get a blank screen (hint: 'which dialog'). I'd also refrain from being root except when you have to (ie: I'd use 'sudo' in the script for 'dd/mount' etc) as the user has to be able to 'sudo' in the first place. You can also mak...
by swampdog
Sun Mar 10, 2019 10:46 pm
Forum: C/C++
Topic: C programming project work
Replies: 2
Views: 289

Re: C programming project work

You might find this useful. It's about the clearest intro to threading in C I've seen.. https://www.youtube.com/watch?v=nVESQQg-Oiw https://www.youtube.com/watch?v=nlHIuG3RQ0g ^^^the vids have links to github where you can grab the sources. For in-depth info on the functions.. $ apropos pthread $ ma...
by swampdog
Fri Mar 01, 2019 7:20 pm
Forum: Troubleshooting
Topic: Terribly slow networking
Replies: 12
Views: 447

Re: Terribly slow networking

"datalink type: EN10MB (Ethernet)" Is it possible my Pi's ethernet is running at 10 Mbps instead of 100? What made it do that. sudo ethtool eth0 | grep "Speed:" You could try two terminals on your pi and 'netcat' "localhost". It might (or might not) help narrow the problem down. Typical output.. fo...
by swampdog
Thu Feb 28, 2019 11:45 pm
Forum: Troubleshooting
Topic: Terribly slow networking
Replies: 12
Views: 447

Re: Terribly slow networking

Try this. It keeps the disks out the picture..

Code: Select all

receiver$ netcat -l 1234 >/dev/null
sender$ dd if=/dev/zero bs=1M count=256 | pv | netcat -q 0 receiver 1234
..should get >10MiB/s else..

pi3b$ sudo arp-scan -I eth0 -l
..(or wlan0) and look for ip address collisions.

Go to advanced search