-
Notifications
You must be signed in to change notification settings - Fork 9
Outputting Bresser data on TTGO ESP32 OLED board #42
Comments
I've now added updated code, which will produce a string called 'global_tbuf' |
I seem to have got it working properly!!, check it out and see what you think? |
I'll have a look at it later. |
If you create a fork of my repository, you can get updates from it later on, even if you made your own modifications. And the CI workflow (continuous integration) will compile your code whenever you check in any changes and help to check it. (see the item "Actions" at the top) |
Forgive my ignorance about all things github, but would a fork be like an amended version of your code? And does it matter that I've just mashed up your code with uspizig's? I will happily give you both the credit you deserve! |
No worries! And GitHub makes this sharing, reusing, remixing etc. quite easy and comfortable. If the modifications of your fork are of general interest, you can create a pull request and I could re-integrate them in my project. |
BTW: Did you see that @Uspizig used some parts of my code in https://github.com/Uspizig/Bresser_Weather_NEW/tree/main/WeatherDecoder_LORA_RFM95Only? ;-) |
I have made a fork and did some modifications (see history for explanation): I hope I did not make any mistakes. Please let me know if it works. Please check how to handle the display update in case of no sensor data was received in the current cycle (ws < 0). |
You have put delays of 10 and 15 seconds in the display function to allow reading before the contents are changed. This might cause problems in the LoRaWAN protocol handling. After sending an uplink message, other things might have to be done in time, e.g. receiving an acknowledgement, parameter changes, the network time etc. I will try to address this later. |
Thankyou for sorting out the time string, it took me a while to work that one out, yes string handling does seem overly complex when compared to python! Regarding the delays, and potential problems with the timing, is that not just a function of when the display function is run? Would it not be easier to wait until the LoRaWAN bits were done before running the display update, after all, we have five minutes after the data is sent to ttn. |
Yes, in this case it would be the easiest solution to call The more complicated solution would be to keep the state (current page) inside the function and compare the current time to the last time the function was called and call it again when due. This would be the desired solution if the sketch were to run continuously (instead of going into deep-sleep mode after each cycle). |
where would be the best place to put it in your opinion?
It certainly wasn't doing this before!! |
Regarding the |
The parity errors above mean that radio signal is disturbed, either directly (by radio emissions of your raspberry/laptop) or by the power supply of your TTGO board. If you want to save battery power in the field, you should switch off these debug messages before deploying the sketch onto the target device. |
It does throw a compilation error:
|
Sorry for this! Fixed in https://github.com/matthias-bs/TTGO-ESP32-Bresser-with-display/commit/5f11b900be6513aed637ba1ba5bb25a47feac63d I created a pull request, so you can see the changes and accept or reject them. |
Nice matrix pattern! ;-) You could install the exception decoder to locate the error: https://github.com/me-no-dev/EspExceptionDecoder It's a little bit difficult for me to help you, because I do not have this board. I could modify the display function in order to check if the data is passed to it correctly. But currently I cannot make any promises when I will find the time. At least GitHub's versioning will allow you to revert the last changes. Sorry for this! |
d'oh, it seems i didn't install the right board manager when i moved to using the arduino ide on my linux machine from my windows one, will try your revisions again and report back |
I just made the same mistake and didn't notice the compiler warnings about redefinition of the OLED interface pins... |
has WeatherSensorCfg.h been changed at all, as i wasn't getting any of these pragma messages before? also, i'm confused by this in WeatherSensorCfg.h:
on my board (and according to @Uspizig) the lora DI01 is connected to gpio12? |
trying again with the latest version of BresserWeatherSensorReciever, board set to TTGO esp32 V2.1.1.6.1
output from serial monitor:
|
Now with board revision set to V2:
serial output:
also , in WeatherSensorcfg.h (lines 46- 85)
|
Yes, the board definitions should be left commented out if configuration via the IDE is supported for your board (please see the Readme.md). And no, you do not get bad data - what you see are the flags which data is available in the current message (well, this is not clear from the output). Do you get a TTN connection with any of the two board versions? Which pin numbers did work four you previously? Maybe I made a mistake with the pinning. |
For V2, a connection between the ESP and the LoRa radio (which is only used by LMIC) is missing entirely. You have to connect a wire to any unused GPIO pin (I selected pin 33 for consistency with v21new). For v21new, all radio pins are connected to the ESP32 and there are the appropriate defines in
|
According to
(Provided Maybe I made some mistake or maybe you have an inconsistent mix of old and new code... In pins_arduino.h, OLED_SCL, OLED_SDA and OLED_RST are already defined (so please do not re-define it in your sketch). According to this, your board should be V2 or V21new. Again from
|
Again from our discussion three weeks ago: #38 (comment)
I'll call it a day now, otherwise I'll get a headache... |
|
Yes, that is what is confusing me, I entered the same url (https://dl.espressif.com/dl/package_esp32_index.json) into the board manager preferences on both my windows and linux machines. the windows machine gives me v1.0.6 (and the sketch compiles and uploads perfectly with the old code) and the linux machine gives me v2.0.6 and doesnt compile properly (giving the errors discussed above) |
ok, changed board manager preferences to that above, installed additional libraries - theengsdecoder and nimble.
and corresponding serial monitor output, with no connection to TTN:
|
The messages are just for information which pins and which transceiver will be used (based on the board settings). The question is: which pin actually worked for you or to which ESP32 GPIO pin did you connect the DIO1 wire? If I got it right from the conversation, you used GPIO12 (not GPIO33). If this is true, you have to change the define for Could you please change your debug level? |
BTW: You are switching between two computers and updating the Arduino development environments... Did you remember to apply the configurations and fixes for the LMIC libraries? |
Ah, I got confused because some of the images of pin maps I've seen have pins labelled as different numbers! |
nope, still didn't work, was wondering if i needed to change this bit? (lines 187 to 205 in BresserWeatherSensorTTN2.ino
also changed 33 to 12 in WeatherSensorRecievierCFG.h :
still get
on compiling |
The pin config bit does say RST - >12 and GDO2/G1/GPIO->12, so I guess that's where the problem lies! |
Well, the question is not if it compiles properly, but if the pins matching your board (and your extra wiring) are selected! To go one step back, please check which boards (are all your boards of the same version?) you have (e.g. by comparing it with https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-2/11973) and check which pinout your board has. If your board is this weird V2 version, check if you have the extra wire for DIO1 and to which GPIO it is connected. Then make sure this GPIO is selected in the defines you are going to uses. Then compile and compare the pragma messages with the GPIO numbers you intended to be used. If all this fails, please go back to the versions (according to the date) and IDE settings which worked for you previously (and then check what has been changed since then). |
What the... in
So the actual define and the comment are different!!! And even worse, according to https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-2/11973, the radio's reset pin is actually connected to the HW reset and therefore cannot be controlled by SW. Therefore they propose to assign Did I mention that Lilygo does not provide schematics for all versions? Probably the circuit is designed in a way, that you could wire an additional GPIO pin to the radio's reset input and then assign this to LMIC. On the other hand, the reset is probably also controlled by SW (via SPI). |
i checked that thread and the board i have isn't shown on there - these are the boards i have (i have two, and they are slightly different, one is marked T3V1.6, (this one is working ok out in the field), the one i am currently trying to get to work is marked T3_v1.6.1)):
The main thing that has changed is that since the update of the esp32 board manager from 1.0.6 to 2.0.6 all the errors have occurred. OK, not sure i understand this, but just tried compiling with board revision set to TTGO LoRa v1 (NoTFcard) and it seems to work ok, reporting and displaying ok, but the message sent to ttn is different, so the old payload formatter is faioling with a mask length error! |
Which errors have occurred? T3_V1.6.1 should be compatible to v21new (http://www.lilygo.cn/prod_view.aspx?TypeId=50060&Id=1271&FId=t3:50060:3) The payload length should only depend on the selected options in BresserWeatherSensorTTNCfg.h. Maybe the change comes from the way I'm dealing with So, for your purpose, if you have updated |
looks like the board I have in the feild is a v1.6, and the one on my desk is a v1.6.1 |
Ah, ok. If you are using |
sorted it out now, PIN_ADC3_IN was not defined. |
All seems to be working ok now, though for some reason it refuses to compile using Arduino ide 2.0 on my Ubuntu 22.04 laptop (works fine using IDE 1.8 on another Ubuntu 22.04 one though!) |
Would you like to investigate why it fails with IDE 2.0? For the second issue: please check the define WEATHERSENSOR_DATA_REQUIRED. If this define is set and weather data is incomplete/not available, the sketch enters sleep mode without sending data. Another solution would be to process the data only if the valid-flag was set. |
|
serial monitor output after compiling on ubuntu 22.04 and arduino IDE 2.0.3
On closer inspection, this compile/upload still recieves from bresser and transmits to ttn, but the screen is just that nice matrix pattern, and the above messages just cycle through |
The verbose output from Preferences.cpp is not an error: If the settings are changed via LoRaWAN downlink, they are stored via the Preferences library in the flash. If settings have not been changed yet, their default values are used. |
whats the
bit about then? :) |
You could try this ESP Stack Trace Decoder: https://github.com/littleyoda/EspStackTraceDecoder |
Hi Matthias,
I have used your code, and also that of @Uspizig to output the bresser data on the screen of the ESP32 board.
I have put the code in my own repository here: https://github.com/mczakk/TTGO-ESP32-Bresser-with-display
I am struggling to extract the current time as generated by the function 'printDateTime' (line 975)so that I can print it on the screen (line 1533)
I tried to put in a public function (lines 985 - 996) to store the value of tbuf, but it doesnt seem to work :(
Could you possibly advise?
Many Thanks
The text was updated successfully, but these errors were encountered: