Go to advanced search

by swampdog
Thu Aug 08, 2019 7:24 pm
Forum: Troubleshooting
Topic: Pi 4, rootfs on SSD goes readonly
Replies: 19
Views: 1111

Re: Pi 4, rootfs on SSD goes readonly

Hi Folks, (partial update) I've now tried four unpowered adapters, none successful. The only joy so far is with a powered caddy. I've set off the Pi4 building gcc 6,7,8,9 (full with tests) so it'll be busy for a while. In the meantime I'm gathering stats. Is there anything I ought to add to this? #!...
by swampdog
Wed Aug 07, 2019 4:16 pm
Forum: Troubleshooting
Topic: rsync - works from terminal but not as cron???
Replies: 33
Views: 896

Re: rsync - works from terminal but not as cron???

My bad. As DougieLawson says, I missed a slash.. $ scp .ssh/id_rsa.pub pj@10.1.1.155:~/.ssh/z identity_sign: private key /home/pj/.ssh/id_rsa contents do not match public I suspect you've overwritten one keypair with part of the other. FYI.. there's a private key (id_rsa) and a public key (id_rsa.pu...
by swampdog
Mon Aug 05, 2019 10:46 pm
Forum: Troubleshooting
Topic: Pi 4, rootfs on SSD goes readonly
Replies: 19
Views: 1111

Re: Pi 4, rootfs on SSD goes readonly

Hi Folks, Thanks all for the useful information. I dug out some powered usb/sata caddies and some old laptop hdd's. It is panning out to be the adapter+ssd combo. Not entirely certain yet: I spent so much time on it that I want to explore every avenue. I'll post proper results later. Essentially, ev...
by swampdog
Mon Aug 05, 2019 12:16 am
Forum: Troubleshooting
Topic: Pi 4, rootfs on SSD goes readonly
Replies: 19
Views: 1111

Re: Pi 4, rootfs on SSD goes readonly

Ah, looks like I was a bit unclear. Tired. Originally, it was a standard configuration. Installed to an 8G sdcard. The next operation was simply to format the SSD (gpt,64G, ext4) then rsync /dev/mmcblk0p2 onto /dev/sda1 (the SSD), mounted as /mnt/tmp/ then adjust /boot/cmdline.txt and /mnt/tmp/etc/f...
by swampdog
Sun Aug 04, 2019 10:10 pm
Forum: Troubleshooting
Topic: Pi 4, rootfs on SSD goes readonly
Replies: 19
Views: 1111

Pi 4, rootfs on SSD goes readonly

Hi Folks, Just wanted to reach out to see if anyone else if having this issue. I've spent the day doing all manner of tests for little result. Only errors to be had are on the console. My phone is a pig for not focusing on displays. "ext4_find_entry:1442: inode N" (various values for N) which I thin...
by swampdog
Fri Aug 02, 2019 11:27 am
Forum: C/C++
Topic: Program Latency
Replies: 1
Views: 2005

Re: Program Latency

I'm afraid, even with the source given, it is nigh on impossible to follow what is going on, certainly for me because I haven't done any gpio stuff yet. With that caveat in mind.. I can't see the mechanism for accessing what may be common variables across threads - ie: a mutex (except possibly globa...
by swampdog
Thu Aug 01, 2019 8:08 am
Forum: C/C++
Topic: compile Linux C programs to use cpu cores exclusively
Replies: 26
Views: 4335

Re: compile Linux C programs to use cpu cores exclusively

The magic word in this case is "affinity".. admin@pi05:~ $ apropos affinity pthread_attr_getaffinity_np (3) - set/get CPU affinity attribute in thread at... pthread_attr_setaffinity_np (3) - set/get CPU affinity attribute in thread at... pthread_getaffinity_np (3) - set/get CPU affinity of a thread ...
by swampdog
Tue Jul 30, 2019 4:43 pm
Forum: C/C++
Topic: Compiling Canon printer driver?
Replies: 3
Views: 368

Re: Compiling Canon printer driver?

Grgh! Libtool! Had no end of problems with that over the years! I'm not going to fix the build but you can link it manually.. Run your "make gen" then once it fails.. $ pwd /wrk/linux-UFRIILT-drv-v150-uken/Sources/cndrvcups-common-3.90/cngplp/src gcc -o cngplp main.o mainwnd.o printerinfo.o load.o o...
by swampdog
Tue Jul 30, 2019 1:07 pm
Forum: C/C++
Topic: StdLib Dirty Replacement Functions:
Replies: 20
Views: 1231

Re: StdLib Dirty Replacement Functions:

@jahboater You can build GCC for a specific language, I have never tried it, but I think you can just do "--enable-languages=c" and get a C only compiler that should be a lot smaller. I typically use.. --enable-languages=c,c++ ..as it's rare I need anything else. For a fast build (mainly to see if ...
by swampdog
Fri Jul 26, 2019 9:07 am
Forum: Raspbian
Topic: Help please: serially connected to RPi zero help configure terminal
Replies: 1
Views: 116

Re: Help please: serially connected to RPi zero help configure terminal

I use minicom on a zero with a serial adapter to connect to various linux machines. The minicom settings are.. +-----------------------------------------------------------------------+ | A - Serial Device : /dev/serial0 | | B - Lockfile Location : /var/lock | | C - Callin Program : | | D - Callout P...
by swampdog
Fri Jul 26, 2019 8:49 am
Forum: C/C++
Topic: StdLib Dirty Replacement Functions:
Replies: 20
Views: 1231

Re: StdLib Dirty Replacement Functions:

The trouble these days with trying to beat the compiler is they're pretty clever now. Take your StrCpy(), slightly modified old-school.. char* StrCpy(register char *d, register const char *s) { register char *r=d; while (*d++ = *s++); return r; } (gcc -c sc.c && objdump -d sc.o) The above isn't supp...
by swampdog
Thu Jul 25, 2019 12:14 pm
Forum: C/C++
Topic: How to catch Unhandled exceptions
Replies: 12
Views: 644

Re: How to catch Unhandled exceptions

You've already got it, ::write() returning <0 (man 2 write). None of the above raise C++ exceptions so without complete compilable code demonstrating the problem it's difficult to help further. Note also it isn't possible to check in the manner you do.. if (IsConnectedSocket(...)) //say it returns t...
by swampdog
Wed Jul 24, 2019 9:32 pm
Forum: Advanced users
Topic: Using all 4gb ram with one process
Replies: 16
Views: 846

Re: Using all 4gb ram with one process

I know nothing of minecraft but what about the possibility of running a pair of servers on the pi? Whilst very quickly googling if this is possible (I can't tell) I spotted this link..


https://www.spigotmc.org/wiki/about-bungeecord/


..meaningless to me, hopefully not to you.
by swampdog
Wed Jul 24, 2019 7:57 am
Forum: C/C++
Topic: How to catch Unhandled exceptions
Replies: 12
Views: 644

Re: How to catch Unhandled exceptions

@norc89 As @Heater said, we need to know more. ::write() can't throw an exception so the next candidate is it comes from IsConnectedSocket() and that it doesn't raise std::exception. Remove the __try/__catch block and instead add.. catch (...) { //unhandled exception message } ^^^after "catch (std::...
by swampdog
Tue Jul 23, 2019 7:37 pm
Forum: C/C++
Topic: How to catch Unhandled exceptions
Replies: 12
Views: 644

Re: How to catch Unhandled exceptions

I've never used gnu __try/__catch myself but I understood it to be used by "-fno-exceptions" and translates "__try" from "try" to "if (true)" and "__catch" from "catch" to "if (false)". If my understanding is correct then the inner "try/catch" makes no sense in the context of the outer __try/__catch...
by swampdog
Mon Jul 22, 2019 10:23 pm
Forum: C/C++
Topic: How to catch Unhandled exceptions
Replies: 12
Views: 644

Re: How to catch Unhandled exceptions

I could be wrong - it's been years since I programmed a windows box but isn't that MSVC code? That __try/__catch block looks like one of those M$ structured C exceptions (or whatever they're called).
by swampdog
Mon Jul 22, 2019 9:56 pm
Forum: Troubleshooting
Topic: rsync - works from terminal but not as cron???
Replies: 33
Views: 896

Re: rsync - works from terminal but not as cron???

This all seems to be getting very complicated! First off, put what you want to do in a script. eg: a normal cronjob on one of my pi's.. admin@pi05:~ $ crontab -l PATH=/usr/local/sd/bin:/$HOME/bin:/bin:/usr/bin:$PATH #------------------------------------------------------------------------------ #min...
by swampdog
Sat Jul 20, 2019 5:59 pm
Forum: Advanced users
Topic: Problems exporting an NFS share
Replies: 5
Views: 277

Re: Problems exporting an NFS share

Have you considered iscsi for the "NFS server" pi's? Each presents a disk to the "head" pi and only NFS export from the "head". It would be a pain to attempt. The obvious caveat is the (now) "ISCSI target" (aka "NFS server") pi's would have to be guaranteed to be up and each would have to be up befo...
by swampdog
Tue Jul 16, 2019 1:32 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 11801

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Fwiw, GEM from Digital Research (aka early Mac and Atari ST) GUI used pointers. Each graphical OBJECT had two pointers, "head" and "tail" which would point to the first OBJECT of the current OBJECT's child node and last OBJECT child node respectively plus a "next" pointer which would point to the ne...
by swampdog
Mon Jul 15, 2019 11:27 pm
Forum: Beginners
Topic: how to copy 1 external SD to another external SD?
Replies: 28
Views: 1483

Re: how to copy 1 external SD to another external SD?

The command line will help you diagnose. $ sudo apt-get install lsscsi usbutils parted You can now "lsscsi" and "lsusb". Note I've only got one of these usb/sdcard dongles and I'm doing this under Linux Mint (no rpi to hand) but the principle is the same. What happens when you plug one in? ... $ sud...
by swampdog
Fri Jun 14, 2019 8:23 pm
Forum: General discussion
Topic: script problem (again) - scratching my head...
Replies: 9
Views: 572

Re: script problem (again) - scratching my head...

'shellcheck' does look quite useful. I'm amazed I've gone all these years without knowing of it. It can't do any harm to run it and because you can disable warnings to taste you can see the wood for the trees. In my case, SC2006, depreciated backticks rather than $(..), and it's not to know I delibe...
by swampdog
Fri Jun 07, 2019 10:39 am
Forum: C/C++
Topic: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’
Replies: 24
Views: 3361

Re: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’

@Paeryn
swampdog, dsylexia123 is compiling the code as C++, not C (the clue is in the error message :roll: )
Doh!

I did similar at work once. "What [insert flowery language] wrote this pile of [insert flowery language]?". (silence). "It was me, wasn't it?".

I've always loved The Clangers! :-)
by swampdog
Thu Jun 06, 2019 10:13 pm
Forum: C/C++
Topic: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’
Replies: 24
Views: 3361

Re: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’

The code you posted does not produce the error. I don't know what the Geany preferences are but from the (gcc 4.9.2) command line.. admin@pi05:/wrk/T $ gcc -o c -Wall -pedantic a.c -lpthread -lwiringPi a.c:16:55: warning: C++ style comments are not allowed in ISO C90 int16_t strstrpos(char * haystac...
by swampdog
Thu Jun 06, 2019 9:57 pm
Forum: General discussion
Topic: script problem (again) - scratching my head...
Replies: 9
Views: 572

Re: script problem (again) - scratching my head...

@hortimech #!/bin/dash ? ;-) Shell script portability is a nightmare because you're reduced to using bourne shell (aka #!/bin/sh) and once you get complex enough to be pulling in sub scripts it becomes a royal pita. There's so many pitfalls that its either best (a) not to bother (b) install the same...
by swampdog
Thu Jun 06, 2019 2:47 pm
Forum: C/C++
Topic: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’
Replies: 24
Views: 3361

Re: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’

You're going to have to post short complete compilable code (and gcc compile options) which demonstrates the issue. We can then figure out where you're getting confused. ;-)

Go to advanced search