Everything is working as advertised on the Mac now. I had an older version of node (0.9.6 from January) installed and it appears to have a problem with buffering and serialport. If I waited long enough, I would see large blocks of my data spit out in one chunk - about 900 lines at a time. Yesterday, I just wasn't being patient enough.
The serial port open/close doesn't appear to cause a reset as through previously.
I upgraded to the latest node v0.10.3 and all is well. Heater's examples work both when talking to a spewing "Hello World" or when sending commands to PropForth.
Node is a moving target, so if you see something strange, it may be worth it to check if you have the latest versions.
And I thought I was doing so well last night... *sigh* that is, until I tried to install serialport. After much searching around, it would appear that there are problems related to VS, maybe not only the express editions either. In any case, I never was able to get serialport to install. So, I tried going back a few versions of Node.js (0.8.16) to see if I could at least get the serialport2 module (now merged with serialport) to install. And it did, with a few warnings. I haven't tested it yet, I only know that it is installed now ("npm list").
Back to doing my taxes for the time being. I'll report more later.
you guys are way too quick to blame Microsoft for something they really aren't responsible for.
There is always a way around something.
It looks like somebody just made a commit
"windows: fix compilation with VS Express "
If it's not regularly tested with a particular configuration, or the developers don't know that it needs to work with a particular configuration, it probably won't work.
It looks like somebody just made a commit "windows: fix compilation with VS Express "
I noticed that; still a no-go for me, however. I already have 2010 VS Express on my computer. Since that doesn't work, I installed 2012 VS Express and tried it that way, different errors but the same result -- doesn't even install.
If you look at the history of serialport + Windows, you find there have been problems getting it to work reliably pretty much from the start. It would appear that the serialport contributors, though they're aware of problems and working to fix them, haven't got it all figured out just yet. I don't blame MS especially for that; it's just one of those things. I have a few other ideas I could try, but for now I'm giving this a rest, and for the time being, I'll put Node.js on one of my Linux or BSD boxes and play with it there.
I should add that other than "serialport" Node.js works seamlessly on Windows. I was able to install and get working several other modules, and do many of the things that Heater has been talking about (more or less). But the show-stopper for Node.js + Windows right now is "serialport" (at least for some of us, others seem able to install it without issue).
...you guys are way too quick to blame Microsoft for something they really aren't responsible for.
Yes we are. However in this case I think they can carry the can.
Two or three years back I wanted to use serial ports on Windows in a Qt application. There is a serial port library for Qt that even works. But guess what? It does not support asynchronous, event driven I/O. That's exactly what you need so that you can get signals out of as serial data event like you do a user pressing GUI button event. To get around that you had to use polling or threads. Needless to say it worked correctly on Mac an Linux.
Now we have Node.js that requires exactly asynchronous I/O. And guess what? They can't get it to work on Windows.
I don't believe there are two teams of guys both so dumb that it their fault it does not work.
Computers have had serial ports since before anyone can remember. They are about the simplest interface we have after flashing a LED. Why can't, or more likely won't, MS get this working?
There are instructions there as to how to down load the code.
I have added a little step toward making it more of a web server.
In propeller-node.js you will see the same serial port code.
What I have added is to take into use the "express" module. Express takes care of a lot of details of serving up web pages.
You will need to do "npm install express" in the directory where propeller-node.js lives.
What express is doing for us is serve up any files we put in the "html" sub directory. So if you point your browser at localhost:8080 you will see the index.html page.
It's nothing to look at yet and and has no functionality. Except it has a link back to a page displaying the raw serial buffer as before.
Next, we will get bidirectional communications going between web page and Propeller via websockets.
Computers have had serial ports since before anyone can remember. They are about the simplest interface we have after flashing a LED. Why can't, or more likely won't, MS get this working?
I'd better not, there are women, children and politically correct people here. The former two groups probably wouldn't mind so much but the latter can be a problem:)
Any way it gets worse. I've kind of put the simplest code together for handling websocket communication from our node.js server to the browser and then thought it would be nice to have a better looking and potentially useful display.
Now, this is partly my fault because I hate messing with all that HTML, CSS, DOM and other WEB chaos that is normally used in building web pages.
No I want to use a nice simple javascript library to draw what I want myself. One of the best way to do that is using webgl because it's fast.
So here come some more MS hold ups to my cross platform plans. For those stuck on IE only the latest versions support web sockets and as far as I know none of them support webgl.
If there are any followers of this little series we will have to continue with Firefox or Chrome. Is that OK?
I'd better not, there are women, children and politically correct people here. The former two groups probably wouldn't mind so much but the latter can be a problem:)
True, oh so true.
If there are any followers of this little series we will have to continue with Firefox or Chrome. Is that OK?
All I use (well, Pale Moon on Windows but same thing as FF).
Comments
And here I just thought it was my setup ....
At this point one has to beg for a binary or rewrite the code.
Every time I buy a Microsoft compiler, they obsolete it!
Doctor: Well stop doing that.
Jazzed: Every time I buy a Microsoft compiler, they obsolete it!
Heater: Well stop doing that.
I was going to suggest cygwin but that is no longer supported by Node.
The serial port open/close doesn't appear to cause a reset as through previously.
I upgraded to the latest node v0.10.3 and all is well. Heater's examples work both when talking to a spewing "Hello World" or when sending commands to PropForth.
Node is a moving target, so if you see something strange, it may be worth it to check if you have the latest versions.
Now, where to go from here.....taxes or node??
My favorite cure
I bought my last M$ compiler in 2003. MinGW works great on windows, but it's not POSIX.
Back to doing my taxes for the time being. I'll report more later.
There is always a way around something.
It looks like somebody just made a commit
"windows: fix compilation with VS Express "
If it's not regularly tested with a particular configuration, or the developers don't know that it needs to work with a particular configuration, it probably won't work.
If you look at the history of serialport + Windows, you find there have been problems getting it to work reliably pretty much from the start. It would appear that the serialport contributors, though they're aware of problems and working to fix them, haven't got it all figured out just yet. I don't blame MS especially for that; it's just one of those things. I have a few other ideas I could try, but for now I'm giving this a rest, and for the time being, I'll put Node.js on one of my Linux or BSD boxes and play with it there.
Two or three years back I wanted to use serial ports on Windows in a Qt application. There is a serial port library for Qt that even works. But guess what? It does not support asynchronous, event driven I/O. That's exactly what you need so that you can get signals out of as serial data event like you do a user pressing GUI button event. To get around that you had to use polling or threads. Needless to say it worked correctly on Mac an Linux.
Now we have Node.js that requires exactly asynchronous I/O. And guess what? They can't get it to work on Windows.
I don't believe there are two teams of guys both so dumb that it their fault it does not work.
Computers have had serial ports since before anyone can remember. They are about the simplest interface we have after flashing a LED. Why can't, or more likely won't, MS get this working?
Bah! I hate that company.
There are instructions there as to how to down load the code.
I have added a little step toward making it more of a web server.
In propeller-node.js you will see the same serial port code.
What I have added is to take into use the "express" module. Express takes care of a lot of details of serving up web pages.
You will need to do "npm install express" in the directory where propeller-node.js lives.
What express is doing for us is serve up any files we put in the "html" sub directory. So if you point your browser at localhost:8080 you will see the index.html page.
It's nothing to look at yet and and has no functionality. Except it has a link back to a page displaying the raw serial buffer as before.
Next, we will get bidirectional communications going between web page and Propeller via websockets.
I'd better not, there are women, children and politically correct people here. The former two groups probably wouldn't mind so much but the latter can be a problem:)
Any way it gets worse. I've kind of put the simplest code together for handling websocket communication from our node.js server to the browser and then thought it would be nice to have a better looking and potentially useful display.
Now, this is partly my fault because I hate messing with all that HTML, CSS, DOM and other WEB chaos that is normally used in building web pages.
No I want to use a nice simple javascript library to draw what I want myself. One of the best way to do that is using webgl because it's fast.
So here come some more MS hold ups to my cross platform plans. For those stuck on IE only the latest versions support web sockets and as far as I know none of them support webgl.
If there are any followers of this little series we will have to continue with Firefox or Chrome. Is that OK?
Firefox and Chrome are everything I have.
Firefox and Chrome are everything I have.
Massimo
All I use (well, Pale Moon on Windows but same thing as FF).
Ah - I recall. That is the program you use to download a browser...