Skip to content

Releases: jbaumann/attiny_daemon

New I2C command to read uptime

04 Jun 20:40
Compare
Choose a tag to compare

New/Added

Added I2C command UPTIME to return the uptime (this is not real milliseconds because the deep sleep turns off all millisecond functionality).

Changed

Nothing.

Fixed Bugs

The stored value for force_shutdown wasn't read from the EEPROM on startup. This has been fixed.

More Robust SMBus Communication and More Cleanup

23 May 21:02
Compare
Choose a tag to compare

New/Added

Nothing.

Changed

Removed old reference to Geekworm UPS1.

Refactored SMBus communication. Instead of keeping the connection open the whole time we now release it directly after the communication and reopen for the next request. This makes the communication more robust.

Fixed Bugs

Increased the settling time after initialization of the SMBus to 1 second. This should get rid of spurious lost connections to the ATTiny.

MQTT Support and major Clean-up

03 May 12:52
Compare
Choose a tag to compare

New/Added

Added a new script attiny_daemon_mqtt_status.py that allows logging of battery voltage and temperature to an MQTT server.

Changed

Modified the ATTiny Communication class to wait a bit longer when writing to the ATTiny. On the ATTiny write operations include writing to the EEPROM which needs more time.

Refactored handleCRC to get rid of the global variable for calculating the CRC.

Refactored I2C code. Moved all I2C code to handleI2C.ino (new function i2c_triggered_state_change()).
Reset bat_voltage(containing the average of the last 10 measurements) whenever the battery voltage coefficient or constant are changed.

Refactored all the state handling code. Everything pertaining to state is now found in handleState.ino.

Moved the delay that lets the ADC settle outside of the measurement loop, since the ADC configuration does not change inside the loop. This reduces the non-sleep time by 8ms ((NUM_MEASUREMENTS-1)*2).

Refactored setup() and main loop(). Moved EEPROM and I2C init code to the respective files. Move the remaining state handling to handle_state(). Moved the code handling the power down sleep to handle_sleep()

Optimized the handling of the ADC to reduce time spent running. Instead of waiting 2ms for each of the sources we now only wait 2ms for stabilizing the internal voltage reference. To get a measure of safety we discard the first measurement as suggested in the datasheet (the one that takes 25CLK and thus 100us).

Changed the order of instructions in ledOff_buttonOn(). This should reduce the power consumption still further.

Fixed Bugs

Changed check for fuse settings to ignore the startup time settings. All of them are ok when BOD is set.

LED OFF Mode

19 Apr 12:55
Compare
Choose a tag to compare

New/Added
Added LED Off Mode. This turns off all led blinken lights and heightens the WAF.

Refactored the source code. Changed #define-statements to enums. Added transitional state to state machine. Changed naming of states to make their function clearer. Moved EEPROM code to its own file.

Fixed Bugs
Fixed a bug in attiny_daemon.py leading to shutdown if ATTiny_Daemon not reachable. This was introduced by changing the in-band error signaling of the ATTiny_I2C class to out-of-band signalling.
Fixed bug that stored bat_v coefficient and bat_v constant into the respective ext_v fields.

Access current state of the ATTiny state machine

14 Apr 12:11
Compare
Choose a tag to compare

New/Added
Added get_internal_state() to read internal state of the ATTiny

Fixed Bugs
None

Fuse Check and automatic correction of wrong clock speed

13 Apr 13:43
Compare
Choose a tag to compare

New/Added
Check fuses and go into failure mode if they are set to wrong values. We accept the correct fuse values (as described in the Wiki) and the default values.
With default fuses we now change the clock speed from 1MHz to 8MHz on the fly.
Provide read access to fuse values over I2C and an additional python script to print them on the command line. This allows a simple check that the correct values have been used.

Fixed Bugs
Removed in-band signalling of errors in attiny_i2c.py (i.e., returning 0xFF on failure when reading 8-bit values and 0xFFFF when reading 16-bit values).

Brownout-Detection added

12 Apr 11:09
Compare
Choose a tag to compare

New/Added
Added sleep_bod_disable() to going to sleep, so we can use the BOD fuses that guarantee that the ATTiny is kept in RESET when the power goes below 2,7V (fuses have to be written using AVRDude).
Fixed Bugs
Changed default value for sw recovery delay to 1000 (the former default 500 was not long enough for all cases).

Full support for switched UPS

01 Apr 06:50
Compare
Choose a tag to compare

New/Added
Refactored the interaction with the UPS and added the functionality to turn the UPS off for the switched mode as well as for the voltage level mode.
Fixed Bugs
Fixed regression that reintroduced the '_num_retries' is not defined problem

Support for UPS switching

29 Mar 16:39
Compare
Choose a tag to compare

New/Added
Removed all support for the ATTiny45. Cleaned up code to mainly use switch-case-statements instead of the very long if-else if-chains.
Added full support for configurations that need a switch to be pressed potentially multiple times.
Changed the meaning of the value held in reset_configuration.
Added two registers, reset_pulse_length and sw_recovery_delay.
Both are reflected in the configuration (see example in attiny_damon.cfg)

Fixed Bugs
none

v2.2.0: Added functionality to read and write the reset configuration from th…

26 Mar 16:54
Compare
Choose a tag to compare

New/Added
Added functionality to read and write the reset configuration from the attiny_daemon. The corresponding option in the config file is 'reset configuration'. Bumped the minor version of both firmware and daemon to reflect the change. This is an intermediate version that does not provide shutdown functionality for reset configuration other than 0 (the reset pulse). The challenge here is that the ATTiny45 has not enough flash to implement that functionality. So all future development will be only for the ATTiny85. Since I believe I'm the only one still using the small MCU, this should not be a problem for anyone (except for me and my pride, but the remaining 4 bytes do not allow for much additional functionality...). To reiterate: This is the last version for the ATTiny45. Future versions will only support the ATTiny85.

Fixed Bugs
fix crashes due to NameError: name '_num_retries' is not defined (by https://github.com/schubter/attiny_daemon/tree/_num_retries-undefined)