Everything I wanted to know about the RaspberryPi

raspberrypi

As far back as November 26, 2015, I read an article, interestingly titled “RaspberryPi Zero, the $ 5 computer“, and from there I began my discovery of the fantastic world of RaspberryPi and the IOT.

I had access to 40 easily programmable GPIO ports to connect a myriad of sensors and devices, to a vast community, to a flood of tutorials and possibilities for a creative person like me.

We are in 2020 and looking back on the past, I went crazy to understand and learn to do basic things, especially because I have no electronics base.

I wanted to gather some ideas that I would have liked to discover immediately, avoiding a bit of headache. I will be super synthetic, and give a quick response to those who need it.

Let’s start from the assumption that I had never used a mini pc, never heard the word GPIO and at most I knew the resistors.

Ideas

Let’s share some ideas, as they come to my mind.

  • The fundamental lesson: among a thousand guides, only follow, the recent one. Because just an operating system or software update could invalidate all the previous tutorials, and you will waste hours figuring out why it doesn’t work. Always follow the newest ones!
  • Devices often need magical things, called pull-up resistors, which each guide defines with a different value without ever explaining the logic of the choice. Here is a precise guide, I just randomly connected 10K Ohm or 4.7K Ohm resistors, and it always worked, but don’t always take it for granted.
  • To control the GPIO ports (sensors, hats and more), you must  download the appropriate libraries, often written in Python. There are various libraries in the wild, but you can start with learning GPIOZero: this way you do everything in an easy and intuitive way.
  • To get started, buy ready-made LEDs, sensors and hats with their mini base with resistors already configured, ready to connect. You will avoid welding, connections and testing everything.
  • You love LEDs, but you hate soldering resistors, I take high intensity blue ones, you can connect them directly to GPIO without problems.
  • To install the operating system, download Raspbian Full and install it with Balena.Etcher.
  • Buy Dupont cables as if there were no tomorrow, at least for me it worked this way. I love to try everything.
  • If you want to create a project for a specific purpose, buy a specific PI HAT.
  • Do you want to use it to control the printer? Avoid AstroPi, go to OctoPi and an excellent short usb cable for printer data.
  • Problems with ip? Access the router, assign a static ip to the RaspberryPi, and even if you format it it will always be ready.
  • DO you need a VPN for your RapberryPi? curl -L https://install.pivpn.dev | bash
  • Do you want to block all advretising on your network? PiHole is the right service for you  curl -sSL https://install.pi-hole.net | bash
  • Python there is a lot of focus on Python for RaspberryPi, but be careful! Guides in Python2 don’t work for Python3 and vice versa.
  • Looking for an editor for Python? Try Mu.
  • Searching a protocolto send sensors data to RaspberryPi ? Try MQTT,it’s its reason of life. Install apt install mosquitto  and use Paho libraries.
  • Do you want to save sensor data and metrics on a database? Try the Stack TICK, the Influxdb database and its Chronograf graphs (we talked about it here).
  • When you start the RaspberryPi you see a yellow flash on the desktop? How much I hate it, you’ve connected too many things and the power supply can’t do it. Use an official power supply and a powered USB HUB.
  • How to configure the RaspberryPi? try sudo raspi-config
  • Do you want an easy and responsive Dashboard for your project? Test Node-Red, Chronograf or Freeboard.
  • Do you lovei arcade games? Go RetroPie.
  • Looking for a software to connect in SSH, Mosh, and many other ways, with the addition of an open port scanner and a network scanner? Install MobaXTerm Free .
  • RaspberryPi looks quite slow when used instead of a home PC? Of course, that’s normal: it’s not its purpose.
  • Do you want to sow sensors everywhere and manage them from the RaspberryPi? Use the RaspberryPi as a central server and buy the WeMos D2 with their HAT ready to use, aqnd use them to send data using the MQTT protocol.
  • Tired of burnt SD cards? Enable the boot via usb and use the sticks.
  • You would like to combine various online services, for example when I say to google home mini “turn off the 3d printer”? IFTTT can send the command to the iot electrical outlet.
  • Do you want to use your RaspberryPi as a NAS? ? You must have version 4, because it has a non-usb network card, then connect the disks to a powered hub, and install Nextcloud or OpenMediaVault.
  • Tired to use your password in ssh? ssh-copy-id user@hostname.example.com
  • How do I turn off linux? sudo shutdown now
  • How do I restart linux ? sudo reboot now
  • I want a website ! Install NGINX, Apache is a bit slower, they say.
  • Do you need a web panel to manage linux? Try Webmin, it simplifies a lot and limits the use of many linux commands.
  • How do I share a folder? Install samba.
  • I want to mine cryptocurrencies! Forget it, it’s a job for professionals with a lot of money to invest, if it were so easy to do it with a RaspberryPi everyone would do it.
  • I want to remotely control my CNC. Of course, there are some plans, but be careful, if something goes wrong, the damage can be expensive.
  • You want an enhanced alternative to Raspbian, take a look at DietPi, with lots of smart features and options.

This is not meant to be a guide, but an answer to myself from the past, I hope it will come in handy.

Devices I triede over the years

Follow us to stay updated with all the news

Tecnico Informatico Windows | Volontario digitale | Technical Editor per RaspberryItaly e MoreWare | con mille hobby. enrico.sartori@moreware.org

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.