Espruino + Meteor.js Web Framework

Posted on
  • So, I'm one of the "completely new to microcontroller" people, but I know web development quite well, and thought it would be cool to be able to make reactive web apps that interact with the Espruino:

    https://www.youtube.com/watch?v=Pjbq2yqyPYM

    Source code: https://github.com/gadicc/espruino-gc-meteor

    Regrettably this was just a weekend project, to take a break from crazy pressure at work which I have to get back to now, but hope to resume work on it soon. Next release would have an API and server-to-server DDP. Definitely intend to invest more in this as time allows.

    See also: http://www.meteor.com

  • This is pretty cool. But being not familiar with meteor, could you add some info to the readme file on GitHub how to install this project and run it?
    I.e is the "gc-meteor-full.js" file running on the Espruino? What about the code in the "website" folder?
    I'd really like to try this out, so any help would be appreciated.
    Mike

  • Good point! I updated the README; please let me know if anything isn't clear... I'm very happy if other people get excited about this :)

    P.S. If you update any files in the website directory while Meteor is running, it will refresh the browser automatically. That's normal.

  • Very cool! Meteor is amazing but it's a shame it doesn't work on ARM, just imagine BeagleBone/RaspberryPi with Espruino board

  • That's really neat! Odd about Meteor on RaspberryPi... it'd be perfect.

    Does anyone know why it doesn't work?

  • I also thought so! My grand home automation master plan is indeed to have Meteor running on a Pi, with lots of Espruino's connecting to it.

    So I looked into this, and it turns out it's not a problem. Although Meteor isn't officially supported on ARM, essentially it's just a node app, and although people struggled to compile node for ARM in the past, it seems that today there are official binaries for the pi just 2 releases behind (v0.10.24). So looks like we're good!

    Incidentally, there is a lot more work in this field than I thought, with Meteor in particular. See e.g. PiJS and enteye, both written in Meteor from what I understand.

  • The following was quite a nice read, about PiJS, with two great quotes from the author. Looks like it's exactly the same idea as I had, using Meteor to interact with the client, and have a thin app implementing DDP on the Pi. It's a very short blog post, check it out.

    https://www.meteor.com/blog/2013/05/28/pijs-embedded-raspberry-pi-apps-in-javascript

    (DDP is Meteor's Distributed Data Protocol, is central to Meteor's reactive ideals, and as you'll see from the article above, very useful for event-driven hardware stuff too).

  • Thanks for the links. Did I get it right that Meteor is not running on RPi and you still need a proper server?

    Please give us a shout on this forum if you actually get Meteor working on Raspberry Pi, as I'm very interested in this, but somehow a bit less optimistic :)

  • Will give a shout when I do it personally, but as mentioned there are official Pi ARM builds of node now (Meteor is just a node app), and plenty of reports of MongoDB on the Pi too. That's all you need.

    Also, I didn't mention it, but there'll be a 3rd way to run this. If you don't need the Meteor server (e.g. no need for persistent data, only few expected simultaneous connections, and just one Espruino), we can serve the entire Meteor client side framework (~300k minified) from that Espruino's SD card. Wouldn't be my first choice, but an option :>

  • we can serve the entire Meteor client side framework (~300k minified) from that Espruino's SD card.

    Right now you can't do that as you need to be able to load every file you send into memory - but there is work in progress on a file stream API, which would fix that.

  • @gadicc Any thoughts on meteor+espruino over the serial connection (i.e. no wifi)?

    Edit:
    To be more specific. I'm thinking about data logger where data is continually collected by sensors connected to Espruino and sent to Meteor. All the data would be stored and presented by Meteor.

  • I'd say it's doable with a bit of work. You could create a new transport layer over serial (using a node serial module on the Meteor side), and plug into the respective parts on each side. Call a function on the Espruino when sending data, and ensure data comes back via console.log() and is handled accordingly on the Meteor side. It's not simple but definitely doable.

    Quite a weird setup though. It will be permanently tethered to your PC? I'd say if you don't want wifi, but are fine with a cable, make it an ethernet cable :>

    Possibly better handled with a small node app that uses the above approach to accept http connections and forwards them over serial. That has greater application for the general community as a whole too.

  • Quite a weird setup though. It will be permanently tethered to your PC?

    Not a desktop PC, I was thinking about something small like Alix board or BeagleBone Black if/when ARM is supported.

    Thanks a lot for your suggestions and ideas, I hope one day I will find more time to play around with them :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Espruino + Meteor.js Web Framework

Posted by Avatar for gadicc @gadicc

Actions