Showing posts with label raspberry pi. Show all posts
Showing posts with label raspberry pi. Show all posts

Sunday, 5 January 2020

Mikrotik + Pi Zero + Pi-hole = advertising sinkhole with fail-safe

Components

  • Mikrotik router with USB port - I tested on RB2011UiAS-2HnD-IN and hAP ac models
  • RouterOS in modern version - I tested with long term (6.44.6)
  • Raspberry Pi Zero - I use old one without "W", with 4GB microSD card running latest Raspbian 10 Buster (minimal, without GUI!)
  • Short micro-USB data cable - because many cheap cables don't do data

Pi Zero actually has more than enough power to run Pi-hole serving even quite large home/family network and running it completely self-contained off Mikrotik seems to work great!


Initial setup

  1. Download and burn the latest Raspbian onto the SD card - I used for this Etcher and 2019-09-26-raspbian-buster-lite.img
  2. Connect SD card to a PC and in partition called boot edit two files to enable Ethernet gadget:
    1. config.txt - at the very end of the file add a line saying dtoverlay=dwc2
    2. cmdline.txt - add modules-load=dwc2,g_ether directly after 'rootwait' and before any other parameters that may (or not) be there
  3. Boot up RPi powering from PC using the port marked as USB on the board - not the PWR IN; it's the one in the centre - only that one does power + gadget
  4. After all boots up, you should be able to run ssh pi@raspberrypi.local (thanks mDNS!) with password raspberry
  5. On the RPi create file called /etc/modprobe.d/g_ether.conf with the following content (single line of text)
    options g_ether idVendor=0x05ac idProduct=0x1402 iProduct=Pi0 iManufacturer=Raspberry
    NOTE - This is required for RPi to show up as LTE interface on Mikrotik!

Saturday, 26 October 2013

Virtual radar - Raspberry Pi and RTL-SDR

As you probably know it's been over a year since Raspberry Pi hit the market. Mine spent most of that year in the drawer, so I decided to see if I can use it as low power server for a particular task. One of the ideas I had for a long time was to build a virtual radar type system that would allow me to see airplanes that fly over my area. There are purpose built systems that are quite expensive so why not to do it on a budget and have some fun with it?

ADS-B Basics

Automatic dependent surveillance-broadcast (ADS-B) is a cooperative surveillance technology for tracking aircraft. --Wikipedia

This is one of the ways in which the airplanes report their basic flight parameters (identification, current position, altitude, speed, etc) to the Air Traffic Control. All of this happens over radio broadcasts (completely public) at 1090MHz - at lest this is the frequency we are interested in. The full Wikipedia article is quite interesting and contains more information.

Why bother?

 

If you have ever seen the flightradar24 website before, you have possibly thought (I know I did) about how cool would it be to do it yourself - own one of those virtual radars and maybe even feed the data into flightradar24 to improve their coverage (and get premium account for free)? If you like this idea, you will like the results your own radar station will produce - in general it would be something like this


All of that is easy to build and the cost is really minimal, using either a PC or a Raspberry Pi as I describe in this post.