matthias-bs / BresserWeatherSensorReceiver

Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver for Arduino based on CC1101, SX1276/RFM95W or SX1262
MIT License
100 stars 21 forks source link

Can't flash on Lilygo T3 V1.6.1 #145

Closed matthias-bs closed 2 months ago

matthias-bs commented 3 months ago

Thanks for the development! But I need help... I have a Lora Lilygo T3 V1.6.1 and no matter how much I follow your tutorial I can't flash this :/ I know I shouldn't put this here, but I don't know where else to turn, sorry

Ursprünglich gepostet von @nosfaratu in https://github.com/matthias-bs/BresserWeatherSensorReceiver/issues/143#issuecomment-2010911201

nosfaratu commented 3 months ago

Mathias, thanks for opening the topic. I'm a bit of a code lammer and I tried to follow all your steps, but without success.

Board - lilygo model T3 V1.6.1

So I'm using Arduino IE as you can see in this link to have a chance of doing everything right, but not :/ https://github.com/matthias-bs/BresserWeatherSensorReceiver/blob/main/BUILD.md

code for BresserWeatherSensorMQTT2.ino https://gist.github.com/nosfaratu/a1c46ffddb8e8281a7018ab253c5f4f0

code for WeatherSensorcfg.h https://gist.github.com/nosfaratu/6b9cf40bd2a2667aee947fadecb6ac58

I compile the code and save it in another folder. Then I'll check ok, when I upload it gives an error, but the upload finishes. Set it to reset but the board does not reset.

ide https://gist.github.com/nosfaratu/3bd3a127fa0f1e063de87ca436db1833

Thanks in advance!

matthias-bs commented 3 months ago

Hi,

in your WeatherSensorCfg.h, you have uncommented two defines in the board section:

// This define is set by selecting "Board: TTGO LoRa32-OLED" / "Board Revision: TTGO LoRa32 V2.1 (1.6.1)"
// in the Arduino IDE:
#define ARDUINO_TTGO_LoRa32_V21new

[...]

// DFRobot Firebeetle32
// https://github.com/espressif/arduino-esp32/tree/master/variants/firebeetle32/pins_arduino.h
//
// This define (not very specific...) is set by selecting "FireBeetle-ESP32" in the Arduino IDE:
#define ARDUINO_ESP32_DEV

Please leave those defines commented out as it was before. If you select this board and board variant in the IDE (as you did as I see in the screenshot), the correct settings are used automatically.

For the first test, I recommend using the basic example. I any case, please use the examples provided when trying the first steps. You are trying BresserWeatherSensorMQTT2.ino - how should I know which changes you made?

After flashing the board, please switch to the serial console (same serial port as for flashing).

Regards, Matthias

nosfaratu commented 3 months ago

@matthias-bs Success! Using just BresserWeatherSensorBasic.ino from the examples, without changing anything it flashed! 333333

The log appears on the serial monitor! 2222222

But I can't pass anything to HA xD but nothing appears on the lilygo screen :/

--- edit---- Now I have successfully installed BresserWeatherSensorMQTT, it connects to the wifi network but does not communicate with mqtt :/ log

I just changed the ssid/pass data, and mqtt data

ifndef SECRETS

const char ssid[] = "ubnt"; const char pass[] = "#Nrfzydas";

define HOSTNAME "ESPWeather"

define APPEND_CHIP_ID

define MQTT_PORT 1883 // checked by pre-processor!

const char MQTT_HOST[] = "192.168.1.99"; const char MQTT_USER[] = "mqtt"; // leave blank if no credentials used const char MQTT_PASS[] = "Nrfzy22222"; // leave blank if no credentials used

matthias-bs commented 3 months ago

Did you check the part related to secure/non-secure MQTT and the related port and WiFi settings? You have to change

#define USE_SECUREWIFI        // use secure WIFI
// #define USE_WIFI              // use non-secure WIFI

to

//#define USE_SECUREWIFI        // use secure WIFI
#define USE_WIFI              // use non-secure WIFI

in order to try a non-secure connection on port 1883.

Check the MQTT broker's logfile to see why the connection fails.

matthias-bs commented 3 months ago

A secure connection requires USE_SECUREWIFI, port 8883 and some specific credentials. Please see the section 'Notes' in the header of the *.ino file.

matthias-bs commented 3 months ago

Regarding the display - have a look at find_transmitter.ino how to use it.

nosfaratu commented 3 months ago

mqtt is already resolved! I had to set sleep to false, because it almost always appeared offline I can now listen to the topic on homeassistant 44444 Now it remains to create the sensors.

Regarding the screen, do I just put that file and flash it along with the others?

matthias-bs commented 3 months ago

No, you have to modify the MQTT sketch to use the display. You can use the other sketch I mentioned as an example for using the Adafruit SSD1306 library.

matthias-bs commented 2 months ago

Seems to be solved - closing.