Hello Guest, Welcome to Apnea Board !
As a guest, you are limited to certain areas of the board and there are some features you can't use.
To post a message, you must create a free account using a valid email address.

or Create an Account


New Posts   Today's Posts

[EzShare SDcard wifi] Script to autodownload
#31
RE: [EzShare SDcard wifi] Script to autodownload
Ok, so thanks everyone for the help!  This actually worked out super well, but I wanted to document a few steps for anyone tryign to do this with Windows.

First of all, you need Windows 10.  Everybody should have that these days,  but you need it, because Windows 10 now supports linux command line.  You'll need a microSD card as well.  The ezshare doesn't come with one even though the product description makes it sound like it does.  It can be a small cheap one because the data is small and you'll be downloading it regularly so overwriting data isn't a concern.

I'm going to do high level instructions, because some steps you might need to google for detailed instructions if you're unfamiliar.  Nothing in here is super difficult though.

1)  Buy an ezshare card.  I got mine from Walmart [Commercial Link Removed].  I can't link it because i'm a forum noob, but I'll put it in a separate post once I get over the post theshold. There are many version and knockoffs of these types of card, and even though you'd be getting it from Walmart or Amazon they're sold by third party sellers so there's no gaurantee you'll get the exact same model, or that it won't change at some point after I write this.    Case in point:  the one I bought had a picture of a red card, but the one I received was white, like Biorn described in his post.   So ymmv if you don't get the same one.

2)  Install Windows Subsystem for Linux

3)  Install the Ubuntu OS module from the Microsoft Store (it's free)

4)  Set yourself a username/password when you first start up Ubuntu

5)  copy the shell script from the original post in this thread to this directory in windows file explorer:  
C:\Users\[windows username]\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\[ubuntu username]

6)  Connect your wifi to the ezshare hotspot (I'm not sure if there's a way to just join the ezshare to a wifi router, I think you have to connect to it directly, but I'm looking into that next)

7) Inside Ubuntu, run these commands

chmod +x ImportEzShare_AirSense10.sh (this marks the shell script as executable, you only need to do this once)

sudo bash ImportEzShare_AirSense10.sh (this executes the script.  Sudo is the linux equivalent to "run as administrator", and it will prompt you for your password when you do it)

Type your password

8) The script will now run and download all your data off the card into this directory:

C:\Users\slune\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\biorn\AirSense10-Data

Note the user directory changed here, that's because Biorn's script is set to his own username.  You could probably do a find/replace in notepad to swap that to your own username without it breaking anything.

9)  You'll probably need to copy the data out of the folder and put it somewhere else on your PC, because Oscar doesn't seem to want to open anythign inside the Appdata directory, since it's a hidden system directory.  


notes:  I'm still working on further automating this.  Step one was getting it running.  That was very straightforward thanks to Windows Subsystem for Linux and the brilliant scripting by Biorn.  This is a very nice script that does some nice things like avoid downloading duplicate files.  First run was about 8 minutes to pull all the data off my card.  Second run was 12 seconds and it downloaded 0 new files.  So I would assume running this daily will probably take 15-20 seconds  total runtime.

What I'll do from here is set up a windows task to open ubuntu bash shell, set ubuntu to run this command automatically on start, and then close down again.  Or something along those lines.  I'm not just going to leave it running constantly so a crontab can run on it because I almost never use WSL at home.  I just wanted this to be something I could schedule to run daily, or kick off on demand by running a batch file or something.  

The other alternative is to re-write this script in batch using wget for windows.  That's the cleaner nicer approach compared by my rube golderberg-esque process listed above.   But my way works and it was within my means to do in a couple hours on a saturday afternoon.

-----
Moderator Action: Commercial Link Removed

To maintain our status as an educational organization, the only commercial links allowed in this forum are to CPAP-related manufacturer websites.  This is stated in the Apnea Board Rules with details given in the Commercial Links Policy section.

-----
Post Reply Post Reply
#32
RE: [EzShare SDcard wifi] Script to autodownload
(06-19-2021, 05:20 PM)mslunecka Wrote: The other alternative is to re-write this script in batch using wget for windows.  That's the cleaner nicer approach compared by my rube golderberg-esque process listed above.   But my way works and it was within my means to do in a couple hours on a saturday afternoon.

Hello,

nice tutorial, but yes it's very tricky. As you said, I mean it should be easier to just adapt it for windows bash. I don't use windows but I'm pretty sure that is not complicate to adapt. This script is very basic with few dependancies.

About your card is it a microsd adapter?

PS: maybe I'll check to make a windows version if somebody need it.
Post Reply Post Reply
#33
RE: [EzShare SDcard wifi] Script to autodownload
Looking at the code, I see that you may need to edit line 11 for a better file storage location.  That is where biorn's name is.   Also, if you are using the popular 192.168.1.x network, you might try changing your computer's subnet mask from 255.255.255.0 to 255.255.248.0.  This will allow all IP's between 192.168.0.1 to 192.168.7.254 to be included within the same subnet network. This would then include the 192.168.4.1 IP of the EZ-Share card.

I hope this may help.

- Red
Crimson Nape
Apnea Board Moderator
Project Manager for OSCAR - Open Source CPAP Analysis Reporter
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#34
RE: [EzShare SDcard wifi] Script to autodownload
(06-19-2021, 07:08 PM)Crimson Nape Wrote: Looking at the code, I see that you may need to edit line 11 for a better file storage location.  That is where biorn's name is.   Also, if you are using the popular 192.168.1.x network, you might try changing your computer's subnet mask from 255.255.255.0 to 255.255.248.0.  This will allow all IP's between 192.168.0.1 to 192.168.7.254 to be included within the same subnet network.  This would then include the 192.168.4.1 IP of the EZ-Share card.

