NodeJsController on non-raspbian linux distros



  • Hi everyone, this is my first post on this forum.
    MySensors looks very powerful, I appreciate your efforts on it and will explore it.

    Couldn't find information on this topic, so I made it. I haven't found clues on MySensors site either.

    I would like to use the NodeJsController :

    • on my PC (running linux mint 17) instead of using it with raspberry-raspbian combo.

    • If this is possible then I would like to do the same on a router (TL-WR703N) running OpenWrt linux.

    Is this possible? I will explore both serial and ethernet gateway.

    This is off-topic, I've found two libraries that have to do something with mysensors via npm, but they don't have no description. Maybe authors of those libs are here and could give some basic info on their libraries.
    Here they are:

    My best, Dario



  • Pinging this post because now NodeJsController could be used on OpenWrt router, I'm running it on my TP-Link WR-703N router :).

    I used automated script from mr. Nelson github repo and successfully cross-compiled V8 and nodejs for mips arhitecture, there are even pre-compiled binaries if you don't want to do that cross-compiling process.

    Npm packets should be cross-compiled (if they use some c++ code) with npm which comes with Node v0.10.5 (Stable).

    Because WR-703N has only 32MB of RAM, and 4MB of flash memory you should do ext-root to an USB stick, and should add some linux SWAP to boost that poor RAM space.

    If somebody is curious about this, please ask.


  • Admin

    Cool. So you just hook upp a serial gateway to the routers USB?



  • Yes, and there are minor tweeks to be done.
    MongoDb can't be cross-compiled for router (my atheros chip uses big endian, and mongo only supports little endian) , so there are two possibilities:

    • connect to mongodb which is located somewhere else (Just change address of db in code, I use my pc)
    • use TingoDb which has compatible api with MongoDb (Just change "dbc.connect()"), tingo could be used when mongo is down (I use that kind of setup, and am working on tingo to mongo script).

    Requestify library uses 35MB of dynamic memory so I commented it out ("require" takes for ~3 minutes or so to load), I really don't understand how does it load new firmware on the gateway so not using that part, could you tell me whats the idea behind that? Could it flash other nodes, I really don't get it.

    Think there is a bug in "sendNextAvailableSensorId()" response to gateway. It will newer increment id unless some "id" is larger than numbers of sensors in the "node" collection. I changed that it itereates over items and saves the largest id, and increment the largest node. Maybe the best solution would be to get the largest id with a mongo querry object.


  • Admin

    Fantastic that have succeeded in squeezing in node and TingoDb in a router. 👏


  • Plugin Developer

    @hek I have two sensors in my network ( temp , Hum ) and motion detection. both working in auto mode and request node id from controller ( raspberry pi ) node via gateway . but unfortunately, reponse code of both nodes get same node id 1.

    may be bug in sendNextAvailableSensorId() function response.
    any idea?
    thanks



Suggested Topics

48
Online

11.4k
Users

11.1k
Topics

112.6k
Posts