Introduction

Coach2mqtt runs on a RaspberryPi 4B and allows you to control and monitor most of the systems in your Jayco Swift/Entegra Ethos or your Jayco Terrain/Entegra Launch from your phone or tablet while connected to the same wifi network as the Raspberry Pi.

Optionally, if your wifi network is also connected to the internet, you will be able to monitor and control your devices from anywhere your phone or tablet has internet.

On Renogy Lithium battery models you will be able to control most of the firefly devices, monitor the Renogy battery BMS, and monitor and control your Renogy Inverter/Charger.

On generator models you will be able to control and monitor most of the firefly devices.

Lithionics models have not been tested.

Getting Started

Hardware requirements

All links are just to help you find the products and are not an endorsement of the product or retailer.

You will need the following:
  • RaspberryPi 4B with at least 2GB RAM
  • 8GB or larger microSD card and some way to write to it.
    I recommend A2 speed rating.
  • Waveshare 2-Channel CAN Hat+ Important: Be sure to buy the + version so you can power the Pi and Hat from the RV-C cable. Can HAT+

  • A case for RaspberryPi 4B that can accomodate the CAN bus hat

  • Several feet of RV-C drop cable (4 conductor 24awg) or equivalant. Get enough so you have some flexibility where you mount the Raspberry Pi but I recommend you keep the length as short as possible to reduce voltage loss. Any 4 conductor wire will probably work for this project.

  • One 3M miniplug connector to connect RV-C bus. Alternatively you can buy RV-C cable with a plug already attached (see above)
  • Renogy Lithium models also require:

    • High quality USB 2.0 A to B cable to connect to Renogy Inverter. I recommend you get a cable with ferrite cores attached to reduce possible noise on the USB bus. Be sure to get one that is long enough to reach from the inverter to the where you are mounting the Pi.
    • In some cases the inverter seems to create enough interference that the USB connection to the inverter is unstable. I recommend you try the USB cable first, but as an alternative you may need to use a USB to RS485 adapter.
    • Industrial isolated Waveshare USB to RS485
    • Connector for Renogy BMS Debug port

    Assembling the hardware

    Attach the waveshare

    1. Attach the Waveshare Can HAT+ to the Pi
      Be sure the resistor jumpers next to the CAN terminal blocks are in the off position and the voltage jumper is set to 3v3 (as pictured)

        Can HAT+ Install stand-offs Attach Can HAT+
    2. If the case you are using allows access to the microsd card you can install the Pi in the case now

    Installing Coach2mqtt

    To use Coach2mqtt you will need to install an image on the Rasperry Pi and an app on your phone or tablet.

    Install the image

    1. Download and install the latest Raspberry Pi Imager tool

    2. Download the latest Coach2mqtt image for the Raspberry Pi. The file you should download is named 'Eth-OS-bookworm-arm64-lite.zip'. There is no need to download the Source code.

      Note: There is no need to decompress the downloaded image. The Imager tool can install a .zip image.

    3. Using the Imager tool to install the image you downloaded onto the micro SD card
      1. Click CHOOSE OS

        • Choose OS

      2. Click Use custom and select the image you downloaded

        • Use custom

      3. Click CHOOSE STORAGE and choose the card you will write the image to

        • Choose Storage

      4. Click NEXT and then EDIT SETTINGS at the OS customisations prompt

        • OS Customizations Prompt

      5. Make your changes in the OS customisation dialog and then click SAVE:

        • OS Customizations Prompt
        • Hostname: Set this to any name you want. This is name you will use to access the services on your raspberry Pi
        • Username and Password: Set a username and a strong password. You will use this for additional setup later.
        • Configure wireless LAN: This will be the default wifi your Pi will connect to when powered up. I recommend setting this to either your Winegard or Starlink wifi
        • wireless LAN country: Set this to US unless you are in another country
        • Time zone: Choose an appropriate time zone
        • Keyboard layout: select us unless you prefer another layout

      6. Click Yes to use your customized settings

        • OS Customizations Prompt

      7. Click Yes to start writing to the microsd card

        • Confirmation Dialog
    4. After the image has been written to the card insert into the Raspberry Pi.

    Powering up with the new image for the first time

    The first time the Raspberry Pi is powered on it may take 5 or more minutes to get everything setup. On first power up the Pi needs to expand the image to use the full space on the microsd card and configure your customizations. It will reboot and then will attempt to connect to the internet and download about 1 GB of files required for coach2mqtt to run. I recommend plugging in an ethernet cable, if possible, for the initial startup.

    Note:If your connection is too slow the download on startup may timeout and fail. You will be able to run the commands manually later if needed.

    Connecting to the Pi

    Once your device has powered on and you have waited for 5 or more minutes you can connect to the Web UI on the Pi. This is easier on a computer but a phone or tablet can be used.
    1. Open a web browser and navigate to https://coach2mqtt:9090 - Replace coach2mqtt with the hostname you set when creating the image. Depending on your network you may need to add .local to the hostname (i.e. coach2mqtt.local) in order to connect.

      You will get a warning that the certificate is not valid or your connection is not private. This is expected and you can follow the browser instructions to connect anyway.

    2. At the login dialog enter the username and password you set during image creation.

      • Login Dialog
    3. If the text shows 🔒Limited Access in the upper right corner click it to enable Administrative access

      • Login Dialog
      • Login Dialog
    4. Verify coach2mqtt components are running

    5. To verify everything installed correctly we need to run some commands on the Raspberry Pi. The Web UI makes it easy to do this.

      Click Terminal on the left side under Tools

      • Terminal
    6. In the terminal area that opens type c2mstatus and hit <enter>. The command will output all names of the running components.

      • c2mstatus command
      • You should see the 5 components as pictured.

        If any are missing you will need to run one more command to download and start them:

        1. In the terminal area that opens type c2mupdate and hit <enter>. This will stop any running components, download any missing components, and then start them back up.

          • c2mupdate command

    7. If you originally set up on your home network now is a good time to add any additional WiFi connections your Raspberry Pi may connect to such as your Winegard or Starlink.

      1. Click on Wifi Manager in the left menu

        • Wifi manager
      2. Add your coach Wifi network

        • Configure network
    8. Once you have verified the software is running and have added your coach wifi you can safely shutdown the Pi so you can install it in your coach.

      1. Click on Overview in the left menu

        • c2mupdate command

      2. On the Overview page click on the down arrow next to Reboot in the upper right and then click Shutdown

        • c2mupdate command

      3. Choose No Delay and click Shut down

        • c2mupdate command


        Wait a minute or two and then you can safely unplug the Raspberry Pi.

        You are now ready to install the Rasperry Pi in your coach.


      Installing the hardware in your coach

      You will need:
      • Raspberry Pi
      • Four conductor RV-C cable with 3M mini plug installed on one end

      Lithium Renogy Models will also need:
      • Two conductor wire with debug connector attached on one end
      • USB cable to connect to Inverter

      Inside your coach the Raspberry Pi will connect to the RV-C network for power and communication. If you have a Lithium model the Pi will also connect to the Renogy battery debug port and the Renogy Inverter with either a USB cable or an RS-485 connector.

      Find a suitable location for the raspbery pi where your cables will reach all devices you need to connect to. In my Entegra Ethos 20D I mounted it under the rear bed near the Renogy Debug port and RV-C G4 Terminator tap.

      1. Attach the 3m connector to one end of your RV-C wire. There is a good explanation on how to do this on myervin.com

        If you are connecting to the the 4 pin molex connector on the G12 you'll need to attach your wire to the connector. This is the pinout on the G12


      2. Connect the RV-C cable blue and white wires to the Can0 terminal on the Canhat+. If you used official RV-C cable the blue wire will go to the terminal labled L, and white to H.
      3. Connect the red RV-C wire to the + terminal, and the black RV-C wire to the - terminal.
      4. If you have a Renogy Li model also connect the wires from the debug connector to Can1. You should connect the wire from the debug port that is labled Can_L to L, and Can_H to H.


        • canhat connected to canbus and rv-c
          Using ferrules on the wires is optional but can make a more secure connection

        Plug the RV-C cable into either your Firefly G12 or G4 Terminal block.

        • canhat connected to canbus and rv-c canhat connected to canbus and rv-c

        For lithium models you also need to connect to the battery debug port and the Renogy inverter USB port:

      5. Plug in the debug connector to the Renogy Debug port


        • canhat connected to canbus and rv-c
        Plug the USB cable into the Raspberry Pi and Renogy Inverter
        • Renogy inverter
        If you are using an RS-485 adapter you will need to make a cable to plug into the RS485/CAN port and connect to your RS-485 adapter. Pinout of the plug can be found on page 17 of the Renogy Inverter manual. Only 2 wires are needed (Pin 2 and 3).

        • Renogy inverter RS-485 pinout

      Once the Raspberry Pi is connected to the RV-C network it will be powered any time your 12v switch is on. To prevent possible file corruption to the sd card you should always shutdown the Pi from the web interface before powering off the 12v switch.

      Installation of the hardware in your van is complete and once powered up the Pi will begin communicating with the RV-C network, and optionally, the Renogy inverter and Renogy Lithium battery BMS.


      Installing the app


      Install the app on your phone or tablet

      In order to control the devices in your van you will need an App that can communicate with the MQTT broker that is running on the Rasperry Pi. There are many apps that are able to do this, but the app I found that is the most configurabale and available on both iOS and Android is IoT MQTT Panel

      After installing the app you will need to configure the dashboards and widgets. To make it easier I have included configuration files that can be loaded.

      1. Connect your phone or tablet to the same WiFi the rasperry pi is connected to and navigate to https://coach2mqtt:1880/configs/ - Replace coach2mqtt with the hostname you set when creating the image. You may need to add .local to the name you configured. i.e. coach2mqtt.local.
        • Configs page

      2. Download the configuration file that matches your floorplan to your phone or tablet by clicking on the link.

      3. Open the IoT MQTT Panel app on your phone or tablet
        1. Click on the Hamburger Menu button in the top left
          Configs page

        2. Click Backup and Restore
          Configs page

        3. Click Restore and select the configuration file you downloaded earlier
          Configs page

        4. Click YES to generate a random client-id
          Configs page

        5. Click the â‹® icon next to the <Floorplan> Phone Release connection
          Configs page

        6. Click the 🖉 icon to edit the connection
          Configs page

        7. Edit the Broker address to match the name you gave your Raspberry Pi
          i.e. coach2mqtt or coach2mqtt.local
          Network protocol should be TCP and Port should be 1883. Configs page

        8. If you are on the same wifi as the Raspberry Pi and your connection settings are connect you should see the connection status icon change to a cloud with a checkmark. Click on the connected configuration to open the Dashboards view
          Configs page

        9. Touch the tab on the bottom to bring up each dashboard.
          Home dashboard Firefly dashboard
          Samkoon dashboard APS-500 dashboard

      4. At this point you are set up for local access. You can now control and monitor your connected devices in the van from the IoT MQTT Panel app as long as you are connected to the same WiFi network as the Raspberry Pi - i.e. your Winegard or Starlink


        Remote Access Setup

        Remote access can be set up in many ways. I will cover how to set up a free remote MQTT broker that can be accessed from anywhere both your phone and the Raspberry Pi have internet access. Another option is setting up something like Tailscale
        TODO: Add more instructions

        1. Create a free account at HiveMQ.com
        2. Configure your Raspberry Pi to relay messages to HiveMQ
        3. Set up your connection to HiveMQ in the Iot MQTT Panel app

        Alternatively you can set up Tailscale. This will use less bandwidth, but could interfere with any other VPN configured on your phone or tablet

        1. Create a free account at Tailscale.com
        2. Install tailscale on your Raspberry Pi
        3. Install tailscale on your Phone or Tablet
        4. Configure your devices so they are on the same Tailscale network


        Basic Features

        Feature 1

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo

        Feature 2

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Explanation 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        Explanation 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        Explanation 3 Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        Explanation 4 Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        Feature 3

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        Feature 4

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Feature 5

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Feature 5

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Advanced Features

        Feature A

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Feature B

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Feature C

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Feature C.1

        Lorem ipsum dolor sit amet, consectetur adipiscing elit:

        • Point 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
        • Point 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

        • Point 3 Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        Feauture C.2

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Important: Please notice that lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        Feature D

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

        Lorem ipsum dolor sit amet, consectetur adipiscing elit.

        More Info

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.marks are protected by intellectual property rights.