General Raspberry Pi stuff

Subjects that don't have their own home
User avatar
jack
Thermionic Monk Status
Posts: 5501
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#46 Re: General Raspberry Pi stuff

Post by jack »

Pi-hole is blocking about 18% of all DNS requests from its blacklists of 91,500 banned domains... Lot less crap on all the mobile phones etc. in the house. 15% of all requests are met by a cache hit and the rest go to Cloudflare who are superfast (sub 30mS at the moment) - way better than Google.

Very pleasing.

The UniFi controller on the Pi is also running very nicely. I'm adding a M.2 SATA hat to the Pi with a Samsung M.2 256GB SSD. That should be big enough!
Vivitur ingenio, caetera mortis erunt
User avatar
jack
Thermionic Monk Status
Posts: 5501
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#47 Re: General Raspberry Pi stuff

Post by jack »

The Pi data logger & server project continues..

StarTechCom M.2 SATA Pi hat plus Samsung 250GB SATA M.2 SSD.
IMG_20200411_192357_copy_665x887.jpg
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

#48 Re: General Raspberry Pi stuff

Post by Neal »

Watching with interest, would be neat if you can boot from the mSATA drive but sure that is possible on the RPi4
Only the Sith deal in absolutes.
User avatar
jack
Thermionic Monk Status
Posts: 5501
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#49 Re: General Raspberry Pi stuff

Post by jack »

It's actually an M.2 SATA, not an mSATA drive...

Got it working, i.e. booting the Pi 3B directly from the SSD with no uSD card installed... Next step is getting docker & docker-compose installed as part of a general server base... The UniFi controller and Pi-hole (from the docker hub) will then run as containers using docker-compose YAML definitions to manage the environment...

Actually is pretty easy to do from a clean install... but only on a Pi 3 - this does not work properly yet on a Pi 4. The HUGE plus is that SSDs are highly unlikely to fail with a lot of use, unlike uSD cards which were designed for use in cameras and can't take many writes before failing, i.e. the speed, wear levelling and quality of cells in a true SSD is way way better than a uSD card.

This makes a Pi a far more reliable host for use as a media (or indeed any type of) server/workstation.

Using the James Chambers benchmark tests, the SSD is 8 x faster than the uSD on the Pi 3B and 17 x faster on a Pi 4 using the USB 3.0 ports...

Firstly, check the Pi's OTP memory #17, i.e.

Code: Select all

pi: sudo vcgencmd otp_dump | grep 17
17:1020000a
pi:
Note this number. The OTP memory, as its name suggests, is a one-time-programmable section of the Pi itself. By default, Pis will not look to boot from USB - that has to be enabled.

Add the line

Code: Select all

program_usb_boot_mode=1
to the end of /boot/config.txt using sudo nano or similar. Reboot the Pi and redo the vcgencmd command above. You should see the number has changed, e.g.

Code: Select all

pi: sudo vcgencmd otp_dump | grep 17
17:3020000a
pi:
Note that this is a ONE TIME OPERATION and cannot be undone for the Pi. Remove the line "program_usb_boot_mode=1" from /boot/config.txt as it's not needed for this Pi again and if you use the uSD card in another Pi, it'll change the OTP on that Pi too...

Now, Use balenaEtcher on Windows or similar to flash the SSD with a new copy of Raspbian Buster. Etcher might not show the SSD as it normally operates in a safe mode where apparently fixed disks are just not presented as a flash option - you need to enable Unsafe Mode *(!!!) - got to Etcher's options and enable Unsafe Mode. The SSD will then show up as a possible target. BE VERY CAREFUL !!!

Plug the SSD back into the Pi and remove the uSD card. The Pi should now boot directly from the SSD and go through the normal "New Install" process... No uSD required from now on... and, yes, that is genuinely the uSD card from that Pi sitting on the wrist pad of the keyboard - the Pi in the photo only has the M.2 SSD mounted on top...
IMG_20200413_120346_copy_1008x756.jpg
IMG_20200413_120334_copy_1008x756.jpg
Vivitur ingenio, caetera mortis erunt
User avatar
jack
Thermionic Monk Status
Posts: 5501
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#50 Re: General Raspberry Pi stuff

Post by jack »

Neal and some others know all this stuff already, so my apologies to them if it seems too obvious - the detail is really for those looking at this for the first time...

So, have docker and docker-compose installed. Now looking for all the apps in containers...

One thing that is important is to manage port forwarding in the YAML - Pi-hole and the UniFi controller both are networking apps and you need to keep track of which ports are in use by which container so no overlaps.

Also added in a guest WiFi portal to the environment along with a workshop development subnet & VLAN.
Vivitur ingenio, caetera mortis erunt
gninnam
Old Hand
Posts: 420
Joined: Thu Jan 07, 2010 6:48 pm

#51 Re: General Raspberry Pi stuff

Post by gninnam »

Good write up.
Setup Pi-hole on my PI4 being used as a NAS server and had to enable it to be the DHCP server as the broadband WiFi router won't allow me to change the DNS settings last night.
All household devices now using the Pi-hole and looking good.
Not noticed any increase in resolution as yet but managed to hit around a 28% block rate so all good.

I have 3 PI3's knocking around to might have a look at the M.2 SATA route - wonder when the PI4's will be able to boot of one??

Keep the good work going.
User avatar
jack
Thermionic Monk Status
Posts: 5501
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#52 Re: General Raspberry Pi stuff

Post by jack »

Ta. I'm enjoying doing a bit of stuff again...

