FlashAir + WebDAV = Minor SleepyHead import bug
I recently started using a FlashAir SD card to pull my CPAP data out wirelessly... And I have stumbled across a small SleepyHead issue.
My setup is a Respironics machine (DreamStation), using a Linux workstation to mount the FlashAir card via its WebDAV interface. When I do this, the Respironics data directory is named "P-SERIES"... But SleepyHead is looking for "P-Series", so it refuses to import. (Linux in general is not case-sensitive.)
If I copy the WebDAV directory tree locally and then rename P-SERIES to P-Series, SleepyHead imports correctly.
If jedimark is reading this, thank you for a fantastic piece of free software!
09-03-2018, 08:00 AM
(This post was last modified: 09-03-2018, 08:03 AM by Crimson Nape.)
RE: FlashAir + WebDAV = Minor SleepyHead import bug
Hi patl -
The problem you encountered is not with SleepyHead but with the operating system that you're using, Linux in this case.
Unlike a Windows computer, both Linux and Mac are very case sensitive when using naming conventions. You can have 5 files or directories named,
MyData, MYDATA, MyDaTa, mYdAtA, and mydata, and each will be a different entity on the Linux or Mac computer. On the other hand, Hypertext Transfer Protocol (web browser commands) are not case sensitive. Since WebDav uses Hypertext Transfer Protocol commands for it command structure, it is also not case sensitive. Evidently WebDav treats all ASCII characters as upper case. That is where the problem exists. If you where running the same WebDav commands on a Windows platform, you wouldn't experience this problem, since Windows file naming conventions are
not case sensitive.
An easy alternative would be a program, like FlashPAP, that addresses this for you. At the same time, it will only select sleep data files that exist on the FlashAir card but not your computer. FlashPAP is written in Java, allowing multi-platform execution. By using command line parameters ("user=" and "exit="), FlashPAP can be automated to select and download the data and exit with one-click.
Good luck!
RE: FlashAir + WebDAV = Minor SleepyHead import bug
Actually I looked at the source code (loader_plugins/prs1_loader.cpp), and it already checks for "last.txt" and "LAST.TXT" under the data directory... So the code already contemplates this sort of problem.
It just needs similar logic for the top-level P-Series/P-SERIES directory. If I can find some time today I will work up a patch and submit a pull request.
I am not really interested in FlashPAP when I can just import directly from the WebDAV-mounted flash card (once this bug in SleepyHead is fixed).
Thanks!
09-04-2018, 11:34 AM
(This post was last modified: 09-04-2018, 11:37 AM by patl.)
RE: FlashAir + WebDAV = Minor SleepyHead import bug
I updated the import code and submitted a merge request. I cannot post a link, being a new member... But you can see it if you search for "sleepyhead" and "gitlab" and then click on "Merge Requests" in the sidebar.
RE: FlashAir + WebDAV = Minor SleepyHead import bug