I hope this may help.

- Red

I don't know why I didn't put a ~ (maybe due to the fact I used a cronjob)

About the network, as the ezshare card is ad-hoc with dhcp server embeded that not should be an issue.

I have a wifi card on my server and always connected to the ezshare network but a cool thing to add is a network switcher. (to connect to the ezshare network then comeback to the normal network)
Post Reply Post Reply
#35
RE: [EzShare SDcard wifi] Script to autodownload
(06-19-2021, 05:20 PM)mslunecka Wrote: First run was about 8 minutes to pull all the data off my card.  Second run was 12 seconds and it downloaded 0 new files.  So I would assume running this daily will probably take 15-20 seconds  total runtime.

I think there is a todo in the script to skip folder older than xx days. Actually that should scan all the folders, so the sync duration will increase with the time. I don't remember maybe 4 sec by mounth
Post Reply Post Reply
#36
RE: [EzShare SDcard wifi] Script to autodownload
I was thinking that the EZ-Share could be configured to act as a client instead of a hotspot. That way, it could join the user's home network and be directly addressable.
Crimson Nape
Apnea Board Moderator
Project Manager for OSCAR - Open Source CPAP Analysis Reporter
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#37
RE: [EzShare SDcard wifi] Script to autodownload
(06-19-2021, 07:53 PM)Crimson Nape Wrote: I was thinking that the EZ-Share could be configured to act as a client instead of a hotspot.  That way, it could join the user's home network and be directly addressable.

Unfortunately not.
Post Reply Post Reply
#38
RE: [EzShare SDcard wifi] Script to autodownload
(06-19-2021, 06:58 PM)biorn Wrote:
(06-19-2021, 05:20 PM)mslunecka Wrote: The other alternative is to re-write this script in batch using wget for windows.  That's the cleaner nicer approach compared by my rube golderberg-esque process listed above.   But my way works and it was within my means to do in a couple hours on a saturday afternoon.

Hello,

nice tutorial, but yes it's very tricky. As you said, I mean it should be easier to just adapt it for windows bash. I don't use windows but I'm pretty sure that is not complicate to adapt. This script is very basic with few dependancies.

About your card is it a microsd adapter?

PS: maybe I'll check to make a windows version if somebody need it.

Yes, that’s correct I have a microsd adapter...the white EZShare.  

If you want to make a windows version that runs natively without WSL that’s great.  I did manage to get this running a little easier this morning.  I mapped .sh files to bash.exe.  So I can just double-click the script to execute it.  Then I edited the script so that line 11 copies the files to /mnt/c/cpapdata

This puts the files inside a normal windows directory that Oscar can then read at will.  

So now I just need to write a little powershell script that automatically join the ezshare wireless, execute the .sh file, rejoin normal wireless when done and then close the windows when done, and this should all be a double-click procedure, or I can just set to run on a windows scheduler task.
Post Reply Post Reply
#39
RE: [EzShare SDcard wifi] Script to autodownload
Looks like white one is expensive so going to order the orange one. I forgot to put SD card back in and missed out on a nights data last week. Would be great to set default folder in onedrive and import data with a button in OSCAR. Could autosync to Viatom (wellue) data in onedrive too. Not sure if commercial links are allowed. [Commercial Link Removed] Search eBay Australia for Item, 164889878421


-----
Moderator Action: Commercial Link Removed
To maintain our status as an educational organization, the only commercial links allowed in this forum are to CPAP-related manufacturer websites. This is stated in the Apnea Board Rules with details given in the Commercial Links Policy section.
-----
Post Reply Post Reply
#40
RE: [EzShare SDcard wifi] Script to autodownload
(06-20-2021, 09:50 PM)Neo2020 Wrote: Looks like white one is expensive so going to order the orange one. I forgot to put SD card back in and missed out on a nights data. Would be great to set default folder in onedrive and import data with a button in OSCAR. Could autosync to Viatom (wellue) data in onedrive too. Not sure if commercial links are allowed. [Commercial Link Removed] Search eBay Australia for Item, 164889878421

The one I ordered looked just like that, but the one that arrived was white.  What matters is that you end up with the same firmware, as I think Biorns script is actually scraping the links off the web interface and then downloads the files.  

If the interface doesn't match the script probably won't work. 

That's why I made sure to order from a site where I knew I'd be able to do a return if it didn't work.

-----
Moderator Action: Commercial Link Removed
To maintain our status as an educational organization, the only commercial links allowed in this forum are to CPAP-related manufacturer websites. This is stated in the Apnea Board Rules with details given in the Commercial Links Policy section.
-----
Post Reply Post Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Information EzShareApp - CPAP Data Downloader from EzShare SD card for macOS adrianfeeger 24 904 11-07-2024, 11:18 PM
Last Post: walshy1009
  WiFi SD Card for AirSense and OSCAR Stillglade 3 1,727 09-03-2024, 05:15 PM
Last Post: dwd1249
  Wifi to Oscar KimLB 1 512 07-01-2024, 06:30 PM
Last Post: Crimson Nape
  Created a program to support Wifi SD card for Resmed and all other devices narual 15 4,276 05-03-2024, 11:09 PM
Last Post: narual
  [split] FYSETC SD Wifi - Possible FlashAir Replacement Psikic 131 26,350 01-12-2024, 11:59 AM
Last Post: scowell
  Request Copy of Resmed Airsense 10 SDCard core files gedm 6 943 12-14-2023, 07:04 PM
Last Post: gedm
  FlashPAP - FlashAir WiFi SD card utility TiredToo 296 103,413 10-05-2023, 06:54 AM
Last Post: olddog27


New Posts   Today's Posts


About Apnea Board

Apnea Board is an educational web site designed to empower Sleep Apnea patients.