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

Schedule name length #185

Open
tidharmor opened this issue Sep 12, 2021 · 3 comments
Open

Schedule name length #185

tidharmor opened this issue Sep 12, 2021 · 3 comments

Comments

@tidharmor
Copy link

tidharmor commented Sep 12, 2021

I tried changing my schedules names, and after changing 2 schedules successfully, the 3rd change caused all schedules to disappear.
The Schedules item on the main menu still showed it has 3 schedules, but when I entered the Schedules page to edit them none were displayed.
This has happened before already and that time I just reset the system and started over (it happened when I first set up the system).
This time I managed to return it to display the schedules by editing the settings file with a hex editor and deleting some characters from the schedule with the long name.
This is the log of the relevant time when I changed the schedule names, specifically at 2021/09/12 08:32:32 when schedule id 2 was changed.
log.txt
My schedule names are in Hebrew which might somehow cause this issue.

Edit: I just browsed the code and saw that in the Schedule class, the name field is char[20], which probably explains the problem.
Since I enter the schedule name in Hebrew, each letter is actually 2 bytes, so any name over 10 letters exceeds the array boundary.
I don't know anything about the EEPROM size limits so I don't know if the name array can be made longer, but probably adding a check for the length when saving would prevent this from causing any problems.
If I'll be able to find some more time I might try to fix the issue and submit a pull request.

@nhorvath
Copy link
Collaborator

nhorvath commented Sep 12, 2021 via email

@tidharmor
Copy link
Author

The name I set was "טפטפות קיץ", so it's 10 letters (including the space), which I guess would be 20 bytes since it's Hebrew.
(There might be a leading or trailing space, so it may be even longer)
I edited the settings file with a hex editor and just deleted a few characters from where I saw the string, it ended up 6 letters after I edited it.
I'm attaching a zip file with 2 settings files: one which has the long name, and the other after I shortened it.
settings.zip

@nhorvath
Copy link
Collaborator

nhorvath commented Sep 12, 2021 via email

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

No branches or pull requests

2 participants