Skip to content

Commit

Permalink
Migration to new repo
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentIO committed Mar 23, 2024
1 parent e227de0 commit 38b5faf
Show file tree
Hide file tree
Showing 13 changed files with 2,379 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Project FireFly",
description: "Software-defined lighting",
base: '/FireFly/',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' }
],

sidebar: [
{
text: 'Getting Started', link: 'getting_started'
},
{
text: 'Hardware',
items: [
{ text: 'Versions', link: '/hardware/' },
{ text: 'Reference Designs (TODO)' },
{ text: '3D Printed Cases (TODO)'},
{ text: 'High Voltage Relays', link: '/hardware/relays'},

]
},
{
text: 'Software',
items: [
{ text: 'Hardware Registration and Configuration Firmware', link: 'https://github.com/BrentIO/FireFly-Controller/tree/main/Hardware-Registration-and-Configuration' },
{ text: 'Controller Firmware', link: 'https://github.com/BrentIO/FireFly-Controller/tree/main/Controller' }
]
},
{
text: 'Documentation and Support',
items: [
{ text: 'Troubleshooting' },
{ text: 'Abbreviations and Failure Reasons', link: '/support/abbreviations_and_failure_reasons' },
{ text: 'OLED Screens' }
]
},
{
text: 'Development Environment',
items: [
{ text: 'IDE Configuration', link: '/ide_configuration' }
]
},
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/BrentIO/FireFly-Controller' }
]
}
})
17 changes: 17 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {
// ...
}
} satisfies Theme
139 changes: 139 additions & 0 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/**
* Customize default theme styling by overriding CSS variables:
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
*/

/**
* Colors
*
* Each colors have exact same color scale system with 3 levels of solid
* colors with different brightness, and 1 soft color.
*
* - `XXX-1`: The most solid color used mainly for colored text. It must
* satisfy the contrast ratio against when used on top of `XXX-soft`.
*
* - `XXX-2`: The color used mainly for hover state of the button.
*
* - `XXX-3`: The color for solid background, such as bg color of the button.
* It must satisfy the contrast ratio with pure white (#ffffff) text on
* top of it.
*
* - `XXX-soft`: The color used for subtle background such as custom container
* or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
* on top of it.
*
* The soft color must be semi transparent alpha channel. This is crucial
* because it allows adding multiple "soft" colors on top of each other
* to create a accent, such as when having inline code block inside
* custom containers.
*
* - `default`: The color used purely for subtle indication without any
* special meanings attched to it such as bg color for menu hover state.
*
* - `brand`: Used for primary brand colors, such as link text, button with
* brand theme, etc.
*
* - `tip`: Used to indicate useful information. The default theme uses the
* brand color for this by default.
*
* - `warning`: Used to indicate warning to the users. Used in custom
* container, badges, etc.
*
* - `danger`: Used to show error, or dangerous message to the users. Used
* in custom container, badges, etc.
* -------------------------------------------------------------------------- */

:root {
--vp-c-default-1: var(--vp-c-gray-1);
--vp-c-default-2: var(--vp-c-gray-2);
--vp-c-default-3: var(--vp-c-gray-3);
--vp-c-default-soft: var(--vp-c-gray-soft);

--vp-c-brand-1: var(--vp-c-indigo-1);
--vp-c-brand-2: var(--vp-c-indigo-2);
--vp-c-brand-3: var(--vp-c-indigo-3);
--vp-c-brand-soft: var(--vp-c-indigo-soft);

--vp-c-tip-1: var(--vp-c-brand-1);
--vp-c-tip-2: var(--vp-c-brand-2);
--vp-c-tip-3: var(--vp-c-brand-3);
--vp-c-tip-soft: var(--vp-c-brand-soft);

--vp-c-warning-1: var(--vp-c-yellow-1);
--vp-c-warning-2: var(--vp-c-yellow-2);
--vp-c-warning-3: var(--vp-c-yellow-3);
--vp-c-warning-soft: var(--vp-c-yellow-soft);

--vp-c-danger-1: var(--vp-c-red-1);
--vp-c-danger-2: var(--vp-c-red-2);
--vp-c-danger-3: var(--vp-c-red-3);
--vp-c-danger-soft: var(--vp-c-red-soft);
}

