stm32f103c8 or esp32 for a datalogger

What are you developing?
aster
Posts: 120
Joined: Thu Mar 30, 2017 2:41 pm
Location: bella italy
Contact:

stm32f103c8 or esp32 for a datalogger

Post by aster » Mon Jan 15, 2018 12:15 pm

hello,

I am working on a datalogger for suzuki/kawasaki motorbikes. I have it already working on a bluepill, it uses 2x SPI (SD and MPU9250) and 2x UART (GPS and a L9637 [it is an ic used to talk with the ECU]). But yesterday i had the very very bad idea that i would like to have camera control (like gopro or other camera with wifi) so here i am to ask for advice :D
which of them do you think is better:

1) change the bluepill with a esp32
2) add to the existing project a esp01 (esp8266)

i guess is difficult to give a suggestion without seeing the code so if needed i could post it. I think that the main problem with the esp32 will be the maths with floating number and i have a few of them :P

both have pro and con, i would prefer the solution number 2 but here people are more expert than me so any suggestion is welcomed

stevestrong
Posts: 2049
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: stm32f103c8 or esp32 for a datalogger

Post by stevestrong » Mon Jan 15, 2018 12:25 pm

aster wrote:
Mon Jan 15, 2018 12:15 pm
i would like to have camera control (like gopro or other camera with wifi)
What kind of control do you mean? Pan-tilt-zoom? Or other? Which?

aster
Posts: 120
Joined: Thu Mar 30, 2017 2:41 pm
Location: bella italy
Contact:

Re: stm32f103c8 or esp32 for a datalogger

Post by aster » Mon Jan 15, 2018 12:44 pm

nono a very basic "start recording"
in the case of the esp01 i will do it with AT commands.
this spanish boy hacked all gopro commands, if you have one you may be interested: https://github.com/KonradIT/goprowifihack

aster
Posts: 120
Joined: Thu Mar 30, 2017 2:41 pm
Location: bella italy
Contact:

Re: stm32f103c8 or esp32 for a datalogger

Post by aster » Mon Jan 15, 2018 1:12 pm

by the way i will also use the wifi with virtuino to control some function of the datalogger (like start the log, stop it ecc) and to show some data on my mobile phone

User avatar
mrburnette
Posts: 2190
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: stm32f103c8 or esp32 for a datalogger

Post by mrburnette » Mon Jan 15, 2018 1:40 pm

Two schools of thought ...
1) keep what you have STM32 and add WiFi with ESP32/ESP8266
2) integrate all functionality into one uC, say the ESP32

Personally, I have an on-again, off-again relationship with the ESP32. I have more experience with the ESP8266 but the single core and the task switching between the Arduino-side and the RF-side is troublesome. Were I doing this, I would incorporate the WiFi with the ESP32 and get some serious experience with the chip. Then, when the camera stuff is all working on the ESP32, take a look at the load on the ESP32 to determine if you have ample resources to move the logging code.

Ray

aster
Posts: 120
Joined: Thu Mar 30, 2017 2:41 pm
Location: bella italy
Contact:

Re: stm32f103c8 or esp32 for a datalogger

Post by aster » Mon Jan 15, 2018 3:54 pm

hi ray,

yep the two schools of thought represent perfectly my problem. usually, in my experience, when there are different schools of thought none is the only correct but all have part of reason

also the price is something to keep controlled, esp32 is 7€ while bluepill+esp01 is 3€
to be honest i think i will stay on the stm32, i like the mcu, i like the repo, i like the forum <3 :lol:

and considering that i will do this project for people who probaply doesn't have any idea of what microcontrollers are (motorcyclist) i think that using the stm32 is more ( :?: ) simple than the esp32

User avatar
mrburnette
Posts: 2190
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: stm32f103c8 or esp32 for a datalogger

Post by mrburnette » Mon Jan 15, 2018 7:51 pm

