The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster,...

27
« transforming an idea » niston cloud. The Art in IT @ Höhere Fachschule Uster, 03.12.2014

Transcript of The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster,...

Page 1: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

« transforming an idea »

niston cloud. The Art in IT @ Höhere Fachschule Uster, 03.12.2014

Page 2: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

« NISTON Stream One »

Niston Cloud’s Streaming Internet Radio Project produced both hardware and software: A HiFi component to receive Internet radio and a quite advanced firmware for it.

Page 3: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• Inception • Nex Gen Requirements • Catalyst • Opportunity • Exploration in mono • Cross Platform Prototype • Human Machine Interface • Engineering Prototype • SIRP: Firmware in C# • Pattern: Engine-Controller • Pattern: Object Tree • SIRP Subsystems Map • SIRP Conclusions

• SDD# - Software Defined Devices in C#

• SDD# Core • Pattern: Observer • Pattern: Accessor • SDD# Apps • StreamOne Technology Demo • Responsive Web Interface • So much things to do! • Project Metamorphosis • Support SDD# • The End

Page 4: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

Software Only Prototype: Chester Virtual Audio IRT-1 Mk4 • 2ppl «overnight» design (16 MH of work) • Built around BASS Audio Library • Simplicity-over-Features principle • UI Resembles traditional stereo Tuner • Programming through Paste of URLs • Has «responsive design» elements • Designed with Touchscreen in mind • Written in Visual Basic 6.0

Compact Mode for small Screens

Regular Mode

Page 5: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• Playback Shoutcast/Icecast streams w/o PC • Discrete HiFi component • Integrated mains power supply • HiFi quality line output (SNR >96dB, THD <0.01%) • «TV-Style» preset memory • Gapless preset change • Show relevant Stream Parameters

(Format/Channels/Resolution) • Show RX buffer level • Show audio signal levels (VU meters) • «RDS-Style» scrolling Shoutcast information • Programming/Configuration by Web Interface

Page 6: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

Project: Monitoring a Diesel Generator more info @ http://niston.wordpress.com/2013/02/24/pi-based-snmp-monitoring-probe/

• Raspberry Pi Single Board Computer

• Linux Operating System

• Integrated 10/100 Ethernet

• Affordable @ CHF 32 (dealer price)

Page 7: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• BASS added support for ARMv6 – nice!!!

• Bitcoin selloff somewhat refilled the coffers

• No full time job meant lots of time at hand

• Found perfect solutions for HMI & Line Out

Page 8: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• Why mono? Because of portable C#!

• Using mono on a Raspberry Pi

• Compilinig mono on Windows

• C# Cross-Platform-Development: VS2013 on Windows for mono on ARMv6 Linux

• Portability of .NET code & Assemblies

• Using native libraries

• Debugging mono runtime crashes with gdb

Page 9: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

Sauron’s Law: One EXE to rule them all!

• Develop on Windows in VS2013, Run on RPi.

• BASS Audio Native Libs (.dll/.so)

• Console UI (no X Win)

• Verification of Audio

• Result: SUCCESS

On Raspberry Pi (via SSH)

Prototype running on Windows 7

Page 10: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• Graphical LCD, Resolution 192x64 Pixels (1bpp) • 7 Generic Navigation Buttons, 3 Bi-Color LEDs • Integrated Piezo Buzzer • Serial Attachment (TTL UART, Serial-over-USB, I2C) • Simple binary command set, easy to work with • Is it fast enough for the VU meters ??? YES IT IS!*

* at 115k2 Baud COM speed easily, no problem!

Page 11: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

[ going physical ]

• Raspberry Pi Model B at heart • Sturdy aluminum case: baseplate, cover, front & backplate • High quality components, excellent build quality • Switch mode power supply w/ ample power reserve (15W) • Large capacitors on USB and pwr distribution rails for stability • Power distribution and GND follow pure star topology • Decoupled audio GND (look ma, no ground loops!) • High quality Burr-Brown (now TI) DAC Chip

Page 12: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• Using my own «Engine Modelling» design approach • Making extensive use of my Engine-ControllerTM Pattern • Completely modular architecture built from subsystems • Applying knowledge gained during prototyping phase • Constructing an LCD GUI System from scratch

Page 13: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

1 Controller

n Engines

Instantiate, Destroy, Access

Combines classical patterns: Factory, Facade, Extender

Events, Types

Consumer*

