-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Password via G-code and MarlinUI #18399
Password via G-code and MarlinUI #18399
Conversation
3531571
to
f045406
Compare
This comment has been minimized.
This comment has been minimized.
c29f2d1
to
1554fa9
Compare
before merging with main repo readded upstream config files added switches in Configuration.h for password feature Added Sanity Checks Put back default environment as mega2560 default platformio.ini file config files remove extra config files add newlines that were removed minor edits
I've cleaned this up a bit and encapsulated the feature in a static class. The code is okay for what it does, but it needs some support at a deeper level to permit putting the machine into a "LOCKED" state where nothing will operate except the password menu and all external host control can also be blocked. To get better support for hosts, a G-code should be added for setting the password, locking the machine, and authenticating from a host. |
Instead of warning over password size change, EEPROM can (and should even now) be reset when flashing new firmware.
I'll get into testing this soon and do some refinement of the input method and the data storage. A custom input screen for password digits (similar to the |
ok, I dont think the problem is with pow(), as outputting pow(10,8) gives the correct value. However, I'm still not getting the value of the password keyed in and not sure what the problem is. In the latest commit under
and try to set a 9 digit password one digit at a time using the LCD I get the following output:
However simply outputting |
Often the print routines for printing floats are using tricks like: If the difference to a round decimal value is smaller than one LSB of the mantissa print the round value. For most of us it is disappointing if
Fact stays - single precision numbers have no exact representation if the mantissa is above 2^23 = 8,388,608. With denormalization pow(2,24) is possible. https://en.wikipedia.org/wiki/Single-precision_floating-point_format |
I think in this case it may not be As for the actual problem, I am not sure why it is happening, or if it can be reproduced on other machines. In any case, using the for loop did avoid the problem on my machine. Furthermore, when I tried changing both the |
It would be an error if the code would require to work in double. The AVRs do not have 'double' just and only 'single precision float'. The code would not work there on. |
True that floats aren't needed. And if we want to avoid #define FIFTH_POWER 5
constexpr long ten_thousand = CAT(10e, DECREMENT(FIFTH_POWER)); |
fbd0fa9
to
e072c19
Compare
I changed the I think the only thing left would be the dedicated password input screen, though the code should work fine as it is. |
654892c
to
b75d321
Compare
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
just wondering, would this feature play nicely with the BTT TFTs? using the tft35 v3 with a BTT SKR Mini v2. |
BigTreeTech's TFT firmware would need to be updated to support this feature. |
As I thought, thank you. |
By the way I noticed the M512 gcode has been changed to use However the comments in the configuration.h file still reflect
|
Thanks for the heads up! I've put in #19108 to address this. |
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Description
A settable passcode for the printer that can configured to ask for the passcode:
The number of digits for this passcode can be configured (1 to 9 digits). The passcode can be entered using a rotatory knob.
Note: It seems the touch UI includes a lockscreen, but this should bring the feature to more printers that do not have a touch screen.
Benefits
The majority of users might not need this. However, it would be useful if the printer is kept in a shared location such as:
This would allow someone to enter their passcode when booting the printer, start a print, and have it automatically lock when the print ends.
Limitations
This is not meant to be a security feature, but a simple form of Access control.
The password can be circumvented by:
The password is not likely to stop someone who knows their way around a 3D printer.
Misc
I have tested this on my Ender 3 Pro but I am not sure what kind of LCDs this would work on. This feature makes use of the LCD Menu functions.