it happens to me, that the /dev/ttyUSBx is not available or dying for whatever reason, but then the smstools as still running is writing to /dev/ttyUSB02, but is not existing to it is creating a file with:
AT-cmd inside. ...
normally i have devices:
and creating a link /dev/modem_sms to /dev/ttyUSB2
so, that works great 8as ttyUSB0 is used for 3G modem connection and ttyUSB3 using to get signal strenght
now i happens that the /dev/ttyUSB2 is not available for whatever reason, and smstools3 is sending a AT cmd to this non existing device, which creates a new file and write into: AT.....
on the other side, i have a smsalarm handler, which regonize that there is a device issue, and this will then restart the whole network to get all /dev/ttyUSB back.
BUt as /dev/ttyUSB2 now existing as file, it will create:
then it is also via start script called: /etc/init.d/device_links i will find and recreate the links to the given new dev name.
but when that happens again, it wil on next round do the same, and then on network restart i have then:
and on enxt round again
and so on ...
that is because smstools is not checking if device is existing.
so, my question: can you add to check if device is existing and only if it existis, then send cmd to sms modem.
or is there an option, to tell smstools to verify if device exists (before sending cmd to it) ?
if [ ! -e /dev/ttyUSB2 ] && [ ! -f /dev/ttyUSB2 ] ; then .... #device seems to be existing and is not a file
also showing my script to set the links to modem for info, sms, and modem
« Last edit by camro on Tue Jul 28, 2020 22:42, 18 months ago. »