MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    Help, I need to send data to the module I am trying to create

    Development
    3
    2
    221
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kylelamb1324 last edited by

      I am new to javascript so this project that I am working on is proving more difficult than anticipated.

      I am creating a module to monitor our schools bus routes and display them onto the screen. I have the webscraping working fine in a javascript file that returns a 2x2 array of bus times for each route and stop. but need to implement it into the magic mirror.

      to my understanding in order to do this I need a node_helper.js file to scrape the data and send it using sendSocketNotification. Is this right? Im not sure how this function works, if anyone has some insight it would be greatly appreciated
      code_text

      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @kylelamb1324 last edited by sdetweil

        @kylelamb1324 see my sample module
        it’s node helper receives a message and sends one back
        https://github.com/sdetweil/SampleModule

        its
        string identifying the message
        and some buffer of data,
        completely up to you, string, number, structure…

        then on the receiving side u get the identifier, so you can tell different messages apart
        and a pointer to the buffer sent by the sender

        socket notifications are private to your module

        an example use

        the node_helper does not get any of the info from config.js like the modulename.js does

        so, typically the first thing would be to send the this.config buffer to the node_helper

        Sam

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy