ESPHome with RAK13010 + RAK19001 + RAK11200

Searching the forum and elsewhere, I haven’t found any examples of using RAK with ESPHome. Is there any reason for this?

So, my case. I’m using a RAK19001 baseboard combined with RAK11200 to read sensors via SDI12 interface using RAK13010.

I need to use ESPHome for this since the solution is based on Home Assistant.

I already have a solution that uses ESP32 + a commercial SDI12 adapter running on ESPHome.

Searching through the documentation, I couldn’t figure out for sure how to use RAK with ESPHome for this solution.

In my attempt, using the official documentation as an example, I came up with this code:

esphome:
  name: esphome-web-8d8d80
  friendly_name: ESPHome Web 8d8d80
  platform: ESP32
  board: esp32dev
  includes:
    - uart_read_line_sensor.h

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  platform: esphome
  
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

captive_portal:

uart:
  id: sensor_reader
  tx_pin: 38 # WB_IO6
  rx_pin: 37 # WB_IO5
  baud_rate: 1200

text_sensor:
- platform: custom
  text_sensors:
    id: "sensor_reader_uart"
    name: "Soil Sensor Reader"
  lambda: |-
    auto sensor_measurements = new UartReadLineSensor(id(sensor_reader));
    App.register_component(sensor_measurements);
    return {sensor_measurements};
    
switch:
  - platform: uart
    name: "read sensor 0"
    data: '0M!'
  - platform: uart
    name: "get measurement 0"
    data: '0D0!'

  - platform: uart
    name: "read sensor 1"
    data: '1M!'
  - platform: uart
    name: "get measurement 1"
    data: '1D0!'

This code already works with my current solution. So I just tried to adapt it for use with RAK.

The first problem. The compiler gives the error GPIO38 (34-39) does not support output pin mode.

Welcome to RAK forum @kroma ,

I have no experience on ESPHome directly but based on the error you have, you are using GPIO38 as TX which is an output pin. GPIO34 up to 39 are input pin only. This will likely be solved by using a different TX pin instead of 38.

The point is, by this RAK13010 docs, in the example it uses pins WB_IO5 and WB_IO6, that by WisBlock docs refers to pins GPIO37 and GPIO38.

In this case, there’s a way to change or configure pins associated to RAK13010?

I’m new to RAK, so I apologize if this it’s a basic question.

Hi @kroma ,

You are looking at the pin numbers of the connector. The pin out number will vary depending on the core board you use.

If you are using RAK11200, you can use this.

  tx_pin: 22 # WB_IO6
  rx_pin: 13 # WB_IO5
1 Like