-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Command line requires X11 #1981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This seems related to #1970, but it's probably a separate problem. I'll put this on my list to investigate, thanks for reporting. |
Thinking about this a bit more, I think this will not be easy to fix. Right now, when running the CLI commands, all of the normal initialization happens normally,except for creating and showing the window. To fix this, we'd need to refactor the GUI code to be less coupled with the compilation functionality, which won't be very easy. We should do this eventually anyway, but this will probably require a significant effort. |
I'd like to comment that I have the same issue, and would love to be able to run the compile and upload commands via SSH (without X11). |
Hi matthijskoijman same issue on a Debian Virtual Machine without GUI, I have try using arduino-mk, but doesn't work anyway... |
Same issue with 1.5.8 on Debian Wheezy (Raspbian) running in a Raspberry Pi. |
Same issue - trying to do Continuous Integration on a Jenkins OS X node to verify Arduino files, but it needs to be headless. I've tried ino but it seems quite outdated. Is there any other workaround in the meanwhile? I've heard of bii hive, I'll give it a try too, but any other recommendations welcome. Cheers, |
We use jenkins all the time. To workaround the needs of the IDE, we have installed https://wiki.jenkins-ci.org/display/JENKINS/Xvnc+Plugin |
Thanks so much @ffissore, I'll give it a try. |
Sorry if this is getting a bit off-topic. @ffissore, In which platform are your running that plugin? I'm trying to test Arduino verification on a Jenkins Mac node and after much configuring and working around, I've got stuck. |
On mac we don't use that plugin because the node is launched via java web start. This allows the java process on mac node to access the display. Indeed, every once in a while, the IDE pops up and executes its functional tests |
I'm not sure I understand. Does that mean it's impossible to test this on a Mac node? :( |
Quite the contrary. We do it all the time. But you need to start the mac node properly. I don't remember which tutorial I used to set it up, but the result is that our mac main user has a startup "start jenkins" app that connects to master using java web start |
Oh, I see. I'll google it! Thanks a lot! |
Closing as wontfix. Fixing would require dismantling the IDE. We make small steps everyday, but can't really set a schedule |
FYI, as @wollew suggested, I switched to PlatformIO which can perform headless builds and uploads of Arduino sketches. For those who can run Python in their headless environment, it can be a temporary workaround. It works a wonder for Travis testing for example. |
It's very ironic multi-target PlatformIO framework can do it and official Arduino-only IDE can't. Oh, my |
Irony aside, I would like to point out the amount of work needed to achieve that. The Arduino IDE is a fork of Processing that has been designed from the beginning as a GUI application: it surely requires much more work to obtain a "pure" CLI application compared to an application that... well... is born as command line utility! :-) Anyway, I've just pushed #5578 that should solve this issue once for all. |
Thank you very much for your efforts on this @cmaglie It will be really good to be able to verify Arduino builds automatically, using the official toolchain. |
"Consider also that the amount of users that runs the IDE from CLI is a small minority" |
"running-arduino-cli-from-a-headless-linux-machine" hits <0.01% of our user base that is mostly Windows / Mac with a desktop PC. BTW now it's fixed, there is no point in discussing this further. |
Thanks for this work! It will enable all sorts of things from letting people use their favourite text editor or IDE for arduino code to automated rebuilds and deploy. |
I'm still noticing the need for this X11 workaround as recently as the 1.8.5 build, as part of development work on a Continuous Integration system for Arduino (https://github.com/ianfixes/arduino_ci). In addition to what I assume was the splash screen popping up, some errors were presented graphically instead of via the console, which caused a hang -- waiting for a graphical "ok" before continuing. Is there a command line switch I'm missing? |
I notice this too with 1.8.5 - even if I run with X Forwarding - as thousands of other apps run fine.
|
I'm running fedora 27 within QubesOS. This issue didn't happen earlier, though I haven't used the arduino IDE within the last year.
|
@GammaSQ it appears you're using a version of the Arduino IDE installed via a package manager. It has been modified in unknown ways by 3rd parties, which might be the cause of the problem. I recommend removing that thing and trying the official Arduino IDE downloaded from: |
#5578 says it fixed this, however running arduino on raspbian stretch still gives the error. No X11 DISPLAY variable was set, but this program performed an operation which requires it. |
@darrahts which command did you launch? |
Arduino 2:1.0.5
also tried the arduino-headless trick but it just hung (although no error messages, but hanging is an error itself) |
You're running Arduino 1.0.5, now we are at 1.8.5. Please remove the package coming from raspbian repositories that is very old, and download the latest from arduino.cc. |
@cmagile I'll swear on my life that I saw this problem on 1.8.5 but I just ran the full suite of tests on my CI library in linux, via Travis with the Can't repro. Will open a new issue if it ever happens again. Thanks for following up! |
Yes that would make a big difference (sorry for the oversight!), however I'm still having issues. on a fresh Adding desktop shortcut, menu item and file associations for Arduino IDE...
running it without sudo I get this:
I am on a fresh install of raspbian stretch. This looked similar to #6116 but the RESOURCE_NAME is already arduino-arduinoide |
@darrahts, that will likely get you an 1.0.5 version, which is the "latest" from Debian. Better get the zipfile from arduino.cc directly (there is an ARM/rpi version). |
Uploading sketches in the (RHEL) user account is blocked. So in user account in shell/terminal I typed "su -" followed by root password, to get root privileges (temporarily) for the time I will be in arduino IDE, as recommended by Red Hat due to security. Then, from the terminal I've fired the Arduino IDE up, getting this same issue:
The only workaround I am aware of is to switch RHEL from user to root (discouraged by Red Hat as insecure). Fire up the IDE from there, and use it. "Headless mode is a system configuration in which the display device, keyboard, or mouse is lacking." - that is not how I use this notebook. But I program bits and pieces on this machine, using various openjdk and java_sdk vers. I would be grateful if you can point me to other workaround(s); I doubt Xvnc si possible solution for me to look at (I've just read DESCRIPTION of 'man Xvnc'). "Virtual Network Computing is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol to remotely control another computer. It transmits the keyboard and mouse input from one computer to another, relaying the graphical-screen updates, over a network." - does not look like what I need. Obviously I can live with the current situation and fully understand that I fall into a very small userbase set. No answer from you is fine, too, and would affirm my understanding the solution would require too extensive a work given our small specific userbase. |
How is this still an issue. Heaven forbid you write code that can run independently of a GUI.
|
This is unlikely to be resolved, since development mostly moved to the Arduino 2.x version. Also, if you want to do something on the cli, there is now also the arduino-cli tool that is a way more streamlined and complete CLI experience than the Arduino IDE 1.x CLI that was more of a bolted-on approach. |
I'd like to use the CLI in Arduino 1.5 on a headless Raspberry Pi (accessed through SSH only, no X11 environment), to make a continuous integration platform.
When calling arduino in the command line, Java complains that the X11 environment is not set and is required (which should not be necessary for CLI programs).
CLI output:
The text was updated successfully, but these errors were encountered: