Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove prefs file first, before saving #5855

Closed
wants to merge 1 commit into from
Closed

Conversation

thebentern
Copy link
Contributor

No description provided.

@thebentern thebentern changed the title Remove prefs first Remove prefs file first, before saving Jan 14, 2025
@todd-herbert
Copy link
Contributor

I'm still seeing a few weird things with this one unfortunately:

DEBUG | 15:05:23 98 PhoneAPI::close()
INFO  | 15:05:23 98 OFF: NeoPixel Ambient lighting
DEBUG | 15:05:23 98 SX126x entering sleep mode
INFO  | 15:05:23 98 Turn off screen
DEBUG | 15:05:23 98 Opening /prefs/config.proto, fullAtomic=1
INFO  | 15:05:23 98 Save /prefs/config.proto
DEBUG | 15:05:23 98 Opening /prefs/module.proto, fullAtomic=1
INFO  | 15:05:23 98 Save /prefs/module.proto
DEBUG | 15:05:23 98 Opening /prefs/channels.proto, fullAtomic=1
INFO  | 15:05:23 98 Save /prefs/channels.proto
DEBUG | 15:05:24 98 Opening /prefs/db.proto, fullAtomic=0
INFO  | 15:05:24 99 Save /prefs/db.proto
Disconnected (ClearCommError failed (PermissionError(13, 'The device does not recognize the command.', None, 22)))
Reconnecting to COM4     Connected!
DEBUG | ??:??:?? 2 Filesystem files:
DEBUG | ??:??:?? 2  prefs (directory)
DEBUG | ??:??:?? 2    config.proto (838 Bytes)
DEBUG | ??:??:?? 2    channels.proto (114 Bytes)
DEBUG | ??:??:?? 2    module.proto (186 Bytes)
DEBUG | ??:??:?? 2    db.proto (533 Bytes)
DEBUG | ??:??:?? 2  adafruit (directory)
DEBUG | ??:??:?? 2  bond_prph (directory)
DEBUG | ??:??:?? 2  bond_cntr (directory)
DEBUG | ??:??:?? 2 Power::lipoInit lipo sensor is not ready yet
DEBUG | ??:??:?? 2 Use analog input 4 for battery level
INFO  | ??:??:?? 2 Scan for i2c devices
DEBUG | ??:??:?? 2 Scan for I2C devices on port 2
DEBUG | ??:??:?? 2 Scan for I2C devices on port 1
INFO  | ??:??:?? 2 No I2C devices found
DEBUG | ??:??:?? 2 acc_info = 0
INFO  | ??:??:?? 2 S:B:69,2.5.20.7a7f3ddf
DEBUG | ??:??:?? 2 Reset reason: 0x0
DEBUG | ??:??:?? 2 Set random seed 3336327371
INFO  | ??:??:?? 2 Init NodeDB
INFO  | ??:??:?? 2 Load /prefs/db.proto
INFO  | ??:??:?? 2 Loaded /prefs/db.proto successfully
INFO  | ??:??:?? 2 Loaded saved devicestate version 23, with nodecount: 3
INFO  | ??:??:?? 2 Load /prefs/config.proto
ERROR | ??:??:?? 2 Error: can't decode protobuf parent stream too short
INFO  | ??:??:?? 2 Install default LocalConfig
INFO  | ??:??:?? 2 Set default channel and radio preferences!
DEBUG | ??:??:?? 2 Expand short PSK #1
INFO  | ??:??:?? 2 Wanted region 0, using UNSET
INFO  | ??:??:?? 2 Load /prefs/module.proto
INFO  | ??:??:?? 2 Loaded /prefs/module.proto successfully
INFO  | ??:??:?? 2 Loaded saved moduleConfig version 23
INFO  | ??:??:?? 2 Load /prefs/channels.proto
ERROR | ??:??:?? 2 Error: can't decode protobuf array overflow
INFO  | ??:??:?? 2 Install default ChannelFile

@esev
Copy link
Contributor

esev commented Jan 14, 2025

@esev
Copy link
Contributor

esev commented Jan 14, 2025

I think the remove has to happen for all of them, not just for prefFileName. When there are repeated fields, appending to the wire format for a proto adds more elements to the repeated field. For the channel file that's likely why the array overflow error happens. The wire format contains more than 8 channels after the append happens.

@thebentern thebentern closed this Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants