Nvidia Jetson Nano I2c issues in matlab/simulink
12 次查看(过去 30 天)
显示 更早的评论
Hello dear community,
I want to read the I2C adress from my Nvidia Jetson Nano via the command scanI2CBus(jetsonObj,m 'i2c-1') in matlab.
My Laptop and the Nvidia Jetson Nano are in the same Network... Previous I have checked it with the command jetson('IP-Adress','name','password')
I have already installed all add-ons like Support Package for Nvidia Jetson, Matlab Coder, Instrument Control Toolbox...
However I get an error with the description: Unrecognized function or variable 'scanI2CBus'
I have tried it already with the proposed solution from https://de.mathworks.com/matlabcentral/answers/871283-jetson-nano-i2c-port-access but it still shows the error from above.
-----------------------------------------------------------------------
Regarding i2c I get errors like Unrecognized function or variable i2cdev.
I have only found solutions for rasperry pi and arduino, but nothing for Jetson Nano.
Has anybody a solution for this problem? I would be very thankful for any support.
Thanks
Burak
0 个评论
回答(1 个)
Rushikesh
2024-10-9
Hello Burak,
I found out that MATLAB does not support ‘scanI2CBus’ function yet for NVidia Jetson as mentioned in MATLAB documentation.
But a workaround I have found out is to use ‘system’ function which let you execute command in the Linux command shell on NVIDIA hardware. To perform an I2C bus scan on the Nvidia Jetson Nano using system commands, you can use the ‘i2cdetect’ utility, which is part of the ‘i2c-tools’ package.
Example:
% Command to scan the I2C bus
command = 'i2cdetect -y 1';
% Execute the command on the Jetson Nano
[status, cmdout] = system(hwObj, command);
Hope this helps.
2 个评论
Rushikesh
2024-10-10
As per my knowledge, as of now MATLAB/Simulink does not support 'I2C' commands for Jetson nano. But you can control PWM Driver from Jetson nano in real time using Jetson linux terminal.
You can use 'i2cset' and 'i2cget' commands in jetson linux terminal to read and write to/from I2C registers.They are available in same 'i2c-tools’ linux package.
Additionally, if you still want to control it from simulink, you can use MATLAB Function Block to execute 'i2cget' and 'i2cset' commands using 'system' function (that will run those commands on linux terminal) and can pass/get data to/from Simulink.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!