Serial Gateway as Controller
-
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..
-
Just rewrite the serial gateway code for your needs.
-
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..
-
hi.
I make changes .. litle changes in https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyGateway.cpp#L223return 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.
-
@dzairo said:
PS : how I can add here part of source code ?
-
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
Regards
Michal
-
@dzairo
Hello dzairo
I could not open the link. Can you please share your code?Regards
Ratnanabh
-
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..
Suggested Topics
-
Update RF24 library to latest version
Bug Reports • 23 Mar 2014, 23:37 • andriej 24 Mar 2014, 22:52 -
EasyIoT server - Mysensors Raspberry Pi controller
Controllers • 4 Sept 2014, 22:02 • EasyIoT 2 Aug 2015, 14:26 -
Stand alone radio relay
General Discussion • 2 Dec 2014, 17:43 • dzairo 3 Dec 2014, 12:43 -
NodeJsController on non-raspbian linux distros
General Discussion • 17 Oct 2014, 14:13 • moo 8 Dec 2014, 09:58 -
Adding sensors and relays to serial gateway
Development • 8 Dec 2015, 16:09 • Tino 9 Dec 2015, 16:19 -
Controller to Sensor communication problem
Troubleshooting • 12 Nov 2014, 10:11 • A Former User 12 Nov 2014, 19:54 -
MyController version "1.4.0.Final" released
MyController.org • 23 Jan 2019, 12:11 • jkandasa 23 Jan 2019, 12:11 -
Android Based Controller for MySensors
Controllers • 17 Aug 2016, 15:35 • Kumar Ratnanabh 17 Aug 2016, 17:45