Saturday, April 25, 2020

oDroid C2 CUPS Print Server - Samsung SCX - Ubuntu 18.04 Minimal

Since we're stuck working from home, my wife and I are getting more serious about our "home office" layouts.  One thing I'd had on my "to do" list for awhile was configuring up some non-network printers to be shared via the network.  While some of this was easily solved by simply having them near another computer (impossible not to be near a computer in MY office), for other areas another solution was needed.

I had some Raspberry Pi 3b's and oDroid C2's left over from a project awhile back, so I flipped a mental coin, picked up the board that was marginally closer to me and went about setting up a print server on the oDroid C2.  However, there are similar configurations of course for the RPi.

Sunday, July 16, 2017

Arduino Loader Project

Hardware: Raspberry Pi 3 B, Adafruit Feather 32u4, 10,000 mAh extended cell battery, 3 button membrane

Software: Windows 10, Platformio 3.4.0, mpg321, Rasbian Jessie Lite, Python 2.7.9

I needed to create a method for "less-trained" staff to reload Arduino boards in the field.  I considered doing something with Android but immediately had several users ask "what about iPhones?!"  So I decided that I'd just build a unit to allow for a more controlled environment.

The result is a handheld Raspberry Pi that the techs can walk around with 


Sunday, April 2, 2017

Arduino Interrupt on Button Press

Hardware: Adafruit Feather 32u4 Radio (RFM69HCW)

Software: Arduino IDE 1.8.1.0 / Windows 10

I can't properly describe how I feel about the documentation on "interrupts" on Arduino.  Even if you don't get into "pin change interrupts" (i.e. NOT THE SAME THING!!!)  it still isn't straightforward.  Add in the fact that the reason you might be looking to handle an external interrupt is because you probably want to put the unit to sleep and now the levels of complexity are notably higher.

I have implemented a fairly simple solution to get past the issues commonly encountered and included it below.  This all revolves around a board going to sleep indefinitely and then waking up on a button press.

Friday, March 17, 2017

A basic 900mhz network (client/server)

Hardware: Adafruit Feather 32u4 Radio (RFM69HCW), Raspberry Pi 3 Model B

I've been building a wireless/wired sensor setup which I thought I should document as a pretty handy basic design for almost any basic wireless project.

Essentially this is taking some of the Adafruit Feather 32u4 900mhz (915/868mhz actually) boards and associated radios to connect to various sensors, buttons, etc. and bring all of that back home to a server that eventually processes everything.  I could have done a very similar design with one of the Moteino boards.

Battery voltage check function on Arduino Feather 32u4

Hardware: Adafruit Feather 32u4 Radio (RFM69HCW)


The folks over at Adafruit have done a nice job with some aspects of documentation on these boards.  This is one of those items that they've documented well, but I find just annoying that they don't drop it in as a simple "best practice" kind of thing.

So here it is!

This is a function you can drop into your code anywhere and get results on the battery voltage on any of the Feather 32u4 devices.

Thursday, March 9, 2017

Connecting two Pis (or other boxes) directly via TCP/IP without a webserver

Hardware:  Two Raspberry Pi 3 Model B's


Software: 2017-01-11 Raspbian Jessie Lite (minimal) / Python


Sometimes you just need something simple.  

In fact, sometimes the layers of possibilities included with webservers and other high-level communications methods are not exactly a benefit.  In particular, when you're dealing with very basic inter-system communications that are more about keep-alive and simple status messages, larger libraries/methods sometimes come with more burdens than benefits.  This is where socket connections can be applied.

Monday, January 23, 2017

RFM69HCW/LowPowerLab SendWithRetry function

Hardware: Adafruit Feather 32u4 Radio (RFM69HCW)

Software:  Windows 10, Arduino Sketch App 1.6.11, LowPowerLab

One minor issue I ran into when testing with the ~900mhz RF radio chips the first time was getting the units to retry failed transmissions.  I had chosen to download/utilize the LowPowerLab RFM69 functions to enhance and simplify many of the radio communications methods.  

I initially made the assumption (as most would) that the examples which used sendWithRetry were essentially correct.  And while that is true-ish (in that they work) it is not true that they are showing you the full power of that function.

Sunday, January 22, 2017

Better way for beginners to sleep or delay on Arduino

Almost every single Arduino example includes a simple line similar to the following:
  • delay(1000)
It is primarily because folks seem to go with a simple one-line solution when focusing on other tasks.  But this continuously leads to the bad practice of beginners on using the Delay() function across the board for anytime they want to "sleep" for X seconds.  While there definitely are situations when you want to use this for the most part you just shouldn't.  Here are some times you would still use delay():

Tuesday, December 13, 2016

AdaFruit Feather 32u4 / RFM69HCW Setup

Hardware: Adafruit Feather 32u4 Radio (RFM69HCW)

Software:  Windows 10, Arduino Sketch App 1.6.11

