Starting with Lilygo TTGO 433

I just started with OpenMQTTGateway.
Flashed the lilygo-rtl_433 firmware on a brand new “LILYGO TTGO LORA SX1278 ESP32 0.96 OLED Display Module 16M bytes (128M Bit) 433Mhz” .
Configured the Wifi and the MQTT server.
Now it just sits there saying “Wifi connected” and nothing else on the display.
I placed a weather sensor next to it that I can receive with rtl_433 and my RTL-SDR.
I see nothing on my MQTT dashboard.
Nmap shows port 1883 as being closed:

$ nmap -p 1883 192.168.178.89
Starting Nmap 7.92 ( https://nmap.org ) at 2023-03-15 18:14 CET
Nmap scan report for esp32-arduino.fritz.box (192.168.178.89)
Host is up (0.095s latency).

PORT STATE SERVICE
1883/tcp closed mqtt

What am I missing / doing wrong?

You should see also MQTT Connected on the screen briefly.
It is likely due to an MQTT configuration error or a network problem with accessing the broker.

Your best chance is to connect the board to a serial monitor to check the logs.

************* WELCOME TO OpenMQTTGateway **************
N: Setup SSD1306 Display end
N: OpenMQTTGateway Version: v1.4.0
{
“mqtt_server”: “192.168.178.23”,
“mqtt_port”: “1883”,
“mqtt_user”: “”,
“mqtt_pass”: “”,
“mqtt_topic”: “home/”,
“gateway_name”: “OpenMQTTGateway_lilygo_rtl_433_ESP”,
“mqtt_broker_secure”: false,
“mqtt_broker_cert”: “”,
“mqtt_ss_index”: 0,
“ota_server_cert”: “”,
“ota_pass”: “OTAPASSWORD”
}*wm:[2] Added Parameter: server
*wm:[2] Added Parameter: port
*wm:[2] Added Parameter: user
*wm:[2] Added Parameter: pass
*wm:[2] Added Parameter: secure
*wm:[2] Added Parameter: cert
*wm:[2] Added Parameter: name
*wm:[2] Added Parameter: topic
*wm:[2] Added Parameter: ota
N: Attempting Wifi connection with saved AP: 0
N: Attempting Wifi connection with saved AP: 1
E (4142) wifi:sta is connecting, return error
[E][WiFiSTA.cpp:221] begin(): connect failed!
N: Attempting Wifi connection with saved AP: 2
E (5144) wifi:sta is connecting, return error
[E][WiFiSTA.cpp:221] begin(): connect failed!
N: ZgatewayRTL_433 setup done
N: Switching to RTL_433 Receiver: 433.92Mhz
rtl_433_ESP(3): SX1278 radio.begin() failed, code: -2

Something is not correct here, the display indicates Wifi Connected, and the log indicates issues with the Wifi Connection.

Can you try erasing the flash area, so that the saved wifi settings are erased and reload the firmware.

Reflashed (not for the first time), same result.
However, my router shows it is connected and I can ping the device.
Maybe I’ll try with a ESP32 or ESP8266 this weekend, I have some 433MHz receivers in the parts bin.

Can you share a picture of your board, and in particular the version details. I wonder if it is a not supported receiver.


Here it is.

I presume that your board is this one - Lilygo ttgo lora sx1278 esp32 0.96 oled display module 16m bytes (128m bit) 433mhz Sale - Banggood.com sold out-arrival notice-arrival notice

Which has this pinout

Lora_IRQ - 26
Lora_MOSI - 27
Lora_RST - 14

Lora_MOSI - 19 ( it must be a typo, As others have this as MISO )
Lora_CS - 18
Lora_SCK - 5

And this is the board we have been using

PIN-DIAGRAM_4162b444-51eb-42ec-9e20-7ce3fedd2dc1_600x600

Lora_DI0 - 26
Lora_MOSI - 27
Lora_RST - 23

Lora_MISO - 19
Lora_CS - 18
Lora_SCK - 5

But I think this is your board definition

~/.platformio/packages/framework-arduinoespressif32/variants/ttgo-lora32-v1

Which should work with the board definition ttgo-lora32-v1 ( The current development branch should support this, but we have yet have positive confirmation )

I published this branch if you want to try it :

You would need to install platformio to test it

If you don’t know how to do it, we can trigger a test build to test with the web upload.

The both of you are very helpful and I appreciate that a lot. Thanks!
I’ve been faffing around with Platformio a couple of years ago when I just started with Arduino and ESP8266, but it was quite confusing to me. So if you could do me a build it would be greatly appreciated!

I will launch it after the nightly build which will start in about 1 hour. I will let you know.

Launched the build should be good in 2h max

It will be ttgo-v1-rtl_433

Unfortunately:

11:05:26.653 → *wm:[2] wifi status: WL_CONNECTED
11:05:26.686 → *wm:[2] wifi mode: STA
11:05:26.686 → *wm:[2] configportal closed
11:05:26.686 → *wm:[1] config portal exiting
11:05:28.672 → T: saving config
11:05:28.705 → {
11:05:28.705 → “mqtt_server”: “192.168.168.23”,
11:05:28.705 → “mqtt_port”: “1883”,
11:05:28.705 → “mqtt_user”: “”,
11:05:28.705 → “mqtt_pass”: “”,
11:05:28.705 → “mqtt_topic”: “home/”,
11:05:28.738 → “gateway_name”: “OpenMQTTGateway_ttgo_v1_rtl_433”,
11:05:28.738 → “mqtt_broker_secure”: false,
11:05:28.738 → “mqtt_broker_cert”: “”,
11:05:28.738 → “mqtt_ss_index”: 0,
11:05:28.738 → “ota_server_cert”: “”,
11:05:28.738 → “ota_pass”: “OTAPASSWORD”
11:05:28.738 → }T: OpenMQTTGateway mac: 58:BF:25:05:61:C0
11:05:28.738 → T: OpenMQTTGateway ip: 192.168.178.89
11:05:28.738 → T: Port: 1883
11:05:28.738 → T: Mqtt server: 192.168.168.23
11:05:30.260 → T: ZgatewayRTL_433 command topic: home/OpenMQTTGateway_ttgo_v1_rtl_433/commands/MQTTtoRTL_433
11:05:30.260 → N: ZgatewayRTL_433 setup done
11:05:30.260 → T: enableActiveReceiver: 3
11:05:30.260 → N: Switching to RTL_433 Receiver: 433.92Mhz
11:05:30.426 → rtl_433_ESP(3): SX1276 radio.begin() failed, code: -2

Different radio, SX1276 instead of SX1278?

Hope I’m not hijacking, but it looked good on my end. Used platformio and uncommented default_envs = ttgo-v1-rtl_433 in platformio.ini. I have the same board that @NorthernMan54 posted but in the 433/470MHz flavor.

************* WELCOME TO OpenMQTTGateway **************
T: Setup SSD1306 Display
T: ZdisplaySSD1306 command topic: /commands/MQTTtoSSD1306
T: ZdisplaySSD1306 log-lcd: false
T: ZdisplaySSD1306 json-lcd: true
T: ZdisplaySSD1306 DISPLAY_PAGE_INTERVAL: 3
T: ZdisplaySSD1306 DISPLAY_IDLE_LOGO: true
T: ZdisplaySSD1306 DISPLAY_METRIC: true
T: ZdisplaySSD1306 DISPLAY_FLIP: true
N: Setup SSD1306 Display end
N: OpenMQTTGateway Version: version_tag
T: mounting FS...
T: mounted file system
T: reading config file
T: opened config file
{
  "mqtt_server": "192.168.0.112",
  "mqtt_port": "1883",
  "mqtt_user": "your_username",
  "mqtt_pass": "your_password",
  "mqtt_topic": "test/",
  "gateway_name": "test",
  "mqtt_broker_secure": false,
  "mqtt_broker_cert": "",
  "mqtt_ss_index": 0,
  "ota_server_cert": "",
  "ota_pass": "OTAPASSWORD"
}T: 
parsed json, size: 388
*wm:[2] Added Parameter: server
*wm:[2] Added Parameter: port
*wm:[2] Added Parameter: user
*wm:[2] Added Parameter: pass
*wm:[2] Added Parameter: secure
*wm:[2] Added Parameter: cert
*wm:[2] Added Parameter: name
*wm:[2] Added Parameter: topic
*wm:[2] Added Parameter: ota
N: Attempting Wifi connection with saved AP: 0
N: Attempting Wifi connection with saved AP: 1
E (3562) wifi:sta is connecting, return error
[E][WiFiSTA.cpp:221] begin(): connect failed!
N: Attempting Wifi connection with saved AP: 2
E (4564) wifi:sta is connecting, return error
[E][WiFiSTA.cpp:221] begin(): connect failed!
T: OpenMQTTGateway mac: 0C:8B:95:A9:21:C0
T: OpenMQTTGateway ip: 192.168.0.103
T: Port: 1883
T: Mqtt server: 192.168.0.112
T: ZgatewayRTL_433 command topic: test/test/commands/MQTTtoRTL_433
N: ZgatewayRTL_433 setup done
T: enableActiveReceiver: 3
N: Switching to RTL_433 Receiver: 433.92Mhz
T: mqtt_max_packet_size: 2560
N: OpenMQTTGateway modules: ["LilyGo_SSD1306","rtl_433"]
N: ************** Setup OpenMQTTGateway end **************

Also, the display is no longer working. Shouldn’t it at least display the logo?
I see this on the serial monitor:
T: ZdisplaySSD1306 DISPLAY_IDLE_LOGO: true

For sake of completeness I’ll post the full log:

************* WELCOME TO OpenMQTTGateway **************
T: Setup SSD1306 Display
T: ZdisplaySSD1306 command topic: /commands/MQTTtoSSD1306
T: ZdisplaySSD1306 log-lcd: false
T: ZdisplaySSD1306 json-lcd: true
T: ZdisplaySSD1306 DISPLAY_PAGE_INTERVAL: 3
T: ZdisplaySSD1306 DISPLAY_IDLE_LOGO: true
T: ZdisplaySSD1306 DISPLAY_METRIC: true
T: ZdisplaySSD1306 DISPLAY_FLIP: true
N: Setup SSD1306 Display end
N: OpenMQTTGateway Version: c07319
T: mounting FS…
T: mounted file system
T: reading config file
T: opened config file
{
“mqtt_server”: “192.168.178.23”,
“mqtt_port”: “1883”,
“mqtt_user”: “”,
“mqtt_pass”: “”,
“mqtt_topic”: “home/”,
“gateway_name”: “OpenMQTTGateway_ttgo_v1_rtl_433”,
“mqtt_broker_secure”: false,
“mqtt_broker_cert”: “”,
“mqtt_ss_index”: 0,
“ota_server_cert”: “”,
“ota_pass”: “OTAPASSWORD”
}T:
parsed json, size: 388
*wm:[2] Added Parameter: server
*wm:[2] Added Parameter: port
*wm:[2] Added Parameter: user
*wm:[2] Added Parameter: pass
*wm:[2] Added Parameter: secure
*wm:[2] Added Parameter: cert
*wm:[2] Added Parameter: name
*wm:[2] Added Parameter: topic
*wm:[2] Added Parameter: ota
N: Attempting Wifi connection with saved AP: 0
N: Attempting Wifi connection with saved AP: 1
E (3592) wifi:sta is connecting, return error
[E][WiFiSTA.cpp:221] begin(): connect failed!
N: Attempting Wifi connection with saved AP: 2
E (4594) wifi:sta is connecting, return error
[E][WiFiSTA.cpp:221] begin(): connect failed!
T: OpenMQTTGateway mac: 58:BF:25:05:61:C0
T: OpenMQTTGateway ip: 192.168.178.89
T: Port: 1883
T: Mqtt server: 192.168.178.23
T: ZgatewayRTL_433 command topic: home/OpenMQTTGateway_ttgo_v1_rtl_433/commands/MQTTtoRTL_433
N: ZgatewayRTL_433 setup done
T: enableActiveReceiver: 3
N: Switching to RTL_433 Receiver: 433.92Mhz
rtl_433_ESP(3): SX1276 radio.begin() failed, code: -2

I have already reflashed a couple of times.
I would get the other board, but unfortunately it’s not in stock at the moment.

Let me see with my 915mhz v1 if I see something.

I have updated the SX module macro to SX1278, should be good to test in 90min:

Awesome! Will try tomorrow.

I will have to reupdate the daily from the branch if you want to test tomorrow, let me know

Yes please, but don’t hurry, I’ll be working in the day time, time to play in the evening.