/**
* Component: Button
* -------------------------------------------------------------------------- */

:root {
--vp-button-brand-border: transparent;
--vp-button-brand-text: var(--vp-c-white);
--vp-button-brand-bg: var(--vp-c-brand-3);
--vp-button-brand-hover-border: transparent;
--vp-button-brand-hover-text: var(--vp-c-white);
--vp-button-brand-hover-bg: var(--vp-c-brand-2);
--vp-button-brand-active-border: transparent;
--vp-button-brand-active-text: var(--vp-c-white);
--vp-button-brand-active-bg: var(--vp-c-brand-1);
}

/**
* Component: Home
* -------------------------------------------------------------------------- */

:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(
120deg,
#ffe554 30%,
#d66b00
);

--vp-home-hero-image-background-image: linear-gradient(
-45deg,
#bd34fe 50%,
#47caff 50%
);
--vp-home-hero-image-filter: blur(44px);
}

@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
}

@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(68px);
}
}

/**
* Component: Custom Block
* -------------------------------------------------------------------------- */

:root {
--vp-custom-block-tip-border: transparent;
--vp-custom-block-tip-text: var(--vp-c-text-1);
--vp-custom-block-tip-bg: var(--vp-c-brand-soft);
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
}

/**
* Component: Algolia
* -------------------------------------------------------------------------- */

.DocSearch {
--docsearch-primary-color: var(--vp-c-brand-1) !important;
}

47 changes: 47 additions & 0 deletions getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# What is Project FireFly?

Project FireFly is a lighting control system for the home and small business. It aims to democratize reliable, high-quality controls at an affordable pricepoint. There are two main components to Project FireFly: the controller and client.

Using low-cost Arduino-based microcontrollers, Project FireFly makes software defined lighting controls available to the masses at a moderate premium cost to traditional lighting controls, and a slight premium cost to "smart lighting" controls integrated with existing switches. Similar commercial applications, while fancier, can add 5-10% to a new project cost compared to traditional lighting controls. On a $300,000 new house build, that's $15,000 to $30,000...just for lighting controls! 🤯

**Open-Source Hardware**
Project FireFly uses open-source hardware to build it yourself, manufacture it to spec, or design your own using ours as a reference.

**Open-Source, Locally-Controlled Software**
No for-profit company should ever decide they can "stop supporting" or "end of life" your technology in the interest of selling you something slightly newer, but with essentially the same capabilities you already have. Sending data to _their_ cloud costs money and is unnecessary.

**Native API's**
HTTP and MQTT work right out of the box, so you can integrate lighting controls to almost any other system imaginable. What's more is that state of health and configuration are all on-board -- no apps to install.

**We ❤️ Home Assistant**
FireFly was designed from the ground-up to work with Home Assistant and can be easily integrated into other home automation systems. From self discovery <Badge type="warning" text="TODO" /> to daily operation via MQTT <Badge type="warning" text="TODO" />, you can make your lighting controls work 100% locally.

## FireFly Controller
FireFly Controller is the heart of the system. It is the central hub for accepting inputs -- from a human touching a button to an automation signaling a change is necessary -- and processing outputs to the [high voltage relays](/hardware/relays) that make our lives more enjoyable.

The hardware consists of a custom PCB with RJ45 inputs that connect to FireFly clients, an Ethernet controller, OLED display, front panel selection button, and outputs. An ESP32 is the core computing module. In a typical home, one FireFly Controller should be used per floor; in a small home a single controller may suffice.

FireFly Controller is designed to be operational all by itself. The "other half" will appreciate this fail-safe, because it's as dependable as what they've used everywhere else:
- ✅ You still have local control of all circuits when your home automation is offline
- ✅ You still have local control of all circuits when your LAN or WiFi is having trouble
- ✅ You still have local control of all circuits when your Internet is offline
- 🚫 May not work during a zombie apocalypse 🧟

### Application Software
FireFly Controller features two applications contained within this repository, the Hardware Registration and Configuration application, and the main Controller application.

### Hardware Registration and Configuration Application
The Hardware Registration and Configuration is for use with new, unprogrammed boards -- essentially factory use. The application provides both a web interface and underlying API calls used by the web interface.

The application's primary functions are:
- Set the device's [partition scheme](ide_configuration#partitions)
- Set the external EEPROM with identity information
- Hardware quality assurance
- Register the hardware with the cloud service for remote backup of configuration data <Badge type="warning" text="TODO" />

### Controller Application
The main application for production use that accepts input from a physical switch and can, optionally, send PWM voltage to an output. It also supports HTTP <Badge type="warning" text="TODO" /> and MQTT <Badge type="warning" text="TODO" /> for inputs from external sources, such as a home automation system. Inputs sensed will raise events via MQTT for use in a home automation system. FireFly Controller is designed to be paired with FireFly Clients.

## FireFly Client <Badge type="tip" text="Coming Soon" />
FireFly Clients are devices that usually replace one or more lightswitches. A Client can support multiple LED-illuminated buttons for feedback when they are pressed. They communicate directly with the FireFly controller over Category 5 or Category 6 Ethernet cable but _do not_ use IP to communicate. Clients connect to MQTT via WiFi and subscribe to certain messages to know when to provide visual feedback of a button press. Because a blinking LED isn't essential to use the system, they still function even during those offline moments.

32 changes: 32 additions & 0 deletions hardware/FFC0806_2305/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Status: Unreleased

Hex: 0x32322211

Number of Inputs: 8

Number of Outputs: 6


**Power Input**
- Minimum:
- Recommended: 12VDC 3A
- Maximum:


**Inputs**

- 1 bank of 8-RJ45 connectors without LEDs
- 9VDC output (one per bank of 8-RJ45 connectors) to pins 4 & 5
-

**Outputs**

- 3 double-stack 90 degree 5.08mm pluggable terminal block

**Network**

Network connectivity is via Ethernet using a W5500 chipset featuring an RJ45 connector with status LEDs. Interrupt was not yet implemented.

:warning: **Known Issues:**
- Inoperative Ethernet
- Interrupt pin not implemented
97 changes: 97 additions & 0 deletions hardware/FFC3232_2211/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# About
Intended for rack-mounting solution, this controller model was a test bed for software development and manufacturing.

**Status:** Unreleased

**Hex:** 0x32322211

**Number of Inputs:** 32

**Number of Outputs:** 32

**Power Input**
- Minimum: 10.5VDC
- Recommended: 12VDC 3A
- Maximum: 26VDC


# I2C Addresses

| Address | Usage | Notes |
| ------- | ----- | ----- |
| 0x20 | Input Ports 1-4 | |
| 0x21 | Input Ports 5-8 | |
| 0x22 | Input Ports 9-12 | |
| 0x23 | Input Ports 13-16 | |
| 0x24 | Input Ports 17-20 | |
| 0x25 | Input Ports 21-24| |
| 0x26 | Input Ports 25-28 | |
| 0x27 | Input Ports 29-32 | |
| 0x40 | Output Ports 1-16 | |
| 0x42 | Output Ports 17-32 | See [Known Issues and Defects](#known-issues-and-defects) |
| 0x70 | Output All-Call | Not used |
| 0x48 | Temperature Sensor | |
| 0x50 | External EEPROM | |
| 0x3C | OLED Display | Variable, check display configuration |


# Inputs

- 4 banks of 8-RJ45 connectors without LEDs
- 9VDC output (one per bank of 8-RJ45 connectors) to pins 4 & 5


# Outputs

- 16 double-stack 90 degree 5.08mm pluggable terminal block
- 9VDC output pins 1 & 2


# Network

Network connectivity is via Ethernet using a W5500 chipset featuring an RJ45 connector with status LEDs.


# Bill of Materials

Prices are each, USD, exclusive of tax/tariff, or assembly prices.

| Use | Manufacturer | Manufacturer Model | Supplier | Supplier Part Number | Purchase Price | Notes |
| --- | ------------ | ----- | -------- | -------------------- | -------------- | ----- |
| Master Control Unit | Espressif Systems | ESP32-WROVER-E-N16R8 | DigiKey | 1965-ESP32-WROVER-E-N16R8DKR-ND | 3.90 | 16MB |
| External EEPROM | Microchip Technology | 24LC024-I/MS | DigiKey | 24LC024-I/MS-ND | 0.42 | 2KB |
| Ethernet Controller | WIZNET | W5500 | LCSC/JLCPCB | C32843 | | |
| Ethernet Port | HANRUN | HR911105A | LCSC/JLCPCB | C12074 | | |
| 25MHz Crystal | YXC | X322525MRB4SI | LCSC/JLCPCB | C70593 | | |
| Temperature Sensor | NXP Semiconductors | PCT2075DP,118 | LCSC/JLCPCB | C192518 | | |
| Input Ports | CONNFLY Elec | DS1131-S80BP | LCSC | C77853 | 2.6982 | |
| Input Controller | NXP Semiconductors | PCA9555PW,118 | LCSC/JLCPCB | C128392 | | |
| OLED Display | Feiyang | 0.91" 128x32 White | AliExpress | 2251832485919024 | 1.595 | Based on Vishay OLED-128O032D-LPP3N00000 |
| Power Input Port | Ningbo Kangnex Elec | WJ2EDGRC-5.08-2P | LCSC | C3697 | 0.027197 | |
| Power Input Plug | Ningbo Kangnex Elec | WJ2EDGK-5.08-2P | LCSC | C71370 | 0.107783 | |
| Output Ports | Cixi Kefa Elec | KF2EDGRH-5.08-2*3P | LCSC | C577721 | 0.2658 | |
| Output Plugs | Cixi Kefa Elec | HT508K-5.08-3P | LCSC | C577811 | 0.0898 | Low-profile |
| Output Controller | NXP Semiconductors | PCA9685PW,118 | LCSC/JLCPCB | C2678753 | | |
| I2C Logic Shifter | Texas Instruments | LSF0102DCUR | LCSC/JLCPCB | C964636 | | |
| Reset Switch | C&K | PTS645VL832LFS | LCSC | C285525 | 0.090682 | |
| Firmware Flash Button | XUNPU | TS-1088-AR02016 | LCSC/JLCPCB | C720477 | | |
| Front Panel Button Header | JST | B4B-XH-A(LF)(SN) | LCSC | C144395 | 0.055267 | |
| Power Supply: 3.3VDC | XLSEMI | XL1509-3.3E1 | LCSC/JLCPCB | C74193 | | |
| Power Supply: 5VDC | HGSEMI | LM2940S-5.0/TR | LCSC/JLCPCB | C434496 | | |
| Power Supply: 9VDC | Texas Instruments | LM2940S-9.0/NOPB | LCSC/JLCPCB | C134005 | | |


# Known Issues and Defects

The following are known issues (and in some cases their improvements) with this hardware.
- Inoperative Ethernet due to poor design and missing SCSn
- Ethernet interrupt pin not implemented
- Address of Output Controller 17-32 incorrectly strapped to 0x42 instead of 0x41
- Adjusted board size incorrect and center holes do not align
- :warning: Pinout to outputs changed after this version

| Pin | 2211 Net | _After_ 2211 Net |
| --- | -------- | -------------- |
| 1/2 | 9VDC (Green) | 0-5VDC (Red) |
| 3/4 | 0-5VDC (Red) | 9VDC (Green) |
| 5/6 | GND (Black) | GND (Black) |
Loading

0 comments on commit 38b5faf

Please sign in to comment.