SerialPlugin not working in the alpha release

I am using Meshtastic V1.2.11 and FW V1.2.10 on a TTGO OLED V1 board.
My objective is to create a universal serial interface by implementing whatever sensor routines I need on a Arduino ProMini by sending a screen to the TTGI via the serial line. That way we don’t have to wait for the sensor interfaces to be integrated into the Mesh core code.

The problem is that I can’t publish strings on the mesh by sending serial strings into the serial port. I don’t think the Rx pin 16, is being initialised correctly.

Here is what I have discovered so far:

  1. I am correctly enabling the SerialPlugin using:

meshtastic --port /dev/cu.SLAB_USBtoUART --set serialplugin_enabled true
meshtastic --port /dev/cu.SLAB_USBtoUART --set serialplugin_rxd 16
meshtastic --port /dev/cu.SLAB_USBtoUART --set serialplugin_txd 17

as confirmed by:

meshtastic --port /dev/cu.SLAB_USBtoUART --info
Connected to radio
my_node_num: 681471664
num_bands: 13
hw_model_deprecated: “tlora-v1”
firmware_version: “1.2.10”
message_timeout_msec: 300000
min_app_version: 20200
max_channels: 8
Nodes in mesh:
{‘num’: 681471664, ‘user’: {‘id’: ‘!289e6eb0’, ‘longName’: ‘Unknown 6eb0’, ‘shortName’: ‘?B0’, ‘macaddr’: ‘JG8onm6w’}, ‘position’: {}}
{‘num’: 3519609904, ‘user’: {‘id’: ‘!d1c8fc30’, ‘longName’: ‘Unknown fc30’, ‘shortName’: ‘?30’, ‘macaddr’: ‘8AjRyPww’}, ‘position’: {}, ‘snr’: 9.75}
preferences {
ls_secs: 300
serialplugin_enabled: true
serialplugin_rxd: 16
serialplugin_txd: 17
}
Channels:
PRIMARY { “modemConfig”: “Bw125Cr48Sf4096”, “psk”: “AQ==”}
Channel URL Meshtastic URL | Meshtastic

  1. I know there is a hardware problem with Pin 16 on the TTGO V1 board. For some reason the manufacturer uses it to drive the OLED RST line - ie it is an output. It is fairly easy to break this line by carefully drilling out the via right at the ESP32 using a 0.8mm drill bit. I then confirmed that Pin 16 could be used as an input pin driven by the Tx line on a USV-to-serial adapter using the following Micropython routine:

from machine import UART
uart = UART(2, 38400)
uart.init(rx=16,tx=17)

while True:
if uart.any():
print(uart.read())

Everything I typed in using:

screen /dev/cu.wchusbserial1420 38400 8-N-1

dutifully appeared on the Thonny console.

  1. Possibly the strongest evidence that indicates that Pin 16 is not being initialised correctly - is when I watch the Tx LED on the USB-serial adapter:

When the adapter is disconnected from the TTGO, the Tx light flashes when I push each key in screen. However, when I connect the Tx pin on the adapter to the RX Pin 16 on the TTGO, the Tx LED on the adapter does not flash indicating it is being pulled high to 3.3V as verified by a multimeter.

So, I guess my questions are:
Q1: Can someone confirm whether the Rx pin 16 line is being correctly initialised and suggest a fix?
Q2: By cutting the line to the OLED RST pin, I have disabled the OLED - not a big issue, but then I did try moving the Rx pin to say 34 using:

meshtastic --port /dev/cu.SLAB_USBtoUART --set serialplugin_rxd 34

and although this doesn’t kill the Tx signal from the adapter, since Pin 34 now sits at ~0V, the string isn’t sent onto the mesh either!

Any suggestions or other diagnostics I can perform?

2 Likes

The serial and gpio plugins are disabled in the alpha until you add a special new channel (see my other thread about remote admin). I should have instructions for how to do that finished tonight.

1 Like