OttoDIY / blockly

Otto Blockly; a fully integrated graphical programming for any type of Arduino projects, including robots, ready to install in your computer, it works offline and also online
https://www.ottodiy.com/software
GNU General Public License v2.0
114 stars 80 forks source link

Mac OS installer #9

Closed cparrapa closed 2 years ago

cparrapa commented 4 years ago

So I have been trying really hard to build from my Windows computer using electron, the Mac and linux versions, unfortunately the application that is generated doesn't open or is just white.

My dream will be to make it also for raspberry pi so that we could make everything with opensource hardware!

There must be a way since electron.is is supposed to be a multi platform development environment for almost all OS.

Alternatively we could "just " find a way to make the arduino uploader work for this online app, for chrome books used in schools this will be amazing. Before in other blockly arduino repos, online uploading was working with codebender.cc but it seems is no longer available or more of a private project not sure. Maybe we could upload via Bluetooth using .hex files will be even easier than USB drivers ?

I don't know, just brainstorming @BodoMinea 😄 putting in common the major challenge to make this software really available to anyone.

You have solve the other issues, so fast, impressive👏so happy to have your support, thanks a lot from all the community, I am pretty sure they are happy too.

Have a good weekend.

BodoMinea commented 4 years ago

We cannot simply make the web version upload to the Arduinos because it has no access to hardware serial ports. There are however some approaches to make webapps able to compile and upload the code. For example, offer a small „adapter” software, like, a NodeJS script or even Chrome extension which accesses the hardware ports and communicates by local web requests with the online Blockly.

However, for all intents and purposes I think we should build proper installers for Mac (pkg->app or directly app) and Linux (a sh installer script or distribution packages). I don't think it's that hard and most probably I am able to do that. It will take some more time since I will be away with work the next week.

I have several Raspberry Pi's and a friend's Mac at my disposal so I can maybe try to build from source and package directly on the target hardware.

cparrapa commented 4 years ago

Cool! I also have one raspberry pi, yes take your time, let me know if you need something. I will be testing more the new PRs, new blocks that I have been working on and see how to add Spanish language, with that we will learn how to add more.

BodoMinea commented 4 years ago

Everything you need to change/add for multi-language resides in www/lang.

In code.js you define new languages or new spots in the app for translatable string, while for the translations themselves you need to add more of or edit the existing COMPONENT_LANG.js file, like Arduino_en.js.

I am also planning to translate this to Romanian, which is my primary language, when I´ll have some more spare time to go through all the strings.

cparrapa commented 4 years ago

Thanks for the tip, this is what a member of the community did so far https://gist.github.com/0day1day/20130c46310f396051e88c42921164d8

Then I guess I have to define the language in code.is as you said. Good to have Romanian too.

But this is very manual I am just concern if we need a better translation system once we add more blocks and make changes in the main one how to keep it consistent and updated.

BodoMinea commented 4 years ago

I added the Spanish translation based on @0day1day´s work. A few interventions were necessary:

Test it live: https://bodominea.github.io/blockly/www/ or see PR #10

s1gmund80 commented 4 years ago

Hi, is there something I could help with to have a proper Mac build installer/app? I have a Mac, I can do some tests and maybe help with some build/install script

cparrapa commented 4 years ago

Hi @s1gmund80 Yes of course, So i have been trying to follow this tutorial https://www.christianengvall.se/dmg-installer-electron-app/ and i generated one for MAC already here: https://www.ottodiy.com/#blockly Download try and let me know.

If not that means i miss something, which we should find a way from the electron documentation https://www.electronjs.org/docs/tutorial/application-distribution or here https://www.electron.build/multi-platform-build

Thanks!

nickboucart commented 4 years ago

I too have a Mac. I tried the installer, but that didn't work, the app wouldn't startup up.

I cloned the project and try to run it locally, but all I get is a blank screen... Do you have any suggestions on how to get the app running locally in development? If I could get that to work on my Mac, I might be able to look into installers etc...

Thanks!

Update: I managed to get the app running locally, by running

yarn electron ./www/index.html 

in the root folder of the project. (note I'm using yarn rather than npm, because I'm more familiar with that...) I can't get compilation of code to work though, when I press the compile button in the app, it shows a blank modal coming up, and then nothing...

