-
-
Notifications
You must be signed in to change notification settings - Fork 105
Description
In order to be able to distribute compiled binaries of BSB-LAN, the complete configuration should be possible via the webinterface. Most parameters can already be configured during runtime via URL commands, so these could be called in the background via JavaScript etc.
More problematic could be the various #define configurations, but since we now have enough space on the Due, all functional parts (de-)activated via #defines should be enabled by default and could then be disabled on the Mega if necessary.
All data should be stored on EEPROM which is provided for the Due on the V3 BSB-LAN boards and has the same size as the one built-in in the Mega: 4096 bytes.
The EEPROM storage should be divided into two sections:
First section: Fixed length configuration options, such as pin numbers for OneWire bus, DHT22, IP-address, PPS parameters etc.
Second section: Divided into two parts for configuration options of (at compile time) unknown length, such as log_parameters array, passkey, exclude_GPIO. First part is a table layouted like this:
Byte 1+2: Offset to actual data
Byte 3: Type of data (may not be necessary if EEPROM.get() is able to determine this in all cases)
Byte 4: Length of data (or length of entries, if EEPROM.put()/get() can be used at all times)
Byte 5 to Byte 5+length: actual data
Since all configuration data is always written at the same time, the actual distribution of data in the second part of the second section can vary, but due to the lookup-table, data can easily be located.
In order to maintain backward compatibility, variables set via BSB_lan_config.h should be written to EEPROM during setup, and then a warning should be printed in the web-configuration that all changes will be overwritten upon reboot as long as the entries in BSB_lan_config.h remain.
Most of the entries probably do not need default values, but for the network part, it would be best to set the device to DHCP mode instead of setting some kind of fixed IP address (although this would probably also be acceptable).
I hope I've covered all caveats, but I guess I have not ;)...