The best articles by Ciro Santilli Updated +Created
These are the best articles ever authored by Ciro Santilli, most of them in the format of Stack Overflow answers.
Ciro posts update about new articles on his Twitter accounts.
A chronological list of all articles is also kept at: Section "Updates".
Some random generally less technical in-tree essays will be present at: Section "Essays by Ciro Santilli".
Raspberry Pis Updated +Created
About the brand: Raspberry Pi
Cosmic ray Updated +Created
Video 1.
CosmicPI: Detecting Cosmic Rays with a Raspberry Pi by Marco Reps (2021)
Source.
How to mine Monero Updated +Created
Ubuntu 20.10 as per xmrig.com/docs/miner/build/ubuntu:
sudo apt install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
git clone https://github.com/xmrig/xmrig.git
mkdir xmrig/build && cd xmrig/build
cmake ..
make -j$(nproc)
At minexmr.com/#getting_started we see that all you then need is a single CLI command:
xmrig -o pool.minexmr.com:4444 -u <your-monero-address>
Seems simple, well done devs!
Benchmark on Lenovo ThinkPad P51 (2017) as per xmrig.com/docs/miner/benchmark:
./xmrig --bench=1M
gives:
948.1 h/s
which according to the minexmr.com mining pool would generate 0.0005 XMR/day, which at the February 2021 rate of 140 USD/XMR is 0.07 USD/day. The minimum payout in that pool is 0.004 XMR so it would take 8 days to reach that.
So clearly, application-specific integrated circuit mining is the only viable way of doing this.
www.makeuseof.com/cryptos-you-can-mine-at-home/ is a completely full of bullshit article that says otherwise. How can someone publish that!
It is hard to do something useful with a devboard Updated +Created
In the 2010's/2020's, many people got excited about getting children in to electronics with cheap devboards, notably with Raspberry Pi and Arduino.
While there is some potential in that, Ciro Santilli always felt that this is very difficult to do, while also keeping his sacred principle of backward design in mind.
The reason for this is that "everyone" already has much more powerful computers at hand: their laptops/desktops and even mobile phones as of the 2020s. Except perhaps if you are thing specifically about poor countries.
Therefore, the advantage using such devboards for doing something that could useful must come from either:
  • their low cost. This would be an important consideration if you were to mass produce your product, but that is not going to be the case for learners, at least initially.
  • their portability, and closely linked their ability to act as sensors
  • their ability to act as actuators, which is often missing from regular computers
  • them having hardware accelerators that are not normally present in regular computers, e.g. FPGAs or AI accelerators. And then the demo project must demonstrate that the project is able to do something significantly faster/cheaper on the devboard than on a desktop computer.
Program Raspberry Pi Pico W with C Updated +Created
Ubuntu 22.04 build just worked, nice! Much feels much cleaner than the Micro Bit C setup:
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib

git clone https://github.com/raspberrypi/pico-sdk
cd pico-sdk
git checkout 2e6142b15b8a75c1227dd3edbe839193b2bf9041
cd ..

git clone https://github.com/raspberrypi/pico-examples
cd pico-examples
git checkout a7ad17156bf60842ee55c8f86cd39e9cd7427c1d
cd ..

export PICO_SDK_PATH="$(pwd)/pico-sdk"
cd pico-exampes
mkdir build
cd build
# Board selection.
# https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html also says you can give wifi ID and password here for W.
cmake -DPICO_BOARD=pico_w ..
make -j
Then we install the programs just like any other UF2 but plugging it in with BOOTSEL pressed and copying the UF2 over, e.g.:
cp pico_w/blink/picow_blink.uf2 /media/$USER/RPI-RP2/
Note that there is a separate example for the W and non W LED, for non-W it is:
cp blink/blink.uf2 /media/$USER/RPI-RP2/
Also tested the UART over USB example:
cp hello_world/usb/hello_usb.uf2 /media/$USER/RPI-RP2/
You can then see the UART messages with:
screen /dev/ttyACM0 115200
TODO understand the proper debug setup, and a flash setup that doesn't require us to plug out and replug the thing every two seconds. www.electronicshub.org/programming-raspberry-pi-pico-with-swd/ appears to describe it, with SWD to do both debug and flash. To do it, you seem need another board with GPIO, e.g. a Raspberry Pi, the laptop alone is not enough.
Universal asynchronous receiver-transmitter Updated +Created
A good project to see UARTs at work in all their beauty is to connect two Raspberry Pis via UART, and then:
Part of the beauty of this is that you can just connect both boards directly manually with a few wire-to-wire connections with simple jump wire. Its simplicity is just quite refreshing. Sure, you could do something like that for any physical layer link presumably...
Remember that you can only have one GNU screen connected at a time or else they will mess each other up: unix.stackexchange.com/questions/93892/why-is-screen-is-terminating-without-root/367549#367549
On Ubuntu 22.04 you can screen without sudo by adding yourself to the dialout group with:
sudo usermod -a -G dialout $USER