General Raspberry Pi stuff

Subjects that don't have their own home
Post Reply
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#76 Re: General Raspberry Pi stuff

Post by Neal »

Good point Nick, I’ve got a high endurance card on the way then I can crack on with installing docker. Planning on running, pihole, LMS, Hikvison iVMS and possibly UBNT controller
Only the Sith deal in absolutes.
User avatar
ed
retired
Posts: 5384
Joined: Thu Jun 21, 2007 4:01 pm
Location: yorkshire
Contact:

#77 Re: General Raspberry Pi stuff

Post by ed »

this makes fascinating reading(maybe)..

looking deeper into this there are a number of industrial cards which are advertised as MLC at reasonable prices BUT if you look at this from a generic point of view you find that TLC(the bottom rung of the ladder) is a type of MLC. It stands to reason that the unscrupulous vendors might sell TLC under the guise of MLC.....

I have taken an image of the raspian install with the modified LAMP and will get a 64gb MLC industrial as a backup for when it crashes.

I also note that there are many recommends to run logging on a ramdisk and only save at closedown. At the moment I'm not too concerned about the security of the databases as periodic backup will be sufficient for the test environment, but this may change. If it does change I'll have a rethink...but whatever happens it will be a budget exercise.
There's nowhere you can be that isn't where you're meant to be
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#78 Re: General Raspberry Pi stuff

Post by Neal »

Finally got around to setting up my RPi4 only to realise I have the 2Gb version....oh well. Reference for others; this is the way I did it...

Download and install Rasbian Lite to SSD card. Drop an empty file called SSH in the root directory and install into the RPi then boot. Find the IP and SSH in.

Run:
pi@raspberrypi:~ $ sudo raspi-config

Configure the Pi, expand the file system, change password, time etc

Run:
sudo apt-get update && sudo apt-get upgrade

Install Docker:
pi@raspberrypi:~ $ curl -fsSL https://get.docker.com -o get-docker.sh
pi@raspberrypi:~ $ sudo sh get-docker.sh

As I have a fanshim installed I set it up at this point....

pi@raspberrypi:~ $ sudo apt-get install git-core
pi@raspberrypi:~ $ sudo git clone https://github.com/pimoroni/fanshim-python
pi@raspberrypi:~ $ cd fanshim-python
pi@raspberrypi:~/fanshim-python $ sudo ./install.sh
pi@raspberrypi:~/fanshim-python $ cd examples/
pi@raspberrypi:~/fanshim-python/examples $ sudo apt install python3-pip

Install service with CPU temperature thresholds and delay time in seconds
pi@raspberrypi:~/fanshim-python/examples $ sudo ./install-service.sh --on-threshold 65 --off-threshold 55 --delay 3

Install portainer:

pi@raspberrypi:~ $ sudo docker volume create portainer_data
pi@raspberrypi:~ $ sudo docker run -d --restart unless-stopped -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Enable Docker to auto start
pi@raspberrypi:~ $ sudo systemctl enable docker

Run portainer from a web browser using the RPi IP address and port 9000
\\192.168.1.214:9000

Note: port 9000 clashes with LMS so use 9090 or similar in the run command above 9090:9000

Reference:
https://phoenixnap.com/kb/docker-on-raspberry-pi
https://linuxhint.com/install_portainer/
Last edited by Neal on Sat May 09, 2020 5:45 pm, edited 1 time in total.
Only the Sith deal in absolutes.
User avatar
ed
retired
Posts: 5384
Joined: Thu Jun 21, 2007 4:01 pm
Location: yorkshire
Contact:

#79 Re: General Raspberry Pi stuff

Post by ed »

after the worries surrounding the longevity of the sd cards reported by Nick..I came across this:

https://www.stewright.me/2019/10/run-ra ... erry-pi-4/

so I thought I'd invest £40 in a 64gb USB SSD and see what it's all about....the current test database on the pi gets about 2000 records a day so it's hit reasonably hard......

It'll be interesting(for me) to see how much of a success this is.
There's nowhere you can be that isn't where you're meant to be
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#80 Re: General Raspberry Pi stuff

Post by Neal »

Question for Nick; how do you have pinhole configured network wise in the container? I can't seem to use host mode, bridge is the only option for me and I don't want to use that. I keep getting an error message trying to use host.

EDIT: Ah, OK I do need to use Bridge mode but need to edit docker-compose.yml......where is it!

Edit: I'm being a doofus, you need to manually add the required port forwarding when deploying the container :bounce:
Only the Sith deal in absolutes.
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#81 Re: General Raspberry Pi stuff

Post by Neal »

