Go to advanced search

by markkuk
Sun Jul 18, 2021 7:18 am
Forum: C/C++
Topic: How to use Bosch BMP180_driver
Replies: 9
Views: 323

Re: How to use Bosch BMP180_driver

This driver appears to work the same way as the BME680 driver I have used with a Pi. In order to use the driver you need to do the following: Define three functions: one to read data from the I2C bus, one to write data, and a delay function. The driver is intended to be used in various systems inclu...
by markkuk
Wed Jul 14, 2021 4:59 am
Forum: Networking and servers
Topic: nginx configuration for postgresql
Replies: 7
Views: 353

Re: nginx configuration for postgresql

From the expression that postgres is a server based database, I got the idea that a server is needed. Yes, a postgresql server is required, not nginx, samba, or some other random server. Check that the postgresql server is running using the command: sudo pg_isready If that works, you can continue s...
by markkuk
Fri Jul 02, 2021 5:47 am
Forum: Beginners
Topic: Need help in configuring UFW for SFTP access
Replies: 12
Views: 330

Re: Need help in configuring UFW for SFTP access

Vsftpd configuration has nothing to do with SFTP. As I wrote before, SFTP protocol is served by OpenSSH (sshd). Check /etc/ssh/sshd_config, and make sure the following line isn't commented out:

Code: Select all

Subsystem       sftp    /usr/lib/openssh/sftp-server
by markkuk
Thu Jul 01, 2021 2:25 pm
Forum: Beginners
Topic: Need help in configuring UFW for SFTP access
Replies: 12
Views: 330

Re: Need help in configuring UFW for SFTP access

ganeshmallyap wrote:
Thu Jul 01, 2021 1:30 pm
As far as I undersand port 22 was used by OpenSSH on my Raspberry Pi.
Yes, and OpenSSH is the SFTP server.
ganeshmallyap wrote:
Thu Jul 01, 2021 1:30 pm
If I want to use only SFTP and not FTP on my current installatino and enable UFW to allow it, how do I do that?
Open port 22/tcp, close ports 21 and 22.
by markkuk
Tue Jun 29, 2021 8:06 am
Forum: C/C++
Topic: pthread_cancel, PTHREAD_CANCELED
Replies: 5
Views: 429

Re: pthread_cancel, PTHREAD_CANCELED

Heater wrote:
Tue Jun 29, 2021 6:28 am
So how do I know if **retval is supposed to be my exit status or PTHREAD_CANCELED when I call pthread_join()?
If *retval does not equal PTHREAD_CANCELED or NULL it points to your return status.
by markkuk
Mon Jun 28, 2021 8:51 pm
Forum: C/C++
Topic: pthread_cancel, PTHREAD_CANCELED
Replies: 5
Views: 429

Re: pthread_cancel, PTHREAD_CANCELED

According to the standard : The symbolic constant PTHREAD_CANCELED expands to a constant expression of type (void *) whose value matches no pointer to an object in memory nor the value NULL. It's not something you can call, it's used as a status value for pthread_join() calls, something like this: v...
by markkuk
Wed Jun 23, 2021 7:56 am
Forum: Automation, sensing and robotics
Topic: 3d printed Weather Station
Replies: 11
Views: 507

Re: 3d printed Weather Station

Osprey72 wrote:
Tue Jun 22, 2021 2:35 pm
Interesting. When you say 'list', is that an array?
Python doesn't have arrays, it uses lists instead.
by markkuk
Wed Jun 16, 2021 7:01 am
Forum: General discussion
Topic: Can't delete files on an external USB HDD
Replies: 13
Views: 611

Re: Can't delete files on an external USB HDD

Am I right in thinking the user pi is the root user, and this is why nothing changes when I change the ownership to this user and group. No, you're wrong. The root user is identifed by User ID (UID) == 0 and conventionally has username "root". The user "pi" has UID 1000 in Raspb...
by markkuk
Sat Jun 12, 2021 11:05 am
Forum: Raspberry Pi OS
Topic: sudo question
Replies: 5
Views: 412

Re: sudo question

The "more" command was copied to DOS from Unix and it's also available in LInux. Using "more" to page command output has nothing to do with sudo.
by markkuk
Wed Mar 31, 2021 7:09 am
Forum: General programming discussion
Topic: Need accurate clock - How to install NTP and keep clock updated?
Replies: 20
Views: 2845

Re: Need accurate clock - How to install NTP and keep clock updated?

If I enter the command "timedatectl" and press enter, it gives me the local and UTC times, says the system clock is synchronized, but says "NTP service: inactive". The "NTP service" line of timedatectl refers only to systemd's builtin SNTP client: systemd-timesyncd. If...
by markkuk
Tue Mar 30, 2021 8:44 am
Forum: General discussion
Topic: Change password on SD card
Replies: 4
Views: 299

Re: Change password on SD card

Use the chpasswd command:

Code: Select all

# chpasswd pi:linuxpassword -R /media/kfa/rootfs
by markkuk
Wed Mar 24, 2021 7:57 pm
Forum: Automation, sensing and robotics
Topic: Stepper motor control
Replies: 4
Views: 480

Re: Stepper motor control

