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?


  • Admin

    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?


  • Contest Winner

    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


  • Contest Winner

    @lafleur I abandoned it due to the fact that my Nano cannot fit it together with signing support.


Log in to reply
 

Suggested Topics

62
Online

11.4k
Users

11.1k
Topics

112.7k
Posts