If not done already, make sure you're using Cloudflare (1.1.1.1/1.0.0.1) as your upstream DNS resolver in Pi-hole. It's way faster than Google (8.8.8.8 etc.) and unlike Google, Cloudflare don't keep and sell your data 👍

BT broadband routers generally don't allow you to change the DNS given out by the DHCP server (as you've found).

That's why I switched to a Draytek modem and the UniFi USG gateway. Works a treat, is about 0.5Mb/s faster than the old BT router, we don't seem to get any dropouts now and as I'm mostly all Ubiquiti, it's managed by the UniFi Controller. In addition, it blocks rogue DHCP servers that crop up unexpectedly sometimes on new kit and which can cause a world of pain.
Last edited by jack on Tue Apr 14, 2020 4:31 pm, edited 2 times in total.
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

#53 Re: General Raspberry Pi stuff

Post by Neal »

yup had the same with my BT account.

Although you can't boot directly from USB on the RPi4 you could always use the old way of keeping /boot on the SD card and copying everything else to the USB device, there's a script and info here: https://www.raspberrypi.org/forums/view ... p?t=196778
Only the Sith deal in absolutes.
gninnam
Old Hand
Posts: 420
Joined: Thu Jan 07, 2010 6:48 pm

#54 Re: General Raspberry Pi stuff

Post by gninnam »

jack wrote: Tue Apr 14, 2020 3:40 pm Ta. I'm enjoying doing a bit of stuff again...

If not done already, make sure you're using Cloudflare (1.1.1.1/1.0.0.1) as your upstream DNS resolver in Pi-hole. It's way faster than Google (8.8.8.8 etc.) and unlike Google, Cloudflare don't keep and sell your data 👍

BT broadband routers generally don't allow you to change the DNS given out by the DHCP server (as you've found).

That's why I switched to a Draytek modem and the UniFi USG gateway. Works a treat, is about 0.5Mb/s faster than the old BT router, we don't seem to get any dropouts now and as I'm mostly all Ubiquiti, it's managed by the UniFi Controller. In addition, it blocks rogue DHCP servers that crop up unexpectedly sometimes on new kit and which can cause a works of pain.
Cheers - set to Cloudflare

Does BT allow you to swap out their router??
gninnam
Old Hand
Posts: 420
Joined: Thu Jan 07, 2010 6:48 pm

#55 Re: General Raspberry Pi stuff

Post by gninnam »

Neal wrote: Tue Apr 14, 2020 3:56 pm yup had the same with my BT account.

Although you can't boot directly from USB on the RPi4 you could always use the old way of keeping /boot on the SD card and copying everything else to the USB device, there's a script and info here: https://www.raspberrypi.org/forums/view ... p?t=196778
Thanks Neal - will bear in mind when Ido the next rebuild!
User avatar
jack
Thermionic Monk Status
Posts: 5501
Joined: Wed Dec 29, 2010 8:58 pm
Location: ɐılɐɹʇsnɐ oʇ ƃuıʌoɯ ƃuıɹǝpısuoɔ
Contact:

#56 Re: General Raspberry Pi stuff

Post by jack »

gninnam wrote: Does BT allow you to swap out their router??
It's really easy. Painless even. The BT router is actually a modem + router. I went for a Draytek Vigor 130 modem as it was strongly recommended by others and we wanted to be fibre-ready - it knows about BT so there is no config for it - just plug it in. It has an ethernet output port that you plug into the WAN port of the router.

In your router you just set up the BT login details for the wan port.
Last edited by jack on Tue Apr 14, 2020 4:15 pm, edited 2 times in total.
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

#57 Re: General Raspberry Pi stuff

Post by Neal »

Yes, I switched out my BT Home Hub for a TP-Link VR600
Only the Sith deal in absolutes.
User avatar
Nick
Site Admin
Posts: 15740
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#58 Re: General Raspberry Pi stuff

Post by Nick »

Yep, I do much the same thing with a TP Link router set to output PPPoE packets to a pfSense box running on a small embedded Linux board.
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
gninnam
Old Hand
Posts: 420
Joined: Thu Jan 07, 2010 6:48 pm

#59 Re: General Raspberry Pi stuff

Post by gninnam »

Did similar when I was with Plusnet - the hub they supplied died and they wanted good money to replace it so I went and bought a new one for a fraction of the price they quoted (could have been a Zytel or something - think I still have it in the garage).

Might look to do this after all this Covid-19 stuff has drifted by as working from home and don't want to upset the apple cart too much!
Max N
Old Hand
Posts: 1456
Joined: Thu Aug 16, 2007 6:10 pm

#60 Re: General Raspberry Pi stuff

Post by Max N »

jack wrote: Tue Apr 14, 2020 4:09 pm
gninnam wrote: Does BT allow you to swap out their router??
It's really easy. Painless even. The BT router is actually a modem + router. I went for a Draytek Vigor 130 modem as it was strongly recommended by others and we wanted to be fibre-ready - it knows about BT so there is no config for it - just plug it in. It has an ethernet output port that you plug into the WAN port of the router.

In your router you just set up the BT login details for the wan port.
I used to use a Draytek when we were with BT. Really liked it, but after a while (maybe 18 months or so? Can't remember) it just died, and wouldn't power up anymore. Hopefully I just had a rogue bad one.
I switched back to a BT Homehub, and that lasted until Gigaclear arrived in the area. I am tied to the Gigaclear box now, which has so far been pretty robust. Its built-in wi-fi is a bit weak so have disabled that.
Nevertheless I am following this thread (not fully understanding it all yet). When I get my head around it I will see how much of the functionality could be handed over to Pi-hole.
I'll echo the thanks, cheers
Post Reply