Recent

Author Topic: ESP32 mqtt demo  (Read 1523 times)

ccrause

  • Hero Member
  • *****
  • Posts: 933
ESP32 mqtt demo
« on: May 12, 2024, 07:55:11 pm »
Inspired by Thaddy's remote lock idea, I cobbled together a quick and dirty mqtt client (source) for ESP32.  This video demonstrates the ESP32 in action.  I have also added the mqtt device to my OpenHAB setup.

dbannon

  • Hero Member
  • *****
  • Posts: 3019
    • tomboy-ng, a rewrite of the classic Tomboy
Re: ESP32 mqtt demo
« Reply #1 on: May 14, 2024, 08:41:01 am »
OK, that looks very interesting ccrause. Maybe I abandon my Raspberry Picos.  I have ordered a couple of ESP32-C3 !

I take it that https://wiki.freepascal.org/Xtensa is the recipe for setting up a build environment for your extensive example collection ?

Thanks very much !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

ccrause

  • Hero Member
  • *****
  • Posts: 933
Re: ESP32 mqtt demo
« Reply #2 on: May 14, 2024, 07:01:18 pm »
OK, that looks very interesting ccrause. Maybe I abandon my Raspberry Picos.  I have ordered a couple of ESP32-C3 !

I take it that https://wiki.freepascal.org/Xtensa is the recipe for setting up a build environment for your extensive example collection ?
Thank you.  Yes I used the wiki as basis for a recipe to build the esp-idf SDK and collect all the required libraries and tools.  There is also Michael Ring's script to automate the build process and packaging the resulting files and tools ready for distribution via fpcupdeluxe.  Only tested for ESP32 and ESP8266, so you may have to tweak things to work for the RISC-V MCU.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5649
  • Compiler Developer
Re: ESP32 mqtt demo
« Reply #3 on: May 14, 2024, 10:24:05 pm »
I have ordered a couple of ESP32-C3 !

Please note that the ESP32-C3 is a RISC-V based device, not Xtensa based. While FPC supports RISC-V I don't know right know whether the environment of the ESP32-C3 is supported for the RISC-V as well (maybe also FreeRTOS like on the ESP32?)

dbannon

  • Hero Member
  • *****
  • Posts: 3019
    • tomboy-ng, a rewrite of the classic Tomboy
Re: ESP32 mqtt demo
« Reply #4 on: May 15, 2024, 03:44:05 am »
OK, thats even more interesting !

I missed the distinction between esp32 and esp32-c3, looking through espressif's documentation, its clear enough now ! Quite different processors. Sigh...

They have not arrived yet (week or so) so cannot do any testing.  From what I have seen the ESP32 is past its use by date. Local retailers are stocking only the -c3. I'll report what I find ....

Michael Ring's approach is still an option but Raspberry Pi have made it's c libraries very difficult with its very convoluted use of cmake. It was avoiding that problem, particularly wrt wifi that attracted me.

We'll see ....

Davo



Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 3019
    • tomboy-ng, a rewrite of the classic Tomboy
Re: ESP32 mqtt demo
« Reply #5 on: May 15, 2024, 04:39:16 am »
Hmm, this page indicates FPC sees ESP32-c3 as being 'embedded' not FreeRTOS, https://wiki.freepascal.org/Platform_list#Supported_targets_for_RISC-V . However, it has not been updated for four years ....

FreeRTOS does mention esp32-c3, https://www.freertos.org/quickconnect/esp32c3-quickconnect/ but only in the context of "QuickConnect" and AWS.

But espressif have their own FreeRTOS featuring, in particular, SMP - https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos.html - this appears to be a significently different fork, reading the text it has some good looking things and some not so good looking things !

Davo

EDIT: the FPC Makefile does have a riscv32-freertos target - sounds promising.....
« Last Edit: May 15, 2024, 05:11:32 am by dbannon »
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018