The two Feather 32u4 units/batteries next to an oDroid C2

I picked up a couple of these to test for a long distance heartbeat style application to use in a more industrial/retail environment.  I'd done a bit of testing with some components and finally just stepped back and decided to test directly with a board off the shelf and then see if I wanted to dig down into something simpler.  I'm sure glad I did.

Tuesday, November 1, 2016

Raspberry Pi 3 cost-effective multi-unit build

Hardware: Raspberry Pi 3 Model B / SanDisk Ultra 8GB

At present, I am doing a workaround of a customer networking requirement and needed to spin up a good number of Raspberry Pi 3's to get around the issue (non-broadcast or hidden SSID).  Since I had to move quickly and wasn't able to order very large quantities, I needed some mid-range volume discounts to cover the increase in costs to cover the short-term technical issues.  I also needed to use a board that I knew would work.

Fortunately, Amazon and Alibaba have saved me once again.

Monday, October 31, 2016

MediaTek LinkIt Smart 7688 Duo - First Application

Hardware: MediaTek LinkIt Smart 7688 Duo

Firmware: 0.9.3

Software: Windows 10 / Putty

The documentation from MediaTek is both wonderful and horrible. It is wonderful in that there seems to be a lot of it. It is horrible in that there are glaring holes in it and lots of errors.

To get your first application running you'll need to first follow the instructions I laid out in my other post on setting up your development environment here.


The first application in their documentation shows how to send data to the Arduino side of the unit from the Python side.  It uses a serial connection to pass a 1 or a 0 over from the Python side to tell the Arduino side to turn an LED on/off.  While this is very basic, it is a good outline of how this board is intended to be used.  Do the higher-level decision-making and external communications on the Linux/Python side and then let the low-level manipulations happen on the Arduino/C side.

oDroid C2 GPIO Setup

Hardware: oDroid C2 Rev0.2 20151218 / SanDisk Extreme SD

Software: Ubuntu 64 16.04 Minimal (ubuntu64-16.04-minimal-odroid-c2-20160815)

As embedded projects tend to go, a new requirement popped up and forced me at the last minute to throw out an Arduino solution and replace it with one of the oDroid C2's and SanDisk Extreme SD cards (https://www.amazon.com/gp/product/B00M55BX3G) I have on the shelf for another project.  Of course this also meant rewriting every stinking piece of code in Python vs. C.

The last minute time crunch meant that I wasted precious hours reading piecemeal discussions on how to get simple pin I/O working on the oDroid series of boards.  Now that the fire is out, I drafted up the following instructions below for future reference.

Sunday, October 30, 2016

MediaTek LinkIt Smart 7688 Duo Development Environment Setup

Hardware: MediaTek LinkIt Smart 7688 Duo

Firmware: 0.9.3

Software: ColaSoft MAC Scanner / Putty / Arduino Sketch

You'll need to mounts this to some kind of PCB eventually

Getting this board working is mostly about fixing the gaps in their instructions.  Here's a quick start guide:

Thursday, October 27, 2016

Fixing a borked MediaTek LinkIt Smart 7688 Duo


Hardware: MediaTek LinkIt Smart 7688 Duo

Firmware: 0.9.3

NOTE: At this time (10/27/2016) I am extremely dissatisfied with MediaTek's approach to supporting this hardware in the field and find them to be wholly unprofessional. They appear to be hoping that the community will solve all the problems with their software/firmware and are not interested in engaging in anything beyond the simplest configuration questions.
I've had a few of the MediaTek LinkIt Smart 7688 Duo (can we fit a few more words in there) boards get into a bad state during configuration. As a result of this, I've gotten a bit aggressive in not using the GUI configuration items and focusing on the CLI (http://wiki.openwrt.org/doc/uci) for configuration. In fact, the first thing you should probably do once you have configured these is to vow never to use their GUI or the LUCI interface again. It just causes problems.

Monday, October 24, 2016

Disable WIFI and Bluetooth on Raspberry Pi 3 Model B



Hardware: Raspberry Pi 3 Model B

Software: 2016-09-23 Raspbian Jessie Lite (minimal)

The Raspberry Pi 3 models are pretty powerful with lots of extras.  But when you start thinking about securing them and/or cutting down on power usage then it is time to start turning things off.

Here's how to shut down the WIFI and Bluetooth radios on the unit.

How to power off Raspberry Pi 3 USB or Ethernet ports

Hardware: Raspberry Pi 3 Model B

Software: Windows 10 / 2016-09-23 Raspbian Jessie Lite (minimal)

I was mildly annoyed searching for how to turn the power for USB ports on/off.  The official documentation doesn't include it and the instructions online are out of date and/or incomplete.  So here it is from scratch!  Essentially, you're going to install an additional Linux module, download a third party app's source (https://github.com/codazoda/hub-ctrl.c), compile it and then run it.

These instructions assume a base install of Raspbian as indicated above and a default configuration.