Open Register a device manually

Discussion in 'Join' started by L.Drake, Dec 30, 2016.

  1. L.Drake

    L.Drake Member

    Joined:
    Feb 12, 2015
    Messages:
    61
    Likes Received:
    1
    I'm currently tinkering with join to extend my "network management" solution.

    Setup currently is as follows:
    I have a router that has served it's time, slapped openwrt on it. On this router I have a small script listening on a random port chosen on script startup, router itself is the only publicly exposed system. I push a request to this port with a json object, containing device, a hash of a currently hardcoded password and the command. Depending on the command, various scripts get executed, depending on password and command in the json object. I have yet to find a way to enable two-way-communication yet.
    I've wrapped a lot of this up in a nice little flask app serving up a web interface in my LAN for adminstration and stuff, but I'd like to have confirmation, and this is where I have the most issues.

    I'm interested in using join as a transport, but I need to find a surefire way to communicate with my router, so I need to have it registered on my device... Is there something I can do for that?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    I'm not sure I'm following exactly, but are you saying you want to register your router as a Join device?
     
  3. L.Drake

    L.Drake Member

    Joined:
    Feb 12, 2015
    Messages:
    61
    Likes Received:
    1
    Yes. Basically, I want to use Join as a transport layer instead of having an open port to a possibly vulnerable web service.
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Unfortunately the receiving device already has to have a way to receive GCM messages. Maybe you can use Chrome to redirect the message via HTTP to the code running on the router?
     
  5. L.Drake

    L.Drake Member

    Joined:
    Feb 12, 2015
    Messages:
    61
    Likes Received:
    1
    As far as I can tell there IS a GCM implementation in Python. Lemme check...
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Make sure it's an implementation to receive messages and not send them :)
     
  7. L.Drake

    L.Drake Member

    Joined:
    Feb 12, 2015
    Messages:
    61
    Likes Received:
    1
    Reading the GCM docs is confusing the shit out of me...

    Would using the GCM XMPP interface work for this?
     
    Last edited: Jan 3, 2017
  8. L.Drake

    L.Drake Member

    Joined:
    Feb 12, 2015
    Messages:
    61
    Likes Received:
    1
    Regarding the GCM API, would I need to register a new app or can I use the Join API key?
     
  9. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    This would only work if you could somehow register a device with the GCM servers which I doubt you can do with a router that's not owned by google...
     
  10. L.Drake

    L.Drake Member

    Joined:
    Feb 12, 2015
    Messages:
    61
    Likes Received:
    1
    I'm still poking around with possible solutions... Will report back if I find something.

    Edit - There are at least two python packages actually enabling communication with GCM, but I'm not too sure whether they provide device registration.
    For reference, these are python-gcm and pushjack.
     
    Last edited: Jan 4, 2017

Share This Page