Upload to Google Drive from Organelle?

Hi gang!

I have created a patch that records wavs to the Organelle’s SD card (running 4.0 on an Organelle 1, with a Ralink 5370 Wi-Fi dongle)

I would like to automatically push these files straight up to Google Drive as soon as they are created, without the need for any further user intervention.

After a little research, I am looking at installing Gdrive onto the Organelle:

https://github.com/gdrive-org/gdrive

I would then follow instructions I found at:

https://olivermarshall.net/how-to-upload-a-file-to-google-drive-from-the-command-line/amp/

Then, I would trigger Shell commands from my patch to upload each newly created wav to Google Drive.

I just wanted to check whether you think this sounds like it could work, and also whether installing this program is likely to interfere the Organelle’s regular operation in any way?

Also, could someone advise me which of the many Linux download options of gdrive would be suitable for the Organelle?

Many thanks!

Mark

That sounds interesting… it probably won’t interfere with the operation if you can get it installed. The Organelle 1 has rather old Linux, so it can be challenging to install new software on it. You could try the gdrive-linux-arm download (Linux Arm 32-bit).

Thanks Owen - I’m giving it a go!

Ok, so I’ve now got as far as getting the Linux Arm 32-bit version onto the Organelle, renaming it to gdrive, assigned it executable rights, and it’s currently sitting on /sdcard

The next step in the instructions I linked to in my original post is to:

sudo install gdrive /usr/local/bin/gdrive

When I do this, I get:

install: cannot create regular file '/usr/local/bin/gdrive': Read-only file system

Presumably this part of the Organelle system is ordinarily read-only, for my own protection?

My assumption is that I’d need to temporarily grant myself read-write access to at least /usr/local/ in order to install the gdrive software?

Any recommendations on the easiest and safest way to do this?

My research so far has suggested:

mount -o remount,rw /

And then presumably after installation I’d need to do:

mount -o remount,ro /

Then walk away whistling innocently!

But I’m painfully aware of my novice-level understanding of Linux, so I feel it’s probably sensible to seek advice from those with more experience before I go ahead and do something that bricks my Organelle!

So any guidance is much appreciated!

Mark

There are some scripts built in to Organelle to set to Read/Write and Read-Only:

@Rainboyo looks like it should be ok, as its a statically linked binaries… so no dependancies.

whilst you can install to /usr/local - Id suspect you dont need to, you can probably run it directly from a ‘system’ directory on the sdcard.
(this is what Id at least first attempt - as you can keep it together with your script to launch it)

note: you might need to use chmod +x gdrive to make it executable.

probably the other thing to make sure is you run it with --config, and make sure this points to somewhere on the /sdcard - this is because it looks like by default it will try to write to the user-dir which will normally be read-only (and its not a good idea to change this when running programs ‘routinely’)

Thanks for your help so far everyone!

I hit a bit of a wall with gdrive - it turns out the program is not being maintained anymore, and Google Drive has disabled Google Sign-In access for it - someone has shared a relatively involved workaround, but rather than go further down that particular rabbit hole, I’m now turning my attention to rclone (https://rclone.org/install/), which looks like a much more active project, and will interface with a bunch of other things like DropBox, FTP, etc.

My first step with trying to install rclone was to re-flash the SD card with OG1-v4.0.img so I was starting from a known state.

Then, following rclone’s Linux installation instructions, I tried:

curl https://rclone.org/install.sh | sudo bash

This (not totally unexpectedly!) returned the Read-only file system message:


So, following chrisk’s earlier advice, I tried:

sudo /home/music/fw_dir/scripts/remount-rw.sh

However, this returned “command not found” - I then checked my /home directory and it only contains a single folder called alarm, even when I tick View -> Show Hidden.

I felt sure I had previously run this command successfully during my gdrive explorations, so this was confusing.

I also tried navigating to / then Tools->Find Files..., and searching for *.sh files, searching sub directories and including hidden files.

This turned up a few .sh files, but not remount-rw.sh or remount-ro.sh.

My next thought was to try to sidestep these permissions issues by doing what TheTechnoBear suggested for gdrive - creating a system folder inside /sdcard and installing to there.

So I looked at rclone’s manual installation instructions from https://rclone.org/install/ and found that they were unsurprisingly also geared toward installing to usr/bin/rclone, and I didn’t know how to adapt them to point to /sdcard/system.

At this point, I felt like I’d reached the limit of my current Linux expertise and hit another wall, so I’m coming to the community for help again!

Does anyone have ideas about why I can’t find or run the remount-rw.sh and remount-ro.sh scripts, given that I’m working on a clean install of OS 4.0?

Also, any other general advice on trying to get rclone up and running on the Organelle would be gratefully received!

All the best

Mark

This is for Organelle M, on the Organelle 1 you want to use:

/root/scripts/remount-rw.sh

Organelle 1 runs as root, so home directory is /root. (and you don’t need the sudo command either).

Ah got it!

Ok, so I got rclone installed using its own install script, and got it working! :blush:

However, after restarting the Organelle, when I tried to run an rclone copy command again, it complained thusly:

Failed to create temp file for new config:  open /root/.config/rclone/rclone.conf391786374: read-only file system

From this, I am concluding that:

  • the Organelle startup sequence probably runs the remount-ro.sh script.

  • the rclone install process created a folder for itself within /root/.config/

  • the rclone copy command needs to write something to this folder when invoked.

So I reckon my options are probably:

  • somehow move everything rclone onto the sdcard, without breaking its ability to find its own config folder (and any other folders it may have installed) - if I could manage to do this, it would also have the advantage of keeping rclone neatly in the same place as the patch, as suggested by TheTechnoBear.

  • change the permissions just for the rclone config folder, either permanently or when I load my patch.

  • call the remount-rw.sh script from my patch, just before calling the rclone copy command, and then call the remount-ro.sh afterwards to make everything nice and safe again (this feels like a last-resort option).

Is moving all of rclone to the sdcard without breaking it a realistic proposition?

Alternatively, what would be the best command to make just the rclone config folder and subfolders read-writeable? And how could I insert this command into the Organelle’s startup processes? Or is it better to call it from my patch?

Many thanks again!

Mark