I’m trying out my new stm32 discovery board and got it connected, the firmware updated, connected to my network, and showing on my edge impulse devices.
I tried sampling some data, but and after 10 seconds of sampling it started uploading. The console also showed this. (so far so good).
The uploading stopped on both the console and my browser, but no data appears in the edge impluse.
Also I used the arduino ide to look at the serial port, and found it ok, but it looks like it’s using AT commands (which I haven’t used since the 80s). Am I limited to this on this board, or can I install linux and get a bash prompt?
Hey @cbruner, how did you connected, over Wifi? If so, could you open the logs in the Arduino IDE and then start sampling from the studio? This should give some information on what might be the culprit.
Alternatively you can disable WiFi by running:
$ edge-impulse-daemon --clean
And choosing n
when it asks to connect to WiFi. This should give some more information as well.
Also I used the arduino ide to look at the serial port, and found it ok, but it looks like it’s using AT commands (which I haven’t used since the 80s). Am I limited to this on this board, or can I install linux and get a bash prompt?
Welcome to embedded development Unfortunately we’re limited (due to the 128K(!) RAM on this board) to only have very limited firmware. Linux won’t run on these boards.
It was connected over wifi. When you say open the logs… where are they, and why use the arduino ide? (just for the editor or do I need to talk to the board for them).
I think the wifi was working properly, since the website knew about the board and when it was last connected, and when sampling started, upload started and upload ended. Just no data appeared.
I guess I assumed that if it’s an arm processor it would have an os.
OK I used the arduino to connect the io port and found the AT+LISTFILES command. The sample files are present and reading one of them shows binary data.
So it looks to me it was at the server end, not accepting/storing the file.
Is there documentation on the AT commands. (Like how to stop AT-RUNIMPULSE)
On reset of the board this is what the arduino monitor shows me.
0:46:43.819 ->
10:46:43.819 ->
10:46:43.819 -> Hello from the Edge Impulse Device SDK.
10:46:43.819 -> Mounting file system: OK
10:46:44.348 -> Loaded configuration
10:46:44.381 -> Connecting to ‘crystal’
10:46:50.239 -> Connected to WiFi, will now automatically upload samples
10:46:50.239 -> Getting NTP info…
10:48:32.840 -> Current time is Wed Dec 31 23:09:51 1969
10:48:32.840 -> ws connect
10:50:15.409 -> Connecting to WS Client returned -3009
10:50:15.409 -> Type AT+HELP to see a list of commands.
10:50:15.409 -> e[2K
Seems to not get the NTP info properly (default timeout time I suppose). and ws also seemed to take forever, and other AT commands shows it’s not connected to the host. (although it was this morning).
Perhaps the --clear screwed it up.
I’ll start fresh again and post results.
The wifi seems to be the problem as you guessed. Going through the daemon works as expected, and I was able to sample and upload data properly.
It sees the networks in the area, and was able to connect last night and this morning, but perhaps the wifi code has some problems.
Any suggestions on how to debug wifi on this board?
Just tried again. Wifi was connected, through screen. (wish there was a ping test to verify that).
Exited screen and ran the daemon.
Daemon seemed to think wifi was not connected would go through daemon. (this worked once before).
server noticed edgeboard online.
recorded an updown
Upload took 3 or so minutes and failed.
log follows
Edge Impulse serial daemon v1.5.0
Endpoints:
Websocket: wss://remote-mgmt.edgeimpulse.com
API: https://studio.edgeimpulse.com/v1
Ingestion: https://ingestion.edgeimpulse.com
[SER] Connecting to /dev/ttyACM0
[SER] Serial is connected, trying to read config…
[SER] Retrieved configuration
[SER] Device is running AT command version 1.2.0
[SER] Verifying whether device can connect to remote management API…
[SER] Device is not connected to remote management API, will use daemon
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com
[WS ] Authenticated
[WS ] Incoming sampling request {
path: ‘/api/training/data’,
label: ‘updown’,
length: 10000,
interval: 10,
hmacKey: ‘5a074d54a2b286a53bd82bf51b74a2cb’,
sensor: ‘Built-in accelerometer’
}
[SER] Configured upload settings
[SER] Instructed device…
[SER] Sampling started
[SER] Sampling done
[SER] Uploading started
[SER] Sampling finished
I then quit the daemon and went back to screen.
AT+WIFI?
shows connected.
AT+RESET
Hello from the Edge Impulse Device SDK.
Mounting file system: OK
Loaded configuration
Connecting to ‘crystal’
Connected to WiFi, will now automatically upload samples
Getting NTP info…
Current time is Wed Dec 31 23:09:51 1969
ws connect
Connecting to WS Client returned -3009
Type AT+HELP to see a list of commands.
So to me it looks like at least the wifi is not working. (datetime incorrect)
Hi @cbruner, thanks a lot for the detailed logs. Failure code -3009
means that DNS lookup failed. Do you have a PiHole or something in your network which might block a connection to any of our domains (remote-mgmt.edgeimpulse.com or ingestion.edgeimpulse.com)? Or perhaps a firewall which might block outgoing connections? The NTP request goes out to 2.pool.ntp.org so if that fails as well I’m suspecting something blocking connections…
- Like how to stop AT-RUNIMPULSE
Press b
to cancel any running event.
I can access 2.pool.ntp.org from my computer, and it’s going through the same network so I don’t believe there could be anything blocking it.
I ssh’d to a local octopi server (raspberrypi wireless) and was able to ping 2.pool.ntp.org from that without problems.
I was able to compile the source of the firmware, and added a pull request to your github. (minor but useful)
Thanks for the PR, build timestamp is indeed useful. Will land somewhere in the coming week.
I’m not entirely sure which DNS server we use, I think I remember seeing a Google one hardcoded in Mbed OS for a while (either 8.8.8.8 or 8.8.4.4) but I cannot find it in the source anymore; so perhaps we use the network supplied one now. Any chance those could be blocked? Regardless, I filed an issue in the WiFi driver: https://github.com/ARMmbed/wifi-ism43362/issues/74, but I can build a firmware with WiFi debug information logged somewhere in the coming week.
The wifi seems to be the problem as you guessed. Going through the daemon works as expected, and I was able to sample and upload data properly.
Does this unblock you for the time being? I want to dig into the source of this error, but will need a few days to bake a firmware with the right debug logs.
I got it work only once, but was concentrating on wifi. I’m not in an urgent need so that’s fine. I did try a few debug builds but too much noise that I didn’t understand. (firehose debug messages).
Thanks for being so responsive.
One last question, there are apparently more sensors on this board, other then sound and accel. It also has arduino shield ability as well. Are there plans to access more of this stuff in the future?
One last question, there are apparently more sensors on this board, other then sound and accel. It also has arduino shield ability as well. Are there plans to access more of this stuff in the future?
You can upload data from any sensor by adapting code similar to ei_accelerometer.h
, or just by uploading data directly to the ingestion service. See e.g. @kartben2’s tutorial on uploading 6-axis IMU data from the MXCHIP IoT devkit: https://blog.benjamin-cabe.com/2020/04/02/quickly-train-your-ai-model-with-mxchip-iot-devkit-and-edge-impulse There’s so many variations of things you can upload that it’s hard to generalize, but you should be able to get data from new sensors with relatively minor changes in the firmware. Always happy to assist!