OK this is not working, I can't get DHCP on PiHole working in a container using Bridge mode. Pihole believes its IP address is 0.0.0.0, Ive set port forwarding for 67, 53, 80 and 443 and enabled DHCP and removed the existing DHCP server, any ideas Nick or can you share your PiHole configuration...
Only the Sith deal in absolutes.
User avatar
jack
Thermionic Monk Status
Posts: 5502
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#82 Re: General Raspberry Pi stuff

Post by jack »

I'm not running Pi-hole in a container yet, but I will be in the next day or so.

One thing to think about is if you are using DNSSEC - if so, there is a local forwarder in use, so an extra complication.

I'll try to have a poke around later this afternoon...
Vivitur ingenio, caetera mortis erunt
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#83 Re: General Raspberry Pi stuff

Post by Neal »

You can’t use a bridge network for dhcp. It has to reside on the host network. Recommendation is create a macvlan and connect to that. I’ve tried and it still doesn’t work, I may be doing something wrong. Also to creat a user defined macvlan you need to create a config lan first in portainer and then create another but calling the config lan you first created. I’m getting frustrated with this now!
Only the Sith deal in absolutes.
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#84 Re: General Raspberry Pi stuff

Post by Neal »

Its working!

Simplest of things, I added the pihole container using the host network. There are some other variables you need to add to the container config. as in this tutorial:

https://homenetworkguy.com/how-to/insta ... portainer/

not listed there is the SERVERIP variable which needs to be set to the host RPi IP address.

GITHub resource with variables

https://github.com/pi-hole/docker-pi-ho ... nit-script

Edit: As the container now sits on the host network it may cause a port 80 conflict if you add a second container in the same manner, just be aware
Last edited by Neal on Tue May 12, 2020 3:06 pm, edited 1 time in total.
Only the Sith deal in absolutes.
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#85 Re: General Raspberry Pi stuff

Post by Neal »

How to correctly create macvlan in portainer

https://www.portainer.io/2018/09/using- ... tainer-io/
Only the Sith deal in absolutes.
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#86 Re: General Raspberry Pi stuff

Post by Neal »

Now in the process of installing LMS into a container...dumped in onto the host network as I cant be faffing with the bridge network. good container to pull seems to be this one: mrtestone/armhf-lms:latest

However, not all plain sailing. The way to mount NAS volumes seems to have changed in Buster (maybe Stretch as well, I don't know) from Jessie

On page two of this thread the simple way I mounted a NAS share doesn't work under Buster you get a Host is Down error message when you try. After a load of googling I stumbled up on this mount syntax for /etc/fstab..

//192.168.1.98/music /home/pi/nsa320s/music cifs username=guest,password=guest,_netdev,sec=ntlm,noserverino,vers=1.0 0 0

This worked, the key part for me was username not user and the version number 1.0 not 2.0 or 3.0

Onwards
Only the Sith deal in absolutes.
User avatar
pre65
Amstrad Tower of Power
Posts: 21399
Joined: Wed Aug 22, 2007 11:13 pm
Location: North Essex/Suffolk border.

#87 Re: General Raspberry Pi stuff

Post by pre65 »

If you IT savvy guys have this much trouble what hope for novices like me ? :lol:

I can manage the Squeezebox Touch, and that's where I'm staying.
The only thing necessary for the triumph of evil is for good men to do nothing.

Edmund Burke

G-Popz THE easy listening connoisseur. (Philip)
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#88 Re: General Raspberry Pi stuff

Post by Neal »

When creating the LMS container and after mounting your music share make sure you map (bind) the mount point to a directory in the container IE: /mnt/music Do this from the Volumes option.
Only the Sith deal in absolutes.
Neal
Shed dweller
Posts: 2300
Joined: Fri Aug 03, 2007 10:57 am
Location: From the land of the Bodgers

#89 Re: General Raspberry Pi stuff

Post by Neal »

I'm mainly incompetent Phil, and thrash about until i find something that works! :D
Only the Sith deal in absolutes.
User avatar
pre65
Amstrad Tower of Power
Posts: 21399
Joined: Wed Aug 22, 2007 11:13 pm
Location: North Essex/Suffolk border.

#90 Re: General Raspberry Pi stuff

Post by pre65 »

Neal wrote: Thu May 14, 2020 1:14 pm I'm mainly incompetent Phil, and thrash about until i find something that works! :D
Ah yes, but my level of incompetence is bigger than yours. :lol:
The only thing necessary for the triumph of evil is for good men to do nothing.

Edmund Burke

G-Popz THE easy listening connoisseur. (Philip)
Post Reply