factory reset
in C#
is a full factory reset available anywhere in the c# sdk? i'm not seeing it. if not, could it be added in a future release? thanks much.
This discussion has been closed.
Comments
What do you mean by "full factory reset"?
sorry, i misremembered the precise name.
there are two options in the (old?) iOS API app and SDK.
1) in app: "Soft Reset" / in iOS SDK code: "resetDevice"
2) in app: "Reset To Factory Defaults" / in iOS SDK code: "setConfigurationAsync"
I believe the #1 "Soft Reset" is available in the C# SDK as GetModule().ResetAsync() but it's not clear if the #2 "Reset To Factory Defaults" is available anywhere.
setConfigurationAsync
from the previous iOS SDK pertains to erasing macros. If you aren't programming any macros, you can just use the normalResetAsync
function.for our application we do need to erase macros and do the setupEvents / runOnDeviceBoot piece. we also use that call for the secondary purpose of resetting the neopixel hardware. if there are reliable ways to do both of those via other means, that's fine; otherwise it's been working great to do all that at once in our iOS app.
Macro documentation should suffice:
https://mbientlab.com/csdocs/0/macro.html
that doesn't help with the second need to reset the neopixel.
our goal is to reset the board fully to a known-good configuration as part of the connection sequence. this is a sort of sledgehammer approach but given various issues we've had in day to day use in the field, it is the most reliable approach and reduces our customer-support burdens.
in some situations that means erasing macros and stored commands, presumably "macro.EraseAll()" will work but we've not gotten far enough to test that. but in some cases that means resetting the neopixel, and so far it appears that the existing neopixel calls don't handle some situations. there may be other reset-based needs that are not immediately apparent given that we've been using this strategy for a while.
Once the macros have been erased, the board won't rerun the previous commands on boot. All you need to do after that is reset the board.
as mentioned in my last, the macro side doesn't really address the full problem.
regardless of that detail, we've gotten a little off track. we're trying to move from the iOS SDK to the C# SDK. one of the features we've been relying on for years is not in the C# SDK. can it be added?
Test the code I posted before prematurely concluding that it does not do what you need.
tested. it does not do what we need.
expected v actual:
please note that i did not yet do exhaustive testing with all three models of board that we use, etc.
setup commands:
all of this works fine, so long as the board has been "wiped" by calling setConfigurationAsync() called from the iOS side first.
the main problem right now is with the neopixel module. it is possible that other issues may appear that have been heretofore masked by using setConfigurationAsync() to start from a known-good state on every connection.
What are the exact functions are you running?
metawear.InitializeAsync();
metawear.GetModule().EraseAll();
metawear.GetModule().ResetAfterGc();
metawear.GetModule().DisconnectAsync();
[ wait, scan, find it again... ]
metawear.InitializeAsync();
metawear.ReadDeviceInformationAsync();
metawear.ReadBatteryLevelAsync();
INeoPixel pxl = metawear.GetModule();
IStrand strd = pxl.InitializeStrand(0, ColorOrdering.WS2811_GRB, StrandSpeed.Slow, 0, 1);
strd.SetRgb(0, 255, 0, 255);
Wrap your code with the appropriate Markdown code tags. Otherwise, code looks fine to me.
You mentioned that you are using 3 models.
setConfigurationAsync
work for all of your boards?