mirror of
https://github.com/tjhorner/upsy-desky.git
synced 2026-01-10 15:58:02 -05:00
Compare commits
50 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9e7fdbe17 | ||
|
|
a8723c7a24 | ||
|
|
dcece2198e | ||
|
|
37c7a6e83a | ||
|
|
02d1dc3ff2 | ||
|
|
a252a9dbe4 | ||
|
|
b9951a4c6a | ||
|
|
c3f7ecae7d | ||
|
|
3d3ebc4292 | ||
|
|
f992081520 | ||
|
|
686bc6258b | ||
|
|
581bb2883e | ||
|
|
41517256bb | ||
|
|
931edac2a5 | ||
|
|
6a5fbfa383 | ||
|
|
e334e7004f | ||
|
|
c36fcb5232 | ||
|
|
a4484761cd | ||
|
|
7bf1275e7d | ||
|
|
b28dcb26ca | ||
|
|
0ae038b8b7 | ||
|
|
543f901d90 | ||
|
|
f3b31ecc61 | ||
|
|
9bcd331a3d | ||
|
|
88f5110e62 | ||
|
|
4a1289de03 | ||
|
|
6626be4545 | ||
|
|
bd416f2ea7 | ||
|
|
54384fe695 | ||
|
|
51650653bf | ||
|
|
b4aaef1dd2 | ||
|
|
193cfe88a1 | ||
|
|
78d6c58d78 | ||
|
|
583a14d664 | ||
|
|
fd16478c5a | ||
|
|
ce9cb8b003 | ||
|
|
274ec9ac94 | ||
|
|
0567307595 | ||
|
|
7a881dc1ee | ||
|
|
148b9cd379 | ||
|
|
655cb303d3 | ||
|
|
f4d61cdb36 | ||
|
|
1986a79782 | ||
|
|
a0602c1201 | ||
|
|
4f3b5acf58 | ||
|
|
b238eb40c3 | ||
|
|
eb54c2c405 | ||
|
|
c09fa97c77 | ||
|
|
273dd62d9a | ||
|
|
16792d6954 |
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1 +1,2 @@
|
||||
github: tjhorner
|
||||
ko_fi: tjhorner
|
||||
|
||||
50
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
50
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: Bug Report
|
||||
description: File a bug report or get help with an issue.
|
||||
labels: ["bug"]
|
||||
assignees:
|
||||
- tjhorner
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: troubleshooting-followed
|
||||
attributes:
|
||||
label: Troubleshooting Guide
|
||||
description: Please confirm you have followed the [troubleshooting guide](https://upsy-desky.tjhorner.dev/docs/troubleshooting).
|
||||
options:
|
||||
- label: I have followed the steps in the troubleshooting guide and my issue is either not listed or is not solved.
|
||||
required: true
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: Please describe the bug you encountered, and what you expected to happen instead.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Logs
|
||||
description: Please copy and paste any relevant log output. Learn how to obtain logs [here](https://upsy-desky.tjhorner.dev/docs/troubleshooting/#other-issues).
|
||||
render: plain text
|
||||
- type: input
|
||||
id: config-version
|
||||
attributes:
|
||||
label: Which version of the Upsy Desky firmware config are you running?
|
||||
placeholder: "1.1.1"
|
||||
- type: dropdown
|
||||
id: update-management
|
||||
attributes:
|
||||
label: How do you manage your Upsy Desky's updates?
|
||||
options:
|
||||
- OTA Updates
|
||||
- ESPHome YAML Config
|
||||
- type: input
|
||||
id: esphome-version
|
||||
attributes:
|
||||
label: If you're using an ESPHome YAML config, which version of ESPHome are you running?
|
||||
placeholder: "2023.5.4"
|
||||
- type: textarea
|
||||
id: esphome-config
|
||||
attributes:
|
||||
label: ESPHome Config
|
||||
description: If you have your own ESPHome YAML configuration, please paste it here. Remember to redact any sensitive information like encryption keys or passwords.
|
||||
render: YAML
|
||||
6
.github/workflows/build.yaml
vendored
6
.github/workflows/build.yaml
vendored
@@ -20,9 +20,9 @@ jobs:
|
||||
- name: Compile Release Firmware
|
||||
working-directory: firmware
|
||||
run: |
|
||||
esphome compile config.yaml
|
||||
esphome compile stock.yaml
|
||||
mkdir -p bin
|
||||
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware-factory.bin bin/firmware-factory.bin
|
||||
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware.factory.bin bin/firmware-factory.bin
|
||||
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware.bin bin/firmware.bin
|
||||
|
||||
- name: Compile Debug Firmware
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
rm -rf .esphome/build/upsy-desky
|
||||
esphome compile debug.yaml
|
||||
mkdir -p bin
|
||||
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware-factory.bin bin/debug-firmware-factory.bin
|
||||
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware.factory.bin bin/debug-firmware-factory.bin
|
||||
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware.bin bin/debug-firmware.bin
|
||||
|
||||
- name: Upload Firmware
|
||||
|
||||
40
.github/workflows/nightly-build.yaml
vendored
Normal file
40
.github/workflows/nightly-build.yaml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Nightly Stock Firmware Build
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Firmware
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.9"
|
||||
|
||||
- name: Install ESPHome
|
||||
run: pip install --pre --user esphome
|
||||
|
||||
- name: Compile Release Firmware
|
||||
working-directory: firmware
|
||||
run: |
|
||||
esphome compile stock.yaml
|
||||
mkdir -p bin
|
||||
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware.factory.bin bin/firmware-factory.bin
|
||||
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware.bin bin/firmware.bin
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: firmware-bin
|
||||
path: firmware/bin
|
||||
|
||||
- name: Send Discord failure notification
|
||||
if: failure()
|
||||
uses: appleboy/discord-action@master
|
||||
with:
|
||||
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
|
||||
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
||||
color: "#FF6961"
|
||||
message: "The latest nightly build failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
@@ -46,10 +46,7 @@ Or whatever else you'd like. The possibilities are endless! As long as the possi
|
||||
|
||||
## Compatibility
|
||||
|
||||
Any standing desk that uses RJ45 to connect to the keypad is likely compatible, but these brands of desks have been verified to work, with official firmware provided:
|
||||
|
||||
- UPLIFT v2
|
||||
- Fully Jarvis
|
||||
Any standing desk that uses RJ45 to connect to the keypad is likely compatible, but the control boxes listed [here](https://upsy-desky.tjhorner.dev/docs/reference/compatibility/) are verified to be compatible.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
18
firmware/README.md
Normal file
18
firmware/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Firmware Configs
|
||||
|
||||
This directory contains [ESPHome](https://esphome.io) config files for the Upsy Desky.
|
||||
|
||||
It is organized like so:
|
||||
|
||||
- `base.yaml`: The base essential configuration, which contains components for reading the desk height, preset buttons, etc.
|
||||
- `stock.yaml`: Inherits everything from `base.yaml` and adds components which are useful on stock firmware, such as the WiFi hotspot, web server, and Improv Serial
|
||||
- `debug.yaml`: Inherits everything from `stock.yaml` and adds components which are useful for debugging
|
||||
|
||||
## Addons
|
||||
|
||||
Major parts of the config are separated into "addons" so they can be easily included or excluded. The following addons are available:
|
||||
|
||||
- `presets.yaml`: Adds support for recalling and setting presets on the desk control box
|
||||
- `runtime-config.yaml`: Adds support for runtime configuration options (you might want to remove this if you are configuring everything via ESPHome yaml)
|
||||
- `bluetooth-proxy.yaml`: Contains the necessary configuration to use the Upsy Desky as a [Bluetooth Proxy](https://esphome.io/components/bluetooth_proxy.html)
|
||||
- `stable-ids.yaml`: Contains configuration necessary to keep some entity IDs stable via the HTTP API
|
||||
7
firmware/addons/bluetooth-proxy.yaml
Normal file
7
firmware/addons/bluetooth-proxy.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
substitutions:
|
||||
bluetooth_proxy_active_connections: "true"
|
||||
|
||||
esp32_ble_tracker:
|
||||
|
||||
bluetooth_proxy:
|
||||
active: ${bluetooth_proxy_active_connections}
|
||||
111
firmware/addons/presets.yaml
Normal file
111
firmware/addons/presets.yaml
Normal file
@@ -0,0 +1,111 @@
|
||||
output:
|
||||
- platform: gpio
|
||||
inverted: true
|
||||
id: button_bit1
|
||||
pin:
|
||||
number: ${button_bit1_pin}
|
||||
allow_other_uses: true
|
||||
|
||||
- platform: gpio
|
||||
inverted: true
|
||||
id: button_bit2
|
||||
pin:
|
||||
number: ${button_bit2_pin}
|
||||
allow_other_uses: true
|
||||
|
||||
- platform: gpio
|
||||
inverted: true
|
||||
id: button_bit4
|
||||
pin:
|
||||
number: ${button_bit4_pin}
|
||||
|
||||
- platform: gpio
|
||||
inverted: true
|
||||
id: button_m
|
||||
pin:
|
||||
number: ${button_m_pin}
|
||||
|
||||
button:
|
||||
# Recall Presets
|
||||
- platform: template
|
||||
id: recall_preset_1
|
||||
name: "Preset 1"
|
||||
icon: "mdi:numeric-1-box"
|
||||
on_press:
|
||||
- output.turn_on: button_bit1
|
||||
- output.turn_on: button_bit2
|
||||
- delay: 1s
|
||||
- output.turn_off: button_bit2
|
||||
- output.turn_off: button_bit1
|
||||
|
||||
- platform: template
|
||||
id: recall_preset_2
|
||||
name: "Preset 2"
|
||||
icon: "mdi:numeric-2-box"
|
||||
on_press:
|
||||
- output.turn_on: button_bit4
|
||||
- delay: 100ms
|
||||
- output.turn_off: button_bit4
|
||||
|
||||
- platform: template
|
||||
id: recall_preset_3
|
||||
name: "Preset 3"
|
||||
icon: "mdi:numeric-3-box"
|
||||
on_press:
|
||||
- output.turn_on: button_bit2
|
||||
- output.turn_on: button_bit4
|
||||
- delay: 100ms
|
||||
- output.turn_off: button_bit4
|
||||
- output.turn_off: button_bit2
|
||||
|
||||
- platform: template
|
||||
id: recall_preset_4
|
||||
name: "Preset 4"
|
||||
icon: "mdi:numeric-4-box"
|
||||
on_press:
|
||||
- output.turn_on: button_bit4
|
||||
- output.turn_on: button_bit1
|
||||
- delay: 100ms
|
||||
- output.turn_off: button_bit1
|
||||
- output.turn_off: button_bit4
|
||||
|
||||
# Set Presets
|
||||
- platform: template
|
||||
name: "Set Preset 1"
|
||||
entity_category: "config"
|
||||
icon: "mdi:numeric-1-box-multiple"
|
||||
on_press:
|
||||
- output.turn_on: button_m
|
||||
- delay: 100ms
|
||||
- output.turn_off: button_m
|
||||
- button.press: recall_preset_1
|
||||
|
||||
- platform: template
|
||||
name: "Set Preset 2"
|
||||
entity_category: "config"
|
||||
icon: "mdi:numeric-2-box-multiple"
|
||||
on_press:
|
||||
- output.turn_on: button_m
|
||||
- delay: 100ms
|
||||
- output.turn_off: button_m
|
||||
- button.press: recall_preset_2
|
||||
|
||||
- platform: template
|
||||
name: "Set Preset 3"
|
||||
entity_category: "config"
|
||||
icon: "mdi:numeric-3-box-multiple"
|
||||
on_press:
|
||||
- output.turn_on: button_m
|
||||
- delay: 100ms
|
||||
- output.turn_off: button_m
|
||||
- button.press: recall_preset_3
|
||||
|
||||
- platform: template
|
||||
name: "Set Preset 4"
|
||||
entity_category: "config"
|
||||
icon: "mdi:numeric-4-box-multiple"
|
||||
on_press:
|
||||
- output.turn_on: button_m
|
||||
- delay: 100ms
|
||||
- output.turn_off: button_m
|
||||
- button.press: recall_preset_4
|
||||
56
firmware/addons/runtime-config.yaml
Normal file
56
firmware/addons/runtime-config.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
select:
|
||||
- platform: template
|
||||
id: height_units_config
|
||||
name: "Height Units"
|
||||
entity_category: "config"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
options:
|
||||
- in
|
||||
- cm
|
||||
initial_option: ${default_height_units}
|
||||
on_value:
|
||||
then:
|
||||
lambda: |
|
||||
const char *unit = id(height_units_config)->state.c_str();
|
||||
id(desk_height)->set_unit_of_measurement(unit);
|
||||
id(target_desk_height)->traits.set_unit_of_measurement(unit);
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: "Re-Detect Decoder"
|
||||
entity_category: "config"
|
||||
icon: "mdi:cog-refresh"
|
||||
on_press:
|
||||
- uart.write:
|
||||
id: handset_tx
|
||||
data: [ 0x0 ]
|
||||
- standing_desk_height.detect_decoder: desk_height
|
||||
|
||||
number:
|
||||
- platform: template
|
||||
name: "Min Target Height"
|
||||
entity_category: "config"
|
||||
min_value: 0
|
||||
max_value: 150
|
||||
step: 0.1
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
initial_value: ${standing_desk_min_height}
|
||||
on_value:
|
||||
then:
|
||||
lambda: |
|
||||
id(target_desk_height)->traits.set_min_value(x);
|
||||
- platform: template
|
||||
name: "Max Target Height"
|
||||
entity_category: "config"
|
||||
min_value: 0
|
||||
max_value: 150
|
||||
step: 0.1
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
initial_value: ${standing_desk_max_height}
|
||||
on_value:
|
||||
then:
|
||||
lambda: |
|
||||
id(target_desk_height)->traits.set_max_value(x);
|
||||
35
firmware/addons/stable-ids.yaml
Normal file
35
firmware/addons/stable-ids.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
# This file provides stable entity IDs for various components, in order to be used in the HTTP API.
|
||||
|
||||
# ESPHome derives entity IDs (internally called "object IDs") from the component name, which is
|
||||
# used as the ID in the HTTP API endpoints. Unfortunately there is no way to control them so they
|
||||
# are set independently of the name, so this is a weird workaround for that.
|
||||
|
||||
sensor:
|
||||
- platform: copy
|
||||
source_id: desk_height
|
||||
internal: true
|
||||
name: "desk_height"
|
||||
|
||||
number:
|
||||
- platform: copy
|
||||
source_id: target_desk_height
|
||||
internal: true
|
||||
name: "target_desk_height"
|
||||
|
||||
button:
|
||||
- platform: copy
|
||||
source_id: recall_preset_1
|
||||
internal: true
|
||||
name: "desk_preset_1"
|
||||
- platform: copy
|
||||
source_id: recall_preset_2
|
||||
internal: true
|
||||
name: "desk_preset_2"
|
||||
- platform: copy
|
||||
source_id: recall_preset_3
|
||||
internal: true
|
||||
name: "desk_preset_3"
|
||||
- platform: copy
|
||||
source_id: recall_preset_4
|
||||
internal: true
|
||||
name: "desk_preset_4"
|
||||
65
firmware/base.yaml
Normal file
65
firmware/base.yaml
Normal file
@@ -0,0 +1,65 @@
|
||||
# Essential ESPHome config options
|
||||
esphome:
|
||||
name: "${name}"
|
||||
friendly_name: "${friendly_name}"
|
||||
name_add_mac_suffix: true
|
||||
min_version: "2024.6.0"
|
||||
on_boot:
|
||||
then:
|
||||
# Wakes up the desk and reports height
|
||||
- uart.write:
|
||||
id: handset_tx
|
||||
data: [ 0x0 ]
|
||||
project:
|
||||
name: tj_horner.upsy_desky
|
||||
version: "4.0.1"
|
||||
|
||||
uart:
|
||||
id: handset_tx
|
||||
tx_pin: 16
|
||||
baud_rate: 9600
|
||||
|
||||
esp32:
|
||||
board: esp32dev
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
# Configurable options
|
||||
substitutions:
|
||||
name: "upsy-desky"
|
||||
friendly_name: "Upsy Desky"
|
||||
desk_height_name: "Desk Height"
|
||||
target_desk_height_name: "Target Desk Height"
|
||||
|
||||
# Standing Desk Component Config
|
||||
standing_desk_uart_rx_pin: "17"
|
||||
standing_desk_up_pin: "21"
|
||||
standing_desk_down_pin: "22"
|
||||
standing_desk_min_height: "25.2"
|
||||
standing_desk_max_height: "50.8"
|
||||
|
||||
# Presets Addon Config
|
||||
button_bit1_pin: "21"
|
||||
button_bit2_pin: "22"
|
||||
button_bit4_pin: "19"
|
||||
button_m_pin: "18"
|
||||
|
||||
# Runtime Config Defaults
|
||||
default_height_units: "in" # Must be "in" or "cm"
|
||||
|
||||
packages:
|
||||
standing_desk: github://tjhorner/esphome-standing-desk/configs/template.yaml
|
||||
addon_presets: !include addons/presets.yaml
|
||||
addon_stable_ids: !include addons/stable-ids.yaml
|
||||
addon_runtime_config: !include addons/runtime-config.yaml
|
||||
|
||||
button:
|
||||
- platform: restart
|
||||
name: "Restart"
|
||||
|
||||
light:
|
||||
- platform: status_led
|
||||
id: upsy_desky_status_led
|
||||
name: "Status LED"
|
||||
pin: GPIO23
|
||||
restore_mode: RESTORE_DEFAULT_ON
|
||||
@@ -1,133 +1,8 @@
|
||||
substitutions:
|
||||
name: "upsy-desky"
|
||||
friendly_name: "Upsy Desky"
|
||||
# This file is here for reverse compatibility. Older versions of the firmware
|
||||
# pointed to `config.yaml` instead of `base.yaml`. That file also included the
|
||||
# config found in `stock.yaml`, which is why it's being included here.
|
||||
|
||||
# Defaults
|
||||
standing_desk_uart_rx_pin: "17"
|
||||
standing_desk_up_pin: "21"
|
||||
standing_desk_down_pin: "22"
|
||||
standing_desk_variant: "uplift"
|
||||
standing_desk_min_height: "25.2"
|
||||
standing_desk_max_height: "50.8"
|
||||
|
||||
# Presets
|
||||
button_bit1_pin: "21"
|
||||
button_bit2_pin: "22"
|
||||
button_bit4_pin: "19"
|
||||
button_m_pin: "18"
|
||||
|
||||
esphome:
|
||||
name: "${name}"
|
||||
name_add_mac_suffix: true
|
||||
on_boot:
|
||||
then:
|
||||
# Wakes up the desk and reports height
|
||||
- uart.write:
|
||||
id: handset_tx
|
||||
data: [ 0x0 ]
|
||||
project:
|
||||
name: tj_horner.upsy_desky
|
||||
version: "0.2.1"
|
||||
|
||||
dashboard_import:
|
||||
package_import_url: github://tjhorner/upsy-desky/firmware/config.yaml
|
||||
|
||||
uart:
|
||||
id: handset_tx
|
||||
tx_pin: 16
|
||||
baud_rate: 9600
|
||||
|
||||
esp32:
|
||||
board: esp32dev
|
||||
|
||||
logger:
|
||||
level: INFO
|
||||
|
||||
wifi:
|
||||
ap:
|
||||
password: "hunter2hunter2"
|
||||
|
||||
captive_portal:
|
||||
|
||||
improv_serial:
|
||||
|
||||
api:
|
||||
password: ""
|
||||
reboot_timeout: 0s
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
|
||||
ota:
|
||||
password: ""
|
||||
# Please use `base.yaml` for new configurations and customizations.
|
||||
|
||||
packages:
|
||||
standing_desk: github://tjhorner/esphome-standing-desk/configs/template.yaml@master
|
||||
presets_addon: github://tjhorner/esphome-standing-desk/configs/addons/presets.yaml@master
|
||||
|
||||
select:
|
||||
- platform: template
|
||||
name: "${friendly_name} Height Decoder Variant"
|
||||
entity_category: "config"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
options:
|
||||
- uplift
|
||||
- jarvis
|
||||
- omnidesk
|
||||
initial_option: ${standing_desk_variant}
|
||||
on_value:
|
||||
then:
|
||||
lambda: "id(desk_height)->set_decoder_variant(x);"
|
||||
- platform: template
|
||||
name: "${friendly_name} Height Units"
|
||||
entity_category: "config"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
options:
|
||||
- in
|
||||
- cm
|
||||
initial_option: in
|
||||
on_value:
|
||||
then:
|
||||
lambda: |
|
||||
id(desk_height)->set_unit_of_measurement(x);
|
||||
id(target_desk_height)->traits.set_unit_of_measurement(x);
|
||||
|
||||
number:
|
||||
- platform: template
|
||||
name: "${friendly_name} Min Target Height"
|
||||
entity_category: "config"
|
||||
min_value: 0
|
||||
max_value: 150
|
||||
step: 0.1
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
initial_value: ${standing_desk_min_height}
|
||||
on_value:
|
||||
then:
|
||||
lambda: |
|
||||
id(target_desk_height)->traits.set_min_value(x);
|
||||
- platform: template
|
||||
name: "${friendly_name} Max Target Height"
|
||||
entity_category: "config"
|
||||
min_value: 0
|
||||
max_value: 150
|
||||
step: 0.1
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
initial_value: ${standing_desk_max_height}
|
||||
on_value:
|
||||
then:
|
||||
lambda: |
|
||||
id(target_desk_height)->traits.set_max_value(x);
|
||||
|
||||
button:
|
||||
- platform: restart
|
||||
name: "${friendly_name} Restart"
|
||||
|
||||
light:
|
||||
- platform: status_led
|
||||
id: upsy_desky_status_led
|
||||
pin: GPIO23
|
||||
restore_mode: ALWAYS_ON
|
||||
stock: !include stock.yaml
|
||||
@@ -1,5 +1,5 @@
|
||||
packages:
|
||||
base: !include config.yaml
|
||||
stock: !include stock.yaml
|
||||
|
||||
logger:
|
||||
level: DEBUG
|
||||
@@ -10,4 +10,4 @@ debug:
|
||||
text_sensor:
|
||||
- platform: debug
|
||||
device:
|
||||
name: "${friendly_name} Device Info"
|
||||
name: "Device Info"
|
||||
40
firmware/stock.yaml
Normal file
40
firmware/stock.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
packages:
|
||||
base: !include base.yaml
|
||||
|
||||
external_components:
|
||||
- source: github://tjhorner/esphome-custom-components
|
||||
components: [ project_version ]
|
||||
|
||||
text_sensor:
|
||||
- platform: project_version
|
||||
name: "Upsy Desky Firmware Version"
|
||||
internal: true
|
||||
|
||||
logger:
|
||||
level: INFO
|
||||
|
||||
wifi:
|
||||
ap:
|
||||
password: "hunter2hunter2"
|
||||
|
||||
captive_portal:
|
||||
|
||||
improv_serial:
|
||||
|
||||
esp32_improv:
|
||||
authorizer: false
|
||||
|
||||
api:
|
||||
reboot_timeout: 0s
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
version: 2
|
||||
js_url: "https://upsy-desky.tjhorner.dev/esphome-webserver/www.js"
|
||||
|
||||
ota:
|
||||
- platform: esphome
|
||||
password: ""
|
||||
|
||||
dashboard_import:
|
||||
package_import_url: github://tjhorner/upsy-desky/firmware/stock.yaml@v4.0.1
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"board": {
|
||||
"3dviewports": [],
|
||||
"design_settings": {
|
||||
"defaults": {
|
||||
"board_outline_line_width": 0.09999999999999999,
|
||||
@@ -66,20 +67,26 @@
|
||||
"rule_severities": {
|
||||
"annular_width": "error",
|
||||
"clearance": "error",
|
||||
"connection_width": "warning",
|
||||
"copper_edge_clearance": "error",
|
||||
"copper_sliver": "warning",
|
||||
"courtyards_overlap": "error",
|
||||
"diff_pair_gap_out_of_range": "error",
|
||||
"diff_pair_uncoupled_length_too_long": "error",
|
||||
"drill_out_of_range": "error",
|
||||
"duplicate_footprints": "warning",
|
||||
"extra_footprint": "warning",
|
||||
"footprint": "error",
|
||||
"footprint_type_mismatch": "error",
|
||||
"hole_clearance": "error",
|
||||
"hole_near_hole": "error",
|
||||
"invalid_outline": "error",
|
||||
"isolated_copper": "warning",
|
||||
"item_on_disabled_layer": "error",
|
||||
"items_not_allowed": "error",
|
||||
"length_out_of_range": "error",
|
||||
"lib_footprint_issues": "warning",
|
||||
"lib_footprint_mismatch": "warning",
|
||||
"malformed_courtyard": "error",
|
||||
"microvia_drill_out_of_range": "error",
|
||||
"missing_courtyard": "ignore",
|
||||
@@ -89,9 +96,14 @@
|
||||
"padstack": "error",
|
||||
"pth_inside_courtyard": "ignore",
|
||||
"shorting_items": "error",
|
||||
"silk_edge_clearance": "warning",
|
||||
"silk_over_copper": "ignore",
|
||||
"silk_overlap": "warning",
|
||||
"skew_out_of_range": "error",
|
||||
"solder_mask_bridge": "error",
|
||||
"starved_thermal": "error",
|
||||
"text_height": "warning",
|
||||
"text_thickness": "warning",
|
||||
"through_hole_pad_without_hole": "error",
|
||||
"too_many_vias": "error",
|
||||
"track_dangling": "warning",
|
||||
@@ -100,7 +112,6 @@
|
||||
"unconnected_items": "error",
|
||||
"unresolved_variable": "error",
|
||||
"via_dangling": "warning",
|
||||
"zone_has_empty_net": "error",
|
||||
"zones_intersect": "error"
|
||||
},
|
||||
"rules": {
|
||||
@@ -108,20 +119,65 @@
|
||||
"allow_microvias": false,
|
||||
"max_error": 0.005,
|
||||
"min_clearance": 0.0,
|
||||
"min_connection": 0.0,
|
||||
"min_copper_edge_clearance": 0.0,
|
||||
"min_hole_clearance": 0.25,
|
||||
"min_hole_to_hole": 0.25,
|
||||
"min_microvia_diameter": 0.19999999999999998,
|
||||
"min_microvia_drill": 0.09999999999999999,
|
||||
"min_resolved_spokes": 2,
|
||||
"min_silk_clearance": 0.0,
|
||||
"min_text_height": 0.7999999999999999,
|
||||
"min_text_thickness": 0.08,
|
||||
"min_through_hole_diameter": 0.3,
|
||||
"min_track_width": 0.19999999999999998,
|
||||
"min_via_annular_width": 0.049999999999999996,
|
||||
"min_via_diameter": 0.39999999999999997,
|
||||
"solder_mask_clearance": 0.0,
|
||||
"solder_mask_min_width": 0.0,
|
||||
"solder_mask_to_copper_clearance": 0.0,
|
||||
"use_height_for_length_calcs": true
|
||||
},
|
||||
"teardrop_options": [
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 5,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_onpadsmd": true,
|
||||
"td_onroundshapesonly": false,
|
||||
"td_ontrackend": false,
|
||||
"td_onviapad": true
|
||||
}
|
||||
],
|
||||
"teardrop_parameters": [
|
||||
{
|
||||
"td_curve_segcount": 0,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_target_name": "td_round_shape",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
},
|
||||
{
|
||||
"td_curve_segcount": 0,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_target_name": "td_rect_shape",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
},
|
||||
{
|
||||
"td_curve_segcount": 0,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_target_name": "td_track_end",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
}
|
||||
],
|
||||
"track_widths": [
|
||||
0.0,
|
||||
0.2,
|
||||
@@ -138,7 +194,8 @@
|
||||
"zones_allow_external_fillets": false,
|
||||
"zones_use_no_outline": true
|
||||
},
|
||||
"layer_presets": []
|
||||
"layer_presets": [],
|
||||
"viewports": []
|
||||
},
|
||||
"boards": [],
|
||||
"cvpcb": {
|
||||
@@ -322,18 +379,23 @@
|
||||
"rule_severities": {
|
||||
"bus_definition_conflict": "error",
|
||||
"bus_entry_needed": "error",
|
||||
"bus_label_syntax": "error",
|
||||
"bus_to_bus_conflict": "error",
|
||||
"bus_to_net_conflict": "error",
|
||||
"conflicting_netclasses": "error",
|
||||
"different_unit_footprint": "error",
|
||||
"different_unit_net": "error",
|
||||
"duplicate_reference": "error",
|
||||
"duplicate_sheet_names": "error",
|
||||
"endpoint_off_grid": "warning",
|
||||
"extra_units": "error",
|
||||
"global_label_dangling": "warning",
|
||||
"hier_label_mismatch": "error",
|
||||
"label_dangling": "error",
|
||||
"lib_symbol_issues": "warning",
|
||||
"missing_bidi_pin": "warning",
|
||||
"missing_input_pin": "warning",
|
||||
"missing_power_pin": "error",
|
||||
"missing_unit": "warning",
|
||||
"multiple_net_names": "warning",
|
||||
"net_not_bus_member": "warning",
|
||||
"no_connect_connected": "warning",
|
||||
@@ -343,6 +405,7 @@
|
||||
"pin_to_pin": "warning",
|
||||
"power_pin_not_driven": "error",
|
||||
"similar_labels": "warning",
|
||||
"simulation_model_issue": "error",
|
||||
"unannotated": "error",
|
||||
"unit_value_mismatch": "error",
|
||||
"unresolved_variable": "error",
|
||||
@@ -360,7 +423,7 @@
|
||||
"net_settings": {
|
||||
"classes": [
|
||||
{
|
||||
"bus_width": 12.0,
|
||||
"bus_width": 12,
|
||||
"clearance": 0.2,
|
||||
"diff_pair_gap": 0.25,
|
||||
"diff_pair_via_gap": 0.25,
|
||||
@@ -374,13 +437,15 @@
|
||||
"track_width": 0.25,
|
||||
"via_diameter": 0.8,
|
||||
"via_drill": 0.4,
|
||||
"wire_width": 6.0
|
||||
"wire_width": 6
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"version": 2
|
||||
"version": 3
|
||||
},
|
||||
"net_colors": null
|
||||
"net_colors": null,
|
||||
"netclass_assignments": null,
|
||||
"netclass_patterns": []
|
||||
},
|
||||
"pcbnew": {
|
||||
"last_paths": {
|
||||
@@ -396,6 +461,8 @@
|
||||
"schematic": {
|
||||
"annotate_start_num": 0,
|
||||
"drawing": {
|
||||
"dashed_lines_dash_length_ratio": 12.0,
|
||||
"dashed_lines_gap_length_ratio": 3.0,
|
||||
"default_line_thickness": 6.0,
|
||||
"default_text_size": 50.0,
|
||||
"field_names": [],
|
||||
@@ -425,9 +492,13 @@
|
||||
"workbook_filename": ""
|
||||
},
|
||||
"page_layout_descr_file": "",
|
||||
"plot_directory": "",
|
||||
"plot_directory": "./",
|
||||
"spice_adjust_passive_values": false,
|
||||
"spice_current_sheet_as_root": false,
|
||||
"spice_external_command": "spice \"%I\"",
|
||||
"spice_model_current_sheet_as_root": true,
|
||||
"spice_save_all_currents": false,
|
||||
"spice_save_all_voltages": false,
|
||||
"subpart_first_id": 65,
|
||||
"subpart_id_separator": 0
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@ void setup() {
|
||||
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
|
||||
delay(100);
|
||||
delay(200);
|
||||
|
||||
for (int &pin : pins_to_test) {
|
||||
Serial.print("Waiting for pin ");
|
||||
@@ -41,6 +41,8 @@ void setup() {
|
||||
delay(100);
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
}
|
||||
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
#else
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
|
||||
@@ -61,7 +63,7 @@ void loop() {
|
||||
Serial.println();
|
||||
|
||||
digitalWrite(pin, HIGH);
|
||||
delay(1000);
|
||||
delay(300);
|
||||
digitalWrite(pin, LOW);
|
||||
}
|
||||
#endif
|
||||
|
||||
9
tools/README.md
Normal file
9
tools/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Tools
|
||||
|
||||
## `oem-flash.sh`
|
||||
|
||||
This script is used before shipment to flash the Upsy Desky with the stock firmware, and to reprogram the CP2102 USB-to-serial chip with the correct name and serial (based on MAC address).
|
||||
|
||||
## `test-flash.sh`
|
||||
|
||||
Flashes the test firmware with PlatformIO (see `../test-firmware`).
|
||||
12
tools/oem-flash.sh
Executable file
12
tools/oem-flash.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
MAC_ADDR=$(esptool.py --chip esp32 read_mac | sed -En "s/MAC: (.*)/\1/p" | uniq | sed 's/://g')
|
||||
esphome upload --device /dev/cu.usbserial* ../firmware/stock.yaml
|
||||
|
||||
if ! command -v cp210x-cfg &> /dev/null
|
||||
then
|
||||
# Get cp210x-cfg from https://github.com/DiUS/cp210x-cfg
|
||||
echo "cp210x-cfg was not found; CP2102 will not be serialized or renamed"
|
||||
else
|
||||
cp210x-cfg -N "Upsy Desky" -S $MAC_ADDR
|
||||
fi
|
||||
2
tools/test-flash.sh
Executable file
2
tools/test-flash.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
platformio run -d ../test-firmware --target upload --environment test_target
|
||||
1
tools/tindie/.gitignore
vendored
Normal file
1
tools/tindie/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.csv
|
||||
26
tools/tindie/split-csv.sh
Executable file
26
tools/tindie/split-csv.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -f ud_orders.csv ground_advantage_and_intl.csv priority.csv priority_express.csv pickup.csv
|
||||
|
||||
csvq -o ud_orders.csv "SELECT * FROM all_orders WHERE \`Model Number\` LIKE \"%UPSY%\";"
|
||||
|
||||
csvq -o ground_advantage_and_intl.csv "SELECT * FROM ud_orders WHERE \`Shipping Method\` LIKE \"%Ground Advantage%\" OR \`Shipping Method\` LIKE \"%Simple Export Rate%\" OR \`Shipping Method\` LIKE \"%First-Class Package International%\";"
|
||||
csvq -o priority.csv "SELECT * FROM ud_orders WHERE \`Shipping Method\` LIKE \"%Priority Mail%\" AND \`Shipping Method\` NOT LIKE \"%Priority Mail Express%\";"
|
||||
csvq -o priority_express.csv "SELECT * FROM ud_orders WHERE \`Shipping Method\` LIKE \"%Priority Mail Express%\";"
|
||||
csvq -o pickup.csv "SELECT * FROM ud_orders WHERE \`Shipping Method\` LIKE \"%Pickup%\";"
|
||||
|
||||
SANITY_CHECK_QUERY=$(cat <<-END
|
||||
SELECT
|
||||
(SELECT count(*) from ud_orders)
|
||||
=
|
||||
(
|
||||
(SELECT count(*) from ground_advantage_and_intl) +
|
||||
(SELECT count(*) from priority) +
|
||||
(SELECT count(*) from priority_express) +
|
||||
(SELECT count(*) from pickup)
|
||||
)
|
||||
AS SanityCheck;
|
||||
END
|
||||
)
|
||||
|
||||
csvq "$SANITY_CHECK_QUERY"
|
||||
Reference in New Issue
Block a user