CircuitBlocks - javascript error

Hi, my son successfully built last weekend Ringo, it is up and running. He really liked it and we planned to move this weekend one step further and start with the programming. However, I am not able to start the CircuitBlocks after installation. I am getting following error:

I tried with three different computers with Windows 10, and it always fails in the same way. This is the only program that I have problems with. I even created manually the directory that it is complaining about (“CircuitBlocks” in user’s Documents directory), but it does not help. The only idea I have is that CircuitBlocks has some strange hard-coded file locations which do not work with folder redirection in active directory environment. It is possible? I know that active directory is not that common in home network, but I have it here and everything works, except for CuircuitBlocks.

I tried all windows versions which are available at github but all fail.

By the way, as my main desktop computer is running Linux (Fedora 31) I tried the Linux Appimage as well, but it does not work either. Yeah know that you list Ubuntu as a requirement, but this not what Appimages are meant for. It is clearly not: “Linux apps that run anywhere” as you can read on the Appimage web page. CuircuitBlocks AppImage asks for (sudo) password to run /bin/bash with root rights and then it is looks for some non-existing group… It is quite frightening to be honest…

I would appreciate if someone could look into this issue and help me, because we are now stuck in the middle of the project. Thanks in advance!

I ended up installing Ubuntu in VMware Player and it works that way, but this is really convoluted…

Hello, Marcin!

You are correct - CircuitBlocks assumes your “My Documents” directory is in its standard location. Furthermore, CB also looks for the Arduino sketches and libraries directories there. If you don’t mind, I’d like to ask you to describe your setup so we can fix that in the next update ASAP, but in the meantime, you can create a mock “My Documents” directory at C:\Users\marcin\Documents and place two more directories in it: CircuitBlocks and Arduino.

As for the Linux issue - unfortunately, due to the sheer fragmentation of Linux, we can’t support every distro and setup. The reason why we provide an AppImage is to allow easy running for users which might not have superuser permissions, but do already have Arduino installed.

The goal behind CircuitBlocks is to allow anyone to start programming with as little hassle as possible. To achieve this, CB automatically checks if Arduino and other comopnents are installed and if they aren’t - it downloads and installs them. Superuser permissions are required to add the current user to the group needed to access the USB port for uploading sketches and the serial monitor. The install script is similar to the default one which comes with Arduino IDE, but with some simplifications. This might be the reason why it isn’t working on your machine. In the future, we will change this so it uses the default Arduino install script.

I can assure you personally, nothing shady is going on with the install. CircuitBlocks is free (as in freedom) open source software and you can check the source code any time on GitHub. The Linux install procedure is located at https://github.com/CircuitMess/CircuitBlocks/blob/master/core/compiler/installer.ts#L179 and the procedure that checks if Arduino is installed is at https://github.com/CircuitMess/CircuitBlocks/blob/master/core/compiler/compiler.ts#L96

Let me know if I can help you any further.

Happy tinkering!

Hi Filip,

thank you for your comprehensive answer! It was actually sufficient to create “Documents” directory under C:\users\$user, and installer created then “CircuitBlocks” subdirectory. Funny enough, the “Arduino” directory gets created in the proper location, in user’s “My Documents”, so I guess the creation of these folders is programmed in different way.

There is actually nothing special about my setup, apart from the fact that this not common at home I guess:) As mentioned all my computers are joined to a domain and there is so called “folder redirection” configured, which means that user files (Documents, Pictures, tec, depending on what you choose) are stored in a share on a file server. Additionally user files are replicated locally (“Offline files”), what makes them available even if the files server is not available. I did it with Linux server and Samba instead of Windows Server. This is the way I tinker:)

As already mentioned, the “Arduino” directory was created during installation in proper location, so it should give you a hint how to fix it for “CircuitBlocks” as well. I will be more than happy to help you testing it if needed.

Regarding Linux - how about including Arduino in the Appimage? I am not an expert but I believe this is main advantage of this format, that you can bundle all required libraries in one package and then the user just needs to execute this one file. It makes of course the file bigger but it will run everywhere. I know it does not solve the problem of USB access though…

Thanks for your help & best regards
Marcin

Glad to hear that fixed your issue, Marcin, and thaks for the helpful info. We will add more flexible directory discovery to CircuitBlocks so it will work out of the box on systems with alternative directory setups. CircuitBlocks should update automatically when that happens :slight_smile:

We could bundle arduino inside the AppImage, but that wouldn’t solve the issue of needing sudo when installing, adding USB permissions, etc. Although, in the future we are planning on adding a simple installer that will let users choose which components to install, and which already are installed, but hiding in alternative directories. That should make CB run on most systems since the installation is the only platform specific part of the app.

Happy tinkering!