Not able to generate cbor data file using "ingestion-sdk-c-master"

Hello edge,
i have downloaded the ingestion-sdk-c-master to generated CBOR data file but when compile main.c file GCC throw error that #include “qcbor.h” file not found, also I searched in ngestion-sdk-c-master directory but I can’t file this file.
Kindy tell me where do I get new SDK with qcbor.h or only file

-Vikas B

Hi @vikas, you’ll need the submodules as well:

git submodule update --init --recursive

I’ve updated the docs: https://github.com/edgeimpulse/ingestion-sdk-c

I have updated all the required source file from Git link and followed the instruction as mentioned.
But still go below error while executing make file , I’m using gcc compiler to build the CBOR data file.

C:\Users\vikas.burhanpure\Desktop\Personal\ingestion-sdk-c-master>mingw32-make
cc -DEI_SENSOR_AQ_STREAM=FILE -Wall -I. -Imbedtls/include -Imbedtls/crypto/include -IQCBOR/inc -IQCBOR/src -Iinc -Iinc/signing test/main.c QCBOR/src/.c mbedtls/library/.c -o ingestion-sdk-example
process_begin: CreateProcess(NULL, cc -DEI_SENSOR_AQ_STREAM=FILE -Wall -I. -Imbedtls/include -Imbedtls/crypto/include -IQCBOR/inc -IQCBOR/src -Iinc -Iinc/signing test/main.c QCBOR/src/.c mbedtls/library/.c -o ingestion-sdk-example, …) failed.
make (e=2): The system cannot find the file specified.
Makefile:15: recipe for target ‘build’ failed
mingw32-make: *** [build] Error 2

Kindly let me know if i’m missing some steps.

-Vikas B

Hey @vikas, try this:

$ set CC=gcc
$ mingw32-make CC=gcc

You’ll need a patch in the Makefile though (to link a library). I’ve pushed that fix + instructions here: https://github.com/edgeimpulse/ingestion-sdk-c

:rocket:

Thanks Janjong for your reply.
I had tried new makfile frm git and tried above commands , I got below error related to "gmtime_s’ reference. I also seen that u added some command related to Windows_NT , but I am using Windows_10 OS. that is why I’m getting issue?

C:\Users\vikas.burhanpure\Desktop\Personal\ingestion-sdk-c-master>mingw32-make CC=gcc
gcc -DEI_SENSOR_AQ_STREAM=FILE -Wall -I. -Imbedtls/include -Imbedtls/crypto/include -IQCBOR/inc -IQCBOR/src -Iinc -Iinc/signing test/main.c QCBOR/src/.c mbedtls/library/.c -o ingestion-sdk-example
mbedtls/library/platform_util.c: In function ‘mbedtls_platform_gmtime_r’:
mbedtls/library/platform_util.c:110:15: warning: implicit declaration of function ‘gmtime_s’; did you mean ‘gmtime’? [-Wimplicit-function-declaration]
110 | return( ( gmtime_s( tm_buf, tt ) == 0 ) ? tm_buf : NULL );
| ^~~~~~~~
| gmtime
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x24): undefined reference to WSAStartup@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0xda): undefined reference to getaddrinfo@16’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x11f): undefined reference to socket@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x15e): undefined reference to connect@12’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x17b): undefined reference to closesocket@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x1a3): undefined reference to freeaddrinfo@4’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x240): undefined reference to getaddrinfo@16' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x285): undefined reference to socket@12’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x2d9): undefined reference to setsockopt@20' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x2ed): undefined reference to closesocket@4’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x31f): undefined reference to bind@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x333): undefined reference to closesocket@4’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x35a): undefined reference to listen@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x36e): undefined reference to closesocket@4’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x3a1): undefined reference to freeaddrinfo@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x3b4): undefined reference to WSAGetLastError@0’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x40e): undefined reference to getsockopt@20' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x45a): undefined reference to accept@12’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x4b2): undefined reference to recvfrom@24' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x4c3): undefined reference to WSAGetLastError@0’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x531): undefined reference to connect@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x582): undefined reference to getsockname@12’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x5a9): undefined reference to socket@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x5ed): undefined reference to setsockopt@20’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x61f): undefined reference to bind@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x6fd): undefined reference to ioctlsocket@12’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x72d): undefined reference to ioctlsocket@12' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x7ab): undefined reference to __WSAFDIsSet@8’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x822): undefined reference to __WSAFDIsSet@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x8c5): undefined reference to select@20’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x909): undefined reference to __WSAFDIsSet@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x935): undefined reference to __WSAFDIsSet@8’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x9a9): undefined reference to recv@16' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0x9d0): undefined reference to WSAGetLastError@0’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0xa55): undefined reference to __WSAFDIsSet@8' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0xae6): undefined reference to select@20’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0xb04): undefined reference to WSAGetLastError@0' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0xb70): undefined reference to send@16’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0xb97): undefined reference to WSAGetLastError@0' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0xbd6): undefined reference to shutdown@8’
c:/mingw/bin/…/lib/gcc/mingw32/9.2.0/…/…/…/…/mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\cc3H3WfM.o:net_sockets.c:(.text+0xbe6): undefined reference to closesocket@4' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccg8lCPu.o:platform_util.c:(.text+0x39): undefined reference to gmtime_s’
collect2.exe: error: ld returned 1 exit status
Makefile:19: recipe for target ‘build’ failed
mingw32-make: *** [build] Error 1

@vikas you need MinGW-W64. gmtime_s error shows when you have the 32-bit version (very confusing, I know). If you get it from this link you should get the right one.

I had installed 64 version MinGW-W64.exe , now looks like gmtime_s error has gone but below new error of reference had pop up.

Kindly check below compile log from command prompt.

C:\Users\vikas.burhanpure\Desktop\Personal\ingestion-sdk-c-master>mingw32-make CC=gcc
gcc -DEI_SENSOR_AQ_STREAM=FILE -Wall -I. -Imbedtls/include -Imbedtls/crypto/include -IQCBOR/inc -IQCBOR/src -Iinc -Iinc/signing test/main.c QCBOR/src/.c mbedtls/library/.c -o ingestion-sdk-example
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x24): undefined reference to _imp__WSAStartup@8' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0xdc): undefined reference to _imp__getaddrinfo@16’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x123): undefined reference to _imp__socket@12' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x164): undefined reference to _imp__connect@12’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x183): undefined reference to _imp__closesocket@4' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x1ad): undefined reference to _imp__freeaddrinfo@4’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x24c): undefined reference to _imp__getaddrinfo@16' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x293): undefined reference to _imp__socket@12’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x2e9): undefined reference to _imp__setsockopt@20' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x2ff): undefined reference to _imp__closesocket@4’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x333): undefined reference to _imp__bind@12' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x349): undefined reference to _imp__closesocket@4’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x372): undefined reference to _imp__listen@8' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x388): undefined reference to _imp__closesocket@4’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x3bd): undefined reference to _imp__freeaddrinfo@4' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x3d2): undefined reference to _imp__WSAGetLastError@0’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x42e): undefined reference to _imp__getsockopt@20' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x47c): undefined reference to _imp__accept@12’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x4d6): undefined reference to _imp__recvfrom@24' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x4e9): undefined reference to _imp__WSAGetLastError@0’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x559): undefined reference to _imp__connect@12' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x5ac): undefined reference to _imp__getsockname@12’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x5d5): undefined reference to _imp__socket@12' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x61b): undefined reference to _imp__setsockopt@20’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x64f): undefined reference to _imp__bind@12' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x72f): undefined reference to _imp__ioctlsocket@12’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x761): undefined reference to _imp__ioctlsocket@12' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x8f9): undefined reference to _imp__select@20’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x933): undefined reference to __WSAFDIsSet@8' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x953): undefined reference to __WSAFDIsSet@8’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x9c9): undefined reference to _imp__recv@16' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0x9f2): undefined reference to _imp__WSAGetLastError@0’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0xb09): undefined reference to _imp__select@20' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0xb29): undefined reference to _imp__WSAGetLastError@0’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0xb97): undefined reference to _imp__send@16' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0xbc0): undefined reference to _imp__WSAGetLastError@0’
C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0xc01): undefined reference to _imp__shutdown@8' C:\Users\VIKAS~1.BUR\AppData\Local\Temp\ccHjYqT6.o:net_sockets.c:(.text+0xc13): undefined reference to _imp__closesocket@4’
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile:19: build] Error 1

Argh, so sorry, forgot to update the linker flags on Windows. Repository now has the updated Makefile, and that should be it!

I think my brain already went on new year’s holiday!

Bingo…:Still your smart that issue got resolved now with that updated makefile.
BTW Happy new year 2021 to all Edge Impulse team , you guys are doing great support to do some Edge AI stuff.

Thanks,
Vikas B

1 Like

If I would like to create my own data set instead of accelerometer data , I need to updated the main.c file with below data, correct?

Max Temp Amb Temp Temp. diff Avg. Temp LC
43.5 28.2 15.3 14.51 64
50.1 25.8 24.3 21.43 47.2