Can I pipe a large file to serial port?

Posted on
  • I need to dump a file content (while making some little changes on the fly) from ESP12 to its serial console. Filesize is about 140 KB (an image file), so the content shouldn't be copied into the RAM. FlashEEPROM.readMem() still (as of 1v86.66) seems to cause reset.

    Is there any workaround or something?

  • Have a look here - this is using pipe with flash reads....

    http://forum.espruino.com/conversations/­283045/#comment12837928

    It's a while back since I wrote it, but could before use.

  • You can't output non-stop to the uart 'cause it doesn't yield the processor for wifi and then WDT hits you. It's a PITA but I don't know what to do about it that is not exceedingly complicated.

  • All things can be done... but as @tve points out:

    ...exceedingly complicated.

    ...and that's why the ESP8266 - a single proc thing - should be left alone to do its designated job. Mixing in an equally hogging / demanding job would has to be done 'in the same low level loop' as the primary task: handling the Wifi connectivity.

  • @Wilberforce I think that library will work for me, let me try it out.

    @tve Actually we don't have to stream in a non-stop manner, we can take a breath for WDT in the process.

    @allObjects you hit the nail on the head... We were considering putting another MCU (eg. STM32F030) for this kind of stuff...

  • You might have some luck using pipe and setting the chunk size to 1? That might be slow enough that it doesn't fill up the output stream - but it's not very efficient. You're probably better off manually reading from the file and outputting via an interval.

    We were considering putting another MCU (eg. STM32F030) for this kind of stuff...

    There's always the upcoming Espruino WiFi board :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Can I pipe a large file to serial port?

Posted by Avatar for ceremcem @ceremcem

Actions