Pages

11/12/2017

Vyatta vRouter Appliance: Using BGP to distribute 'firewall' rules

A while ago I attended a Mikrotik User Meeting or MUM for short. For those of you that don't know, Mikrotik are a Latvian company that make networking hardware and an operating system known as RouterOS, that will act as a router and firewall. Their 'USP' is value for money. £22 will get you a home router that will support OSPF, BGP, MPLS et and £2736 will get you a router that will route almost 80Gb/s. Nice.

The MUM consisted of various presentations and demonstrations and one which caught my eye was a presentation from Barry Higgins from Allness, who demonstrated using OSPF to distribute a black list of bad guys which were then null routed, a nice method of distributing 'firewall' rules on a bunch of routers automagically. You can view his presentation on Youtube.

I've recently been playing Vyatta vRouter appliances and wondered if I could apply a similar method of injecting a black list from an IDS (Intrusion Detection System) and having it distributed via BGP.

25/09/2017

Hidden London: Charing Cross

If you've read any of my blog posts it may have come apparent that I have a bit of a 'thing' for the London Underground. I can't tell you how many bogies are on an S Stock train or the unladen weight of a Bakerloo line train so I've not reached full anorak status yet, but I do go on the Hidden London tours whenever I can.

About a month ago my wife and I attended the Hidden London: Highgate Wilderness Tour which was a little disappointing, but this time round the Charing Cross really delivered. It didn't quite top Aldwych Station, but was certainly better than Highgate and Euston. If I had to recommend two tours out of those that I've attended so far, I'd say Aldwych and Charing Cross are the ones to go for.

The Jubilee line used to terminate at Charing Cross prior to the extension to Stratford, so the tour gives you the opportunity to see the disused Jubilee platforms and some of the other areas of the station that are usually closed to the public.

If you intend on going on the tour and want to keep it a surprise, I suggest you stop reading here. If you won't be going on the tour or want to see if its worth £35 English Pounds, read on...


07/09/2017

Flashing the DVMega UHF with the latest firmware using an Arduino Uno and a Raspberry Pi

In case you've missed it, there's a new firmware release out (3.17) for the DVMega - a small transceiver that can operate as a Digital Mode Hotspot that supports DMR, D-Star and Fusion.

Unless your DVMega is brand new (purchased after 2017-09-07) it's safe to assume you're on an older version. You can always check your current version in the MMDVMHost logs or your preferred MMDVMHost dashboard.

Unfortunately there's no built in way to upgrade the firmware, which leaves you with a couple of choices depending on your board-

  1. Remove the large chip and flash it with an Arduino Uno, a microcontroller that uses the same chip as the DVMega (UHF Version Only!)
  2. Solder a wire between two points on the board and program it direct from the host computer or Raspberry Pi. (Both Versions)


If you'd prefer to solder the wire to avoid having to purchase an Arduino Uno, or in the case of the dual band version you have no choice, I thoroughly recommend G0WFV's blog post, which inspired me to write this one for flashing with an Uno.

If you'd prefer to use an Uno because you're either not confident with the soldering or in my case you'd rather not have an unsightly wire flapping around on your DVMega so you can flash it twice a year, then read on.
DVMega on a custom Orange Pi Zero 'Hat' with the chip circled


Disclaimer

This is a hands on process. Whilst its unlikely that you will make the chip completely unusable (unless your short it or insert it the wrong way around) its plausible that the flashing may fail part way through rendering your DVMega temporarily out of action. You should just be able to flash it again to fix the issue, but I can't accept responsibility if it goes wrong.

Preliminaries

To use the Arduino Uno method you will first need an Arduino Uno and the appropriate cable (Usually USB 2.0 B type). Make sure you get an Uno with the full sized chip and not one of the SMD models. A 'clone' or 'compatible' version should work fine. The cheapest I could find was £5.49 on Ebay but double check with the seller that they're shipping the full sized DIP version first.

In theory you should wear an anti-static wrist strap whilst working with semiconductors, but I've not had any issues going without.

Don't plug in or power up the Arduino Uno until instructed to do so!

Swapping the chips

In order to program the DVMega chip you will need to remove the large black chip from both boards, place the DVMega chip in the Uno, flash it, and then swap them back. It might be sensible to mark the DVMega chip with some paint, tipex, nail varnish, whatever you have handy.

If you have one handy you can use a fancy IC extractor, however my cheapo one usually causes more harm than good. Instead I use a thin flat blade screw driver and insert it into each end and twist it slightly to loosen the chip. Once loosened you can usually just pull it out with your fingers. 

Be careful not to bend the pins! 

Whilst you're at it, make a visual note of the 'notch' and the 'dot' in the corner of the chip. For the UNO these should be furthest away from the USB connector, and on the DVMega they should be furthest away from the GPIO header socket.


The chip that needs removing from the UNO is circled.

Once removed, you can carefully push the DVMega into the socket of the UNO. You don't need to ram it all the way home, just enough to make electrical contact but ensure its still easy to remove.

Discovering the Arduino 'port'

Now the DVMega chip is in the Arduino, we can flash it. Connect to a terminal session running on the Raspberry Pi via SSH or a local screen and run-
sudo su

If you're running pi-star, make the file system read/write-
rpi-rw

Run dmesg to find out which 'port' the Arduino is connected to-
dmesg

