Updating M2RET firmware to support redirection

Just wanted to make a new thread so I can document progress with updating M2RET to work with other output devices other than the USB port.

The intended effort is to allow any XBEE devices or devices connected to the UART3 (External connector).

The library is setup to be a generic DUE library to allow input or output to any of the serial devices.
Note that in the M2 UART 1 & 2 are LIN devices and won’t be available to redirect to.

Currently believe I have the new Library setup. It is more or less a Wrapper around the normal Serial devices but had logic in it to read or write to other devices. There is a write only mode available as well if you want to monitor while not allowing input. It will default to the console and whatever device is hooked to the XBEE or external port to be both read and write. The console device will be the priority device for reading input from.

I will test it more to insure the library works as expected then I will begin integrating it into the M2RET software.

I have a couple ESP32 modules now that I will start playing with it to further test it once I have the M2RET updated.

I may also do a proof of concept using my Nextion display to see if I can build a different type of driver that will allow a display to work easily with the M2. This might allow the M2 to be a sort of ODBII scanner without using anything else. Nice for plugging directly into the UTH version and controlling it from within the vehicle. But still work with SavvyCAN if connected or other modules etc.

Quick Update. I have started my new semester but I am in the process of testing the library I made as I can.

If everything works out ok I should begin working on the M2RET conversion shortly.

I also have a serial Display that I am tinkering with to see if I can get it to work with the M2.
This display needs 5volts at max 250miliamps to run but will talk over a 3.3 UART connection so I will be wiring it to the device to see if I can get it working. With this device you build a platform with its development software and it becomes the HMI. This could potentially make the M2 into an intelligent ODBII scanner down the road. Assuming I get the M2 stuff converted soon I MAY tinker with getting this working as well and provide information to others how to use it. There already is an Arduino Library to use it so it should be reasonably simple to impliment. I am thinking of adding support in my “switchboard” to support such a board. When I get to that point I will post more information in its own thread.

Funny how this stuff seems to all tie together…

Sorry, Been tied up with school. Have tested a portion of the Switchboard functions and hope to test the rest this week and start modifying M2RET to support this.

I have also been tinkering around a little with my Nextion.

At this point I am going back and forth on if I should add a simple display using the Nextion or not. I am also tinkering with the idea of tying two M2’s together to support using 2 M2’s as if they were one. May require some extensive additions to M2RET to make work but will see how it goes. I am going to try adding some code to switchboard to check for devices that don’t just redirect the serial input/output such as the BT/WiFi devices but won’t add full support for them now.

Rodney

I like both of you ideas, especially tying 2 M2’s together. This is on our long term goals list.

I have decided to debug my Switchboard and M2RET modifications by using two M2’s tied together before moving onto the ESP32 board. I have 2 wire kits on their way and will connect the UART3 ports together and make use of Serial3.

I believe this will greatly simplify my debugging process. Basically when finished I will be able to have the first m2 connected to my lab and to the second M2. I should be able to run SavvyCAN from the second M2 and it should respond as well as if it were connected to the test lab directly.

Once this is working I can move onto the ESP32 device and get it running. Should be reasonably simple at that point to get it and any other device up and running with M2RET.

Such as the Cellular Modem…