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)