Support for LILYGO® LoRa32 V2.1_1.6.1 433 Mhz ( rtl_433_ESP and OLED Display )

I recently received some new boards based on the sx127x Chipset, LILYGO® LoRa32 V2.1_1.6.1 433 Mhz and have completed the initial changes to enable the board for use with rtl_433_ESP, and am in the process of making the similar updates to the openMQTTGateway code to also support the board.

Adding support for the board within rtl_433_ESP was straightforward, as I just needed to map the sx127x pins based on the platformio board definition file ~/.platformio/packages/framework-arduinoespressif32/variants/ttgo-lora32-v21new/pins_arduino.h.

And here is the board running in my test setup beside a Heltec board and a CC1101 on a breadboard.

The OLED Display on the board is based the SSD1306 chipset and is likely the same display as used on the Heltec boards, which leads to an issue. @1technophile When I added support for the Heltec display, I included it in a module called ZboardHeltec, which doesn’t really make sense when using a LilyGo board. So am thinking the ZboardHeltec needs to be refactored as ZboardSSD1306 or ZoledSSD1306 or ???

More glamor shots




It makes sense to rename it

That’s great this opens more possibilities again !

Hi,

Currently i am running OMG on a old D1R2.

Wanted to move to 3 Heltecs ( one on eacht floor )

Unfortunately the Heltecs are version 3 :frowning:

So i got myself a Lilygo.

I have zero knowledge of PlatformIO…i tried to load the Development branch in there, but could now find the Lilygo board in the platformio.ini under default_envs.

So i added

default_envs = lilygo-rtl_433

Then the is the lilygo-rtl_433 part, any idea if i can add my mqtt and wifi settings there ?

[env:lilygo-rtl_433]
platform = ${com.esp32_platform}
board = ttgo-lora32-v21 ; ~/.platformio/packages/framework-arduinoespressif32/variants/…/pins_arduino.h
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp.lib_deps}
${libraries.wifimanager32}
${libraries.ssd1306}
${libraries.rtl_433_ESP}
build_flags =
${com-esp.build_flags}
; *** OpenMQTTGateway Config ***
‘-UZmqttDiscovery’ ; disables MQTT Discovery
‘-DvalueAsATopic=true’ ; MQTT topic includes model and device
‘-DGateway_Name=“OpenMQTTGateway_lilygo_rtl_433_ESP”’
; *** OpenMQTTGateway Modules ***
‘-DZgatewayRTL_433=“rtl_433”’
‘-DZdisplaySSD1306=“LilyGo_SSD1306”’
‘-DZradioSX127x=“SX127x”’
; *** ssd1306 Module Options ***
‘-DLOG_TO_LCD=true’ ; Enable log to LCD
; ‘-DLOG_LEVEL_LCD=LOG_LEVEL_NOTICE’ // default is WARNING log level

Thanks for your help !

Alex

Hi @Slorf

Sure, just add the appropriate build_flags

'-DESPWifiManualSetup=true'
'-Dwifi_ssid="your_ssid"'
'-Dwifi_password="your_password"'
'-DMQTT_SERVER="192.168.xxx.xxx"'
'-DMQTT_USER=""'
'-DMQTT_PASS=""'
'-DMQTT_PORT="1883"'

Eventually you might want to look into defining your personal lilygo-rtl_433 environment in a separate portable config file to easily preserve your environment definitions across updated versions of OpenMQTTGateway.

You can take the included prod_env.ini.example as a starting point.

Hope this helps

Thought that I would share some things I’m working on in conjunction with the ssd1306 display, the display of messages on the display. So far this is configured for RTL_433, and am working on bme280 sensors.

1 Like

Thanks all of you !

Got the LilyGo working.

Only 2 issues left:

1: i cannot see the new gateway in HA ?, ( auto discovery is off in the MQTT integration )

2: how to i switch on the auto discovery on the LilyGo ?
In the platformio.ini i have

’ -UZmqttDiscovery’

But i cannot find if that switches it on or off ?

