anduril: needs a factory reset function

Bug #1802500 reported by Thomas Arthofer
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Flashlight Firmware Repository
Fix Released
Medium
Selene ToyKeeper

Bug Description

Currently, there is no way of resetting the light to factory defaults.

Idea: By holding down on boot, the light enters a "self destruct" sequence

Revision history for this message
Thomas Arthofer (arthofer-thomas) wrote :

By holding down the eSwitch on boot, the light will:

- Start a triangle ramp with increasing frequency
- Upon reaching the max, calibrate to ROOM_TEMPERATURE
- Write the defaults to EEPROM
- Go to off state

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Oops, I didn't see this when I was on a bug-filing spree, and I made a duplicate. Copying the description of that bug here:

-----

People are sometimes afraid that they will mess up their settings and not be able to get back to sane values. Both Bistro and Narsil had factory reset functions, and it gave people sort of a safety net. I avoided including one for Anduril, because I feel its interface is simple enough it shouldn't need one, but maybe it should be included after all.

Part of the reason for this is to make it easier for manufacturers to calibrate their products at the factory. The attiny85's thermal sensor varies widely from unit to unit, so for thermal regulation it's really important to calibrate the sensor.

What I have in mind is something like what I use for the "self-destruct" function on my lightsaber:

  - Disconnect power. (loosen battery tube or something)
  - Hold the e-switch.
  - Connect power.
  - Continue holding the e-switch for a few seconds, while the light makes an escalating warning buzz.
  - If the user lets go of the e-switch: abort, fade the LED, and boot normally.
  - Otherwise, when the timeout is reached...
    - Do an automatic thermal calibration, based on the assumption that the light is currently at room temperature.
    - Save the config values (which are default because it hasn't loaded eeprom yet).
    - Make a bright flash to indicate the reset is complete, then sparkle back down to off.

Maybe it doesn't need to be as fancy as the lightsaber version, but still. This would make it easy for people to get sane values.

Changed in flashlight-firmware:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Selene ToyKeeper (toykeeper)
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Assigning to me, since a patch is available and waiting on me to test/merge it.

summary: - Allow reset to factory defaults
+ anduril: needs a factory reset function
Revision history for this message
Thomas Arthofer (arthofer-thomas) wrote :

Strange Idea:

Make ROOM_TEMPERATURE a value in flash instead of a define.
After the build, export the address of the const (and maybe some others) to another file (simmilar to a2l in vehicle software)

e.g.:

ROOM_TEMPERATURE - uint8 - 0xDEADBEEF
THERM_CEIL - uint8 - 0xDECAFBAD

Provide a script which takes that "fsm-a2l" file and allows to patch those values after the build.

Reason:
Programming station reads the temperature (environment or IR-temperature of the head), patches the hex-file and flashs the values.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

I'm not sure anyone has the equipment or skill to implement that solution in a production environment, and it still doesn't resolve the issue of the attiny sensor being uncalibrated. Due to communication and translation difficulties, it is difficult to get manufacturers to use the correct fuse values, much less get them to patch a hex file.

However, what it could do is, at boot time, if the thermal calibration value isn't set, it could do a quick calibration. Normally, this would happen the first time a customer puts a battery in. It's like the manual factory reset, except it happens automatically on first boot.

Revision history for this message
Thomas Arthofer (arthofer-thomas) wrote :

This patch needs a small change. It currently passed the values ROOM_TEMP (20) and DEFAULT_THERM_CEIL (45) to the save function.

Sadly, the save function saves 30+passed value to the EEPROM.

In the current case, 75°C is set as the thermal ceiling if this is implemented that way.

Changed in flashlight-firmware:
status: In Progress → Confirmed
status: Confirmed → Incomplete
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

That was odd. Looks like a bot of some sort.

Changed in flashlight-firmware:
status: Incomplete → Confirmed
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

BTW, I gave this a quick try last month, hoping to get a reset function in time for the FW3A... but things didn't go well. I went back to a solid and well-tested build for that, and haven't really gotten back to the reset function yet. But it should still happen.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

I forgot to update this when I fixed it, but the new feature was released almost a month ago.

Changed in flashlight-firmware:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.