Uploading stops working after "reload"

I’ve used XOD before, and deployed just fine. But, after “reload”, it is having problems now (avrdude: stk500_getsync(): can't communicate with device: resp=0x04).

Using the Arduino IDE works fine. Tried using the hello-world tutorial (using “deploy” patch, for example).

This allows things to work:

  • Close XOD (not restart, must close)
  • Open XOD
  • Click on tutorial
  • deploy (doesn’t matter what patch)
  • uploads ok.
  • (my own projects also upload)
  • (having Arduino IDE open or closed has no effect)

To break it (everytime):

  • Reload xod: ctrl-R
  • click on tutorial
  • deploy (any patch)
  • upload can't communicate with device as below
  • further reloads give same behavior. Must close to fix.

So, it’s the reload, presumably doing something to the serial port. Like failing to release it? Or (re-)misconfiguring it?

XOD 0.25.3
"upgrade arduino packates & toolchains": upgraded
Linux 4.15.0-38-generic #41~16.04.1-Ubuntu SMP Wed Oct 10 20:16:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 16.04.5 LTS
Genuine Arduino UNO smd
AND Mega2560 (clone).
arduino ide port: /dev/ttyACMO (Arduino/Genuino UNO)
xod port: /dev/ttyACMO (Arduino Srl)
Uploading compiled code to the board...

avrdude: Version 6.3, compiled on Jan 17 2017 at 11:00:16
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/awgrover/xod/__packages__/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf"

         User configuration file is "/home/awgrover/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200

avrdude: stk500_getsync(): can't communicate with device: resp=0x04

avrdude done.  Thank you.

Error: exit status 1
Error during upload.
Upload failed
Command `/opt/XOD\ IDE/resources/arduino-cli --config-file=/tmp/arduino-cliZ6Hg24/.cli-config.yml upload --fqbn arduino:avr:uno --port /dev/ttyACM0 --verbose -t /tmp/xod_temp_sketchbooktLAQwy/xod_1543764498453_sketch` failed with code 1
Make sure the board is connected, the cable is working, the board model set correctly, the upload port belongs to the board, the board drivers are installed, the upload options (if any) match your board specs.

No messages in “developer tools” that seems relevant (several "ENOENT: no such file or directory, open '/opt/XOD IDE/resources/app-update.yml'")

Hello! Thank you for the report.

I am pretty sure we have some flaw relater to re-joining IDE processes after Ctrl+R because Ctrl+R restarts only one of them. But may I ask why do you use Ctrl+R? What are you achieve when reload the IDE. It used to have much sense previously, but now I see no clear reason.

Am I understand correctly, you reload to switch to an empty/dummy project? If so, can’t the Ctrl+Shift+N or opening a particular project (Ctrl+O → Recent) do the trick?

1 Like

While developing libraries, I use this constantly. As I add patches to the library, for example, or manually insert libraries/packages/arduino-libraries, or change nodes, or fix bugs in my cpp (soooo many bugs).

What do you do as you develop new libraries? XOD doesn’t seem to pick up changes till a reload/restart.

If I was just doing normal XOD projects/patches, I doubt I’d need reload (though it seems that not everything works perfectly on linux? the #pragma for loading arduino libraries?).

I see. So, you re-load with Ctrl+R to load the recent changes in libs, right?

I usually make a library having it open as the current project. If I need to test something, I create an example-lalala utility patch and upload it. When it is done, the patch stays there because it is somewhat usable.

I agree, the experience is poor and should be improved. At the very least we should fix the bug you’re reporting (created Uploading stops working after reload · Issue #1583 · xodio/xod · GitHub) and eventually do something more.

What if:

  • There will be a dedicated menu item to reload the current project and all libraries from FS
  • When entering a new patch name you will be allowed to enter awgrover/my-super-lib/some-new-patch and that will create the some-new-patch patch inside the awgrover/my-super-lib

Will these two items make your experience better to a comfortable extent?

That seems like what the default “reload” should do. And would directly address why I reload.

Being able to “work” on a library would be quite useful when the patches are XOD nodes. I’ve lost track of whether you can edit a libraries patches? Ii’ve used a the hack of linking the lib-directory into the project space and editing the project, and reloading.

The first, definitely. The second seems like it could us more thought: how to develop libraries staying in XOD. So, allow us to edit library patches, etc. And then upload the library!


Symlinks were suggested by nkrkv as a work-around for being able to develop, then push a library: Managing local libraries and workspace and publishing libraries

I hope it’s relevant, but it would be nice to be able to have multiple projects open at once. Think like atom.io add project folder feature.

This way you could have the tutorial and a custom project open at once. Or a lib or two :slight_smile:

Yes, you can currently. Ctrl+S saves everything: the project and the libraries. Sometimes you shoot your leg when one of that libraries changed is a xod/* library. Then a new version goodness becomes masked behind this auto-created fork.

What you cannot do currently is creating a new patch inside a library.

I open two or three XOD instances, and I copy complete nodes or parts.
XOD (1) In the project create a new patch, find the node in XOD (2) copy the content of the node and paste it in the new patch, it will be part of your project.