Single Board Computer projects. (and other fun stuff)

Hi all. Decided to try and start a talk on fun stuff we did with SBCs such as RaspberryPi, BananaPi, OrangePi and other FruitMathematicalConstants.

A little project I went through recently is a home NAS based on Orange Pi PC2.

The choice of the operating system was kind of a no-brainer, as the board is incredibly new and locating OS image that works at all quickly turns into an adventure. After exhausting all options of getting the image from the official site (google drive links not working, my perfect inability to understand chinese on Baidu cloud) i managed to download a working Debian Xenial image from the forum that works.

A fair warning for anyone who intends to play around with this SBC. If thereā€™s no bootable image on the SD card, the board will not indicate in any way itā€™s operating. LEDs on the PCB are off and you are convinced you got a damaged board.

The choice for storage media was 500Gb Samsung SSD disk i had lying around with SATA-USB bridge. The concern here was less speed (a bit more of that later), but lots about power consumption. While I was able to connect an old laptop spindle to OrangePi usb port and it work and mounted in Linux with usage it was becoming unstable, often unmounting on its own or disappearing from the system completely.

A configuration of Samba also managed to surprise me, as it turned out they deprecated a lot of functionality since the last time I played with it. (the lovely and effective security = share option does not work anymore, you have to go with security = user and force bad user to file owner).

Overall I got it working and after a couple of days of testing Iā€™ve also put up a quick rack for it, as pictured below.

As you can clearly see, the security is provided by Wolverine, which makes everything twice as secure half of the stuff available off the shelf.

When it comes to the performance, for now Iā€™m reaching roughly 4-5 Mb/S download/upload times which is good enough to stream inside my network to RasberryPi with OSMC and Kodi thatā€™s currently doing HTPC duty by the only large screen we have in our apartment.

Iā€™d say overall it was a fun Saturday project that serves some practical purpose and was indefinitely more interesting than just buying something and putting it on the shelf.

PS. I refrained from specifying the configuration of linux and Samba too much, as apart from some minor kinks it was as easy and straightforward as humanly possible,

4 Likes

Very cool - thanks for kicking this off!

Quick question: how would you describe the differences and benefits between the different types of Pi (and other makers computers)?

What are you mainly using it for?

Would love to see what other people are doing with these kinds of projects. Be sure to share (with pictures!)

Ya. Some sort of summary of these SBCs (do things such as the CHIP also count?) would be useful ā€“ Iā€™m personally not up to date enough to know the differences between them, and what each is good at. I mean, is the orange pi a rival to the raspberry pi made by a different company? Or is it something not actually designed for the same use cases at all?

At home I have a Raspberry running a Wiki for my own documentation and a NextCloud for the stuff I donā€™t want to have on an Internet connected server.

At work Iā€™ve created a thing to measure the power consumption of our company, also based on a Raspberry. It uses these transformers.
Hereā€™s a diagram:

Current is measured through ADCs (Analog-Digital-Converter) connected via IĀ²C to the Raspberry. It runs a little web-server to show the measured data.

2 Likes

Iā€™d say RaspberryPi is for solid or a bit more demanding applications, also the most expensive of those (yet still surprisingly cheap). Orange Pi is a knockoff, similar to RasberryPi, yet different when it comes to particular hardware (cheaper Allwinner CPU, etc) and itā€™s produced by Shenzhen Xunlong. As for now itā€™s my first attempt at doing something from it. Iā€™m more familiar with Raspi.
When it comes to OrangePi and BananaPi they are fighting for the same niche as RaspberryPi, mostly with price, but at least for now not in software support (as mentioned in the original post it was find to get software for it).

When it comes to CHIP it strikes me more as a competitor for RaspberryPi Zero or OrangePiZero.

For now I only have RaspberryPi 2 running OSMC and Kodi (working as HTPC basically) and OrangePi running SMB NAS (thatā€™s the one in the post). I also did a small solution for punching in and out a old worklplace, but it was both boring and Iā€™m not sure how much Iā€™m actually allowed to talk about it, but it was 3 RaspeberryPis B+ (one for each entry point) with minimal Linux, Python and connected RFID readers talking to a virtualized SQL server. Luckily i had a lot of help from some devs in house when it came to database.

