regnaDkciN / Filament-Scale

3D Printer filament scale.
GNU General Public License v3.0
16 stars 2 forks source link

Some errors while trying to build #3

Closed xyzroe closed 2 years ago

xyzroe commented 2 years ago

Hi. Great work, thanks. I'm trying to build firmware using your instruction (new clean Arduino IDE v1.8.19, all libraries from table 4 were installed, menu and hx711 files were replaced) but I got a few errors that I tried to fix. So far I have not had success, but maybe you can help me.

  1. DHT.h: No such file or directory - I tried different versions of 'DHT sensor library for ESPx', but all of them used DHTesp.h not DHT.h as in your project. I change to DHTesp.h, according to https://github.com/beegee-tokyo/DHTesp/blob/master/examples/DHT_ESP32/DHT_ESP32.ino#L1
  2. WiFiManager.h: No such file or directory - I installed https://github.com/tzapu/WiFiManager that is not mentioned in table 4, but I found this link at https://github.com/regnaDkciN/Filament-Scale/blob/03aa03c5be18ce4ef94d06465c40cf69e46beec1/SourceFiles/JmcFilamentScale/Network.h#L17
  3. JmcFilamentScale\EnvSensor.cpp:13: EnvSensor.h:35:1: error: expected class-name before '{' token - I changed 'class EnvSensor : private DHT' to 'class EnvSensor : private DHTesp'
  4. EnvSensor.h:41:15: error: class 'EnvSensor' does not have any field named 'DHT' - I changed 'DHT(dataPin, type)' to 'DHTesp(dataPin, type)'
  5. _EnvSensor.h:41:81: error: no matching function for call to 'DHTesp::DHTesp(uint8_t&, uint8t&)' - And here I have no more ideas.

Maybe I need to install some other library for DHT?

What am I doing wrong?

UPD: I installed DHT sensor library and it turned out to be a successful build. I will test.

xyzroe commented 2 years ago

I made a fork that supports PlatformIO right out of the box.

The main advantage is that you do not need to download the libraries by hand - everything will be downloaded by itself at the time of the first build of the project. There is also no need to replace the library files, since the two libraries that need to be changed are included in the project with all the necessary changes. I tried to make a minimum of changes in the project files in order to leave the opportunity to develop using Arduino IDE.

If you find an opportunity to study my solution and it seems interesting and acceptable to you, I will gladly make a PR.

regnaDkciN commented 2 years ago

Hi xyzroe, Does this mean you overcame the errors you reported earlier?  I've only recently started using PlatformIO and am glad that you made a fork for it.I will check your fork when I get a chance.  May take a few days. Joe

On Monday, September 12, 2022 at 02:08:13 PM EDT, xyzroe ***@***.***> wrote:  

I made a fork that supports PlatformIO right out of the box.

The main advantage is that you do not need to download the libraries by hand - everything will be downloaded by itself at the time of the first build of the project. There is also no need to replace the library files, since the two libraries that need to be changed are included in the project with all the necessary changes. I tried to make a minimum of changes in the project files in order to leave the opportunity to develop using Arduino IDE.

If you find an opportunity to study my solution and it seems interesting and acceptable to you, I will gladly make a PR.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

xyzroe commented 2 years ago

Yes, I overcame those errors. I edited the first message as soon as I found the solution.

Regarding the fork: I made the possibility of automatic build directly on GitHub, it seems to me convenient. Also made a little order in the organization of the files, so that the repository would look easier.

So far, I don’t have a weight sensor or a screen, so I can’t do full-fledged tests. But in general, build goes without remarks, wifi connected, the DHT readings are received. So I think everything should be fine.

regnaDkciN commented 2 years ago

Looks like I unintentionally referenced the wrong DHT library in the PDF file.  The correct one is the Adafruit "DHT sensor library"  which can be found and installed in the Arduino library manager.  It doesn't explicitly state that it works with the ESP32, but it works OK for me.  However, if your changes using DHTesp work, then by all means use them.  Regarding WiFiManager, the link in the PDF file is correct and you should have been able to find it.  However, again, if the file you found works for you then go ahead and use it. Disclaimer: I actually started work on the scale in 2019, so some of the things (parts and / or libraries) I used may have been superseded by now, or better ones may be available.  Feel free to change whatever anything you need to make it work for you.

On Monday, September 12, 2022 at 06:14:03 PM EDT, xyzroe ***@***.***> wrote:  

Yes, I overcame those errors. I edited the first message as soon as I found the solution.

Regarding the fork: I made the possibility of automatic build directly on GitHub, it seems to me convenient. Also made a little order in the organization of the files, so that the repository would look easier.

So far, I don’t have a weight sensor or a screen, so I can’t do full-fledged tests. But in general, build goes without remarks, wifi connected, the DHT readings are received. So I think everything should be fine.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

regnaDkciN commented 2 years ago

Looks like the two main issues were that the wrong DHT and WiFiManager libraries were specified in the Instructions document. I have updated the Instruction document to link to the correct DHT and WiFiManager libraries.