Git Product home page Git Product logo

Comments (16)

VanDavv avatar VanDavv commented on May 24, 2024 1

Thanks for opening the issue! CC @Erol444 @saching13

from esp32-spi-message-demo.

Erol444 avatar Erol444 commented on May 24, 2024

@VanDavv I believe @themarpe will handle this ticket.

from esp32-spi-message-demo.

elblogbruno avatar elblogbruno commented on May 24, 2024

After some changes to my code I am receiving an error message when clogging up.

at 'req_success = mySpiApi.spi_pop_message(METASTREAM);'
image

from esp32-spi-message-demo.

elblogbruno avatar elblogbruno commented on May 24, 2024

image

I do receive IMU metadata (SPI_IMU_OUT stream), but then this is what shows up when camera stops receiving messages from custom Stream (METASTREAM)

from esp32-spi-message-demo.

themarpe avatar themarpe commented on May 24, 2024

Hi @elblogbruno

Just to summarize - after around 2-3 seconds no more messages are coming from the OAK to the ESP32?
Can you try develop (and make sure to update the submodules git submodule update --init --recursive) as well as try changing the SPI speed from 16MHz to 1MHz (in components/depthai-spi-api/common/esp32_spi_impl.c):

diff --git a/common/esp32_spi_impl.c b/common/esp32_spi_impl.c
index 7046fe7..2e6e80d 100644
--- a/common/esp32_spi_impl.c
+++ b/common/esp32_spi_impl.c
@@ -55,7 +55,7 @@ void init_esp32_spi(){
         .command_bits=0,
         .address_bits=0,
         .dummy_bits=0,
-        .clock_speed_hz=16000000,
+        .clock_speed_hz=4000000,
         // TODO(themarpe) - enable .clock_speed_hz=20000000
         .duty_cycle_pos=128,        //50% duty cycle
         .mode=1,

from esp32-spi-message-demo.

elblogbruno avatar elblogbruno commented on May 24, 2024

Just to summarize - after around 2-3 seconds no more messages are coming from the OAK to the ESP32?

Great summary.

Can you try develop (and make sure to update the submodules git submodule update --init --recursive)

I just made sure

try changing the SPI speed from 16MHz to 1MHz (in components/depthai-spi-api/common/esp32_spi_impl.c)

Just made that change and the problem still occur.

from esp32-spi-message-demo.

themarpe avatar themarpe commented on May 24, 2024

@elblogbruno
Does the time till "clog" change if you modify the queue sizes of the SPIOut nodes?

from esp32-spi-message-demo.

elblogbruno avatar elblogbruno commented on May 24, 2024

If I do set the queue size to 1 it took like two minutes and 30 seconds.
changing it to 5 is reduced to 40 seconds.
So I feel like yes it does change!

from esp32-spi-message-demo.

elblogbruno avatar elblogbruno commented on May 24, 2024

setting it to 10 made the esp32 crash after 30 seconds

image

from esp32-spi-message-demo.

themarpe avatar themarpe commented on May 24, 2024

@elblogbruno if the queue sizes change the behavior, make sure to set them to correct type (eg. blocking / non-blocking) and to pop messages as they are incomming to not fill up the queues.

If it always crashes after filling up the queues, it seems like it might be an out of memory issue, by the looks of the stacktrace.
(Also, can you share what the rest of the queue size issues looks like?)
Add the following in spi_api.cpp:492 - it tries guarding for that case:

bool SpiApi::send_message(const RawBuffer& msg, const char* stream_name){
    bool req_success = false;
    SpiStatusResp response;
    uint32_t total_send_size;

    std::vector<uint8_t> metadata = serialize_metadata(msg);
    // Add the following check
    if(metadata.empty()){
        return false;
    }
    
    ...

Let me know how it goes.

from esp32-spi-message-demo.

elblogbruno avatar elblogbruno commented on May 24, 2024

make sure to set them to correct type (eg. blocking / non-blocking)

All SPIOut nodes are set to non_blocking (spiOut.input.setBlocking(False))

Add the following in spi_api.cpp:492 - it tries guarding for that case:

Will check out any memory leaks

Also, can you share what the rest of the queue size issues looks like?

image

These are other issues I have received

from esp32-spi-message-demo.

elblogbruno avatar elblogbruno commented on May 24, 2024

Sorry if It is a dumb question, currently I was running the pipeline from the host, I mean I did not flash it to the camera.
Does this make any kind of influence?
Aswell, how can I read node.warn messages from a flashed pipeline?

from esp32-spi-message-demo.

themarpe avatar themarpe commented on May 24, 2024

@elblogbruno then it seems like there are some issues with allocation / some other issue that causes a null dereference or something similar.

currently I was running the pipeline from the host, I mean I did not flash it to the camera.
Does this make any kind of influence?

No difference for the most part (just XLink nodes are disabled)

Aswell, how can I read node.warn messages from a flashed pipeline?

For now you'll have to send it via an alternative means (SPI, UART...) - If you have USB connected, you can run the same app again from host. Otherwise its not possible to connect to a running app using USB and read out logs, etc... (for now, might change in the future)

from esp32-spi-message-demo.

elblogbruno avatar elblogbruno commented on May 24, 2024

Thanks!
I will look at my code!
Cordially,
Bruno

from esp32-spi-message-demo.

elblogbruno avatar elblogbruno commented on May 24, 2024

I was not deleting my CJSon parsing of the message and so had memory leaks. Now it seems to work ok.

I have another question about IMU parsing but I will do a second issue.

from esp32-spi-message-demo.

themarpe avatar themarpe commented on May 24, 2024

Great, in that case, I'll close this issue :)

from esp32-spi-message-demo.

Related Issues (16)

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.