Skip to content
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

What is the current state of this, does it work at all yet? #7

Open
trullock opened this issue Oct 25, 2020 · 14 comments
Open

What is the current state of this, does it work at all yet? #7

trullock opened this issue Oct 25, 2020 · 14 comments

Comments

@trullock
Copy link
Collaborator

trullock commented Oct 25, 2020

Nothing works for me, either by building with npm and copying the folder to .vscodes extensions folder or by building a visx and installing

I get the Arduino CLI commands in the command pallet, but all of them just give me an empty search bar, sometimes with a placeholder...

Am I too keen? Is this where we're up to? Or have I missed an install step

I've set the arduino-cli.exe path in the settings

@ghost
Copy link

ghost commented Oct 25, 2020

Well, if you're running Windows 10, I might be able to help by explaining what I've done so far.

To summarize, I've built a VSIX and installed from that. I added the folder to arduino-cli.exe to my environment path variable as well as specified the path, including the filename and file extension, in my extension settings. After all that, I'm at the point where I can select my controller board and my serial port. I can compile my code. But, my serial monitor doesn't appear to be receiving data and I have a few other questions about the "normal" usage of the extension. All of which I presume deal with my lack of experience with it. But, that's what I'm here for...to use it and to help get it ready for the masses...

If you're using Windows 10, give those steps a shot. Peter's instructions work, just follow them and you should be good to go to get to where I am, at least...

@PeterWone
Copy link
Owner

PeterWone commented Oct 26, 2020

The state of it is all the main functionality works on my system but deployment is not yet robust.

I'm very relieved to see mutual support happening, I can't give this any attention in the next two days. Plus I live in Australia making timezones awkward.

@trullock In case you haven't already found the wiki I direct your attention there. https://github.com/PeterWone/vscode-arduino-cli/wiki

We've been building out this material while shaking down HEMIsixty's setup.

@PeterWone
Copy link
Owner

PeterWone commented Oct 26, 2020

OK I have to leave this right now, but I knocked up one more wiki topic that expands on the problem that I think @HEMISixty encountered. https://github.com/PeterWone/vscode-arduino-cli/wiki/Theory-of-operation

This topic is far from comprehensive, I started with the the part of the theory that pertains to your experience.

@trullock if we are lucky this is what's afflicting you too.

Work with Hemi and between you make the documentation what you wish you'd found!

@ghost
Copy link

ghost commented Oct 26, 2020

I'm going through the link and playing with things in PowerShell to see what I come up with...

@PeterWone
Copy link
Owner

@HEMISixty crumbs the serial monitor is totally undocumented. It's a separate C# dotnet core program that you have to build and deploy. My apologies. I'm totally out of time, just wanted to say you haven't messed up, just wait and I'll come back with code and details.

@ghost
Copy link

ghost commented Oct 26, 2020

Take it easy Peter, we'll be here when you get back. Maybe we'll have something figured out by then. Cheers!

@PeterWone
Copy link
Owner

Thanks. Look in serial-monitor.ts for this

    if (this.serialPortName !== "No monitor") {
      this._childProcess = child_process.spawn("d:/serial-monitor/bin/debug/netcoreapp3.1/serial-monitor", [this.serialPortName, this.baudrate.toString()]);
      this._childProcess.stdout.on("data", (data: any) => {
        this.outputChannel.append(data.toString());
      });
      this._childProcess.on("error", (err: any) => {
        this.outputChannel.append(err);
      });
    }

and if you know how your first contribution can be to make this a setting like for arduino-cli path.

@ghost
Copy link

ghost commented Oct 26, 2020

Sure, I'll give it a shot...

@trullock
Copy link
Collaborator Author

Lovely Heisenbug here, the extension works when debugging it 🤦

Here's what I did:

  • Installed the VISX, closed all VSC windows (repeat multiple times) opened an Arduino project, tried the CLI extension, didnt work.
  • Made this thread
  • Went to bed
  • Tried the debugging approach this morning, it works!
  • Opened a new VSC (whilst the VSC for the extension project was open, but stopped debugging) for an Arduino project, installed extension works!
  • Closed all VSC and repeated this whole process, doesnt work :/

@trullock
Copy link
Collaborator Author

Now it works all the time :/

I'll leave this thread open because something odd definitely happened, just no idea what

@ghost
Copy link

ghost commented Oct 26, 2020

Ok, before I go and try to repeat your steps, I'm going to create a backup of my extension for a "before" and "after" attempt at diff'g them.

But, I presume you uninstalled the extension before starting the debugging session that did "something" to make the VSIX installation work afterwards, right?

@ghost
Copy link

ghost commented Oct 26, 2020

Aaannnddd...I don't see a *.*proj file...what, exactly, is the project file I should be loading to do the debugging? Sorry for my "noobness" here...debugging isn't new...but, I haven't debugged anything since the early 90's...

@PeterWone
Copy link
Owner

Proj files are A Visual Studio thing. C# uses them too, but VS Code and extensions are Node.js written in Javascript or typescript. For a VS Code extension, "project file" just means a file in the project, most likely src/extension.ts

@ghost
Copy link

ghost commented Oct 27, 2020

Yeah, I was thinking "main.cpp", but I think I'm showing my age with that...lol

I was just opening the folder and winging it...that seemed to be working... Thanks for the explanation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants