Serial communication while running inference using edge impulse CLI

Hello, I followed this doc to run the impulse locally on my Himax


How can i send data to the himax through the serial port while running the CLI?

Also, the library contains this function hx_drv_uart_getchar() where we can receive data through the serial port 1 character at a time. Are there any ways to receive multiple data (e.g. 50 sets of x,y,z float values from external accelerometer)

Hi @weijunawj,

Can you give more information on the type of information you need to send to the board?

The getchar function is part of the Himax library, you can see an example on how we handle UART communication in our SDK to read multiple characters: https://github.com/edgeimpulse/firmware-himax-we-i-plus/blob/master/ingestion-sdk-platform/himax/ei_device_himax.cpp#L456

Aurelien

Hi Aurel, the data i want to send to the board is the accelerometer data from an external accelerometer! :slight_smile:

You might also want to check this repo: https://github.com/edgeimpulse/example-sparkfun-ccs811-himax
Sensors are connected through SPI on the boards headers so the USB port can still be used to send commands to the board.

Aurelien

1 Like

The external accelerometer data will be sent to the RPI/PC via bluetooth and then relayed to the Himax board. Is it possible to do that? if yes how can i do it? :sob:

That should be possible but you’ll need to write the code to read from the UART.
The code from our firmware should be a good example on how to read data: https://github.com/edgeimpulse/firmware-himax-we-i-plus/blob/master/ingestion-sdk-platform/himax/ei_device_himax.cpp#L456

Once you retrieve your accelerometer samples, you can fill in the features array as mentioned in our documentation.

Aurelien