You should see something like the following-
[    2.269154] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
[    2.414242] usb 1-1.2: New USB device found, idVendor=2341, idProduct=0043
[    2.416199] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[    2.419794] usb 1-1.2: Manufacturer: Arduino (www.arduino.cc)
[    6.899923] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device

Which tells you that the Arduino is connected to /dev/ttyACM0.

Installing the software

Before you can flash the chip its best to ensure you have the correct software packages installed-
apt-get update
apt-get install avrdude zip wget

Downloading the new DVMega binary

Go to the DVMega software page and double check the latest version for your board. For the DVMega Single Band board you're looking for this section-

BlueDV-MMDVMhost

Raspberry PI based Support for D-Star, Fusion and DMR auto mode

Singleband and Dualband Radio

The current firmware is 3.17

Change into your home directory, just in case-
cd ~/

Download the firmware-
wget http://www.dvmega.auria.nl/images/DVMEGA_RH_V317_UNO.zip

Unzip it-
unzip DVMEGA_RH_V317_UNO.zip -d DVMEGA_RH_V317_UNO

Flashing the binary to the Arduino UNO

Change into the unzipped directory-
cd ~/DVMEGA_RH_V317_UNO

And run avrdude to flash the binary, remembering to change your serial port if necessary-
avrdude -p m328p -c arduino -P /dev/ttyACM0 -b 115200 -F -U flash:w:DVMEGA_HB_V317_UNO.cpp.hex

You should then see something like the following, indicating flashing was successful-
avrdude-original: Using autoreset DTR on GPIO Pin 7

avrdude-original: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude-original: Device signature = 0x1e950f
avrdude-original: NOTE: "flash" memory has been specified, an erase cycle will be performed
                  To disable this feature, specify the -D option.
avrdude-original: erasing chip
avrdude-original: reading input file "DVMEGA_HB_V317_UNO.cpp.hex"
avrdude-original: input file DVMEGA_HB_V317_UNO.cpp.hex auto detected as Intel Hex
avrdude-original: writing flash (31172 bytes):

Writing | ################################################## | 100% 6.09s

avrdude-original: 31172 bytes of flash written
avrdude-original: verifying flash memory against DVMEGA_HB_V317_UNO.cpp.hex:
avrdude-original: load data flash data from input file DVMEGA_HB_V317_UNO.cpp.hex:
avrdude-original: input file DVMEGA_HB_V317_UNO.cpp.hex auto detected as Intel Hex
avrdude-original: input file DVMEGA_HB_V317_UNO.cpp.hex contains 31172 bytes
avrdude-original: reading on-chip flash data:

Reading | ################################################## | 100% 5.06s

avrdude-original: verifying ...
avrdude-original: 31172 bytes of flash verified

avrdude-original: safemode: Fuses OK (E:00, H:00, L:00)
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe

avrdude-original done.  Thank you.

strace: |autoreset: Broken pipe


If not, try hitting the reset button on the Arduino UNO a few times or removing the USB cable completely and reinserting it before running avrdude again.

Returning the chips to their relevant device

You should now be able to unplug the UNO, remove the chip and place it back into the DVMega using the same process as above.

Remember the orientation,  the 'notch' and the 'dot' on the UNO should be furthest away from the USB connector, and on the DVMega they should be furthest away from the GPIO header socket.

Now the chip is flashed and back where they should be, you should be able to stick the DVMega back on your Raspberry Pi or BlueStack and use it as you were before.

Acknowledgments


  • G0WFV - Wrote a blog post that inspired this one 
  • PE1PLM - DVMega Creator



73!

30/08/2017

Using the ZTE MF190 3G dongle with a Mikrotik Router

3G Dongles suck. Or maybe Linux support for 3G dongles sucks. Either way, if you're hoping to accelerate your hair loss, I can recommend attempting to setup a 3G dongle with a Linux based device.

This brief guide will cover setting up the ZTE MF190 modem with a Mikrotik router.

18/08/2017

Flashing a bootloader on to an STM32 'Blue Pill' using a Raspberry Pi

I am currently preparing some STM32 'Blue Pill' Microcontrollers for use with an Amateur Radio project. From the factory these appear to arrive without USB support, so before we can flash any firmware over USB you must first flash a new bootloader over the UART interface.

I used a USB to Serial adapter set to 3.3v, but you could use the Raspberry Pi's UART if you wish. Remember, if you're using the Raspberry Pi 3 you will need to disable the built in bluetooth and TTY running on the UART first.

13/08/2017

Hidden London: Highgate wilderness walkabout

It's no secret that I'm a big fan of the London Underground. To be clear, I don't consider myself a true anorak as I can't tell you the exact diameter of the wheels on an S Stock Car or the top speed of a fully laden A stock train, but I have an appreciation of the infrastructure and history of the Underground.

Having attended Hidden London tours of Aldwych, Euston and riding the Metropolitan No. 1 steam locomotive between Watford and Chesham, I grabbed some tickets for the newly announced 'Hidden London: Highgate wilderness walkabout' tour as soon as they were released.

My wife and I attended the tour today and both left a little disappointed, primarily due to the cost of the event - £31.50 each. Perhaps we had misguided expectations, however in comparison to Euston and Aldwych (£36.50) and the steam train (£20.00) which were all all fantastic experiences, the pricing seems a little ambitious.



If you plan on going on the tour and don't want any spoilers, stop reading here! However if you're not planning on going or are now having second thoughts and want to know a little more about our experience, read on.