Skip to content

Latest commit

 

History

History
558 lines (366 loc) · 34.3 KB

README.md

File metadata and controls

558 lines (366 loc) · 34.3 KB

Firmware for Status Indicator Display (SID)

This repository holds the most current firmware for CircuitSetup's magnificent SID kit. The SID, also known as "Field Containment System Display", is an important part of Doc Brown's Delorean Time Machine.

The hardware is available here. The SID replica can be used stand-alone, or in connection with CircuitSetup's Time Circuits Display. It's made of metal and perfectly fit for mounting in an actual Delorean.

mysid

Features include

Installation

If a previous version of the SID firmware is installed on your device, you can update easily using the pre-compiled binary. Enter the Config Portal, click on "Update" and select the pre-compiled binary file provided in this repository (install/sid-A10001986.ino.nodemcu-32s.bin).

If you are using a fresh ESP32 board, please see sid-A10001986.ino for detailed build and upload information, or, if you don't want to deal with source code, compilers and all that nerd stuff, go here and follow the instructions.

Important: After a firmware update, a "wait" symbol (hourglass) might be shown for a short while after reboot. Do NOT unplug the device during this time.

Initial Configuration

The following instructions only need to be followed once, on fresh SIDs. They do not need to be repeated after a firmware update.

The first step is to establish access to the SID's configuration web site ("Config Portal") in order to configure your SID:

  • Power up the SID and wait until the startup sequence has completed.
  • Connect your computer or handheld device to the WiFi network "SID-AP".
  • Navigate your browser to http://sid.local or http://192.168.4.1 to enter the Config Portal.

Connecting to a WiFi network

As long as the device is unconfigured, it creates a WiFi network of its own named "SID-AP". This is called "Access point mode", or "AP-mode".

It is ok to leave the SID in this mode, especially if it run stand-alone. In a typical home setup and/or if you also have a Time Circuits Display, however, you might want to connect the SID to a WiFi network (in case of using it together with a TCD: to the same WiFi network the TCD is connected to). If you have your SID, along with a Time Circuits Display, mounted in a car, you might want to connect the SID to the TCD's very own WiFi network "TCD-AP"; see here.

In order to connect your SID to a WiFi network, click on "Configure WiFi". The bare minimum is to select an SSID (WiFi network name) and a WiFi password.

Note that the SID requests an IP address via DHCP, unless you entered valid data in the fields for static IP addresses (IP, gateway, netmask, DNS). If the device is inaccessible as a result of incorrect static IPs, wait until the SID has completed its startup sequence, then type *123456OK on the IR remote; static IP data will be deleted and the device will return to DHCP after a reboot.

After saving the WiFi network settings, the SID reboots and tries to connect to your configured WiFi network. If that fails, it will again start in access point mode.

After completing this step, your SID is basically ready for use; you can also continue configuring it to your personal preferences through the Config Portal.

The Config Portal

The "Config Portal" is the SID's configuration web site.

The Config Portal
The Config Portal's main page

It can be accessed as follows:

If SID is in AP mode

If SID is connected to WiFi network

  • Connect your hand-held/computer to the same WiFi network to which the SID is connected, and

  • navigate your browser to http://sid.local

    Accessing the Config Portal through this address requires the operating system of your hand-held/computer to support Bonjour/mDNS: Windows 10 version TH2 (1511) [other sources say 1703] and later, Android 13 and later; MacOS and iOS since the dawn of time.

    If connecting to http://sid.local fails due to a name resolution error, you need to find out the SID's IP address: Type *90 followed by OK on the remote control; the IP address will be shown on the display. Then, on your handheld or computer, navigate to http://a.b.c.d (a.b.c.d being the IP address as shown on the SID's display) in order to enter the Config Portal.

In the main menu, click on "Setup" to configure your SID.

Click for full screenshot

A full reference of the Config Portal is here.

Basic Operation

When the SID is idle, it shows an idle pattern. There are alternative idle patterns to choose from, selected by *10OK through *14OK on the remote, or via MQTT. If an SD card is present, the setting will be persistent across reboots.