Basicly, i want the OMG in HomeAssitant, but i dont want any other devices to be added automaticly.

Alex

The leading capital U - for Undefine - switches it off :wink: whereas your other build_flags with leading D Defines them.

Deleting or commenting out the line with ’ -UZmqttDiscovery’ will use the default

'-DZmqttDiscovery="HADiscovery"'

from the included ${com-esp.build_flags} in your case.

How to only have the gateway with its options discovered but no other sensors is best left to someone with better HA discovery knowledge.

That worked !!

I switched auto discovery on both in HA MQTT and on the Lilygo.

Now i have 2 more challenges

1: I only see part of the device info in HA ?

2: I see 9 sensors under entities, but i have no idea how i can find out which device is what ??

The Lilygo works, in MQTTExplorer i can see one firealarm and a window sensor, but i cannot match them with the 9 entries under entities

Alex

Edit:

Challenge 1 is solved after a refresh :slight_smile:

Edit 2:

the 9 devices are ZigbeetoMqtt devices.

But the smokedetector and window sensor do not appear in HA automaticly ,which i actually do not want anyway :slight_smile:

Hello,

The auto discovery with rtl 433 is currently in dev:

You need to take this branch to test it, this would add your devices.
As you are not willing to have them auto discovered, you can wait a bit, we are thinking on adding a filtering mechanism.

Hi,

I flashed this branch and used following settings:

Screenshot 2023-01-05 193221

This works, i see a lot of my sensors and smokedetectors in HA now, but they do not show all their sensors.

The sensors are:

The smokedetector:

I will leave the OMG running tonight ( have 2 more Lilygo’s comming in and i am also busy printing housings for them ), in the morning i will have a look if there is more information

Alex

Hi @Slorf,

the branch you have been trying out only implements the newly introduced auto-discovery for rtl_433_eps devices.

Both your listed sensors are non-rtl_433_eps, but RF/SRFB devices, which you can see on your linked sensors details pages above. So there will not be auto-discovery of their properties, but it is still possible to add them manually, but only with an RF/SRFB gateway.

Hi everyone,

Just looking for some advice please. Bought one of these boards from Amazon like @NorthernMan54 's above https://www.amazon.co.uk/dp/B07RXRDH4D

My version Has the “LILYGO 433/70 Modle-LORA32” label like the one above rather than the “TTGO 433/70 Modle-LORA32” shown on the Amazon page.

Plugged it in and it fired up ok and had data on the OLED screen from the firmware it came with.
Flashed in the firmware for lilygo-rtl_433 at https://docs.openmqttgateway.com/upload/web-install.html

Flash procedure reported as completing ok but nothing on OLED screen and no ad-hoc wifi network is available.

Tried the same thing with a generic ESP32 board and esp32dev-weather station firmware and after that flashed, was able to connect to its ad-hoc wifi network.

My question is, do I have to build a version of OpenMQTTGateway from the github repo for this board or does lilygo-rtl_433 at the web install page already incorporate the change to support this board?

Cheers,

Jason

I just tested the upload process with my board and it works fine, upload takes about a minute then it boots with the OMG Logo on the screen, and the ad-hoc network is created with the name of the board. So the lilygo-rtl_433 binary does support the board.

I’m wondering if your board is different, or something else is going on. You may need to access the serial output from the board to see what is happening, and why it is failing.

Thanks for your reply. I was thinking that it may be a board issue.

I purchased my board from Amazon UK by following the link to the recommended one from either the OMG or RTL_433 github pages and then changed the .com to .co.uk and the same board seemed to come up. I’ll get another board and try it.

Where did you order your boards from please?

Many Thanks
Jason

I ordered my boards from AliExpress

Boards ordered. Will report back when I’ve tried them.

Thanks again.

I’ve ordered LILYGO®TTGO LoRa32 V2.1 _ 1.6 868MHz version.
I’ve some devices which probably should be decoded by RTL_433 library but using 868MHz frequency.
Is it possible to compile RTL gateway but listening to 868MHz?