Geany IDE for c Programming on RP 5

Note: Seems like nothing is just a simple install and done.  I’d like to start getting back to learning c programming.  I have various books (K&R; Schildt, etc).  Don’t really need for work, but it’s a good brain exerciser.

On RP5, it comes with Geany, which is recommended for what I’m doing, considering starting with Schildt Books.

Was able to run the first program of hello.c.  That worked.

Wanted to install the Geany GDB Debugger:

Sudo apt update

Sudo apt install geany-plugins

That did a good amount of installation, but not the GDB debugger.  There is a plugin called Debugger, but I don’t think that’s what I want.

I read something about system dependencies: Geany plugins often silent-fail to load if they require an underlying system library that is missing. The debugger plugin specifically relies on the VTE (Virtual Terminal Emulator) library

sudo apt-get update
sudo apt-get install gdb libvte-dev

Checked Geany again for the plugin:

Not there

Installing the base geany package does not automatically install all of its available plugins. You must ensure the plugin bundle or the explicit debugger package is added:

sudo apt-get install geany-plugins geany-plugin-gdb

NOTE: Came back with: geany-plugin-gdb has not installation candidate

Tried this:

sudo apt-get install geany-plugins geany-plugin-debugger

Note: That worked for the CLI (Says that geany-plugin-debugger set to manually installed; already the newest version of 2.0-6+b1)

Resolution, I think.  I went down a rabbit-hole, and then found this:

In many versions of the Geany Plugins Bundle, the classic “Debugger” plugin was replaced or complemented by an upgraded front-end called Scope.

Within Plug-in Manager, I see Scope, and it says it’s a relatively simple GDB front-end.  I selected that.

Well…  I think the debugger is installed.  Just need to figure out how to use it.

 

 

 

 

 

Posted in c Programming | Leave a comment

Troubleshooting serial port issue – RP Pico to RP 5

Raspberry Pi 5 with USB ports

Raspberry Pi Pico WH with a micro USB Cable to USB

Goal: Connect the RP Pico to the RP 5, in order to then use Thonny IDE on RP5 for programming.  Also, update the firmware of the RP Pico

Issue: When I connect the RP Pico, I get conflict errors, to the point where I cannot restart the RP 5.  I thought it was a corrupt SD card, or recent Tor installation, but the troubleshooting boards all point to a serial port conflict.

Error I saw: Failed to start serial-getty@ttyAMA10.service.  NOTE: Typically happens on the Raspberry Pi 5 when systemd tries to launch a login console (getty) on the dedicated 3-pin debug UART port (ttyAMA10), but the port is either disabled, being blocked by another process, or the kernel serial console argument has been modified or removed from your boot configuration.

Background:

-Getty  is the Linux background service that manages terminal login lines

-When I hook up Pico WH to the Raspberry Pi’s GPIO UART pins (GPIO 14 and 15) to transfer data or execute code, getty will aggressively hijack the port.  In my case I’m not specifically thinking of using UART pins, but there is still a conflict

-When I had initially plugged in the RP Pico and worked in Thonny, I saw this:

-Configure Interpreter; Select Micropython (Raspberry Pi Pico)

-Port selected was n/a @ /dev/ttyAMA10

-This confirms that the RP Pico was using the same port as Getty

Proposed solution, according to troubleshooting boards:

To resolve this conflict and free up the serial port entirely for Pico WH, you must disable both the serial boot console and the getty service

Initial confirmation steps:

-Check what is currently connected to ttyAMA10, in terminal:

sudo fuser -v /dev/ttyAMA10

It came back with a reference to Getty

Turning off ttyAMA10 from Getty accessing:

Step 1: Use raspi-config to Free the Port
The easiest first step is to tell the operating system to stop using the serial port as a console.
sudo raspi-config
  • Navigate to Interface Options (or Advanced Options in older versions) → Serial Port.
  • When asked: “Would you like a login shell to be accessible over serial?”, select No.
  • When asked: “Would you like the serial port hardware to be enabled?”, select Yes.
  • Finish and exit, but do not reboot just yet.
Step 2:
Stop and Mask the getty Service
On newer versions of Raspberry Pi OS (such as Bookworm), getty can sometimes still stubbornly cling to the hardware interface despite using raspi-config. You need to manually terminate and mask the systemd service to make sure it never starts again.
sudo fuser -v /dev/ttyAMA10
Note: Looks like it’s still running, as it referenced agetty
Mask the service (If you aren’t using the 3-pin debug port) – I don’t think I am.
If you don’t need a login terminal via the hardware debug connector, the cleanest solution is to completely mask the service so systemd stops trying to launch it. Run the following commands in your terminal:
sudo systemctl stop serial-getty@ttyAMA10.service
Note: It came back with failed to stop, as was not loaded
sudo systemctl mask serial-getty@ttyAMA10.service
Note: Came back saying service not loaded, but proceeding anyway.  Referenced creating a symlink in /etc/systemd/…
Restarted Pi5
NOTE: The RP Pico wasn’t connected and I left disconnected for the restart
Hmn…   A bunch of things failed to start and flashing cursor and blank screen.
Something about failing to start Network Manager; cloud-config-services; cloud-final-servces; rpc-statd-notify.service
Powered off button and back on
Same thing
Disconnected Cat-5 and restarted
Errors:
Pulled out power and back in; CAT-5 still out
Same issue
Pulled out power and monitor cable
Kept Cat-5 out
Plugged both back in; on
Less errors, but says plymouth-quit.service
WTF!  I plugged the CAT-5 back in and plugged power back in again and it came back to desktop OK.
Ran the sudo fuser command (above), again and getty not loaded
At this point, system is running, but unsure if stable or not
Got it working and able to go into Thonny and update firmware of RP Pico to version 1.28.0
Still not quite convinced the system is stable if I restart it, though
Posted in Raspberry Pi | Leave a comment

Tor Browser for Raspberry Pi

Tor Browser:

I don’t plan on doing a ton of web-browsing on this system, but it’s useful for accessing information, including this WordPress site.  I heard about Tor in the past, and don’t plan on doing anything top secret, but never used it.  One side benefit maybe less spam.  Another side benefit is that I believe this is one of the best app installers for Raspberry Pi.  As an experiment, I’m going to install on my new Raspberry Pi 5 setup.  When it’s all installed, it’s easy to download the latest Tor Browser from the: Menu, Internet, Tor Browser Nightly menu.

Sourcing the installer (Pi-Apps):

-Looks like the 64-bit version is still in development, and the Raspberry Pi folk are OK with using Pi-Apps for sourcing the latest from Sourceforge, and then installing.  Other option is to do it manually with tar files, but then I’m on my own for updates.

-Open terminal and enter the following:

wget -qO- https://raw.githubusercontent.com/Botspot/pi-apps/master/install | bash

Note: The -qO- is “O” as in output

NOTE: Wow!  It’s been a while since I did command line stuff.  Took me several tries, but: Needing a capital O; needed a hyphen after the O; needed one space after the O; needed me to not misspell Botspot.  Yeesh!  Great.  Now I have a Pi-Apps icon on desktop, and also within Menu, Accessories.

Installing Tor, using Pi-Apps:

-Menu, Accessories, Pi Apps

-Internet.  Browsers

-There is a ton, but I want “Tor”

-Install in bottom right of pop-up

-Some links in order to donate, which I’ll consider later

-Done.  Version installed was:

Running Tor, for the first time:

-Menu, Internet, Tor Browser Nightly

NOTE: It says in top-right that it’s not connected.  There is a selection for “Always connect automatically”.  An option to Configure Connection.  And, Connect button.

-For now, I left blank the “Always connect automatically”; didn’t change anything; and clicked Connect.

-Well…  It connected, so that’s good.

 

 

 

 

 

Posted in Raspberry Pi | Leave a comment