Pi Recipes

We have a number of Raspberry Pi's around our home and family.  The little system has been deployed to simplify techno-life, entertain or integrate household technology.  This collection of RPi Recipes is maintained to help with builds/rebuilds and may range from half-baked concepts to step-by-step procedures, typically for my own pursuit, but possibly of interest to others.  Pi recipes will slowly be migrated to this site from good old Ventures.TPedersen.net as needed, hopefully saving anything important before Google Transitions everyone  to 'New' Sites


Pi Recipes




Half Baked (below)




Half-Baked 

(Works in process, likely VERY unsettled)

ProbePi  

August 2023 - slight change of direction? ... now looking at Threat Hunting.  Lots to learn, compare/contrast with IDS, Vulnerability Scanning, et al

Stumbled upon PIhunter @ https://github.com/jeffvader84/piHunter.  Will see if I have a rpi/buster kicking around.  

Sing-a-long with https://github.com/jeffvader84/piHunter/blob/main/README.md


Haven't played with OpenVAS for a ver y long time, and never on an RPI.  Interested to see how its evolved and how all these IoT 'Things' do on vulnerability scans  ...

*** June 2023 - initial playtime


MeePi  [Progress?]

Initial play with private AI gizmo ... ultimately hope to build something creepy like this  https://homespace.is/ai

