Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Serial Gateway as Controller

Serial Gateway as Controller

Scheduled Pinned Locked Moved General Discussion
serialgatewayserial protocolcontroller
8 Posts 4 Posters 3.5k Views 3 Watching
  • 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.
  • D Offline
    D Offline
    dzairo
    wrote on last edited by
    #1

    Hi all.
    Is there possible in serial gateway read last recieved packet?? not in serial format .. format like Message in Sensor ..
    I don't want parse data from serial string ..

    I want add code to gateway , for controll I2C relay .. don't need controller..

    regards..

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      Just rewrite the serial gateway code for your needs.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dzairo
        wrote on last edited by
        #3

        hmmm.... then I must do it self .. OK .. in loop secton is good point to check if new packet is received and control realy..

        OK .. regards..

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dzairo
          wrote on last edited by
          #4

          hi.
          I make changes .. litle changes in https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyGateway.cpp#L223

          return 1 if new message else 0
          then I can test in loop if got new message .
          then load last message .. and have all information what I need ..

          super thanks ..

          PS : how I can add here part of source code ?

          regards.

          hekH K 2 Replies Last reply
          0
          • D dzairo

            hi.
            I make changes .. litle changes in https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyGateway.cpp#L223

            return 1 if new message else 0
            then I can test in loop if got new message .
            then load last message .. and have all information what I need ..

            super thanks ..

            PS : how I can add here part of source code ?

            regards.

            hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #5

            @dzairo said:

            PS : how I can add here part of source code ?

            http://forum.mysensors.org/topic/666/how-to-ask-for-help

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MiJu
              wrote on last edited by MiJu
              #6

              Hi @dzairo and @hek,

              If you can share with me and other person in that forum more info. about your experiences in that topic... "Gateway as Controller". For me that solution and idea is very interesting because I'll tried prepare gateway with LCD and SD card reader only ...to write information from sensors. Extra controller and other stuff isn't necessary for me. You know @hek it can be solution for small environment only with arduino and nRF cards ... Additionally it seems to me that configuration will be much chipper than full architecture (sensors, gateway and controller) isn't it ?

              Because I'm not sure where I can make changes in Gateway Code or library to read directly information from message ... help me please and give me advise how I can start with that ... I feel that it could have a future :smiley:

              Regards

              Michal

              1 Reply Last reply
              1
              • D dzairo

                hi.
                I make changes .. litle changes in https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyGateway.cpp#L223

                return 1 if new message else 0
                then I can test in loop if got new message .
                then load last message .. and have all information what I need ..

                super thanks ..

                PS : how I can add here part of source code ?

                regards.

                K Offline
                K Offline
                Kumar Ratnanabh
                wrote on last edited by
                #7

                @dzairo
                Hello dzairo
                I could not open the link. Can you please share your code?

                Regards
                Ratnanabh

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dzairo
                  wrote on last edited by
                  #8

                  Hi. It's long time .. but standard function is : gw.processRadioMessage();
                  and I make changes in source code in MyGateway.cpp to this :

                  char MyGateway::processRadioMessage() {
                  	char isMessage=0;
                  	if (process()) {
                  	// A new message was received from one of the sensors
                  	  isMessage=1;
                  	  MyMessage message = getLastMessage();
                  	  if (mGetCommand(message) == C_PRESENTATION && inclusionMode) {
                  		rxBlink(3);
                  	  } else {
                  		rxBlink(1);
                  	  }
                  	  // Pass along the message from sensors to serial line
                  	  serial(message);
                  	}
                  
                  	checkButtonTriggeredInclusion();
                  	checkInclusionFinished();
                  	return isMessage;
                  }
                  

                  But in new library is not file MyGateway.cpp .. then I don't now ..
                  using is :

                  if (gw.processRadioMessage()==1) {..}
                  

                  regards..
                  there is possible make easy gateway .. controler .. to control only light for example.. then we don't need external controller .. etc..

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  17

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.0k

                  Posts


                  Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular