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
-
NodeJsController on non-raspbian linux distros
General Discussion • 17 Oct 2014, 14:13 • moo 8 Dec 2014, 09:58 -
ioBroker for MQTT, Ethernet W5100, TCP, UDP, SERIAL (OTA soon)
IOBroker • 8 Mar 2016, 19:12 • maxtox 21 Mar 2016, 22:05 -
PiDome Domotica/Home Automation
PiDome • 2 Sept 2014, 20:50 • John 13 Jan 2016, 22:53 -
My "hybrid" gateway
My Project • 24 Oct 2014, 22:21 • Anticimex 2 Mar 2015, 17:43 -
Raspberry PI + MQTT (Mosquitto) + Serial Gateway
General Discussion • 14 Feb 2015, 06:12 • catcher 2 Mar 2017, 17:58 -
API first controller with OTA support, also exposes WebOfThings APIs for sensors
Mozilla WebThings Gateway • 23 Jun 2018, 06:13 • Sathishkumar Thangavel 29 Nov 2018, 09:17 -
Android Based Controller for MySensors
Controllers • 17 Aug 2016, 15:35 • Kumar Ratnanabh 17 Aug 2016, 17:45 -
Can't compile serial gateway example, MySigningNone.h not found
Troubleshooting • 6 Aug 2017, 20:20 • billgoolsby 7 Aug 2017, 15:05