Arduino SD card access

I have an Arduino Ethernet Shield W5500 Development Board which has a slot for a SD card. I insert a Micro SD card into the slot (FAT32 formatted) and try executing a sketch because Arduino should execute the HTML file on the webserver …

// initialize SD card
Serial.println("Initializing SD card...");
if (!SD.begin(4)) {
    Serial.println("ERROR - SD card initialization failed!");
    return;    // init failed
}
Serial.println("SUCCESS - SD card initialized.");
// check for index.htm file
if (!SD.exists("index.htm")) {
    Serial.println("ERROR - Can't find index.htm file!");
    return;  // can't find index file

The “index.htm” file is there. So I am quite astonished that the serial monitor complains about a missing file.

I have a SD card module at hand and execute a sketch writing some lines in a testfile …

Serial.print("Writing to test.txt…");
myFile.println("This is a test file :)");
myFile.println("testing 1, 2, 3.");
for (int i = 0; i < 20; i++) {
myFile.println(i);
}
// close the file:
myFile.close();
Serial.println("done.");

Now I can see in the serial monitor that there is NO error message that the “index.htm” file is not there. And I am quite surprised that the C++ sketch has written the text into the “index.htm” file and saved it as “INDEX.HTM”.

Seems to be a matter of fact that Arduino, when accessing a Micro SD card (FAT32) , expects the filename in upper cases and ignores filenames with lower case letters.

Python : DHT11 : Raspberry ZeroW : No module named ‘board’

I have two Raspberry ZeroW , and I try to use both for to get temperature data. I am recording this data in order to find out when the temperature changes. Both devices should be able to execute the same script. Both have the same hardware setup and they record data on a USB stick.
Kind of weary that on the second device executing the python script fails : I get the error :
No module named ‘board’
That s odd because I am sure the board has been installed.
This is a known issue :
I tried to follow the widely published troubleshooting (reinstalling Blank etc) with no success.
For instance :
pip3 install adafruit-circuitpython-dht
does not work !

The error message ( error: externally-managed-environment ) is followed by a hint which indeed leads me to the solution :
“This environment is externally managed ╰─> To install Python packages system-wide, try apt install … “
The only way to get this issue fixed is installing a virtual environment :

That means :

python3 -m venv ./ws-env
source ws-env/bin/activate
(ws-env) user@raspberrypi:/home/pluto# pip3 install board
(ws-env) user@raspberrypi:/home/pluto# pip3 install adafruit-circuitpython-dht

It works like a charm !

Thunderbird : Saving message in HTML format

How to accomplish saving a message in HTML format ? This is depending on the version installed.

Quite easy though not easy to find on a Raspberry :

Raspberry installed Thunderbird Email Client

You have to select and right click on the message. Then You can choose between many formats.

Thunderbird 115.6.0 (64-bit) installed with Ubuntu 22.04 does not offer so much options. The access to this functionnality is similar :

Likewise You have to select and right click on the message.

You will get a list with options … save as is at the end …

When You have selected “Save As …” You will get further 4 options. The second option is for to save as an HTML file.

Raspian : Shell script does not get executed

Thought havin done everything which has to be done. The file made executable with + x …

-rwxrwxrwx 1 user group 72 jul 9 2023 mouse.sh

The shell script does not executed because I am used to the Ubuntu shell, You execute with

./mouse.sh

wheras when using the Raspberry (Raspian) this is a little bit different :

. mouse.sh

DHT11 / Raspberry Pi Zero W : RuntimeError: Timed out waiting for PulseIn message. Make sure libgpiod is installed…

Took me quite some time to figure out how to get rid of this error, because the Python script for the DHT11 temperature sensor does not get executed. The error message seems to be quite strange because libgpiod is found when executing "pip3 freeze".

The reason for this failure is that libgpiod Python 3 does not work without the installation of libgpiod-dev.

It has to be installed with :

> apt install libgpiod2 libgpiod-dev


Arduino Nano : Cannot upload code

Quite common that could not upload code to my Arduino Nano. Uno, Mega no problem. So could not be an issue with the USB ports. Tried out different Arduino IDE versions. Different operating systems/versions. Still not possible to upload code. Finally found out that the reason was that upload requires the old bootloader. Most of the Arduino Nano s (at least the ones that I own) do not use the standard bootloader. I saw old bootloaders are required for …

WCHCH340G AMS1117 5.0 H947MK
Diymore/WCH
CH3400 AMS1117 ATMEL M328 P

Anzeige von Datenbankabfragen

Eine solche Darstellung ist sehr ärgerlich

Ich habe eine Datenbank mit ca 200 Abkürzungen (Schwerpunkt Wirtschaft und Gesellschaft Lateinamerikas). Bei einer Abfrage, ich verwende dabei PHP, bekomme ich allerdings keine spanischen Buchstaben angezeigt, deutlich zu sehen beim ñ. Stattdessen kommt das Unicode Ersatzzeichen (U+FFFD) Ein Blick in die Datenbank : Hier ist alles in Ordnung..

Diese Datenbank war zuvor in XOOPS (ein Webportal, etwa mit WordPress vergleichbar) integriert. Hier sind die spanischen Zeichen immer richtig angezeigt worden. Von daher wusste ich dass das Problem nicht etwa an den Einstellungen des MySQL servers liegen konnten (LAMP Installation, MySql Ver Distrib 5.7.41 Ubuntu0.18.04.1). In meine Suche nach einer Lösung probierte ich aus ob ich eine richtige Formatierung nicht etwas über HTML zustande bekommen könnte ... vergebens. Es war nicht das erste Mal dass dieses Problem erschien ... Folgende Möglichkeiten gab es zur Behebung : header('Content-Type: text/html; charset=utf-8'); header('Content-Type: text/html; charset=UTF-8'); header('Content-Type: text/html; charset=iso-8859-1'); Es schien nicht an der Schreibweise des Charsets zu liegen (Gross/Kleinschreibung). Ich bin nicht mehr völlig sicher ob ich die Lösung hier gefunden habe, jedenfalls wird sie hier erwähnt : ... $title = mb_convert_encoding($article['title'], "UTF-8", "iso-8859-1"); Sie führte mich zur Lösung (3. Option!): header('Content-Type: text/html; charset=iso-8859-1');

Korrekte Anzeige nach Hinzufügen von charset=iso-8859-1

Raspberry GPIO Expansion board

Took me quite a while to find the name for this adapter : GPIO 40pin Breakout Expansion Board

This photograph shows how the adapter is placed on the breadboard
How the adapter is placed on the Raspberry Pi GPIO s. The black cable is to be found at the angle.

Further information please have a look at … http://wiki.sunfounder.cc/index.php?title=GPIO_40pin_Breakout_Expansion_Board

Ubuntu : PS2 Mouse is not responding

Took me quite a while to find out how to overcome this problem. Because quite weary restarting the PC.
The keyboard was working fine. Just the mouse. Did not want to take a USB Mouse (matter of not compromising ressources).

Could get it fixed opening a terminal window …

sudo modprobe -rv psmouse
sudo modprobe -v psmouse

Reference :
Thread : I can’t get any PS2 mouse working:
http://ubuntuforums.org/showthread.php?t=2178803

HDD enclosures Wavlink ./. Orico. HDD 2,5 ” Recycling

I did already buy some Orico products and have been quite happy with them.

For some reason, when I needed a HDD enclosure for my old HDD (taken out of my broken Lenovo Ideapad S10) I bought a Wavlink enclosure. Maybe because Wavlink was promising that it were working with all SATA types … SATA I/II/III. Orico publishes less information.

Reason for doing this is that I like to reuse the harddisks. Already did have some problems accessing the MicroSD card on my Raspberry and now trying to save data on an external HDD.

I do have a HDD SATA adapter as well, but an enclosure is more beautiful than leaving the HDD with an adapter on the office desk .

However, when the Wavlink enclosure has been shipped, I saw that there was no access to the data. So this enclosure was quite useless.

The solution to this problem was ordering an Orico encloser, which, in fact was working.