Well, and again
everybody wondering how we can send SMS over 3G modems in Vera, and maybe i have a decision.
Here is my modem:
Vendor=12d1 ProdID=1436 Rev= 0.00
S: Manufacturer=HUAWEI Technology
S: Product=HUAWEI Mobile
And i can send SMS over it with this LUA code:
function wait(seconds)
local _start = os.time()
local _end = _start+seconds
while (_end ~= os.time()) do
end
end
wait(1)
wserial=io.open("/dev/ttyUSB0","w")
wserial:write("AT+CMGF=1\r\n")
wserial:write("AT+CMGS=\"+###########\"\r\n")
wait(1)
wserial:write("VHODNAYA DVER OTKRYTA\r\n\026")
wserial:flush()
But if you will try it, you can met some troubles:
- Modem must be connected directly to vera USB port (not via USB-hub)
- modem port somtimes can be changed to /dev/USB*
- sometimes SMS messages came empty and in debug output in vera i recive:
AT+CMGF=1
OK
AT+CMG=1
COMMAND NOT SUPPORT
AT+CMGS="+79241815373"
> AT+CMG7924T+CMG7924T+CMG7924T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG74T+CMG7
> VHODNAYA DVER OTKRYTA
>
+CMS ERROR: 305
a added delays as you can see (wait function), sometimes it didn’t help but it makes code more stable
so maybe anyone can help to resolve this problems