Error in Data forwarder

Hi !
I get this error when I want to use the data forwarder :

[SER] Connecting to /dev/ttyUSB0
(node:28844) UnhandledPromiseRejectionWarning: Error: Could not read serial number for device
    at getDeviceId (/usr/lib/node_modules/edge-impulse-cli/build/cli/data-forwarder.js:509:15)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async connectLogic (/usr/lib/node_modules/edge-impulse-cli/build/cli/data-forwarder.js:94:24)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:28844) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:28844) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I use a NodeMCU to record my voice, here the code :

const int picMic = A0;
void setup(void)
{
Serial.begin(115200);

delay(1000);
Serial.println(“Start”);
}
void loop(void)
{
Serial.println(analogRead(picMic));
}

What can I do to solve this problem ?
Thank you !

@forstark interesting error message, I’ve not seen that before. Could you post the output of lsusb ?

Note that the data forwarder typically is not fast enough to capture audio correctly (you get limited throughput), but I’d love to see what you can pull out of it.

Thanks for your message !
Here, the output of lsusb :

Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04f2:b685 Chicony Electronics Co., Ltd Chicony USB2.0 Camera
Bus 001 Device 006: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 005: ID 8087:0029 Intel Corp.
Bus 001 Device 004: ID 06cb:00a8 Synaptics, Inc.
Bus 001 Device 002: ID 1ea7:0064 SHARKOON Technologies GmbH 2.4G Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

If it works I will publish a full description of my project on Instructable :slight_smile:

@forstark, hmm… Bus 001 Device 006: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter sounds like the one you want and that has an ID. What is the output of ls -l /dev/serial/by-id?

It looks like this for me:

$ ls -l /dev/serial/by-id
total 0
lrwxrwxrwx 1 root root 13 Feb 16 02:03 usb-STMicroelectronics_STM32_STLink_066EFF323338424E43141326-if02 -> ../../ttyACM0

I wonder if it finds the wrong device.

Anyway, as a workaround I’ve pushed v1.12.2 of the CLI (npm update -g edge-impulse-cli) which bypasses this error, and defaults to MAC address 000000000000 if it cannot read the ID. Let me know if that works on your end!

I get this output :

total 0
lrwxrwxrwx 1 root root 13 févr. 16 13:45 usb-1a86_USB2.0-Serial-if00-port0 -> …/…/ttyUSB0

I use a NodeMCU v3 board by the way.

I just updated the edge-impluse-cli, it works now ! thank you !

1 Like

Moreover, I just want to tell you that if you select a baud rate higher than 115200 on the board, the data forwarder crashes when he tries to detect the data frequency.

@forestark you’ll also have to set a higher baud rate when starting the data forwarder via:

$ edge-impulse-data-forwarder --baud-rate XXX
1 Like