Developing and Deploying devices

Jeroen Massar jeroen at massar.ch
Tue Apr 12 05:16:21 PDT 2016


On 2016-04-12 11:53, Robert Helling wrote:
> Hi,
> 
> I have been thinking a bit more about setting up a small device
> (C.H.I.P. or similar) to do the dive computer read out and communication
> with the mobile device.
> 
> One thing I am worried about is how to collaboratively develop for such
> a target. It is quite likely that we have to modify system files and
> settings (like startup, maybe configure BT or networking, instilling
> packages etc). How can we put that in version control? Do everything
> with a script and version control that script? For configuration files,
> one could have those in a directory under git and then have a small
> script that writes them in the appropriate places (and sets permissions
> etc). But maybe people have better ideas. Am I reinventing a packaging
> system?

You would be re-inventing that.

Hence the best way to go is to just use the packaging system of the
distro that gets chosen.

> The other thing is deployment. Initially, that’s simple, we provide disk
> images. But then, what is the upgrade path? Connect to wifi and do git
> pull? apt-get upgrade/update? Get a new disk image? That needs to be
> thought about as well for devices like this.

Very good questions and still at the right time.

We should definitely have a list of requirements as one of the first
things, as otherwise how do we know what we really want and who is going
to be working on what (duplicate stuff or stuff that never gets used is
rather an annoying downer for many people).

Assuming that the small size, flexibility and capabilities of a
Adruino/USB/BT 'stick' is likely too little for us, lets go for a
'bigger' device which can run a proper-ish Linux.


As an initial list of things see below, (do we have a wiki or git repo
where we could put this list in markdown or similar format, makes
discussing easier...)

The device:
 * a name ("OnSurface" ? :)

 * a case
  - mostly water-proof-ish
  - nice bright yellow plastic so it can't get lost

 * selection of hardware [see note below though]
  - CHIP
  - Pi
  - other?

 * battery that can at least make it functional for "a day"
  - we assume you get to land at one point where it is dry
    and that you can charge the thing, but it should not be
    after an hour of usage, the battery should at least survive
    a day of going out and diving

 * Dive Computer connectivity
   - USB Host to Dive Computer
   - USB<->IRDA connector support
   - others?
   Likely USB is the minimum, and that then things can plug
   into it that actually connect to the DC.

 * Connectivity between device and mobile:
   - Bluetooth LE
     - low throughput
     - would require custom things for transfering items
     + does not require switching WiFi on mobile device
   - WiFi for connectivity
     + high throughput
     + can use standard HTTP transfers etc
     - does require switching WiFi on mobile device
       (but see below: Home/Away switch)

 * "OS" Selection: I'll stick to this Linux-based thing ;)
   but we'll have to select a "Distro", and this will
   also select what 'upgrade' options we have:
   - Debian
     - I am partial to this where possible
       simply because of 'apt-get update && apt-get dist-upgrade"
     - would mean we simply roll Debian packages in a
       'addon' repo originally and if we can get them
       into mainline Debian there, for setting everything up
   - Depending on storage: small form factor might just
     need custom strip-down distro
     Could build this from components/kits offered by others
     eg using OpenWRT as a base etc.
     -> it does affect upgrade methods...
   - something else?

Then the actual work for binding stuff together:

 * Installation of (minimal?) Subsurface on the device
   - if Debian or other such system: packages!

 * Upgrade system
   - if Debian or other such system: packages!

 * First-time Setup Interface
   - SDcard slot option:
     could have an program that writes a simple configuration
     file to that medium config can be on a partition formatted
     with FAT32 or something else that any computer can read
     This 'program' could just be a menu option in SubSurface
     as we have all GUI parts sorted out there already.
     - won't work without a computer
   - WiFi option:
     it should just become an AP when initially enabled
     the user then connects, gets an IP, connects to http://<ip>
     and gets a nice web interface for configuration
     - in combo with broadcast mentioned below, mobile tool
       could actually just be the configuration tool
       with some kind of REST interface on the device.
   - USB:
     - Would require a non-host USB port next to host USB
     - Requires a computer
     -> not a really good option

 * Configuration Interface
   After setup we should be able to reconfigure
   Likely this will be a component of the Mobile edition when wifi
   or heck the full version; but with BE or SDCard this would be
   quite a different tool to do.

 * "Home"/"Away" switch:
   - When switched to "Home" it will try to connect to the local
     home WiFi Network, that way it becomes available to the home
     network and one can use it that way, thus avoiding need
     to have to have your mobile device switch between the home-wifi
     and the device wifi.
   - When switched to "Away" it will be a AP, your mobile device
     can then connect to it and use it directly.

 * Device discovery (for WiFi)
   - Simple edition: allow the user to enter the IP/hostname of
     the device in the mobile tool
   - Broadcast packet on local WiFi:
     Likely UPNP packets are a good tool for that, but we can use
     whatever is good. This way tool can autodetect it.
     (this option should of course have the option of being disabled
      in the configuration, I hate broadcasting stuff myself...)
 * Security policy: minimal exposure of anything


Yes, that is a long list of things, but if we have the list we want,
then people can say "I'll tackle that part" and together we can get
there quite fast.

Note that the hardware could just be a variety of things, having it
based on Debian could just mean that somebody runs this on a cheap
laptop (great for devel, but indeed then you do not really need a mobile
version anymore), while others use a mini-device. Or the in-house
edition that you have on your desk could just be a VM on a bigger device
etc, while you keep the tiny one in your divebag.


Just in case, I got a dive-trip coming up in June, hence... I got a
target for having such a device with me ;)

Greets,
 Jeroen



More information about the subsurface mailing list