As there is no information about the controller on the stepper motor on the linked site I would suggest you need to do a bit of testing of voltages present/required on the controller before connecting it to the pi gpio or you could end up damaging the pi or controller board. You will of course need...
by markkuk
Thu Mar 18, 2021 6:20 am
Forum: Beginners
Topic: Change storage path for MySql on a USB stick does not work
Replies: 6
Views: 238

Re: Change storage path for MySql on a USB stick does not work

Luca_ wrote:
Wed Mar 17, 2021 9:22 pm
It all worked until the second to last step.
I get an error that the operation is forbidden to change this group.
If your USB stick is formatted in FAT you can't change file/directory ownership. Reformat the stick as Ext4 and restart from beginning.
by markkuk
Tue Mar 16, 2021 1:22 pm
Forum: Beginners
Topic: What exactly are the issues of rpi os 64 bit beta test version
Replies: 23
Views: 5790

Re: What exactly are the issues of rpi os 64 bit beta test version

Adding on to this post, I also remembered that some software does not install correctly - it asks for 32 bit versions of packages which are unavailable or conflict with already installed packages. This report might be useful if you included the name of the package you tried to install and what the ...
by markkuk
Mon Mar 15, 2021 11:35 am
Forum: General discussion
Topic: error on sudo apt install code
Replies: 15
Views: 763

Re: error on sudo apt install code

The recent update to raspberrypi-sys-mods removed the repository definition for Visual Studio Code. Restore it by running the following commands: wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg sudo install -o root -g root -m 644 packages.microsof...
by markkuk
Sun Mar 14, 2021 9:08 am
Forum: Automation, sensing and robotics
Topic: Autogriller
Replies: 9
Views: 1034

Re: Autogriller

That's the meater-python module source code. Remove any modifications you have made and write your own code in a different source file. Maybe you should review the Python Tutorial section on modules and packages.
by markkuk
Thu Mar 04, 2021 11:36 am
Forum: General discussion
Topic: 61 Year old NOOB question
Replies: 10
Views: 515

Re: 61 Year old NOOB question

Steve36 wrote:
Thu Mar 04, 2021 2:42 am
I used sudo nano /usr/share/scratch/locale/scratch.pot.
Are you sure that the instructions you are following match the version of Scratch you are using? RPi OS has Scratch 1.4 and Scratch 3, and there used to be Scratch 2 as well.
by markkuk
Sun Feb 21, 2021 9:20 am
Forum: Beginners
Topic: Running program at start-up
Replies: 18
Views: 777

Re: Running program at start-up

Hi Mark The first line is as follows #!/usr/bin/env python should I get rid of the env part cheers You have something in the file before the #!, otherwise the system wouldn't try to run it as a shell script. If you used Geany to edit the file make sure that the option "Write Unicode BOM" ...
by markkuk
Sat Feb 20, 2021 12:01 pm
Forum: Beginners
Topic: Running program at start-up
Replies: 18
Views: 777

Re: Running program at start-up

Add the following line to the start of your Python program:

Code: Select all

#!/usr/bin/python3
Make sure that #! are the fist two characters of the file, you can't add any spaces, blank lines or other comment lines before them.
https://en.wikipedia.org/wiki/Shebang_(Unix)
by markkuk
Thu Feb 18, 2021 10:32 pm
Forum: Python
Topic: New member: gpiozero questions
Replies: 4
Views: 280

Re: New member: gpiozero questions

Now I have the code to work with the PRI.gpio library but I would like to convert that code to work with the gpiozero library. But I do not see any example in the gpiozero docs. There is a entry in the documents about SPI Devices, I guess that is what I need But I do not see some device of 8-bit an...
by markkuk
Mon Feb 08, 2021 2:59 pm
Forum: Other programming languages
Topic: Best Way for Building List for javascript via nodejs
Replies: 17
Views: 1491

Re: Best Way for Building List for javascript via nodejs

Heater wrote:
Mon Feb 08, 2021 2:51 pm
Ha. Believe it or not I was wondering whether to count Part 0 and say 12 parts or not.
Part0 contains some mandatory exercises, so it should be counted.
by markkuk
Mon Feb 08, 2021 2:20 pm
Forum: Other programming languages
Topic: Best Way for Building List for javascript via nodejs
Replies: 17
Views: 1491

Re: Best Way for Building List for javascript via nodejs

There are 11 parts in that course, 12 parts, the numbering starts from zero. Parts 0-3 cover the basics, 4-7 are more advanced stuff and 8-11 are "optional" subjects like TypeScript. They don't take long to work through This isn't an one-weekend course or even an one-week course. I starte...
by markkuk
Tue Feb 02, 2021 4:32 am
Forum: Other programming languages
Topic: Best Way for Building List for javascript via nodejs
Replies: 17
Views: 1491

Re: Best Way for Building List for javascript via nodejs

React is a JavaScript library, it adds functionality to the base language and doesn't remove anything.
by markkuk
Sun Jan 31, 2021 7:56 am
Forum: Other programming languages
Topic: Best Way for Building List for javascript via nodejs
Replies: 17
Views: 1491

Re: Best Way for Building List for javascript via nodejs

What's the best way to keep the original HTML valid so that I can just update it with the new key? Keep all the data in Javascript code, for exaple in React component state or in Redux store. Then I suppose I need to do a binary search of the HTML elements to find the place where the new descriptio...

Go to advanced search