Code Monkey home page Code Monkey logo

Comments (6)

jamieparkinson avatar jamieparkinson commented on August 17, 2024

Hi Marius - yes, the answer you got in the forum is correct that this library expects sole access to a peripheral (which is just my laziness), but I don't think the "rewrite" they suggest is required.

I don't have access to an ESP32/MAX31865 right now but my first guess without thinking about it very much is that the library just needs to allow the case where the bus isn't already initialised rather than erroring and bailing out, and the Chip Select should do the rest.

I made that change in this branch - try it and let me know how you get on, if it doesn't work feel free to fiddle around and PR any fixes/changes, or I can dig out a dev board and have a better look later.

from esp32-max31865.

schroedermarius avatar schroedermarius commented on August 17, 2024

Seems like its working. Thanks so much for your fast response and help.
My understanding of SPI isnt that big.
Do you mind to explain to me, if HSPI (which is preconfigured as default parameter) is the right for me, or do I need to use VSPI?
Also im reading zero as RTD all the time. Could it be the wrong pins?

    auto Twi_1_device = Max31865(19, 23, 18, 13);
    auto Twi_2_device = Max31865(19, 23, 18, 14);

I saw in Arduino with Adafruit_MAX31865 where only the CS Pin got set. MISO, MOSI and the SCK did not get set up.

from esp32-max31865.

jamieparkinson avatar jamieparkinson commented on August 17, 2024

It shouldn't matter which of the ESP32's SPI peripherals you're using as, while they do have direct connections (IOMUX) to specific GPIOs, they will be connected to any pin you specify automatically by using the GPIO matrix (you don't have to do anything for this, it just happens).

That said, you're using the IOMUX pins for the VSPI peripheral so you might want to use the VSPI host for neatness if nothing else. It shouldn't change the function at all by doing this (if it does there's a problem with the library!).

There is still a problem if you're reading 0s from the RTD unfortunately, it means there is no working communication - other than checking your connections (MISO to SDO, MOSI to SDI, etc) it's hard to know what the problem is. Does it work for any of the following configurations?

  • only one sensor on the bus
  • another library
  • just using the example code from this library with one sensor

ie I'm not 100% sure that the problem is not with this library. The reason that you don't set the data/clock pins for the Arduino library is because Arduinos always use specific, predetermined pins for SPI, because this is necessary for some (maybe most? not sure) Arduino-compatible chips. As explained above, because of the GPIO matrix the ESP32 does not suffer from this restriction.

from esp32-max31865.

schroedermarius avatar schroedermarius commented on August 17, 2024

Well, i could not find another library to try.

I've achieved to get an other error right now, dont know how:

W (230922) Max31865: Sensor fault detected: Over/under voltage fault
Will try to dig some more in it.

from esp32-max31865.

schroedermarius avatar schroedermarius commented on August 17, 2024

Hey again,
seems like I got it working right now! Thanks for you help.
Looks like its only working on MISO=19; MOSI=23,SCK=18 on my system.
Although had some problems on my side.

Now my last error seems to be
E (954) Max31865: Error adding SPI device: ESP_ERR_NO_MEM

Will verify if it lacks memory.

from esp32-max31865.

jamieparkinson avatar jamieparkinson commented on August 17, 2024

Glad you got it working - ESP_ERR_NO_MEM is annoying though. It might be to do with the fact that I've disabled DMA for the bus (DMA with the ESP32 SPI can be a complete nightmare. I had weeks of pain in a production project with it last year). Perhaps if you try changing max_transfer_sz to something small (maybe 4 or 8?) it'll help. You'd want to do that in this block.

Sorry I can't be of more help!

from esp32-max31865.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.