I note that modbus module or lib is included in the legatoproject legato-af (git sources).
Yet I cannot find clarity on the following:
is it std in the legato-linux build?
where are the API’s?
any example or sample app’s using this ‘module’?
I’m looking to utilize modbus serial RTU functions on the MangOH Yellow via plugin RS485 module (Renfell and Engergiya) and serial port /dev/ttyUSB0.
Any direction/pointers is most welcome,
Mike
jyijyi
August 27, 2020, 12:13am
2
I have no knowledge on libmodbus, but I found that you can build it in the yocto source:
You can have a try on this:
1.download the yocto source and go to ./meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc
2.add the following line:
IMAGE_INSTALL_append = " libmodbus"
3.go to ./meta-swi/meta-swi-mdm9x28/conf/machine/swi-mdm9x28.conf
change UBI_ROOTFS_SIZE ?= “48MiB”
Make the yocto image and download to the module
I can find some libmodbus libraries are built, for example :
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/libmodbus/3.0.6-r0/image/usr/lib/libmodbus.so
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/libmodbus/3.0.6-r0/image/usr/lib/libmodbus.so.5.0.5
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/libmodbus/3.0.6-r0/image/usr/lib/libmodbus.so.5
hi a small clarifictaion regarding libmodbus when i set slave slave id as 1, i can able to read register value.but when i set Slave id as 2, not able to fetch the data, returns connection time out error.
modbus_set_slave(ctx, 2);
Any basic sample available to read multiple slave id