Hello,
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:
/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB2
/dev/ttyUSB3

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:
/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB3
/dev/ttyUSB4

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:
/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB4
/dev/ttyUSB5

and on enxt round again
/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB5
/dev/ttyUSB6
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) ?

is like:

if [ ! -e /dev/ttyUSB2 ] && [ ! -f /dev/ttyUSB2 ] ; then .... #device seems to be existing and is not a file

cu Camel

also showing my script to set the links to modem for info, sms, and modem


/etc/init.d/device_links



« Last edit by camro on Tue Jul 28, 2020 22:42, 8 weeks ago. »