[Start]5.Save program (.bin) from mbed to Pokitto automatically on a Mac

#MAC OSX / mbed online compiler
Problem
Macintosh likes to put extra files on USB drives. Since Pokitto is so small, it can not handle these hidden (files starting with a “.” dot) files. If you try to save directly from mbed online compiler to Pokitto, you will get a “disk full” error. That “disk full” is the Mac OSX trying to sneak its disgusting hidden files on the poor Pokitto (I’m joking, but actually its kind of true).

We have a couple of nifty workarounds to this problem. One way is to use the utility @adekto has kindly made for us. But, I discovered there is another way, that makes it even simpler, because you do not have to drag and drop anything. That method is explained here:

Saving directly from browser to Pokitto using Mac’s Automator utility

  1. Create a specific folder where you will be saving the binaries (e.g. Desktop/pokittodrop)
  2. Open “Automator” app (it’s a standard Mac utility)
  3. Create a “Folder Action”, select the folder you have created (see screenshot below)
  4. Drag n’ drop “Run Shell Script” action from middle column to the window on the right
  5. Write the script listed below into the “Run shell Script” window, remember to replace ./Desktop/pokittodrop/ with your own chosen folder location. /Volumes/CRP\ DISABLD/ may also be different depending on the language of your operating system. In any case it is the volume that pops up when you connect Pokitto to the Mac in flash drive mode.
  6. Save your Automator script (File->Save)
  7. Now, when you compile in mbed online, just “Save as” into your chosen folder. As soon as the file is downloaded in the folder, the Automator script will run and will copy the file over to Pokitto if the Pokitto is connected and is in flash programming mode. (Flash mode means “turn device on while USB connected and lower button at the back is pressed and kept down”)

This is the script:

cp ~/Desktop/pokittodrop/*.bin /Volumes/CRP\ DISABLD/firmware.bin
rm ~/Desktop/pokittodrop/*.bin

And this is how the Automator should look like:

3 Likes

I need to learn how to do this lol, though it’s probably not as hard as my brain thinks it is.
Though they do have some cheap windows notebooks at the local pawn shop,

would recomend adding this to the end of the script to eject the pokitto properly else macos is going to shout at you for remove a drive

diskutil unmount /Volumes/CRP\ DISABLD

to add polish to your folder you can replace its icon by pressing “control mouse click” then “get info” and drag and drop this icns file on the top left folder icon
AppIcon.icns (25.3 KB)

1 Like