Hi Ben
Is it possible to add for the Bluetooth from the ESP32 some more commands also like the UART or App Developper comport already have it?
This both makes it easier for me:
SendINTArray and ReceiveINTArray
SendBinary32 and ReceiveBinary32
regards
Stefan
ESP32 add more commands for Bluetooth
-
- Valued Contributor
- Posts: 883
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 173 times
- Been thanked: 203 times
-
- Matrix Staff
- Posts: 1895
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 491 times
- Been thanked: 664 times
Re: ESP32 add more commands for Bluetooth
Hi Stefan,
Ok I'll get those on the list for you.
Ok I'll get those on the list for you.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 883
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 173 times
- Been thanked: 203 times
Re: ESP32 add more commands for Bluetooth
Hi Ben
On various projects I have to use 24Bit data. This is not supportet in FC but 32Bit is very well supported. So I will use 32bit instead of 24bit
But not yet the 32-bit (Long) data transmission as Array in AppDeveloper comport, ESP32-Uart and ESP32-BT
Would it be possible to add this command as well:
ReceiveLongArray and SendLongArray
Maybe it would be possible to add this command for the ESP32-BT so the commands are the same.
ReceiveByteArray and SendByteArray
ReceiveIntArray and SendIntArray
The ESP SendArray already exists, you could leave it there so that old programs still work, but you know better than me how to do it.
regards
Stefan
overview commands
On various projects I have to use 24Bit data. This is not supportet in FC but 32Bit is very well supported. So I will use 32bit instead of 24bit
But not yet the 32-bit (Long) data transmission as Array in AppDeveloper comport, ESP32-Uart and ESP32-BT
Would it be possible to add this command as well:
ReceiveLongArray and SendLongArray
Maybe it would be possible to add this command for the ESP32-BT so the commands are the same.
ReceiveByteArray and SendByteArray
ReceiveIntArray and SendIntArray
The ESP SendArray already exists, you could leave it there so that old programs still work, but you know better than me how to do it.
regards
Stefan
overview commands
-
- Valued Contributor
- Posts: 883
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 173 times
- Been thanked: 203 times
Re: ESP32 add more commands for Bluetooth
Hi Ben
Would it be possible already add for ESP32 Bluetooth
ReceiveIntArray and SendIntArray
regards
Stefan
Would it be possible already add for ESP32 Bluetooth
ReceiveIntArray and SendIntArray
regards
Stefan
-
- Matrix Staff
- Posts: 1895
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 491 times
- Been thanked: 664 times
Re: ESP32 add more commands for Bluetooth
Hello,
I've looked at this before and it's tricky to do it well. I'll look again. Basically the esp32 does the queuing for you but expects a char array (shakes fist at strict compiler) and conversion requires an intermediate buffer which has to be of a big enough size to cope with anything a user might throw at it. Any fixed size I make it will probably be both needlessly big and too small. Or we do things piecemeal byte by byte to avoid the buffer but this incurs delays and or missed bytes. Hmm. I'll try again a nice solution may present itself and I do have an idea which is a halfway house. Piecemeal using a reasonable sized buffer.
I've looked at this before and it's tricky to do it well. I'll look again. Basically the esp32 does the queuing for you but expects a char array (shakes fist at strict compiler) and conversion requires an intermediate buffer which has to be of a big enough size to cope with anything a user might throw at it. Any fixed size I make it will probably be both needlessly big and too small. Or we do things piecemeal byte by byte to avoid the buffer but this incurs delays and or missed bytes. Hmm. I'll try again a nice solution may present itself and I do have an idea which is a halfway house. Piecemeal using a reasonable sized buffer.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 883
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 173 times
- Been thanked: 203 times
Re: ESP32 add more commands for Bluetooth
Hi Ben
I mean these are just suggestions....
There is still a small improvements possible.
To write data to an SD disc relatively quickly, you can fill the buffer and write all at once. But buffer is only possible to fill per byte.
Couldn't this buffer also be filled with an integer? 256 integer will fill 512Byte.....
Could I make the USB/Bluetooth transmit aaray (buffer) to 256x integer and then write it to the sd card right away?
The other little problem.... I need to filter all integers with the DSP component.
I don't know yet whether in the ESP32 program or in the FC9 App or in both. In an array there will be 9 axes per sensor and there will be two sensors.
So 18 integers every 100Hz
All go through a DSP filter but not to the same filter. Once Kalmann, once low pass, possibly also a high pass
There could also be a DSP Component "IMU" where I read in all 9 axes and the DSP Component "IMU" gives me the roll pitch and yaw filtered......
(in the future)
regards
Stefan
SD Card
I mean these are just suggestions....
There is still a small improvements possible.
To write data to an SD disc relatively quickly, you can fill the buffer and write all at once. But buffer is only possible to fill per byte.
Couldn't this buffer also be filled with an integer? 256 integer will fill 512Byte.....
Could I make the USB/Bluetooth transmit aaray (buffer) to 256x integer and then write it to the sd card right away?
The other little problem.... I need to filter all integers with the DSP component.
I don't know yet whether in the ESP32 program or in the FC9 App or in both. In an array there will be 9 axes per sensor and there will be two sensors.
So 18 integers every 100Hz
All go through a DSP filter but not to the same filter. Once Kalmann, once low pass, possibly also a high pass
There could also be a DSP Component "IMU" where I read in all 9 axes and the DSP Component "IMU" gives me the roll pitch and yaw filtered......
(in the future)
regards
Stefan
SD Card
-
- Valued Contributor
- Posts: 883
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 173 times
- Been thanked: 203 times
Re: ESP32 add more commands for Bluetooth
Hi Martin
Yes that would be a possibility. At the moment I'm still using the USB. Maybe Ben will still add this to BT.
For file write/read I'm trying to use the app developer with built-in function File to write array and read it again as a simulationdata.
So I will create a movement file and read it again.
I chose the name "IMU.FMV".
Flowcode MoVment file
Also the 18 DSP filters with input output are much easier to create than I thought.
regards
Stefan
built-in function File in FC AppDevelopper
Yes that would be a possibility. At the moment I'm still using the USB. Maybe Ben will still add this to BT.
For file write/read I'm trying to use the app developer with built-in function File to write array and read it again as a simulationdata.
So I will create a movement file and read it again.
I chose the name "IMU.FMV".
Flowcode MoVment file
Also the 18 DSP filters with input output are much easier to create than I thought.
regards
Stefan
built-in function File in FC AppDevelopper
-
- Valued Contributor
- Posts: 883
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 173 times
- Been thanked: 203 times
Re: ESP32 add more commands for Bluetooth
Hi Ben
The use of ESP32 Bluetooth together with the APP developer is very easy, fast and a stable connection.
But two tiny wishes. With the ESP32 the sending (perhaps also receiving) of INTArray and with the App Developer a command like checkConnectionStatus.
Would this be possible to add?
regards
Stefan
Compare both commands ESP32 BT and APP developer comport:
The use of ESP32 Bluetooth together with the APP developer is very easy, fast and a stable connection.
But two tiny wishes. With the ESP32 the sending (perhaps also receiving) of INTArray and with the App Developer a command like checkConnectionStatus.
Would this be possible to add?
regards
Stefan
Compare both commands ESP32 BT and APP developer comport:
-
- Matrix Staff
- Posts: 1895
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 491 times
- Been thanked: 664 times
Re: ESP32 add more commands for Bluetooth
Hello,
Sorry I know this one has been on the request list for a while. I've added the INT array functions for you now and am interested as to how you get on with them.
As for the check connection status function this is tricky, I don't think Windows itself manages this one very well but I could be wrong. The way I do it is I put a simple comms check into the firmware, so for example the App sends out a specific combination of bytes, the embedded side checks for this and replies. If the reply doesn't come then the comms channel is assumed dead, the COM port is closed and the app stopped with an error message.
Sorry I know this one has been on the request list for a while. I've added the INT array functions for you now and am interested as to how you get on with them.
As for the check connection status function this is tricky, I don't think Windows itself manages this one very well but I could be wrong. The way I do it is I put a simple comms check into the firmware, so for example the App sends out a specific combination of bytes, the embedded side checks for this and replies. If the reply doesn't come then the comms channel is assumed dead, the COM port is closed and the app stopped with an error message.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel