pajikos / sms-gammu-gateway

Simple SMS REST API gateway for sending SMS from gammu supported devices
Apache License 2.0
116 stars 31 forks source link

Error opening device. Unknown, busy or no permissions #12

Closed bluemanos closed 3 years ago

bluemanos commented 3 years ago

I run your project in docker, but it cant start.

Traceback (most recent call last):,
  File "./run.py", line 12, in <module>,
    machine = init_state_machine(pin),
  File "/sms-gw/support.py", line 18, in init_state_machine,
    sm.Init(),
gammu.ERR_DEVICEOPENERROR: {'Text': 'Error opening device. Unknown, busy or no permissions.', 'Where': 'Init', 'Code': 2},

Device is correctly mapped: /dev/ttyUSB1:/dev/mobile My .gammurc also is using the device:

[gammu]
device = /dev/ttyUSB1
connection = at

Any idea what to do, how to fix it?

pajikos commented 3 years ago

Unfortunately, it is a common behavior when gammu sometimes locks your gsm modem, something bad happened in gammu and after container restart, it cannot be used again. Re-inserting USB modem or restart your machine usually helps to unlock the modem. This is the simplest, but I know, not so good solution, but not found any better yet. Anyway, it cannot be solved inside this python wrapper gateway.