Holds instances in Field

Handles all n Engines, Abstracts many into one.

Each one performs a specific Task

*Cares not about individual engines but about functionality provided.

Page 14: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• Facilitates creation of layered abstraction levels – this helps manage complexity

• Encapsulates responsibility by

delegation: a layer performs a specific set of tasks within a particular scope or domain of the problem only, delegating micromanagement and implementation specific details to sub-levels as needed.

• Code near the root of the object

tree is more generic in terms of functionality, whilst fanned out levels solve more specific problems.

Page 15: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

subsystems.ui subsystems.ui.screens

subsystems.display

subsystems.io

subsystems.audio

subsystems.memory

main

Page 16: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• Build time ratio hardware:software == 1 : >14

• Hardware platform totally generic

• Built entirely from readily available COTS parts

• Device functionality almost exclusively defined by software running on general purpose CPU/OS

Course of Action:

Turn the SIRP firmware into a generic, open source framework for building software defined devices!

Page 17: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

[ for .NET/Windows, mono/Linux (and mono/Android and mono/OSX) ]

Mantra: «Virtualize your Device!» B u z z w o r d s : C l o u d , I n t e r n e t - o f - T h i n g s

Principles: • Use generic, inexpensive hardware base platform • Add specific HW extensions as per requirements • Implement device overall functionality in C# - local and remote! Software Building Blocks: • .NET Framework / mono • SDD# Core • SDD# Apps

WTF! Why do this? Why not MCUs and C? • Powerful C# language and tools • Complete UNIX (and Windows) networking • Easy Cloud integration, Internet-of-Things • Easy File System handling (FAT, FAT32, NTFS...) • Reduced hardware development cost • «Heavy duty» stuff like Databases, Network Services • Lots of smart C# developers out there ! • Humongous open source codebases for C# and Linux! • MCUs still required for specific extensions ;-)

Page 18: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

The SDD# Core provides:

• Generalized serial IO

• Concrete support for RS232 serial ports (or Serial-over-USB solutions)

• Generalized layer for LCD interaction, so you don't have to mess with serial IO

• A concrete implementation for a specific LCD module

• An LCD screen manager

• An LCD menu system with support for submenus and interactive menu items

• Audio support (powered by BASS)

• Configuration management (not much implemented)

• Support for Apps (ApplicationManager, IApplication interface).

• TODO: GPIO support

• TODO: HTTP service

Page 19: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

[ provide notification of value changes to MenuItem’s owner ]

Notifies observer(s) of change to value. Usually there’s only one observer: The MenuItem owner. Yet, anyone holding a reference may choose to listen to this event.

Problem: Provide an unified, type-independent way of sending notifications about changes to the MenuItem value to all interested parties.

Solution: Introduction of generic ObservableMenuItem. This provides one ValueChanged event for all derived MenuItem types.

Page 20: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

[ decoupling MenuItem from MenuSystem ]

done through accessor interfaces

All actions on MenuItems

Page 21: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• .NET Assemblies (DLL) that implement the IApplication interface

• Dynamically loaded/unloaded by ApplicationManager instance

• Provide IScreen implementations for GUI, handled by ScreenManager

• Provide App-specific MenuItems for MenuSystem

• Host problem/app specific code

• Can access SDD# features by Object Tree

Page 22: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

• App for SDD#

• SIRP firmware on top of the SDD# Core

• Provides tuner and alarm clock functions

• Holds preset memory

Page 23: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

[ remote control ]

• Currently in the making

• Designed by André Ceres

Page 24: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

[ a glimpse into the future ]

NISTON Project One – Raspberry Pi compatible* SDD rapid prototyping kit

Building A Hardware

Platform for SDD#

Rpi HATs, CM Progger,

Case Accessories,

User Port Modules

& more ...

* Powered by genuine Raspberry Pi Compute Module

Page 25: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

Physical manifestation:

Was: Idea written down as code

Became: Hardware implementation

Ideological transformation:

Was: Internet streaming audio receiver

Became: Generic framework for Software Defined Devices.

Page 26: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

12vB2Zephh4wgjyqUQ3SCsSSjTcpVbT41d

Page 27: The Art in IT @ Höhere Fachschule Uster, 03.12 · The Art in IT @ Höhere Fachschule Uster, 03.12.2014 « NISTON Stream One » Niston Cloud’s Streaming Internet Radio Project produced

Contact:

[email protected]