aster wrote:
Mon Jan 15, 2018 3:54 pm
<...>
also the price is something to keep controlled, esp32 is 7€ while bluepill+esp01 is 3€
to be honest i think i will stay on the stm32, i like the mcu, i like the repo, i like the forum <3 :lol:
<...>
Recent reduction in ESP32 prices for Rev 1 silicon:
https://www.aliexpress.com/item/LOLIN32 ... 43452.html
but still more than the blue board
https://www.aliexpress.com/item/STM32F1 ... 40083.html

Still, from my limited testing, ESP8266 Arduino code ports very well to the ESP32 dual-core uC. So the idea of using the ESP8266 is a good way to go ... just remember, you must release the Arduino code every 50mS or shorter in order to keep the RF side of the ESP8266 healthy!

Ray

victor_pv
Posts: 1859
Joined: Mon Apr 27, 2015 12:12 pm

Re: stm32f103c8 or esp32 for a datalogger

Post by victor_pv » Tue Jan 16, 2018 3:32 am

mrburnette wrote:
Mon Jan 15, 2018 7:51 pm
... remember, you must release the Arduino code every 50mS or shorter in order to keep the RF side of the ESP8266 healthy!
Sorry for sidetracking the thread, but what did you mean with that, how to you release the code? with a delay() perhaps?
I don't have experience with the ESP yet, but was thinking on using one for a humidity logger. My code should take less than 50ms to read and go back to sleep, but I'm curious about that need to release and how to do it.

aster
Posts: 120
Joined: Thu Mar 30, 2017 2:41 pm
Location: bella italy
Contact:

Re: stm32f103c8 or esp32 for a datalogger

Post by aster » Tue Jan 16, 2018 8:50 am

You have to release the code, that means "do the internes stuff to keep the connection going" with yield() or delay(0) i have read that it is suggested every 200milliseconds to be very safe. Mandatory every 500

Ray i just discovered about the revision in esp32 but for now i think that the 3 euros less is not enough good: https://cdn.instructables.com/ORIG/FJP/ ... WQBOV7.pdf or maybe yes :roll:

By the way i meant that i will use both the bluepill and the esp01 which will be used with AT commands to do the turn on / shooting of the camera

User avatar
mrburnette
Posts: 2190
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: stm32f103c8 or esp32 for a datalogger

Post by mrburnette » Tue Jan 16, 2018 12:44 pm

victor_pv wrote:
Tue Jan 16, 2018 3:32 am
<...>
Sorry for sidetracking the thread, but what did you mean with that, how to you release the code? with a delay() perhaps?
I don't have experience with the ESP yet, but was thinking on using one for a humidity logger. My code should take less than 50ms to read and go back to sleep, but I'm curious about that need to release and how to do it.
Victor,
Sidetracks are learning experiences ... IMO. The way the ESP8266 core is managed is that non-OS (a very elementary RTOS) is incorporated into the native code compiles and provides a pseudo-thread to the Arduino code. However, non-OS is a light-weight and does not fully manage Arduino ... the default circumstance is to automatically pause Arduino at loop() and return to the Espressif thread to manage RF protocols and stacks and required housecleaning. When the core is finished with the RF side, the non-OS returns to the Arduino thread ... which by default is at the top of loop(). Other ways to force a servicing of the RF side is: delay(n), delay(0), and yield().

There are various online articles about how tightly the loop() must execute, the figures range from 30mS to 50mS ... failure to release the user's code quick enough usually has very bad consequences :o

The above does not apply to ESP32 dual-core device... FreeRTOS is integrated into the compile automatically.

Ray

One of my ESP8266 Projects you may find interesting (RF disabled, just a fat SRAM Arduino)[w/assistance from martinayotte]::
https://www.hackster.io/rayburne/esp826 ... ime-1df8ae

What do you do with all of that unused flash? (Build tables, of course!):
https://www.hackster.io/rayburne/oui-ou ... 266-323ae4

Other Projects including many ESP8266 rehashes:
https://www.hackster.io/rayburne/projects

Post Reply