Page 2 of 2
Re: ESP32 Bluetooth command to take a picture
Posted: Tue Nov 08, 2022 11:08 am
by stefan.erni
Hi Martin
Before I compile the Keyboard.fcfx
I would like to ask you in which folder I have to copy the file Keyboard.fcfx.
The program needs an include file "ble_hidd_demo_main.h"
Does this mean that Keyboard.fcfx .. should be copied to the same folder?
regards
Stefan
File it needs

- ESP32_2022-11-08_11-26-59.png (92.22 KiB) Viewed 2522 times
folder

- file_2022-11-08_12-05-33.png (26.87 KiB) Viewed 2522 times
Re: ESP32 Bluetooth command to take a picture
Posted: Tue Nov 08, 2022 1:18 pm
by mnfisher
Hi Stefan,
The fcfx file in your project folder - attempting to compile this (from within FC) will create a new directory with the name of the project (in this case 'keyboard') contents of the zip file to copy to this new directory.
See my post on esp bluetooth mesh for more detail..
Martin
Re: ESP32 Bluetooth command to take a picture
Posted: Thu Nov 10, 2022 7:46 am
by mnfisher
So - a bit more of a useful setup now.
Handles ASCII characters (7 bit) with the exception of '@' and '£' - I had an American keyboard list - the demo now 'types' a list of character codes and the 'key equivalent. The missing keys should be easily added (2 bytes

in the lookup table)
..
65 A
66 B
67 C
..
97 a
98 b
..
So now SendStr accepts strings such as "Hello World\tTabbed+content\r"
Each key is now 'pressed' for 10ms and then released. I suspect faster rates are possible.
As an aside the ascii to keycode routine will work with any HID setup and is very compact - changing the lookup table from an array to a lookup table would save valuable RAM (128 bytes) on smaller MCUs too.
FCs - compile to hex works but need to upload using idf.py. Compile to C doesn't seem to regenerate esp-project.c?
Martin
Next to have a play with mouse commands?
Re: ESP32 Bluetooth command to take a picture
Posted: Thu Nov 10, 2022 8:27 am
by stefan.erni
Hi Martin
Compile to C is working and give a keyboard.c
Firts time Compile to hex give a error but it creat the main folder.
So I copy the zip files in the main folder and
Second time Compile to hex run bether.
but still a little error
Re: ESP32 Bluetooth command to take a picture
Posted: Thu Nov 10, 2022 8:57 am
by mnfisher
Hi Stefan,
You need to create the project file as per first downloads then update as per second.
1) save Keyboard.fcfx somewhere (say C:\Projects) open in FC and compile to hex (this will fail - no matter it creates the directories needed)
2) copy in the contents of the first zip (to c:\projects\keyboard)- and then contents of 2nd zip file to the directory (c:\projects\keyboard\main)
3) should now be able to compile to hex in fc.
4) upload using idf.py -p COM5 flash (change 5 as required for your com port)
If you pm an email address I'll send a 'complete' setup - it was too large to upload here even as a zip.
The errors indicate that the CMakeLists file isn't updated - see
https://flowcode.co.uk/forums/viewtopic.php?f=3&t=1511 - where I break the steps down a bit more....
Martin