Running SDK python on linux

Im trying running the model using SDK linux with pyhton and i followed the instrcutions as shown but im not sure what i did is right or not. I need to classify the real time using the custom sensor

Im struggling to identify what excatly the issue .Is it on the right path when i use

edge-impulse-linux-runner


Aslo here it seems it working when i run it but i dont know why it stopped

I have also tried using ubuntu to see if the issue is from Linux but the issue persisted
Guys any idea @louis @aurel

I’m using custom sensor data to classify in real-time. When i copy the feature from edge impulse and paste it in txt file i can get the classification offline successfully. The problem is i wanted to be classified in real-time.

Hello @Joker147,

This is an example, you need to adapt the classify.py file to collect your raw features from your sensor.

Best,

Louis

@louis I can’t use this file to classify the real time ?
like using

python3 classify.py modelfile.eim /dev/ttyS0 ?

Hello @Joker147,

You use this file as a template but you’ll need to implement your “/dev/ttyS0” wrapper’s logic.

Best,

Louis

@louis Thank for you your reply, i have tried to use my sensor to read the data but it shows me this error which means the data I’m receiving is empty inside the string, i have tried to just test what coming from the serial port separately but as you can see there is not value is printing, meanwhile i have used command windows to test the serial communication but i can receive data, which means this problem it only appears on linux terminal. what could be done to resolve it

Hello @Joker147,

Could you share your custom code on Github (or a Github gist) so I can have a look.
It seems that you have an issue with the string to float conversion.

Can you also share which sensor are you using and the expected output values through serial please.

Best,

Louis

Hi @louis im using the example provided from this respiratory git clone GitHub - edgeimpulse/linux-sdk-python: Use Edge Impulse for Linux models from Python
on GitHub so i clone it and its already can classify the offline data when i copy the features from edge impulse and put in the text file ,but when im trying to read the sensor from Arduino via the Linux terminal i don’t get any value inside the string. However, im reading EMG signal from the two sensors.
i hope its enough to grasp the idea behind it and if there is any missing information you could tell me

@Joker147 Is it a true serial port or a USB port? Maybe ttyUSB0, or ttyUSB1, etc.

Hi @MMarcial
You are right `

ttyS0 is the device for the first UART serial port on x86 and x86_64 architectures so im running the terminal on my windows system that why tty so will be the orignal serial port
ttyUSB0 is the device for the first USB serial convertor
ttyACM0 this basically will be interfaced when i connected my sensor using raspberry pi

Hi @louis i was waiting for your reply

Hello @Joker147,

Could you check with your sensor provider how to retrieve the raw data on your system please?
Once you can read the data, feel free to share your custom classify.py implementation if you have an issue with your serial wrapper so I can have a look.

Best,

Louis

@louis Here i tired to show you that im able to read the serial data comming from arduino using CMD in the windows system which is fine .The issue now in order to run the classificaion i need to use the linux but linux can’t read the data from the serial the sting has to be printed as what printed in the windows terminal

Hi @louis i still could not able to read

Hello @Joker147,

What is your host machine?
Are you using Linux through a virtual machine maybe? If so, are you sure that your port is being forwarded to the virtual machine?

Louis

yes im using virtual machine .How to know the forwarded ports ?