If the option Adhere strictly to movie patterns is set (which is the default), the idle patterns #0 through #3 will only use patterns extracted from the movies (plus some interpolations); the same goes for when GPS speed is used. If this option is unset, random variations are shown, which is less boring, but also less accurate.

For ways to trigger a time travel, see here.

The main control device is the supplied IR remote control. If a TCD is connected through BTTF-Network, the SID can also be controlled through the TCD's keypad.

IR remote control

Your SID has an IR remote control included. This remote works out-of-the-box and needs no setup.

Supplied IR remote control
The default IR remote control

Each time you press a (recognized) key on the remote, an IR feedback LED will briefly light up. This LED is located at the bottom of the board.

IR learning

Your SID can learn the codes of another IR remote control. Most remotes with a carrier signal of 38kHz (which most IR remotes use) will work. However, some remote controls, especially ones for TVs, send keys repeatedly and/or send different codes alternately. If you had the SID learn a remote and the keys are not (always) recognized afterwards or appear to the pressed repeatedly while held, that remote is of that type and cannot be used.

IR Learning requires a physical Time Travel button.

First, go to the Config Portal, uncheck TCD connected by wire on the Setup page and save. The SID reboots. Afterwards, to start the learning process, hold the Time Travel button for a few seconds, until the displays shows "GO" followed by "0". Then press "0" on your remote, which the SID will visually acknowledge by displaying the next key to press. Then press "1", wait for the acknowledgement, and so on. Enter your keys in the following order:

0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - * - # - Arrow up - Arrow down - Arrow left - Arrow right - OK

If your remote control lacks the * (starts command sequence) and # (aborts command sequence) keys, you can use any other key, of course. * could be eg. "menu" or "setup", # could be "exit" or "return".

If no key is pressed for 10 seconds, the learning process aborts, as does briefly pressing the Time Travel button. In those cases, the keys already learned are forgotten and nothing is saved.

To make the SID forget a learned IR remote control, type *654321 followed by OK.

Locking IR control

You can have your SID ignore IR commands from any IR remote control (be it the default supplied one, be it one you had the SID learn) by entering *71 followed by OK. After this sequence, the SID will ignore all IR commands until *71OK is entered again. The purpose of this function is to enable you to use the same remote for your SID and other props (such as the Flux Capacitor).

Note that the status of the IR lock is saved 10 seconds after its last change, and is persistent across reboots.

In order to only disable the supplied IR remote control, check the option Disable supplied IR remote control in the Config Portal. In that case, any learned remote will still work.

Remote control reference

Single key actions
1
Games: Quit
2
-
3
Games: New game
4
-
5
-
6
-
7
-
8
-
9
Games: Pause
*
Start command sequence
0
Time Travel
Siddly: Fall down
#
Abort command sequence

Increase Brightness
Siddly: Rotate
Snake: Up

Games: Left
OK
Execute command

Games: Right

Decrease Brightness
Games: Down
Special sequences
(⏎ = OK key)
FunctionCode on remoteCode on TCD
Default idle pattern *10⏎6010
Idle pattern 1 *11⏎6011
Idle pattern 2 *12⏎6012
Idle pattern 3 *13⏎6013
Idle pattern 4 *14⏎6014
Switch to idle mode *20⏎6020
Start Spectrum Analyzer *21⏎6021
Start Siddly game *22⏎6022
Start Snake game *23⏎6023
Enable/disable "strictly movie patterns" *60⏎6060
Enable/disable peaks in Spectrum Analyzer *61⏎6061
Disable/Enable IR remote commands *71⏎6071
Display current IP address *90⏎6090
Set brightness level (00-15) *400⏎ - *415⏎6400-6415
Reboot the device *64738⏎6064738
Delete static IP address
and WiFi-AP password
*123456⏎6123456
Delete learned IR remote control *654321⏎6654321