My further plans, when it comes to NAS is most likely setting up an OpenVPN instance there. Didnā€™t do it yet as Iā€™m uneasy about forwarding any ports on my home router for fun.

Thatā€™s basically the same use Iā€™m making of my OPi -wiki and with basic SMB instead of NC. How does NextCloud instance work there, and which RaserryPi are you using?

Did you do anything to mitigate a danger to SD card (such as writing logs to external storage or disabling them)? I had a friend who killed his SD card pretty fast with some more complicated server software due to constant abuse of read/write by logging.

A well known hack for lowering logging read/writes is to specify the logging directory to exist in RAM only. On Linux this can be accomplished by entries in /etc/fstab for example:

cat /etc/fstab
# <file system> <mount point> <type>   <options>                                       <dump> <pass>
...
tmpfs           /var/log       tmpfs   defaults,noatime,nodiratime,size=512M,mode=0777 	0      0

Iā€™m uneasy about opening ports too. I have a Pi running a local site with to-do lists, shopping lists, diary etc.

TBH I could probably get away with a white board suck to the fridge door but this is a reflection of the fact I am a geek or nerd (which of any of these terms should I be admitting to, if either?).

Thatā€™s the way i have it set up on RaspberryPi. When it comes to OrangePi Iā€™m logging to the disk for now.

I think itā€™s the name of the game with maker movement and Linux in general. You do it because you can and it brings in fun, even if a whiteboard would do the job.

Making a photobooth with my brother for his wedding ā€¦ So far itā€™s based on raspberry pi ā€¦Picam and python.

I did a test run and it looks like this

4 Likes

Ah. I see what youā€™re saying, but I think youā€™re more invested in this than me, so I donā€™t know what to pick, here.

Take an example. Letā€™s say I wanted to build a photo booth, like @Mike_Hingley has described, above. Or as a more personal example, wanting to build a music player which can plug into a TV and have all the music stored on it and be controlled by a phone app. How do I know which of the zillion single-board-computers to choose? Do I choose a pi zero and add stuff to it, or a CHIP and add stuff to it, or a Pi 3, or a Banana Pi 3, or a Beagleboard, or an Orange Pi, or what? I donā€™t know how to make that determination, and I donā€™t know where to find out how to make that determination without learning about all the SBCs on the market and thatā€™s just Too Much Work. How does one decide? Why isnā€™t there some website where I can select what I want and it says ā€œhere are the five things that are good at what you want, with prices and a list of things youā€™ll need to do and know about to choose between themā€ to help me?

1 Like

I use an Odroid (www.hardkernel.com) at home as a file backup server (running NextCloud) for the media content on my phone which runs FolderSync to automatically syncs certain folders when it detects my home wifi.

Although there isnā€™t AI to automatically categorize my images (Iā€™m working on this) yet, it does allow me to save content in whichever format I want. I also run a cron job to periodically compress and encrypt files which I upload to the cheapest cloud storage services I can find.

It also doubles as a personal digital journal which interfaces through Wordpress. Running ngnix with php-fpm stack seems to provide sufficient performance.

1 Like

I have a Raspberry P 2 Iā€™m planning on using as an MQTT broker/Node-Red server/mongodb server inside my network while I tech myself some IoT stuff. Do you think I could use your NAS approach on top of that to breathe some new life into an old external USB hard drive I have lying around?

Thanks

That is really cool. If you could share more about how this works, that would be cool.

Sure - Itā€™s all based on a template.

A template is an inkscape svg file, which contains embedded images - it doesnā€™t matter what those images are, they will be replaced with images taken from the ā€˜cameraā€™). All that matters is that the images are the right aspect ratio. Typically I used a photo of an eagle, but itā€™s probably a good idea to take a photo using the camera and use that instead.

I use the term ā€˜cameraā€™ because the system allows dynamic loading of a suitable python class, meaning that if you want you can run this on a laptop and use a webcam, or you can use a pi camera module (currently I have a WebCam module, a PiCamera module and a Fake Camera module - which just uses that same picture of an eagle)

