Issues getting the Particle Dev working with a library example (SOLVED)

Hello everyone!

I seem to be having some issues. I copied webserver.h and the helloworld.ino from the library to Particle Dev. I saved them both, with the webserver.h in a src subfolder, and ran a compile and check. I keep getting this error…
Title: ENOENT: no such file or directory, uv_chdir
Error Text: C:\Program Files (x86)\Particle Dev\resources\app.asar\node_modules\spark-dev\lib\spark-dev.js:474

Then under it there is a message saying…
The error was thrown from the spark-dev package. Atom is out of date: 0.0.24 installed; 1.0.2 latest. Upgrading to the latest version may fix this issue.

I went and got Atom 1.0.2 and installed it but I still get the same error.

I thought Particle Dev was the software used to flash your core/photon…
What is Atom?
Why does it not see I have installed the latest version of Atom? (I used the exe installer)

The folder it’s looking for does not even exist as both Particle Dev and Atom have app.asar.unpacked folders not app.asar folders.
Why is this folder not part of the install and do I need to create it?
If so and after I do where can I find a copy of spark-dev.js?

This should not be this confusing. I have worked with the arduino now for some time and have made many projects so it’s not like I am band new to this type of thing but I just don’t get this. Please point me in the right direction!!!

Thanks!

1 Like

Maybe you could start with something as simple as possible to start to get something working.

Maybe control the led or something. Post simple code and you will get lots of help.

@HardWater I have started with simple code. I have had no issues until I got to this point. I even wrote my own web page to trigger events on the core itself and had no issues.

You would think that if there is sample code offered that the code would work but as I read through some of the other posts I see there are issues with examples in the build site library.

Having said all that how about some answer to the questions I have that are not trouble shooting issues.

What is Atom?
Why do I need Atom when I have Particle Dev?
Why does Particle Dev not see the new install of Atom?
why is the app.asar folder have an extra .umpacked
Where can I find a copy of Spark-dev.js

I have been a developer for over 30 years. My first hard drive was a cassette tape player as the floppy had not even been invented yet. When I purchased my first arduino I was programming multiple devices on an i2c network within the first month. These managed over 120 meters of LED neo pixels using XBee network cards via a desktop software package I wrote. I did all that in less than 2 weeks.

This should not be that hard. I took copies of code from the library and now I get errors. First time I got errors was this, and it’s the first time I did not write the code myself. I am just asking for a bit better understanding of what is taking place. To ask me to step backwards and work on something simple without even attempting to address any of the questions ask is kind of offensive.

Hey @digital_janitor I am a guy just like you a user not a particle employee. Just trying to help.

@HardWater No worries, just pointing out that what you did is somewhat offensive. Someone asks questions and you come in and tell them they should step backwards without giving any input on the questions ask. Keep in mind people come here for answers to their questions. While the hardware/software is new to me the process is not, though I have much to learn about the hardware/software and the process as it relates to Particle products.

@Digital_Janitor, there is a lot to take in even for an Arduino developer. I am not a Particle employee either but @HardWater and I will try to help.

What is Atom? Atom is the open-source platform used by Particle DEV

Why do I need Atom when I have Particle Dev? You don’t need Atom since DEV is a customized Atom environment

Why does Particle Dev not see the new install of Atom? I suggest you remove both Atom and Particle DEV and ONLY install Particle DEV going forward.

why is the app.asar folder have an extra .umpacked? I have no clue. See last point.

Where can I find a copy of Spark-dev.js? Everything you need to know is in the documentation. The ParticleJS info is there as well.

I have to admit that the Particle environments are not as mature as Arduino’s but for a company that is under two years old, its doing pretty well. I personally use CLI and DEV without issue though I do prefer a local toolchain and the bleeding edge source. Don’t panic, the Community and Particle are here to help :smile:

I don’t know who changed the subject here but I have particle dev working. It works with code I write and other samples but the web server code seems to have some issues and that is what my questions are about. The issues caused by the code do relate to Particle Dev but only as much as what Particle Dev is looking for to make this code work.

@Digital_Janitor, ah, I must have missed something and I was answering your questions. So, can you tell me where you got webserver.h and can you post your code? Particle DEV likes to have all the files in the same directory (no subfolders). Have you tried that?

Thanks @peekay123, the only reason I installed Atom was because Particle Dev told me to. lol

Thanks so much for the answers to those questions.

I will go read more about ParticleJS.

I did try putting the webserver.h in the same folder as the .ino but still no good. Installing nodejs now.

I got webserver.h from the build library and here it is…
webserver.h
Too much text for the forum…

Thanks so much for your help!!!.

@Digital_Janitor, my pleasure! Did you try the example that comes with the webserver library to start with?

yes the example was the hello world example. Now having issues with bower. When you install node.js it tells you to run this cmd line…
npm install spark

That seemed to work just fine. It then moves to the client side area in the instructions and it says to type…
bower install spark.
I guess bower is another software package as this line does not work in command prompt but the site is not real clear. It just says ParticleJS can be included using bower.

This is not an issue for me as I understand that the js file is on the web and needs to be included in any web based file I intend on creating if I want to communicate through the cloud with a web page. Correct?

Well I have installed the node.js package as instructed but I keep getting this error

Keep in mind that the Particl Dev install does not create a folder called app.asar but does create one called app.asar.unpacked and that does not have the node_modules\spark-dev\lib subdirectory in it. Even after installing nodejs and using the command line…
npm install spark.

Now in the install folder of nodejs I found a file called spark.min.js, is that now what the file is called instead of spark-dev.js? if so that is real messed up to have the software give an error that it cant find a file and give you the wrong name. If that is not the file I need then where is spark-dev.js now that I have added all this additional software to my computer?

Okay, let’s try this: remove everything Particle-dev, ParticleJS, Particle-whatever related. I think a bunch of things have been confused. The Particle Dev is an editor based on the Atom editor by GitHub, and is a standalone program. ParticleJS is the Javascript SDK meant to be used when you’re trying to create a node.js or browser application and want an easy API wrapper. The Dev and SDK have nothing to do with each other, and operate completely independently.
Try to get rid of any Particle Dev files as thoroughly as possible, so they won’t mess up a new installation. Then, download the Dev again, and go through the installation process.
Then, create a nice, clean, empty new directory. In that directory, paste nothing more than the WebServer.h file and your WhatEverYouLikeToCallIt.ino file. Don’t make any subdirectories, don’t add any other files.
I’ve just done a fresh install of Particle Dev, and the steps above allowed me to successfully compile for the Core without the issues you’ve mentioned above.

2 Likes

@Moors7 THANK YOU VERY MUCH!!! This worked but I am not sure why, and I don’t know that I care lol. I am just glad it did. It may have been that I started out using the src subfolder as used with the arduino.

I had done the uninstall one other time but did not delete the original ino and h files. This time I deleted those and did the uninstall Particle Dev. Once I reinstalled Particle Dev and created the new project folder the “Compile and show errors” showed no errors at all!!! I then tried to flash and thought I had an issue but it was a DEU error, (defective end user), as I was asking it to upload to a photon that was not plugged in. Once I got that fixed it worked great with no error.

This was such a pain but the only thing I can contribute the error to is that I was using that src subfolder. That is the only thing that is different at this point.

Thanks again for your help not only did it flash with no issues but it also worked when I went to the IP address in a browser!

You are the man!

1 Like

Glad I could help, that’s what we’re here for :smile:

1 Like