gcormier / megadesk_companion

companion board for megadesk to add smarthome functionality

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

megadesk companion

This board expands the megadesk to allow for additional functionality - notably esphome/homeassistant integration.

Tindie store

This is available for purchase at https://www.tindie.com/products/gcormier/megadesk-companion/

Features

  • For newer 5-pin megadesks, plug and play!
  • Older 3-pin megadesks require soldering 2 wires to SCK/MISO
    • Serial firmware is required. All units after December 2022 were flashed with the serial firmware.
  • Built-in logic-level shifting between megadesk (5V) and the ESP32 (3.3V)

Using

  • Pay attention to the warning on the PCB. It is imperative the RED+ on both sides represents the 24V power source.
  • The esphome files are located at the main megadesk repository
  • Using the USB-C port will use the ESP32-C3's native USB interface to support the first uploading of code
  • Connecting USB-C while the device is powered from the main cable will not cause damage. However, it is recommended to only use the USB-C port while flashing. The device can be flashed over WiFi after the first time.
  • Youtube Video - 3-pin hookup
  • Youtube Video - 5-pin hookup
  • CP210x drivers for Windows (linux supports this natively)

Additional Information

  • The megadesk repository is the main location for all discussion and issues. There is a popular discussion relating to esphome usage.
  • GPIO4/GPIO3/GND have been broken out to solder pads for those with other ideas.
    • They should only be used with 3.3V logic
    • They go directly to the ESP32 with no protection. Use logic signals only, do not power anything.
  • There is an additional 3 pin area that can be soldered to power RGB style LED strips.
    • The total power limit of the board is 500mA. The ESP32 will use up some of that, so it is recommended to avoid pulling excessive current and limit it to 200mA. If more power is needed, use an external power supply for the LEDs. The switching regulator powering the companion has a thermal shutdown if too much current is drawn.
    • The LED signal is 3.3V, the power is 5V

Why an addon board?

When designing I considered a brand new megadesk PCB with all of this functionality integrated, or an addon board.

With the addon, it achieves

  1. People who do NOT want any of this extra functionality do not need to pay the extra costs for this board. The ESP32 is pricy.
  2. We still respect the initial design goal of using the same enclosure.
  3. It provides an upgrade path for the many existing owners of megadesk to add-on this functionality without wasting their initial controller.
  4. It keeps the code base for megadesk isolated, and avoids refactoring the code to ESP32 and requiring me to support esphome changes over time.

Remote Control via REST-API

The megadesk-companion's default setup is done using esphome and can be found in the megadesk's respository under esphome/megadesk-companion.yaml. This setup includes an HTTP server that allows controlling the megadesk via the esphome REST-API.

By default, the megadesk-companion hosts a server at http://megadesk.local/ which listens on port 80. For example, to set the height, one can simply send a POST request:

curl -X POST 'http://megadesk.local/number/megadesk_height__cm_/set?value=<height>' # for height in cm
curl -X POST 'http://megadesk.local/number/megadesk_height__inches_/set?value=25' # for height in inches

About

companion board for megadesk to add smarthome functionality