cparrapa commented 4 years ago

Hi @nickboucart

That is a great progress! at least we know the app runs well just need to figure out how to pack in an APP.

The blank screen was happening to me also, in my case it was because i did not open git bash as admin.

For MAC i think there must be another process also to build.

Maybe we need to modify the packgage.json file so that it builds all the OS together with one command like the shortcuts in this tutorial https://www.christianengvall.se/electron-packager-tutorial/

Thanks!

nickboucart commented 4 years ago

Hi,

The app is not really running well on macosx as it stands now: I browsed through the source code and found couple of places where windows specific calls where made (e.g. calls to the arduino.exe and python.exe). These will have to be made os dependant.

I’m completely new to electron development, so I have to find my way around a bit.I might have some time next week to look into the mac side of things. I'm not promising anything though ;)

Nick.

On Thu, 13 Feb 2020 at 13:13, Camilo Parra Palacio notifications@github.com wrote:

Hi @nickboucart https://github.com/nickboucart

That is a great progress! at least we know the app runs well just need to figure out how to pack in an APP.

The blank screen was happening to me also, in my case it was because i did not open git bash as admin.

For MAC i think there must be another process also to build.

Maybe we need to modify the packgage.json file so that it builds all the OS together with one command like the shortcuts in this tutorial https://www.christianengvall.se/electron-packager-tutorial/

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OttoDIY/blockly/issues/9?email_source=notifications&email_token=AAAVFPIY6CC2UXDNCHMPG2TRCU2O5A5CNFSM4KLQWZTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELUXWCI#issuecomment-585726729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAVFPM3EP6X5JEHC5FFH7TRCU2O5ANCNFSM4KLQWZTA .

cparrapa commented 4 years ago

Hi @nickboucart and @s1gmund80

I am also new in this electron, java, Blockly development world and still with help of people and just trying we manage to make a very functional windows app. I only have Windows computers so i cant verify whatever we output for other OS is fully working. So you guys a big help!

You are right about the calls maybe we need the arduino cli compiler version for linux and mac as well, it is not that simple as just pack the app for other OS with electron.

Thanks intentions count!

nickboucart commented 4 years ago

Hi all,

I'm working on getting the app running and working on mac. You can follow up on progress at https://github.com/nickboucart/blockly/tree/mac. That said, I don't know how much time I can spend the next couple of days/weeks.

Things I did so far

I'll keep using this thread to post updates as I go.

Thanks! Nick.

mxochicale commented 4 years ago

Hi @cparrapa et al.,

Here to offer my weekends to help on the linux installer (Ubuntu, raspbian, etc) for Otto Blocky. From your above comments, I read that @BodoMinea suggested "(a sh installer script or distribution packages)" and I see that @nickboucart has done a nice progress with the mac installer. That said, I am wondering if you have any references, links or instructions to understand more about the workflow on the linux installer for Otto Blockly.

PS. You might create a new issue to follow up the linux installer and rename the current issue to mac installer only.

cparrapa commented 4 years ago

Hi @mxochicale

Indeed we better separate this issue for Linux here #38

Thanks for your help we are gonna need a lot i am also getting more time now for Blockly so in this July we can make some progress!,

I did not see @nickboucart, advances is it something we can merge? to be honest i am lost of what to do to make it work for Mac, i tried all in my humble software developing experience, this is what i used last time to pack it.

$ electron-packager . --overwrite --platform=darwin --arch=x64 --icon=build/icon.icns --prune=true --out=release-builds Packaging app for platform darwin x64 using electron v4.1.1 Wrote new app to release-builds\Blocklino-darwin-x64

Another thing is that i do not have a Mac so very difficult for me to test, i gave to people to try but they only got white screens #28

NeftaliVenancio commented 3 years ago

Tengo equipo Mac e interesado en poder realizar pruebas.

cparrapa commented 3 years ago

Hi @nickboucart Neftali have you tried to generate the installer from electron builder?

cparrapa commented 2 years ago

Hi guys use this one https://drive.google.com/file/d/1owVPRWOEcMCEG8Oo4l11p0zWlsCsBPOu/view