Open DeeEmm opened 1 week ago
Started to take a quick peek at this.
First hurdle is always trying to find a good library.
Adafruit is most common, but I will not use their libraries in a project like this as it requires an additional framework. (bloatware)
DFRobot Library is also very bloaty
I previously tried using the Bosch Sensortechnic library for the BME280 but it had a lot of issues, so I am apprehensive about using it again
The author of the TinyBME library that is used currently, does not have an equivalent BME680 library, which is a shame as it is nice and cut down.
The Zanduino library looks fairly lightweight https://github.com/Zanduino/BME680/tree/master but is written for Arduino so may need porting
Similar story for Seeed, although this still needs trimming down as well https://github.com/Seeed-Studio/Seeed_Arduino_BME68x/tree/master
I've forked the Zanduino library and will see if I can get it working as it is the most lightweight.
Ok so I've got the library up and running but it's not converting values yet. Just need to figure out why.
I've also got a bit sidetracked from the Pitot stuff that I was originally looking at, so the BME680 stuff is on the pitot branch.
https://github.com/DeeEmm/DIY-Flow-Bench/tree/213-feature-requestgui-pitot-display-changes
Yeah, yeah, messy I know. Guess I should pay more attention lol.
New library call is in platformIO, so it should pull library from the Repo - https://github.com/DeeEmm/BME680 on first compile
I suspect that this might just be a typecast or conversion issue as the library uses integers, whereas we use doubles in code.
If anyone with a BME680 wants to take a look and see if they can get some data from it please feel free to dig in.
I have my branch of the Pitot/BME68X setup, after uploading my pins.json and index.html, then rebooting. The serial monitor is hanging near the end of the "INPUT"
DIY Flow Bench
DIYFB Version: V2.0.RC.8
Build: 24111801
For help please visit the WIKI:
https://github.com/DeeEmm/DIY-Flow-Bench/wiki
Initialising File System
Loading Configuration
Loading Lift Data
Loading Calibration Data
PINS file Found: /PINS_ESP32_S3_DEV_KITC.json
Loading Pins Data
Parsing Pins Data
Defaulting to AP Mode
Creating WiFi Access Point: DIYFB
Access Point IP address: 192.168.4.1
Multicast: http://diyfb.local
Initialising I/O
Input MAF_PIN: 0
Input REF_PRESSURE_PIN: 0
Input DIFF_PRESSURE_PIN: 0
Input PITOT_PIN: 0
Input SERIAL0_RX_PIN: 44
Input SDA_PIN: 8
Input SCL_PIN: 9
Input SD_MISO_PIN: 0
Input SD_SCK_
The SD card is not defined, and my pins.json for my ESP32 S3 DEVKITC board has the pins for the SD card as -1.
When performing a rest on the board the serial monitor hangs at the same place each time, other than the length of the last lines output differs by one or two characters. e.g. Input SDSCK, Input SD_SCK_PIN:, Input SD_SCK_PIN: 0
I have also tried with the pins defined as my boards default SPI pins, with the same results in the serial monitor.
"SD_CS_PIN" : 10,
"SD_MOSI_PIN" : 11,
"SD_MISO_PIN" : 13,
"SD_SCK_PIN" : 12,
I eventually pulled the BME280 class files directly into the project so work on them locally, as updating the remote repo quickly became a PITA.
I managed to get the code to compile and loaded, but I do not get any output. I note that even if I manually send hardcoded values direct from classes 'getSensorData' method, I do not see those values in DIYFB. Kinda weird. I suspect that is it some kind of scope issue but haven't been able to find out what's happening.
I then tried to get the example working directly on the ESP32 without the DIYFB code, which should be pretty straightforwards, but was having a lot of dependency issues.
At which point I parked it as it was taking the branch I was working on too far off topic. So I've merged this changes back into Dev so that I can now create a dedicated branch for this issue.
The branch contains all of the changes that I made to integrate the 680 into the code, you will just need to adjust the configuration.h file to enable the BME680 and set temp / baro / relh to BME680.
Rather than uncommenting the library call, I have found that it is easier to copy the DeeEmm_BME680.cpp/h files into the main project directory and work on them locally.
BTW. I updated the changes that I've made to the library which are mostly just code tidying so that it is readable (I mean seriously who minifies source code lol)
I was in the process of commenting out the SPI stuff to simplify the code, but did not finish, so this might (probably has) broken the code.
Just uncomment the commented out SPI stuff which is easy enough to spot.
Code is very similar to BME280. Each measurement requires getting values from a bunch of registers - these are defined at top of main file. Those register values are then 'decoded' to generate final values. Not particularly tricky but lots of number crunching so difficult to follow.
We can assume that the number crunching part is okay, it's just how the generated values are accessed from code external to the library.
It should be...
It seems to be failing on the last part, but could also be any other part. Kinda hard to determine as there are no error messages.
Best bet might be to try and get the example working and then go from there, but I was having trouble setting up my environment to get the example to compile. I had a bunch of issues with project paths. (a local environment issue not necessarily a project issue).
All of those changes are pushed to the library, so feel free to hack on those to get it working, or if it works for you let me know how 😆
With this DEV branch,
"MAJOR_VERSION" : "V2",
"MINOR_VERSION" : "0",
"BUILD_NUMBER" : "24111901",
"GUI_BUILD_NUMBER" : "24111702",
"RELEASE" : "V2.0.RC.8",
"DEV_BRANCH" : "https://github.com/DeeEmm/DIY-Flow-Bench/tree/DEV"
Yes I think this is as a result of the changes I made to the library whilst testing.
I was trying to get the example in the library to compile and run stand-alone.
Thinking that this is probably best moved to a V3 update in conjunction with considering the Reverse Flow implementation and the requirement of adding an additional Temp or BME280/68X sensor for the pressure and temp changes that are likely to occur depending on the type of air pumps used.
The DIYFB code part is actually done. It's just the library part that needs to work. I suspect that its not too far away from working, just need to finish what I started. 😆
OK. some progress...
I have the example project compiling and running. It is however reporting nonsense. But it is a step in the right direction.
Had to re-jig the project layout, add a platformIO.ini file and some other stuff so that it would compile as a stand alone project uner VScode / plstormIO, so not too sure if it will now work as a library. Figured that I would get the example working first and then sort out the library aspect after.
Ok so sorted the project paths out. Library can now be included in code and also built as a standalone project using the default I2CDemo
Now to get it working
BME68X incorporated in to the code please.
Originally posted by @KirikauKiwi in https://github.com/DeeEmm/DIY-Flow-Bench/discussions/189#discussioncomment-11230280