Enter it like this; “Users/michaelmatos/Downloads/crow-v1.0.0/”. You want the terminal to be running in that folder. What’s happening is it’s going to look for the file crow.bin, but it can’t find it unless it is running in the same folder.

Thank you! I had to go to system preferences and enable Shortcuts tab at the top and then select Services on the left.

Under Files and Folders on the right, I checked the New Terminal at Folder and New Terminal Tab at Folder boxes.
Then I could right click the crow folder, open terminal in the folder, and then enter the cd command.

2 Likes

Sorry to be dense but could someone please provide some info on how and why to do all this terminal opening in folders stuff as if explaining it to a smart but inexperienced 13 year old?

Also is it wise to create a specific folder in which to put all scripts, does it need a specific name or location, what would someone who knows this stuff do because they already know it and therefore not think to mention it?

Finally can that level of helpful info get incorporated into the documentation?

Thanks!

(Note: I’m assuming you’re on a Mac, but most of this will be useful regardless of platform.)

Here’s an article that walks you through the basics of how to get around the file system in the Terminal:

Here’s a couple examples to illustrate what’s going on when you type commands.

When you type a command, the system needs to know where the file that you are trying to execute is. For example, you might type:

druid

You probably noticed that will work wherever you are when you type the command. That’s because when druid was installed, it was put in a special place the system looks at when you type a command. That is, not finding druid in the current directory (i.e. the directory you are in when you type the command), the system goes looking in the usual places. So the system still needs the complete path, but it has a clue about how to figure it out itself without you typing it explicitly (or being in the directory with the druid executable file).

However, in the case of the flash.sh, it wasn’t installed in the same way druid was, it’s just a random file sitting on your computer. So in this case you need to provide the path to the file. The easiest way is to navigate to that folder and execute the command there. So, once there, you’d think you could just type this:

flash.sh

But, no luck. You actually need to type:

./flash.sh

The “./“ is a shortcut that means “the current directory.”

It may not be obvious (i.e. it is totally not obvious) how to figure out the path of a file on your system. Luckily, there’s a handy shortcut to help you navigate the file system. Type:

cd

(Important note: there needs to be a space after the “cd”)

Then, drag the folder from the Finder and drop it anywhere onto the Terminal window. The path will then magically appear after the cd. Hit ‘return’ and you’ll be transported to the directory.

That’s a personal preference, but putting all your scripts in one place is probably a sensible choice. In that case you can make a Crow folder (wherever you want), drop the examples folder into that folder and make a “MyCoolScripts” folder there as well. Then navigate to that folder (as described above) and launch druid from there. That way, once in the druid app, you can upload scripts from either collection easily:

u examples/boids.lua

or

u MyCoolScripts/worldchangingalgorithm.lua

Note that, unlike when executing commands in the Terminal, you don’t need the leading ./ when you provide the path to the script.

5 Likes

Thanks, that’s very helpful!

1 Like

You should just be able to double-click flash.sh in finder. None of the terminal business required. I’ll confirm / update the docs on monday.

You shouldn’t need to ‘know terminal’ just to upload a new firmware.

4 Likes

I’m not sure that’s setup by default. I’m not positive, but I don’t think the default on the Mac is to open .sh files with terminal, you’d have to set that up yourself (with get info/command-i on a .sh file, change “Open with” and “Change All…”).

Update: That theory appears to be confirmed in this SO post:

I added this bit to a few docs (Scripting and Update):

Having trouble using the cd command?

  • Mac: right click the unzipped crow-vx.x.x folder and then press the OPTION key. This will reveal a Copy “crow-vx.x.x” as Pathname action. Select it and then paste into terminal after cd [spacebar].
  • Windows: hold the SHIFT key and right click the unzipped crow-vx.x.x folder. This will reveal a Copy as path action. Select it and then paste into terminal after cd [spacebar].
  • Linux: right click the unzipped crow-vx.x.x folder and select “ Copy ”. Then, simply Paste into terminal after cd [spacebar] .

my mac automatically opens flash.sh in Sublime :confused:

2 Likes

Thanks again, and yes, on a Mac…

With the monome eurorack firmware there was none of these issues. Once hombrew was installed you double click on the flash file and away it went. I think that’s why I ran into so many issues as in my mind I was doing the same thing yet nothing was working.
Extremely grateful for all the help here.

1 Like

on macos we could make a flash.command file (ie tt is attached below, requires some extra bits)

#!/bin/sh
cd "$(dirname "$0")"
dfu-programmer at32uc3b0256 erase
dfu-programmer at32uc3b0256 flash kria.hex --suppress-bootloader-mem
dfu-programmer at32uc3b0256 start

Ah yes, I was thinking of ‘.command’. We’ll get that rolled into the next firmware release.

1 Like

This seems helpful, but when I actually type ./flash.sh after getting into the right directory, it says:
sudo: dfu-util: command not found
SCOTTs-MBP:crow-v1.0.0 scottburton$

any idea why?

Nevermind—I had not fully installed a JDK which had stalled out my dfu-util and Homebrew install. Anyway, I just successfully installed crow 1.0.0!

1 Like

Still having trouble updating my crow with my PC and cmd!

After I cd to the folder containing the .zip file, in this case running:

cd C:\Users\Jacob\Desktop\Hardware\Firmware\crow\crow-v1.0.0

And then typing “./flash.sh”, it comes up with:

“.” is not recognized as an internal or external command, operable program or batch file.

I try removing the “.” and the same message appears.

I try holding shift, right clicking, copying as path, and pasting it into cmd with cd, as this:

cd “C:\Users\Jacob\Desktop\Hardware\Firmware\crow\crow-v1.0.0.zip”

And it then tells me that the directory name is invalid.

I’ve tried removing the quotation marks but it still comes up with the same message. I’ve tried unzipping, but then I’m back to the “not recognized message” after trying to run the “./flash.sh” command…

Can someone help me?

Those instructions are Mac/Linux specific. Open the sh file in a text editor and copy the text, paste into the command prompt opened at folder. Delete ‘sudo’ and run the command.

Need to update that update doc

2 Likes

Great, thank you! I thought it could be something along those lines. Will try it when I get a chance tonight :slight_smile:

Okay, I’ve opened the sh file in notepad and tried copy pasting the text in the command prompt, without sudo, yet I’m still getting the same “is not recognized as an internal or external command, operable program or batch file.” message.

This is the text, if it’s any help:

dfu-util -a 0 -s 0x08020000 -R -D crow.bin -d ,0483:df11

You need to install dfu-util. If you’re on windows 10, you’ll need the 64bit version. There is a link on the update page - “windows binary”.

I already have dfu-util, and have used it plenty of times to update my ansible without issue. Unless there’s something different about its use with crow?