Here is a cheat sheet for printing or screen-use. (Note that MacOS' preview application has a bug that scrambles the links in the document. Acrobat Reader does it correctly.)

Time travel

To travel through time, type "0" on the remote control. The SID will play its time travel sequence.

You can also connect a physical button to your SID; the button must connect "TT" to "3.3V" on the "Time Travel" connector. Pressing this button briefly will trigger a time travel.

Other ways of triggering a time travel are available if a Time Circuits Display is connected.

Spectrum Analyzer

The spectrum analyzer (or rather: frequency-separated vu meter) works through a built-in microphone. This microphone is located behind the right hand side center hole of the enclosure.

Sticky peaks are optional, they can be switched on/off in the Config Portal and by typing *51 followed by OK on the remote.

Games

Siddly

Siddly is a simple game where puzzle pieces of various shapes fall down from the top. You can slide them left and right, as well as rotate them while they are falling. When the piece lands at the bottom, a new piece will appear at the top and start falling down. If a line at the bottom is completely filled with fallen pieces or parts thereof, that line will be cleared, and everything piled on top of that line will move down. The target is to keep the pile at the bottom as low as possible; the game ends when the pile is as high as the screen and no new piece has room to appear. I think you get the idea. Note that the red LEDs at the top are not part of the playfield (but show a level-progress bar instead), the field only covers the yellow and green LEDs, and that similarities of Siddly with computer games, especially older ones, exist only in your imagination.

Snake

Snakes like apples (at least so I have heard). You control a snake that feels a profound urge to eat apples. After each eaten apple, the snake grows, and a new apple appears. Unfortunately, snakes don't like to hit their heads, so you need to watch out that the snake's head doesn't collide with its body.

SD card

Preface note on SD cards: For unknown reasons, some SD cards simply do not work with this device. For instance, I had no luck with Sandisk Ultra 32GB and "Intenso" cards. If your SD card is not recognized, check if it is formatted in FAT32 format (not exFAT!). Also, the size must not exceed 32GB (as larger cards cannot be formatted with FAT32). Transcend SDHC cards and those work fine in my experience.

The SD card is used for saving secondary settings, in order to avoid Flash Wear on the SID's ESP32. The chosen idle pattern (*1x), along with the "strictly movie patterns" setting, is only stored on SD, so for your selection to be persistent across reboots, an SD card is required.

Note that the SD card must be inserted before powering up the device. It is not recognized if inserted while the SID is running. Furthermore, do not remove the SD card while the device is powered.

Connecting a Time Circuits Display

BTTF-Network ("BTTFN")

The TCD can communicate with the SID wirelessly, via the built-in "Basic-Telematics-Transmission-Framework" over WiFi. It can send out information about a time travel and an alarm, and the SID queries the TCD for speed and some other data. Furthermore, the TCD's keypad can be used to remote-control the SID.

Watch the video
Click to watch the video

Note that the TCD's firmware must be up to date for BTTFN. You can use this one or CircuitSetup's release 2.9 or later.

BTTFN connection

In order to connect your SID to the TCD using BTTFN, just enter the TCD's IP address or hostname in the IP address or hostname of TCD field in the SID's Config Portal. On the TCD, no special configuration is required. Note that you need TCD firmware 2.9.1 or later for using a hostname; previous versions only work with an IP address.

Afterwards, the SID and the TCD can communicate wirelessly and

  • play time travel sequences in sync,
  • both play an alarm-sequence when the TCD's alarm occurs,
  • the SID can be remote controlled through the TCD's keypad (command codes 6xxx),
  • the SID queries the TCD for GPS speed if desired to adapt its idle pattern to GPS speed,
  • the SID queries the TCD for fake power and night mode, in order to react accordingly if so configured,
  • pressing "0" on the IR remote control or the SID's Time Travel button can trigger a synchronized Time Travel on all BTTFN-connected devices, just like if that Time Travel was triggered through the TCD.

You can use BTTF-Network and MQTT at the same time, see below.

Connecting a TCD by wire

Note that a wired connection only allows for synchronized time travel sequences, no other communication takes place. A wireless connection over BTTFN/WiFi is much more powerful and therefore recommended over a wired connection.

For a connection by wire, connect GND and GPIO on the SID's "Time Travel" connector to the TCD like in the table below:

SID TCD with control board >=1.3 TCD with control board 1.2
GND of 3-pin connector GND of "Time Travel" connector GND of "IO14" connector
TT of 3-pin connector TT OUT of "Time Travel" connector IO14 of "IO14" connector

Do not connect 3_3V to the TCD!

Next, head to the Config Portal and set the option TCD connected by wire. On the TCD, the option "Control props connected by wire" must be set.

You can connect both the TCD and a button to the TT connector, which might be handy in case you want to have the SID learn an IR remote control without fiddling with cables. But the button should not be pressed when the option TCD connected by wire is set, as it might yield unwanted results. Also, note that the button connects IO13 to 3_3V (not GND!).

Home Assistant / MQTT

The SID supports the MQTT protocol version 3.1.1 for the following features:

Control the SID via MQTT

The SID can - to a some extent - be controlled through messages sent to topic bttf/sid/cmd. Support commands are

  • TIMETRAVEL: Start a time travel
  • IDLE: Switch to idle mode
  • SA: Start spectrum analyzer
  • IDLE_0, IDLE_1, IDLE_2, IDLE_3, IDLE_4: Select idle pattern

Receive commands from Time Circuits Display

If both TCD and SID are connected to the same broker, and the option Send event notifications is checked on the TCD's side, the SID will receive information on time travel and alarm and play their sequences in sync with the TCD. Unlike BTTFN, however, no other communication takes place.

MQTT connection

MQTT and BTTFN can co-exist. However, the TCD only sends out time travel and alarm notifications through either MQTT or BTTFN, never both. If you have other MQTT-aware devices listening to the TCD's public topic (bttf/tcd/pub) in order to react to time travel or alarm messages, use MQTT (ie check Send event notifications). If only BTTFN-aware devices are to be used, uncheck this option to use BTTFN as it has less latency.

Setup

In order to connect to a MQTT network, a "broker" (such as mosquitto, EMQ X, Cassandana, RabbitMQ, Ejjaberd, HiveMQ to name a few) must be present in your network, and its address needs to be configured in the Config Portal. The broker can be specified either by domain or IP (IP preferred, spares us a DNS call). The default port is 1883. If a different port is to be used, append a ":" followed by the port number to the domain/IP, such as "192.168.1.5:1884".

If your broker does not allow anonymous logins, a username and password can be specified.

Limitations: MQTT Protocol version 3.1.1; TLS/SSL not supported; ".local" domains (MDNS) not supported; server/broker must respond to PING (ICMP) echo requests. For proper operation with low latency, it is recommended that the broker is on your local network.

Car setup

If your SID, along with a Time Circuits Display, is mounted in a car, the following network configuration is recommended:

TCD

  • Run your TCD in car mode;
  • disable WiFi power-saving on the TCD by setting WiFi power save timer for AP-mode to 0 (zero).

SID

Enter the Config Portal on the SID (as described above), click on Setup and

  • enter 192.168.4.1 into the field IP address or hostname of TCD
  • check the option Follow TCD fake power if you have a fake power switch for the TCD (like eg a TFC switch)
  • click on Save.

After the SID has restarted, re-enter the SID's Config Portal (while the TCD is powered and in car mode) and

  • click on Configure WiFi,
  • select the TCD's access point name in the list at the top or enter TCD-AP into the SSID field; if you password-protected your TCD's AP, enter this password in the password field. Leave all other fields empty,
  • click on Save.

Using this setup enables the SID to receive notifications about time travel and alarm wirelessly, and to query the TCD for data. Also, the TCD keypad can be used to remote-control the SID.

In order to access the SID's Config Portal in your car, connect your hand held or computer to the TCD's WiFi access point ("TCD-AP"), and direct your browser to http://sid.local ; if that does not work, go to the TCD's keypad menu, press ENTER until "BTTFN CLIENTS" is shown, hold ENTER, and look for the SID's IP address there; then direct your browser to that IP by using the URL http://a.b.c.d (a-d being the IP address displayed on the TCD display).

Flash Wear

Flash memory has a somewhat limited life-time. It can be written to only between 10.000 and 100.000 times before becoming unreliable. The firmware writes to the internal flash memory when saving settings and other data. Every time you change settings, data is written to flash memory.

In order to reduce the number of write operations and thereby prolong the life of your SID, it is recommended to use a good-quality SD card and to check "Save secondary settings on SD" in the Config Portal; some settings as well as learned IR codes are then stored on the SD card (which also suffers from wear but is easy to replace). See here for more information.

Appendix A: The Config Portal

Main page

▶ Configure WiFi

Clicking this leads to the WiFi configuration page. On that page, you can connect your SID to your WiFi network by selecting/entering the SSID (WiFi network name) as well as a password (WPA2). By default, the SID requests an IP address via DHCP. However, you can also configure a static IP for the SID by entering the IP, netmask, gateway and DNS server. All four fields must be filled for a valid static IP configuration. If you want to stick to DHCP, leave those four fields empty.

Note that this page has nothing to do with Access Point mode; it is strictly for connecting your SID to an existing WiFi network as a client.

▶ Setup

This leads to the Setup page.

▶ Update

This leads to the firmware update page. You can select a locally stored firmware image file to upload (such as the ones published here in the install/ folder).

▶ Erase WiFi Config

Clicking this (and saying "yes" in the confirmation dialog) erases the WiFi configuration (WiFi network and password) and reboots the device; it will restart in "access point" mode. See here.


Setup page

Basic settings

▶ Screen saver timer

Enter the number of minutes until the Screen Saver should become active when the SID is idle.

The Screen Saver, when active, disables all LEDs, until

  • a key on the IR remote control is pressed; if IR is locked, only the # key deactivates the Screen Saver;
  • the time travel button is briefly pressed (the first press when the screen saver is active will not trigger a time travel),
  • on a connected TCD, a destination date is entered (only if TCD is wirelessly connected) or a time travel event is triggered (also when wired).

Hardware configuration settings

▶ Disable supplied IR remote control

Check this to disable the supplied remote control; the SID will only accept commands from a learned IR remote (if applicable).

Note that this only disables the supplied remote, unlike IR locking, where IR commands from any known remote are ignored.

Network settings

▶ Hostname

The device's hostname in the WiFi network. Defaults to 'sid'. This also is the domain name at which the Config Portal is accessible from a browser in the same local network. The URL of the Config Portal then is http://hostname.local (the default is http://sid.local)

If you have more than one SID in your local network, please give them unique hostnames.

▶ AP Mode: Network name appendix

By default, if the SID creates a WiFi network of its own ("AP-mode"), this network is named "SID-AP". In case you have multiple SIDs in your vicinity, you can have a string appended to create a unique network name. If you, for instance, enter "-ABC" here, the WiFi network name will be "SID-AP-ABC". Characters A-Z, a-z, 0-9 and - are allowed.

▶ AP Mode: WiFi password

By default, and if this field is empty, the SID's own WiFi network ("AP-mode") will be unprotected. If you want to protect your SID access point, enter your password here. It needs to be 8 characters in length and only characters A-Z, a-z, 0-9 and - are allowed.

If you forget this password and are thereby locked out of your SID, enter *123456 followed by OK on the IR remote control; this deletes the WiFi password. Then power-down and power-up your SID and the access point will start unprotected.

▶ WiFi connection attempts

Number of times the firmware tries to reconnect to a WiFi network, before falling back to AP-mode. See here

▶ WiFi connection timeout

Number of seconds before a timeout occurs when connecting to a WiFi network. When a timeout happens, another attempt is made (see immediately above), and if all attempts fail, the device falls back to AP-mode. See here

Settings for prop communication/synchronization

▶ TCD connected by wire

Check this if you have a Time Circuits Display connected by wire. Note that a wired connection only allows for synchronized time travel sequences, no other communication takes place.

While you can connect both a button and the TCD to the "time travel" connector on the SID, the button should not be pressed when this option is set, as it might yield unwanted effects.

Also note that the process of learning keys from an IR remote control requires this option to be unchecked. After learning keys is done, you can, of course, check this option again.

Do NOT check this option if your TCD is connected wirelessly (BTTFN, MQTT).

▶ TCD signals Time Travel without 5s lead

Usually, the TCD signals a time travel with a 5 seconds lead, in order to give a prop a chance to play an acceleration sequence before the actual time travel takes place. Since this 5 second lead is unique to CircuitSetup props, and people sometimes want to connect third party props to the TCD, the TCD has the option of skipping this 5 seconds lead. If that is the case, and your SID is connected by wire, you need to set this option.

If your SID is connected wirelessly, this option has no effect.

▶ IP address or hostname of TCD

If you want to have your SID to communicate with a Time Circuits Display wirelessly ("BTTF-Network"), enter the IP address of the TCD here. If your TCD is running firmware version 2.9.1 or later, you can also enter the TCD's hostname here instead (eg. 'timecircuits').

If you connect your SID to the TCD's access point ("TCD-AP"), the TCD's IP address is 192.168.4.1.

▶ Adapt to GPS speed

If this option is checked and your TCD is equipped with a GPS sensor or a rotary encoder, the SID will adapt its display pattern to current GPS speed or the reading of the encoder, respectively.

▶ Follow TCD night-mode

If this option is checked, and your TCD goes into night mode, the SID will activate the Screen Saver with a very short timeout.

▶ Follow TCD fake power

If this option is checked, and your TCD is equipped with a fake power switch, the SID will also fake-power up/down. If fake power is off, no LED is active and the SID will ignore all input from buttons, knobs and the IR control.

▶ '0' and button trigger BTTFN-wide TT

If the SID is connected to a TCD through BTTFN, this option allows to trigger a synchronized time travel on all BTTFN-connected devices when pressing "0" on the IR remote control or pressing the Time Travel button, just as if the Time Travel was triggered by the TCD. If this option is unchecked, pressing "0" or the Time Travel button only triggers a Time Travel sequence on the SID.

▶ Show clock when Screen Saver is active

If this option is checked, the SID will show current local time - as queried from the TCD - when the Screen Saver is active.

Visual options

▶ Adhere strictly to movie patterns

If this option is checked, in idle modes 0-3 as well as when using GPS speed, only patterns which were extracted from the movies (plus some interpolations) are shown. If this option is unchecked, random variations will be shown, which is less accurate, but also less monotonous. Purists will want this option to be set, which is also the default. This option can also be changed by typing *50 followed by OK on the IR remote control.

Note that this option setting, along with the current idle pattern, is only saved if there is an SD card present. Without an SD card, this setting is always reset to "checked" upon power-up.

▶ Skip time tunnel animation

When set, the time travel sequence will not be animated (no flicker, no "moving bar"). Purists will want this option to be set; the default is unset.

▶ Show peaks in Spectrum Analyzer

This selects the boot-up setting for showing or not showing the peaks in the Spectrum Analyzer. Can be changed anytime by typing *51 followed by OK on the IR remote control.

Home Assistant / MQTT settings

▶ Use Home Assistant (MQTT 3.1.1)

If checked, the SID will connect to the broker (if configured) and send and receive messages via MQTT

▶ Broker IP[:port] or domain[:port]

The broker server address. Can be a domain (eg. "myhome.me") or an IP address (eg "192.168.1.5"). The default port is 1883. If different port is to be used, it can be specified after the domain/IP and a colon ":", for example: "192.168.1.5:1884". Specifying the IP address is preferred over a domain since the DNS call adds to the network overhead. Note that ".local" (MDNS) domains are not supported.

▶ User[:Password]

The username (and optionally the password) to be used when connecting to the broker. Can be left empty if the broker accepts anonymous logins.

Other settings

▶ Save secondary settings on SD

If this is checked, secondary settings (brightness, IR lock status, learned IR keys) are stored on the SD card (if one is present). This helps to minimize write operations to the internal flash memory and to prolong the lifetime of your SID. See Flash Wear.

Apart from Flash Wear, there is another reason for using an SD card for settings: Writing data to internal flash memory can cause delays of up to 1.5 seconds, which interrupt sequences and have other undesired effects. The SID needs to save data from time to time, so in order for a smooth experience without unexpected and unwanted delays, please use an SD card and check this option.

It is safe to have this option checked even with no SD card present.

If you want copy settings from one SD card to another, do as follows:

  • With the old SD card still in the slot, enter the Config Portal, turn off Save secondary settings on SD, and click "SAVE".
  • After the SID has rebooted, power it down, and swap the SD card for your new one.
  • Power-up the SID, enter the Config Portal, re-enable Save secondary settings on SD, and click "SAVE".

This procedure ensures that all your settings are copied from the old to the new SD card.

Text & images: (C) Thomas Winischhofer ("A10001986"). See LICENSE. Source: https://sid.out-a-ti.me