In this blog post, we delve deep into the intriguing concepts of I2S audio and DMA, particularly focusing on parameters like dma_buf_count and dma_buf_len. We explore their roles, ideal values, and the impacts they have on aspects such as CPU load and latency. We also discuss the limitations that come hand in hand with these parameters. This post aims to provide you some insights on trading-off between latency, CPU load, memory usage and the overall buffer space allocation. However, the primary takeaway remains that the optimal configurations largely depend on individual context and application needs.
20 April 2021
This blog outlines the absolute fundamental elements that any competent team needs to ensure smooth operations. It emphasizes the importance of continuous integration, continuous deployment, running effective unit tests, comprehensive code reviews, and the ability to run the system locally. The objective here is not to over-complicate procedures, but to streamline consistent quality through these five basic yet crucial practices which when implemented should mark an effective team.
26 November 2020
This post provides a comprehensive guide to building a do-it-yourself (DIY) Alexa using an ESP32 and Wit.ai. It illustrates how to create a wake word detection system, use Python for machine learning and employ TensorFlow for the 'wake' word identification. It also covers the usage of Wit.ai for intent recognition and managing commands. The post is fully backed with code snippets, examples and video tutorials to deliver an interactive learning experience to readers.
15 October 2020
In this blog post, I've delved deep into the world of audio input for ESP32, exploring all the different options for getting analogue audio data into the device. After discussing the use of the built-in Analogue to Digital Converts (ADCs), I2S to read ADCs with DMA, and using I2S to read directly from compatible peripherals, I go on to present hands-on experiments with four different microphones (MAX4466, MAX9814, SPH0645, INPM441). This comprehensive look at getting audio into the ESP32 should be a valuable resource for anyone hungry for a deep-dive into ESP32's audio capabilities, complete with YouTube videos for an...
12 September 2020
In this blog, I venture beyond binary classification and delve into categorical classification using TensorFlow. Specifically, I show how to generate and classify images into four categories: blank, square, circle, and triangle. Crucially, I highlight the use of one-hot encoding for labeling and the softmax activation function in our model. I provide examples of code, results of my model's predictions, and link to the full code in my GitHub repository. Feel free to try it out and explore this exciting domain of machine learning further.
06 September 2020
In this playful tutorial for binary classification aided by visuals, we create a Python generator that generates alternating images of squares and circles, which we then classify using TensorFlow. We take special care to point out, too, that to get binary classification up and running, we must use a particular activation function and loss function. After training our model, illustrations show that it's excellent at identifying images as either squares or circles. So, if you're into Machine Learning and has a sense of humor, don’t forget to check out the 'hot dog or not hot dog' bit and visit the...
06 September 2020
In this post, I reminded myself about some peculiarity with TensorFlow's tf.random.shuffle. I assumed that using the same seed for two shuffle operations would always output the same results but turns out, I was wrong! I discovered that I need to set the global seed with tf.random.set_seed() before every operation to get consistent results. Definitely a lesson learned to pay a bit more attention to TensorFlow's well written documentation about seeds usage for random operations.
04 September 2020
Logging errors and exceptions are often the bare minimum folks set-up but hey, it's time we optimized this! We need log trails that allow us to follow the code - the 'happy path'. Why, you ask? To be able to trace user reported bugs, have a visual of where the code went rogue and save tons of debugging time. Next time you set up your logging system, remember these words of wisdom.
28 August 2020
Today, we dissected a classic programmer joke about the stages of debugging and why we find it funny while it reflects a dire situation. We pondered why our first instinct is to dismiss a bug, dug into invalid claims about machines, and appreciated the shift from denial and blame to accepting responsibility and finding solutions. After deconstructing the old stages of debugging, we reconstructed healthier, proactive stages with prime focus on problem-solving. Next, we explored different types of bugs from easy user interface bugs to the complex Heisenbugs. Lastly, I highlighted logging, debuggers, and good old human brainpower as instrumental...
25 August 2020
This blog showcases the progress of my idea to create an augmented reality Sudoku solver using technology that enables us to solve puzzles in our browser rather than with dedicated apps. I have developed an AR Sudoku solver with a simple image processing pipeline. It identifies and extracts Sudoku puzzles from pictures, recognizes each cell's numbers, solves the puzzle, and renders the solution on top of the original image. This process is accomplished by converting the image to greyscale, conducting thresholding, OCR-processing, and puzzle-solving. I've also done parallel image location and extraction. It's a technical journey that's achieved some high-quality,...
25 July 2020
I've successfully used addressable WS2811 LED strings and an ESP-CAM board to create an adjustable lighting system. The best part is that the image processing code can be duplicated in JavaScript which allows you to use a plain dev board to drive the LEDs instead of needing a camera on your ESP32 board. If you want to replicate this project, you'll need your own ESP32 dev board and some addressable LEDs. After figuring out the location of each LED in 2D space, it's easy to map from each LED's x and y location onto a pattern you want to show...
05 June 2020
In this technical tutorial, we walk through the process of wiring up the iPhone's camera to CoreML using Vision Kit, allowing us to run machine learning models against the camera input. We outline the necessary steps in creating a new Xcode project; capturing video frames; using AVFoundation, Vision, and CoreML; and dissecting the video frames using Vision magic. We also illustrate the process of running our Vision requests and displaying the expected outputs.
22 June 2017
In this post, I discuss how running Elastic Beanstalk on small instances may lead to memory exhaustion, particularly when deploying applications that rely on gems with native extensions. To combat this, I suggest adding swap to the instances, providing a file and code as a solution to the memory issue.
04 June 2017
This blog post walks through setting up a worker environment on Elastic Beanstalk and using SQS as our Active Job queue, using the active-elastic-job Gem. We start by creating a new queue in our AWS account via Simple Queue Service. Then, we provide our Elastic Beanstalk environments access to the queue and add an AWS_REGION environment variable. We proceed to creating and configuring our worker environment. In our Rails app, we instruct Active Job to use our active-elastic-job queue adapter and create an Active Job. Finally, we deploy our changes to both the web and worker environments, ensuring our ActiveJobs...
21 May 2017
In this post, we explore a solution to the challenge of running the Rails console against a PostgreSQL database housed in a private subnet for security reasons. While it's a good security practice, it can limit access for bootstrapping users or debugging issues. By tunnelling through a Bastion server, we can establish a connection to the database as if it was running locally. We walk through code examples of SSH tunneling, database connection, and how to run Rails console. A key point is to ensure the Bastion server is shut down after use.
21 May 2017
In this blog post, we look at how to connect .NET Core's Web API with PostgreSQL on a Mac platform. We go through step-by-step instructions including setting up a new .NET project and creating a Web API, installing and using dotnet command line, installing required packages, setting up a PostgreSQL database, configuring the .csproj file, creating and integrating a database connection, and defining test entities and required methods for our API. The post also guides through the process of using the API to create, retrieve, and delete database entries. Overall, it shows how Microsoft is making strides in allowing cross-platform...
14 May 2017
This blog provides detailed steps and configurations on setting up an application using Action Cable feature in Rails 5. It talks about setting up proper environment for the application to run and includes using both PostgreSQL and Redis as backend services for the ActionCable. The blog also shares troubleshooting commands in case of any issues encountered during the setup. Built on top of WebSockets, Action Cable was first announced at RailsConf 2015 and now a substantial part of Rails 5 providing real time communication with backend server.
11 May 2017
In this post, we successfully set up a custom domain name for our Elastic Beanstalk environment and secured it using SSL. By creating a CNAME or an ALIAS pointing at our environment URL (found on the dashboard screen), we made our app accessible via the new domain name. We then used AWS Certificate Manager to add SSL to our environment for access over HTTPS, which was confirmed by visiting the secured site. Now we have a Rails application that can not only be deployed by a CI server, but is also SSL secured with a custom domain.
07 May 2017