*** May 2023 - Some Mycroft work, apschedule (pip install apscheduler) followed by
routine skill  (msm install https://github.com/ChristopherRogers1991/mycroft_routine_skill.git)

*** Feb 2023 - Ack!  one step forward, one step back ... I knew Picroft was precarious (Nov 2022 was last of it) but there are some troubles upstream with Mycroft - here's the note from the CEO - https://community.mycroft.ai/t/update-from-the-ceo-part-1/13268.  I will monitor and also follow antics of https://openvoiceos.com/

In the meantime .... Taking a look at Rhassby via https://rhasspy.readthedocs.io/.  Sing-a-long @ https://rhasspy.readthedocs.io/en/latest/tutorials/#from-scratch-on-a-raspberry-pi


--------- Earlier ....

We'll start with https://mycroft.ai/ - Baby steps!

Easiest start is via https://mycroft-ai.gitbook.io/docs/using-mycroft-ai/get-mycroft/picroft.  Came right up on RPI3B+ and ran even better on RPI4.   Started with monitor, keyboard/mouse and HDMI sound.  Good way to get to know mycroft and related components.

*** Jan 21 2023 - back to picroft image ...

{

"max_allowed_core_version": 21.2,

"hotwords": {

  "hey papa": {

    "module": "precise",

    "phonemes": "HH EY . P AA P AH",

    "threshold": 1e-90,

    "lang": "en-us"

  },

  "wake up": {

    "module": "pocketsphinx",

       "phonemes": "W EY K . AH P",

    "threshold": 1e-20,

    "lang": "en-us"

  }

},

"listener": {

  "wake_word": "hey papa"

}

}

mycroft-config set listener.wake_word "hey papa"

Reference stuff moved from Pi-in-the-sky area

https://iotdesignpro.com/projects/how-to-build-ibm-watson-chatbot-using-raspberry-pi-and-tjbot

https://chatbotslife.com/i-run-a-machine-learning-program-on-a-raspberry-pi-and-heres-what-happened-a7f97aad6bb2

https://python-telegram-bot.org/

From Class:

https://www.aclweb.org/portal/

Spacy.io - Industrial Strength Natural Language Processing 

Gensim Topic Modelling for Humans @ https://radimrehurek.com/gensim/

Mycroft.ai Stuff:

Underpinnings @ https://mycroft.ai/initiatives/

https://github.com/MycroftAI/mycroft-precise/wiki/Training-your-own-wake-word#how-to-train-your-own-wake-word

https://github.com/sparky-vision/mycroft-precise-tips

----------------------------------------------

**** Dietpi abort (hopefully just a pause) struggling with permissions (I think when I try to run mycroft utilities - like skill maker (mycroft-msk) .... ****

I moved on to fav foundation - dietpi.  doc/quickstart @ https://dietpi.com/docs/.  Mycroft is part of optimized software library *and* seems to run better than the picroft image, see https://dietpi.com/docs/software/hardware_projects/#mycroft-ai.    

NetAidPi+Internet-Pi ServerPi [Overcooked]

This one looks like a keeper! ...  I'll cleanup the recipe below and probably call ours  "ServerPi".   It is now basically a local utility server with a nice face (UI) .... I think there will be a number of handy Self-Hosted apps to come.

------

Project history (in nutshell):  Started looking into monitoring our ISP internet speeds and stumbled upon https://github.com/geerlingguy/internet-pi with thoughts of cramming it into SentinelPi.  Had many struggles attempting to get Internet-pi in/up/running and ended up building a utility server that combines a number of handy local network services and links (instead of Browser bookmarks).  The server was initially built using DietPi, Pi-Hole, Speedtest Tracker, docker (portainer) and a friendly web face (homer).  This server will be foundation for our self-hosted apps - including Internet Speedtest-tracker to monitor our ISP (much easier).    

Initially just replaced/documented our NetAidPi.  It was an old rpi (Model B!)  that has been running on the network for quite a long time  (Pi-hole, Murmer and some other services that I didn't even remember!   Simply notes for now ....

-------

Sometime between March and August 2023

Added File Browser from Dietpi software:  https://dietpi.com/docs/software/cloud/#file-browser

March 2023:  Too many eggs in this basket?   Had to do a rebuild due to networking issues (it now really hurts when pi-hole server goes down!)
Also lots of putzing and playing with dietpi software .... 

V2 mods


---------------

From the beginning .... hopefully final

---------------

Notes from Attempt #4 - Looks like a keeper.  Decided that NetAidPi will remain standalone, I forgot that SentinelPi sits on a mirrored Ethernet port, it sees all IoT traffic, NetAidPi doesn't need all that.  Also upgraded to RPI4 for ISP monitoring (RPI3B+ ethernet seemed to max out ~150M) and for folding@home.

----------

Attempt #3!    ACK ACK ACK - Enough with https://github.com/geerlingguy/internet-pi!  Way too complicated for the problem at hand ... I just need a speedtest script/datastore, a dashboard *AND* I want to see how it all goes together!!!!!   RaspOs, intrnet-pi (and friends) was blowing up all over the place - I was chasing missing packages, path issues and my usual config fumblings (due to briefly scanning instructions!)

------------------------
Attempt #2 - ACK ACK!  This was a bust too!  All sorts of fumbling installing ansible (missing rust complier ... followed by comedy of errors)

----------------
Attempt #1 - ACK!  This was a bust!  Internet-pi seems to be dependent on stock raspos (maybe pi user? I'll revisit at some point)

MonitorPi or ContainmentPi [Done, Good One!]

This one is turned into SentinelPi - original notes/fumbling/flailing moved over there

SmartiePi - First Computer for 4-6 Year Old [Done]

Jan 2023:  FINALLY Back at it!  Ran GCompris on stock RPIOS for the heck of it and it ran MUCH better than on DietPi ... not sure why, but it's running great on an RPI3 and looks like it will live in harmony with CutiePi world if need be .. .

Final notes/recipe @  SmartiePi - First Computer for 4-6 Year Old

Feb 2022:  Moved to this site.  Cut/Paste from 'Classic' Google site page @ http://ventures.tpedersen.net/errata/raspberrypi/smartiepi ... did not paste in very well!  

WiFi Bootstrapping :   Comitup+Dietpi [Works!],  Comitup+Q4OS [TBD]

I often make Pi's for others - pre-configuring them for WiFi in someone else's home is a pain in the drain!

Gave Comitup a quick once over - there was a downloadable image @  https://davesteele.github.io/comitup/.    It looks to be JUST what I need AND it WORKS!

Posted experiences with the downloadable image (RaspOS that boots up with Comitup) in Raspberry Pi OS Alternatives.  

I am currently exploring installing/incorporating  Comitup packages into my projects as opposed to starting with the image because I use a variety of OS underpinnings - Q4OS, DietPi, Manjaro ...  it (comitup-1.15-1) seems to be in latest RaspOS which should allow me to apt-get install on everything except Manjaro.  I don't see it in Manjaro or Arch AUR


FlypaperPi (Honeypot) [Interesting]

Playing w/ OpenCanary Honeypot ... this is a mess/work-in-process

Sing-a-long w/ https://github.com/thinkst/opencanary#readme but ....
.... watching this one as I do:  https://simpaul.com/opencanary-on-a-pi-quick-setup/

Step by step (notes to self)

RPIOS - lite is fine, usual setup:  update/upgrade, rpi-config: pw, hn, local/kb, yada/yada

Switch to Ubuntu 20.04 LTS 32-Bit for 3 reasons - NOPE!  That came out badly

From guide ....

pip3 install --upgrade setuptools
git clone https://github.com/thinkst/opencanary
cd opencanary
sudo apt-get install libffi-dev # Paul may have missed this one, fatal err missing
sudo python3 setup.py install

<clip>
UserWarning: You do not have a working installation of the service_identity module: 'No module named 'service_identity''. 
Please install it from <https://pypi.python.org/pypi/service_identity> and make sure all of its dependencies

are satisfied.  Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verifica

tion.  Many valid certificate/hostname mappings may be rejected.

I'm a good guesser ... closed my eyes and fixed this via ...
pip3 install service_identity

[Unit]
Description=OpenCanary honeypot

After=syslog.target

After=network.target


[Service]

User=root

Restart=always

WorkingDirectory=/home/pi/opencanary

ExecStart=/home/pi/opencanary/bin/opencanaryd --dev


[Install]

WantedBy=multi-user.target

enough for now ...

-----------------

Leftovers to deal with
pip install scapy pcapy # optional

Install fail that forced me to install libffl h

Whoops!  that failed
No package 'libffi' found
c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
15 | #include <ffi.h>
    |          ^~~~~~~


Samba install output (in case I need it)

Setting up samba (2:4.13.13+dfsg-1~deb11u3) ...

Adding group `sambashare' (GID 125) ...

Done.

Samba is not being run as an AD Domain Controller: Masking samba-ad-dc.service

Please ignore the following error about deb-systemd-helper not finding those services.

(samba-ad-dc.service masked)

Created symlink /etc/systemd/system/multi-user.target.wants/nmbd.service → /lib/systemd/system/nmbd.service.

Failed to preset unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.

/usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory

Created symlink /etc/systemd/system/multi-user.target.wants/smbd.service → /lib/systemd/system/smbd.service.

samba-ad-dc.service is a disabled or a static unit, not starting it.

Processing triggers for man-db (2.9.4-2) ...

Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u2) ...



CutiePi V4 Collection [Kinda Stalled]

A few links at this point ... my bookmarks are a mess

https://github.com/mental32/spotify.py

https://getuikit.com/

Related:  Murmer Server for Push4Papa testing

Also:  Dietpi possibilities for V4

TightVNC Server [Looks OK]

Bottomline:  This MAY work if I need it ... more putzing to do to get it installed and not as full featured as rpi default vnc server (realvnc).


Considerations/ToDo's
- XP lookswitcher (XPQ4 Desktop) does not show in remote session (I'm probably NOT in the session I'd like to be)
- Below includes definitions for systemd service but I think I'd just fire this up via CLI on an as needed basis
- I still need to double check that it works via remote.it (remote control gizmo I use)

-------

Motivation:  Struggling with stock (RealVNC) vncserver on latest GramPi rebuid ... thought I'd try TightVNC for the heck of it

Rough notes as I go ... Working with Q4OS, but I'd guess this will work on RaspiOS too

TightVNC looks to be GPL, actively maintained and has been around for a long time (> 10 years).  

Most doc seems to be focused on windoze, but this guy posted a RPi step-by-step 

Notes as I go in case I need to retrace my steps


[Unit]
Description=TightVNC Server
After=network.target

[Service]
Type=forking
User=pi
ExecStart=/usr/bin/vncserver :1
ExecStop=/usr/bin/vncserver -kill :1

[Install]
WantedBy=multi-user.target

sudo systemctl enable vncserver

systemctl status vncserver

● vncserver.service - TightVNC Server

  Loaded: loaded (/etc/systemd/system/vncserver.service; disabled; vendor preset: enabled)

  Active: inactive (dead)

pi@GramPiV2:~ $ systemctl enable vncserver        

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ===

Authentication is required to manage system service or unit files.                                 

Multiple identities can be used for authentication:

1.  pi

2.  root

Choose identity to authenticate as (1-2): 1

Password:  

==== AUTHENTICATION COMPLETE ===

Created symlink /etc/systemd/system/multi-user.target.wants/vncserver.service → /etc/systemd/syste

m/vncserver.service.

==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===

Authentication is required to reload the systemd state.                                            

Multiple identities can be used for authentication:

1.  pi

2.  root

Choose identity to authenticate as (1-2): 1

Password:  

==== AUTHENTICATION COMPLETE ===

OccuPi - Remote Controlled Full Screen Kiosk-Like thingy [Stalled]

Moved to tech.tpedersen.net Feb 2022.  Cut'n Paste from 'Classic' Google site page @ http://ventures.tpedersen.net/errata/raspberrypi/occupi ... VERY STRANGE, this page pasted into new sites quite well, PanelPi was a total mess!


OccuPi - Remote Controlled Full Screen Kiosk-Like thingy

Last update:  09 October 2020

Original 15 September 2020


VERY EARLY Stages, this page will be a mess as I stumble thru this ...


The Goal is to build a little Pi that will connect to my parents TV to allow me to share (project) videos, web pages and such.  Will be used during COVID-19 to keep them occupied over the winter months.  More to come as this idea develops.


Notes/Updates

09 Oct:  Struggling to find OS fast enough to use Google Streetview in Full Screen or Kiosk mode on a Raspberry Pi 3.  It appears that I MUST run Chromium browser to pull this off.  Have tried Arch, Dietpi and Raspbian lite.  On to Chromium OS.  Also created subordinate startpage to simplify testing ... we may end up with a simple webpage providing links to all activities,  


25 Sept:  General concept works very well, even had an old gyration remote control working with it.  RaspOS was painfully slow on the RPi3.  Switching to LXDE desktop from Dietpi to see how that runs.  Dietpi has been my goto for servers, really haven't played with desktop. 


Dietpi/Chromium kiosk is pretty slow.  Friggin streetview map is upside down too!  Added a startpage to facilitate adding activities/features without connecting to or messing with OccuPi system


Research/Reference 

- https://blog.gordonturner.com/2020/06/30/raspberry-pi-full-screen-browser-2020-05-27-raspios-buster/

- https://www.instantstreetview.com/

- https://peter.sh/experiments/chromium-command-line-switches/

- Upside down google maps - https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=274315

- Bigscreen Project - https://plasma-bigscreen.org/

- Chromium OS - Image to try quickly here - https://github.com/FydeOS/chromium_os-raspberry_pi/releases

- Chromium remote desktop - https://remotedesktop.google.com/?pli=1

- Puffins OS - https://www.puffin.com/raspberry-pi/ - Install


Software


- Stock RaspOS - Raspberry Pi OS (32-bit) with desktop to start

- Switching to Rspbian via Dietpi


Hardware

- RPi 3 

- 16g 

- Old Gyration MCE Remote!


Dietpi Setup Notes



----------- RaspOS aborted for now - Save in case I fallback -----------

Steps (raspos)




PanelPi -  Integrate hardwired home security sensors into smart home [Stalled]

Last Update - 21 July 2020

Here wee go again!  PanelPi - A little Pi help to integrate old wired alarm system


*** VERY early in the project, this page is expected to be a mess for quite a while (as usual) ***


Background

PanelPi was initially cobbled together to explore sprucing up our wired home security system.  Current plan is to integrate a number of hardwired sensors into our 'Smart' home.  We'll see!

Software 

Hardware

Current Config

Stuff to Explore


Step by Step (rough notes to self, I'll cleanup later)


Phase I - Pi in Panel. 

Get Panel online - currently in Wifi deadspot.  Use Webiopi to see what is going on with existing sensors.   

Notes

- PanelPi will have to Wifi to SuitiePi - forgot to run Ethernet to panel area when I had wall out!!! Argh!

    - remember to static route and reserve dhcp so I can find/access PanelPi on that subnet

- WebIOPI did not install via Dietpi ... attempting by hand

    - RPi 1 Model B -> Install instructions @ http://webiopi.trouch.com/INSTALL.html

    - RPi 2 and beyond (40pin GPIO) @ https://thepiguy.altervista.org/webiopi-rp3/

Log, Odd and Ends and fond memories


July 2020 - rebuild


June 2020 - Back at it

downloaded attached a GPIO pinout leaf - We'll see if it helps, pretty small print for old eyes!

https://github.com/splitbrain/rpibplusleaf


- Ghazooks!  To keep all this stuff going on our network remember the following.