Shop OBEX P1 Docs P2 Docs Learn Events
Node.js and the Propeller. - Page 2 — Parallax Forums

Node.js and the Propeller.

2»

Comments

  • Heater.Heater. Posts: 21,230
    edited 2013-04-07 05:04
    mindrobots,
    ...does not work with the Express version of VS due to serialport's use of MFC/ATL which is only available in the retail version.
    Ahggg!. Try and do something nice and there is always MS there to spoil it. They have been doing that for decades. God I hate that company.
  • jazzedjazzed Posts: 11,803
    edited 2013-04-07 07:21
    mindrobots wrote: »
    Anyone trying this on Windows?

    I just ran into this bug report on node-gyp from 10 days ago: ....


    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!
  • Heater.Heater. Posts: 21,230
    edited 2013-04-07 07:39
    Patient: Dr, Dr, everytime I slam the door on my finger it hurts.

    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.
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-04-07 08:45
    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.

    Now, where to go from here.....taxes or node??
  • jazzedjazzed Posts: 11,803
    edited 2013-04-07 09:02
    Heater. wrote: »
    Patient: Dr, Dr, everytime I slam the door on my finger it hurts.

    Doctor: Well stop doing that.

    Jazzed: Every time I buy a Microsoft compiler, they obsolete it!

    Heater: Well stop doing that.

    My favorite cure :)

    I bought my last M$ compiler in 2003. MinGW works great on windows, but it's not POSIX.
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-07 09:44
    mindrobots wrote: »
    Anyone trying this on Windows?
    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.
  • whickerwhicker Posts: 749
    edited 2013-04-07 14:51
    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.
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-07 16:04
    whicker wrote: »
    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.
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-07 16:11
    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).
  • Heater.Heater. Posts: 21,230
    edited 2013-04-08 13:54
    whicker,
    ...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?

    Bah! I hate that company.
  • Heater.Heater. Posts: 21,230
    edited 2013-04-08 14:06
    I have put the code we are discussing here up on GtHub https://github.com/ZiCog/propeller-node

    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.
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-20 11:59
    Heater. wrote: »
    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.
    Now tell us how you really feel, Heater! LOL
  • Heater.Heater. Posts: 21,230
    edited 2013-04-20 12:43
    KC_Rob,

    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?
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-04-20 14:36
    I-what?

    Firefox and Chrome are everything I have.
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-04-20 14:37
    I-what?

    Firefox and Chrome are everything I have.
  • Heater.Heater. Posts: 21,230
    edited 2013-04-20 14:39
    Oh good. Glad to hear it. Then we can continue.
  • max72max72 Posts: 1,155
    edited 2013-04-20 14:42
    I use IE only with rare webpages working with exclusive code, otherwise I'm chrome and firefox only, so trash IE as soon as possible!
    Massimo
  • whickerwhicker Posts: 749
    edited 2013-04-20 14:52
    I use Firefox exclusively.
  • KC_RobKC_Rob Posts: 465
    edited 2013-04-20 16:27
    Heater. wrote: »
    KC_Rob,

    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).
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-04-20 23:55
    What is this "Internet Explorer" of which you speak?

    Ah - I recall. That is the program you use to download a browser...
Sign In or Register to comment.