Go to advanced search

by jojopi
Wed Apr 10, 2024 8:54 pm
Forum: MicroPython
Topic: Aligning actions to a specific time-gap before a second
Replies: 4
Views: 169

Re: Aligning actions to a specific time-gap before a second

Pico MicroPython's time() does not include fractions, and the fractions from ticks_*() are not synchronized with the moments that the integer time increments. So I think you need to use time_ns() to calculate a sleep to the next whole second: import utime while True: utime.sleep_us(1000000 - utime.t...
by jojopi
Sun Apr 07, 2024 11:27 pm
Forum: General discussion
Topic: bookworm: where is IPv6 duid stored?
Replies: 3
Views: 276

Re: bookworm: where is IPv6 duid stored?

Truncate empty (without removing) the file /etc/machine-id . On the next boot a new random ID should be generated and stored in the existing file, and systemd uses this to programmatically generate things like IPv6 DUID. (In my testing, I find if I remove /etc/machine-id completely I get a different...
by jojopi
Thu Apr 04, 2024 6:28 am
Forum: General
Topic: C program, flush input, scanf(), menus, etc.
Replies: 13
Views: 513

Re: C program, flush input, scanf(), menus, etc.

A well known gotcha with scanf() on any platform is that if you request an integer, like scanf(%i, &num); and the user enters a non-numeric character, the program will go into an infinite loop. No. Only if the program tries the same conversion again, without consuming the bad byte first. Method...
by jojopi
Wed Apr 03, 2024 5:16 pm
Forum: Raspberry Pi OS
Topic: Error loading shared libraries: libboost_system.so.1.55.0: cannot open shared object file: No such file or directory.
Replies: 4
Views: 247

Re: Error loading shared libraries: libboost_system.so.1.55.0: cannot open shared object file: No such file or directory

I installed the library with sudo apt-get install libboost1.55*. Bookworm does not provide that old version. (It was also not available in bullseye, buster, or stretch. Was the Pi2 running jessie?) The dynamic loader will not look for new subdirectories, and I suspect the tar file you extracted is ...
by jojopi
Wed Apr 03, 2024 12:00 pm
Forum: C/C++
Topic: UNIX time overflow
Replies: 5
Views: 317

Re: UNIX time overflow

What is the best practice solution that is wide adopted in creating NEW C and python program ? Python integers have unlimited range, and it uses floating point for Unix timestamps. Should be immune. Starting with bookworm, you can compile C using gcc -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 to use 64...
by jojopi
Tue Mar 26, 2024 3:32 pm
Forum: Raspberry Pi OS
Topic: No such file or directory
Replies: 5
Views: 265

Re: No such file or directory

What methods should I try to solve this error I am currently receiving? How can I install the libraries I view with "readelf"? Can you just rebuild the executable, on the Pi5? You can install 32bit libraries on a 64bit system, and I am surprised you do not already have libc6:armhf , which...
by jojopi
Tue Mar 26, 2024 12:47 am
Forum: Troubleshooting
Topic: Malloc_Consolidate:() Invalid Chunk Size Error
Replies: 15
Views: 566

Re: Malloc_Consolidate:() Invalid Chunk Size Error

malloc() and free() are not operating system calls, they are functions in the standard C library (usually). libc obtains memory from the OS by using the system call brk() to set the upper address limit of the heap. Because only the top of heap can be adjusted, it is usually not possible (or desirabl...
by jojopi
Sun Mar 24, 2024 1:52 pm
Forum: Advanced users
Topic: SSH - no matching key exchange method
Replies: 2
Views: 210

Re: SSH - no matching key exchange method

ssh -Q kex lists the algorithms that are "supported" (compiled into the binary), but algorithms that rely on SHA-1 are disabled by the default runtime configuration. ssh -vv host will show the algorithms actually offered and accepted by each party. For outbound from Pi, add a stanza to ~/...
by jojopi
Sun Mar 17, 2024 3:18 pm
Forum: Python
Topic: EOFError from input( )
Replies: 9
Views: 370

Re: EOFError from input( )

You are right. The even more reduced version of the code works as expected. So it is a problem with the port. I do not think that is the intended, or the correct, conclusion. Removing the serial port facilitates testing. It should not affect whether there is an end of file condition on an unrelated...
by jojopi
Sun Mar 17, 2024 12:04 pm
Forum: Python
Topic: Pi Day
Replies: 3
Views: 294

Re: Pi Day

Here is my version from 2013. It uses the Taylor series for arcsin(1/2)=π/6. Each successive term includes an another factor of x²=1/4, so we need log(1/10)/log(1/4)≈1.661 terms per decimal. Rather than calculating the individual terms and summing them, which would be slow, we use a recursive Binary...
by jojopi
Mon Mar 11, 2024 10:44 am
Forum: Beginners
Topic: lxterminal commands
Replies: 9
Views: 368

Re: lxterminal commands

When you put a job in the background with "&", it is given a local PID starting with 1, then 2 etc. That PID is what you see in the "[1]" message. That is properly called the shell's job number. The process ID is the bigger number outside the brackets (and in jobs -l ), whic...
by jojopi
Mon Mar 11, 2024 1:52 am
Forum: Beginners
Topic: lxterminal commands
Replies: 9
Views: 368

Re: lxterminal commands

When "lxterminal" runs after the command "lxterminal &", it brings up a new terminal and returns "[1]+" and "DONE lxterminal" in the original terminal. I'm not sure why typing "lxterminal" after the command "lxterminal &" would be ...
by jojopi
Sat Mar 09, 2024 9:13 pm
Forum: Troubleshooting
Topic: Raspberry Pi 6.1.0 OS Cron Job Configuration Issue: Running Twice on Different Dates
Replies: 5
Views: 154

Re: Raspberry Pi 6.1.0 OS Cron Job Configuration Issue: Running Twice on Different Dates

Note: The day of a command's execution can be specified by two fields — day of month, and day of week. If both fields are restricted (ie, aren't *), the command will be run when either field matches the cur‐ rent time. For example, ``30 4 1,15 * 5'' would cause a command to be run at 4:30 am on the...
by jojopi
Sun Mar 03, 2024 4:12 pm
Forum: General
Topic: Problem with Pico's RTC, daylight saving time, and daytime_t
Replies: 2
Views: 163

Re: Problem with Pico's RTC, daylight saving time, and daytime_t

The RTC does not implement daylight savings, and the SDK makes no attempt to translate between hardware and local time. If something is happening at the wrong hour, I would check the hour field, rather than the month. The POSIX date command has two formats for day of week: %u day of week (1..7); 1 i...
by jojopi
Thu Feb 29, 2024 2:19 pm
Forum: Raspberry Pi OS
Topic: Systematic journal corruption on clean install of Raspian Lite Bookworm 64bit
Replies: 5
Views: 289

Re: Systematic journal corruption on clean install of Raspian Lite Bookworm 64bit

The action that systemd reports that it will take is never done. The journal is not renamed and only one single journal file exists at all times. Actually the inode number and creation time of the file changes (which does not happen on a clean reboot on a Pi5 with RTC). So systemd is making a new f...
by jojopi
Tue Feb 27, 2024 4:59 am
Forum: Raspberry Pi OS
Topic: Kernel build failing
Replies: 6
Views: 282

Re: Kernel build failing

AndrewJ wrote:
Tue Feb 27, 2024 12:12 am
I tried using the -d flag to get additional information, but it didn't make much sense to me:
make V=1 should show the commands that are being run. make -d shows debug information about make's own decision making, which is unlikely to be at fault, while the Makefile remains quiet.
by jojopi
Sun Feb 25, 2024 8:34 pm
Forum: Raspberry Pi OS
Topic: rsync files between two Pis that are owned by other than the sending user
Replies: 8
Views: 326

Re: rsync files between two Pis that are owned by other than the sending user

knute wrote:
Sat Feb 24, 2024 6:01 pm
The problem is I need root permissions on the receiving end
It should be sufficient for the pi user to be a member of the www-data group on the receiving system.
by jojopi
Sun Feb 18, 2024 8:39 pm
Forum: Python
Topic: Concurrent Processing Problem
Replies: 8
Views: 220

Re: Concurrent Processing Problem

makingwithheld wrote:
Sun Feb 18, 2024 7:00 pm
does not stay in the While True loop.
The while loop includes an unconditional raise SystemExit, so it only executes once.

I presume you intended the raise to be within the except block.
by jojopi
Sat Feb 17, 2024 7:36 am
Forum: Advanced users
Topic: Read custom config file into bashrc
Replies: 4
Views: 244

Re: Read custom config file into bashrc

Milliways wrote:
Sat Feb 17, 2024 3:23 am
.bashrc is NOT run at login!
In practice it is, because it is also sourced inside ~/.profile.

Shell startup files are not a good place to launch applications, though, and one chromium per bash is likely to be both unnecessary and insufficient.
by jojopi
Fri Feb 16, 2024 10:45 am
Forum: Troubleshooting
Topic: Bookworm Packages armhf not updated anymore
Replies: 5
Views: 237

Re: Bookworm Packages armhf not updated anymore

logopk wrote:
Tue Feb 13, 2024 4:30 pm
Looking at the repo I see that there have been no updates on main since November 28 2023.
This morning the problem seems to be fixed and many new packages, including openssh*, are now available.
by jojopi
Thu Feb 15, 2024 8:21 pm
Forum: Ubuntu
Topic: Trying to understand bizarre MOUNTPOINT name...
Replies: 8
Views: 240

Re: Trying to understand bizarre MOUNTPOINT name...

Your /proc/mounts shows that mmcblk0p2 is mounted both on / and on /var/snap/firefox/common/host-hunspell/. That seems weird to me, but I do not use snaps, so maybe it is normal when you do. As I said, lsblk in Raspberry Pi OS would show both mount locations in that situation, not just the strange o...
by jojopi
Thu Feb 15, 2024 6:55 pm
Forum: Ubuntu
Topic: Trying to understand bizarre MOUNTPOINT name...
Replies: 8
Views: 240

Re: Trying to understand bizarre MOUNTPOINT name...

That is interesting. What does cat /proc/mounts say? In Raspberry Pi OS (bookworm), even if a device is mounted in multiple places all of them are shown: pi@pi64:~ $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 59.6G 0 disk ├─sda1 8:1 0 512M 0 part /boot/firmware ├─sda2 8:2 0 28G 0 part ...
by jojopi
Tue Feb 13, 2024 2:35 pm
Forum: Raspberry Pi OS
Topic: cmdline.txt doesn't effect
Replies: 4
Views: 332

Re: cmdline.txt doesn't effect

The console= parameter sets which VT and/or UART receives kernel messages (printk). It is not supposed to change which one is visible at boot. I assume you know that you can press Ctrl+Alt+F3 for that.

It is not clear why you would want to select tty3. By default, tty2-6 all behave identically.
by jojopi
Mon Feb 12, 2024 8:07 am
Forum: Raspberry Pi OS
Topic: Removing exim4-base fails to remove systemd timer symlink
Replies: 3
Views: 196

Re: Removing exim4-base fails to remove systemd timer symlink

drankinatty wrote:
Mon Feb 12, 2024 2:48 am
This is a removal issue
There is a general distinction between remove and purge.

remove retains conffiles, and does not run the package's postrm script.
by jojopi
Thu Feb 08, 2024 12:44 pm
Forum: C/C++
Topic: How to set date time to Y2040 and get time - a Y2038 problem
Replies: 9
Views: 568

Re: How to set date time to Y2040 and get time - a Y2038 problem

Starting with glibc 2.34 (bookworm), you can compile with -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64. (Or define the corresponding macros in every source file, such as by having your own "config.h" that is included before any system headers.) This makes time_t a 64bit type, and automatically c...

Go to advanced search