You can store these images on a layer called ā€œphotosā€. This means that you can use pictures as backgrounds (the wood effect is a picture) without the system trying to replace it with a photo.

The main code is written in pygame and it loads more SVG files - these are UI screens, Pressing P (or a button connected to GPIO) tells the system to take photos. We have another button that will quit the program (and i think shut the pi down)

The code loads up the template and looks for all images in the Photos layer. It extracts some photo metadata from the photo. That metadata includes a ā€œpreen phraseā€ -ā€¦ something to print onto the screen like ā€œSmileā€ā€¦ etcā€¦

  • The system then takes all of the photos required for the template.
  • The system then converts each image into a Base 64 encoding of the image and inserts it into the template, replacing the temporary image with the image taken.
  • The new SVG file is written to a photo folder (timestamped) along with all the source photos.
  • The template with its new images is then saved to a png,

so now our photo folder contains:

  • 4 (or however many images are required for the template)
  • SVG template (with images set)
  • PNG representation of the SVG

it then :

  • tweets the PNG file using tweepy and whatever hashtag you set up in configuration
  • prints the PNG file to whatever printer you have set up in your configuration

The project is set to

  • Build using travis-ci (not that thereā€™s much to build), but it packages the project as a .deb file for easy installation onto a Raspberry pi
  • Runs the code through Codacy to see where thereā€™s problems with code quality (and there are at the moment - mainly because the code still contains some of the proof of concept code)
  • Builds its documentation using readthedocs.io
  • And for bonus points, I also run the code through sonarqube (https://sonarqube.com/dashboard?id=titaniumbunker.selfietorium)

I wrote up some / most of the configuration for this on my blog :

Not being a ā€œwood workā€ guy - we roped in our Dad to help create an enclosure for the whole thing.

That large hole in the front of the box is where the screen will go that will allow subjects to see how theyā€™re framed. Thereā€™ll be a slot at the side for photos to come out.

3 Likes

I think easily, the only issue you might encounter is the power consumption. RaspberryPis do not output fumm 500mA typical for USB 2.0, but only about 200mA. In other words, you will not encounter any issues if your disk is externally powered, or does not consume much electricity. Or you can buy one of those split cables that allows you to connest to 2 USB ports at once.

With the music player Iā€™d use OSMC with Kodi and any compatible board, so avaliable funds would be actually a deciding factor. Kodi has a lot of good remote apps for android and ios, and it works great on OSMC. I donā€™t know much about music playing though and Iā€™m like 42% sure someone could bring in a better home solution in the comments.

A recent ubuntu podcast had an email from a guy with an absolutely bonkers list of all the things he used a pi for in his home. It must have been close to two dozen of them doing a variety of jobs.

On the ā€œwhich board to useā€ front, the Raspberry PI has the huge community - someone has probably already done what you want to do. You can get support and software is being maintained for it - you arenā€™t stuck on a single precise kernel version for example. I donā€™t think either of these hold true in the same way for others, so itā€™s a big pull.

1 Like

I think a PI is ideal for this sort of thing in the home.

Iā€™ve been using a Raspberry Pi as a media centre for years now and fairly recently upgraded my dear old Model B to a Pi3.

I have two hard disks providing storage and an old PC PSU powering them. Iā€™ve grabbed one of the 5V lines and wired it to a USB connector to power the Pi. Annoyingly it doesnā€™t hold a consistent 5V so the Pi frequently complains of the voltage being a bit too low for its tastes. Iā€™m considering looking into stepping down one of the 12V lines to 5.5V or so to see if that solves the problem. Not a clue how to do that yet, admittedly!

This leaves me with an original Raspberry Pi Model B that Iā€™m considering running Pi Hole on. Alternatively I might set it up at the in-laws place in Sweden to act as a VPN. Undecided as of yet!

I also own a Pi Zero that Iā€™d like to use to build a podcasting tool. Something to play samples (and ideally record them) for things like intros, outros, and so forth. On the plus side Iā€™ve been doing a lot more soldering lately and am approaching the skill level of ā€œincompetentā€.

Now if only I could understand what purpose resistors serve in a circuit!