An alternative to the Raspberry Pi 3
C Applications
Programming in C is fairly well documented, and an ODROID "C Tinkering Kit" is sold separately. The WiringPi library is used in C applications. Listing 3 is a C version of the Python code in Listing 2. It is important to note that these two examples talk to the same physical pins, but the C WiringPi library uses the ODROID-C2 wPi numbers, whereas the Python RPi.GPIO library uses the Pi BCM numbers.
Listing 3
led.c – Read/Write Example
To compile and run the program in Listing 3, enter
$ gcc -o led led.c -lwiringPi -lpthread $ sudo ./led
in a terminal.
A Streaming Video Server Example
The ODROID-C2 does not have a camera serial interface (CSI) port like the Raspberry Pi, but you can use generic USB webcams. I built two identical video servers using Lego Pi cases and some added Lego blocks to secure the USB webcam and cables (Figure 5).
Some good video server software options are available. I like to use motion
, because it is super-easy to set up. To install it, enter:
sudo apt-get install motion
Once motion
was installed on both my RPi3 and ODROID-C2, my goal was to try and run both systems at 800x600 resolution with 24 frames/second (fps) refresh and see how the performance varied. For this setup, I edited some parameters in /etc/motion/motion.conf
(Listing 4).
Listing 4
/etc/motion/motion.conf
To run the video server, enter:
sudo motion
The motion
package has a built-in web server that you access at http://<your_ip>:8081 (Figure 6).
The RPi3 had issues trying to stream 24fps, and the video would often freeze up. The faster specs of the ODROID-C2 allowed for near perfect real-time video streaming. To get a quick check on the differences in performance, I used the vmstat command-line tool on the RPi3 and ODROID-C2 (Listing 5).
Listing 5
Performance Check with vmstat
The ODROID-C2 was running at 97% idle time (id) compared with the Pi's 74%. Probably one of the biggest performance differences was the time the CPU was waiting for I/O (wa, 18% for the PI compared with 0% for the ODROID-C2). The ODROID-C2 was the clear winner as a live-streaming video server.
Summary
Being able to reuse some of my Pi cases and prototyping HATs with the ODROID-C2 was nice. As a Pi user, I found that coding in C, Python, and Node-RED on the ODROID-C2 was fairly easy, although with many limitations compared with the Pi platform. The ODROID wiki had key product documentation, but it was nowhere near the incredibly rich documentation that exists with Raspberry Pi modules.
Some excellent Python libraries and Pi hardware add-ons that support a variety of sensors and I/O applications might or might not work with the ODROID hardware.
During the development cycle of a project, it is nice to have a fast interface, but typically my final projects do not need any high-end processing, and they can often run on Raspberry Pi 1 modules. For now, I would stick to a Raspberry Pi for GPIO/hardware projects.
I enjoyed playing with the ODROID-C2. For projects requiring higher performance, such as video servers and graphic or web applications, the ODROID-C2 module is definitely worth considering.
Infos
- ODROID website: http://www.hardkernel.com
- ODROID wiki: https://wiki.odroid.com
- Node-RED: https://nodered.org
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.