Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Saturday, January 24, 2026

Custom Linux Image Build Using Yocto on WSL

When your Single Board Computer (SBC) is connected to specialized hardware, building an optimized Linux image with Yocto can be advantageous, as it produces a highly customized, reproducible, and lightweight system. To save time setting up the environment for building a custom Linux image, you can use a Yocto Docker container in combination with WSL.



Friday, April 1, 2022

PCA9535 GPIO Expander

PCA9535 is a GPIO expander with 16 IO lines which has I2C bus interface. It provides additional IOs for I2C bus master such as SBC or MCU that can be used to read push button or sensor, to control LED, etc. PCA9555 is identical to PCA9535 except the presence of internal pull-up resistor which increases power consumption when the IOs are low. PCA9535C is another variation of PCA9535 with open drain outputs. Its operating supply voltage range is 2.3V to 5.5V. There are 3 hardware pins which allow to use 8 different I2C bus addresses, from 0x20 to 0x27.


Friday, September 17, 2021

V4L2 Capturing as Bitmap Image

V4L2 (Video for Linux 2) consists of drivers and API for video capturing on Linux [1]. In this article, we will discuss about using the library and analysis of video capture example. There are utilities for controlling media devices on Linux called v4l-utils [2]. We will explore about using and testing webcam with them also.


Sunday, April 5, 2020

Using Orange Pi

Orange Pi is a cheap alternative to Raspberry. They can be bought at their online store Shenzhen Xunlong at Aliexpress. There are many Orange Pi models. For example, Orange Pi One costs only ~USD 10. Another model called Orange Pi PC Plus even has 8 GB eMMC onboard and costs ~USD 25 only.


Figure. Orange Pi One





Wednesday, January 29, 2020

Linux Device Driver on Raspberry Pi

In this article, I would like to discuss developing a IO device driver for Linux. Although, I use a Raspberry Pi as an example, it should work on other Debian based Linux systems too.


Friday, November 23, 2018

Using Parallel Port on Linux with C++

Example programs for using parallel port on Linux [Lin15a,Coo08a], and a C++ class library can be found at the following link.

https://github.com/yan9a/cecpp/tree/master/parallelport


Figure 1. wxWidgets example using paraller port as digital output and input.


Thursday, November 22, 2018

MySQL Connector/ODBC 8.0 on Linux

Oracle's MySQL server can be connected and used with ODBC driver in a similar fashion that we have discussed for Microsoft's MsSQL server in the previous post. For that, we will use the latest MySQL Connector/ODBC 8.0 driver by building and installing it from the source.

Therefore, the procedure can be used for various SBCs with different architectures. An advantage for this approach is that we can use the same C++ code for both MsSQL server and MySQL server just by changing the DSN. At first, following tools need to be installed in the machine.
sudo apt install mysql-client libmysqlclient-dev
sudo apt install unixodbc unixodbc-dev
sudo apt install libgtk-3-dev cmake
sudo apt install libssl-dev

Monday, October 22, 2018

Using MS SQL Server from C++ with wxWidgets



Using SQL Server with ODBC, C++, and wxWidgets

In this article, we will discuss about using MS SQL server with ODBC API from C++ program. [Eas18]. Thereafter, we will create a class module that connects to SQL server and use it with an example wxWidgets GUI application. For Unix and Linux machines, FreeTDS and ODBC need to be setup as discussed at the following link.

Using Microsoft SQL Server from Linux Machines with ODBC & FreeTDS
(http://coolemerald.blogspot.com/)


Friday, October 5, 2018

Using Microsoft SQL Server from Linux Machines with ODBC & FreeTDS

FreeTDS is a set of libraries for Unix and Linux machines to use Microsoft SQL server and Sybase databases [Fre16]. FreeTDS C libraries are free, opensource, and distributed under GNU LGPL license. In this article, I will discuss about using MS SQL server located on a Windows machine which is installed using mixed mode authentication. The MS SQL server must be configured to allow remote connection with TCP/IP using username and password. That MS SQL server is to be connected and used from a Linux machine using FreeTDS.

MS SQL server is a result of cooperation between Microsoft and Sybase. Therefore, their SQL servers are quite similar and the communication protocols are almost identical. That protocol is called Tabular Data Stream (TDS). The project for open source implementation of TDS is started by Brian Bruns and it is called FreeTDS.

Thursday, October 4, 2018

MySQL Connector C++ 8.0 with wxWidgets

Let us discuss about using MySQL Connector C++ 8.0 with wxWidgets. Details about setting up and using wxWidgets, and MySQL server and connector can be found at the following links.

ceMySQL.h Cross-platform C++ programming with wxWidgets

Using MySQL Database with C++ on Various Platforms Including ARM Single Board Computers

For this example, by using MySQL Workbench, we will create a database called 'mytest' and a table called 'mytable' in the MySQL server that is to be connected and used.


Figure 1. Creating a database 'mytest' and a table 'mytable' using MySQL Workbench.


Monday, November 20, 2017

OpenCV on Linux using g++, CMake, Qt, Code::Blocks

  1. Introduction
  2. Using GCC ၊ CMake
  3. Using Qt
  4. Using Code::Blocks
  5. References

Introduction

To install OpenCV on your Linux machine, you need to have the following packages as prerequisites [Ope17g].
  • GCC 4.4.x or later
  • CMake 2.6 or higher
  • Git
  • GTK+2.x or higher, including headers (libgtk2.0-dev)
  • pkg-config
  • Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)
  • ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev
  • [optional] libtbb2 libtbb-dev
  • [optional] libdc1394 2.x
  • [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev, libdc1394-22-dev
To install the required packages, you can enter the following commands in terminal.

Wednesday, May 31, 2017

Programming serial port in C++ for Windows, Mac and Linux

I have developed a class library 'ceSerial.h' to use serial port (com port) on Windows, Mac and Linux. This cross-platform 'ceSerial' class is written in C++ and we just need to include "ceSerial.h" in your source code in order to use it. A simple example for C++ console program using the class is demonstrated. The source code can be found at

https://github.com/yan9a/serial


Figure. A wxWidgets GUI application using 'Serial' class with Visual Studio 2017