Combining Serial and MQTT/Ethernet Gateway
-
Hello,
I'm about to make my first gateway and since I want the flexibility to switch controller, since I'm note sure if I want to run Indigo or OpenHAB, I thought of building a gateway that has the Ethernet module installed on the board. Then if I want to use it as a serial gateway for Indigo I can just re-flash the Arduino with the Serial Gateway firmware instead, and if I want to use MQTT or Ethernet - I'll just re-flash with those firmwares.
Now since the radio needs to be soldered differently on the Ethernet/MQTT gateway, is it sufficient to just change the pin locations in the Serial firmware? In other words I'll just change the following line:
MyGateway gw(DEFAULT_CE_PIN, DEFAULT_CS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);
To:
MyGateway gw(5, 6, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN);
Is that correct? I'm not sure what the 6, 5, 4 pins are for though?
Also: Is it possible to hook up the MQTT gateway into the router instead, and still let the controller interact with it?
-
Or you can compile the serial gateway with SOFTSPI enabled if you don't want to rewire.
-
@hek Hmm, what do you mean? That I build the Ethernet Gateway, and when I want to Serial fw, I compile it with SOFTSPI so I don't need to change pin locations?
-
I made a GW sketch that could handle serial and ethernet simultaneously (by reboot). If ethernet cannot obtain IP through DHCP (cable not inserted) it reverts to acting as serial GW. Unfortunately, ethernet GW sketch with DHCP is too big to fit an Arduino Nano without some form of tweaking to the code (on development branch). For that reason I have not published my sketch.
But it is not that difficult to merge the two sketches anyway if you wanted to try it.
-
any chance you can send me the dual serial/ethernet code?
Thanks
-
@lafleur I abandoned it due to the fact that my Nano cannot fit it together with signing support.
Suggested Topics
-
MQTT Client Gateway
My Project • 3 Feb 2015, 10:37 • b0rmann 14 Apr 2015, 03:47 -
ESP8266 gateway crashes while the node is in FOTA progress.
Troubleshooting • 25 Nov 2017, 00:22 • Abdu Sahin 13 Dec 2017, 20:50 -
MQTT gateway - Openhab & Mosquitto
OpenHAB • 25 Feb 2015, 01:48 • alexeinz 25 Feb 2015, 07:52 -
Stabile Controller
Troubleshooting • 5 Mar 2015, 14:08 • C.r.a.z.y. 8 Mar 2015, 15:34 -
Incoming MQTT Prefix can't have '/' or '-' in it.
Bug Reports • 13 Nov 2016, 16:19 • Meshx86 13 Nov 2016, 16:38 -
ESP8266MQTTClientGateway
Bug Reports • 30 Jan 2016, 10:26 • mbj 30 Jan 2016, 14:16 -
Building a gateway with two transport layers
Hardware • 15 Aug 2021, 10:31 • Giovanni Chiva 15 Aug 2021, 18:02 -
MQTT Client Gateway / Node Controller / OTA
Hardware • 19 Jul 2016, 15:01 • CrankyCoder 26 Jul 2017, 13:32