Huawei 3G modem with domoticz

Compatibility (hardware, devices and OS)
Post Reply
smq
Posts: 32
Joined: Monday 11 August 2014 23:23
Target OS: Raspberry Pi
Domoticz version:
Contact:

Huawei 3G modem with domoticz

Post by smq » Sunday 03 April 2016 10:36

Hello friends,

I connected huawei 3g modem to my Raspberry PI via USB to add possibility to receive SMS commands and send SMSes to me with information when for example alarm is raised. I know that in domoticz is possible to use clickatel but I wan't to became independent of external service in case of lost internet connection.
I configured gammu-sms deamon and I can sending smses from linux console like that (using bash script):

Code: Select all

[email protected] ~ $ echo "text to be send" | sudo gammu-smsd-inject TEXT XXXXXXXXX
where XXXXXXXXX is of course my phone number.

The problem is when I'm trying to initiate the script from the domoticz.
I created dummy switch and in section "On action" I put this command:

Code: Select all

script:///home/pi/scripts/sms.sh
in sms.sh script is the same command like above. When I'm switching on the switch, then script is launching but sms is not comming out by gammu ;(
I getting an error:

Code: Select all

Sun 2016/04/03 10:33:45 gammu-smsd[16640]: Error in outbox on 'OUTC20160303_103321_00_+48XXXXXXXXX_sms0.smsbackup'
So then I need to kill gammu, remove outbox files from /var/spool/gammu/outbox and lanuch gammu again.
It's really strange, because script is working properly when I'm launching manually (from pi user and root as well).
Anybody have a

Reinz
Posts: 5
Joined: Wednesday 27 May 2015 11:29
Target OS: Raspberry Pi
Domoticz version: 3.5877
Location: Austria
Contact:

Re: Huawei 3G modem with domoticz

Post by Reinz » Sunday 10 April 2016 21:21

I made something similar, but with SMS Servertools3 and had the problem that the sms deamon could not move the text files (for the sms) in the spool directory from "outgoing" to "sent" due owner ship problems.

Here is my solution
viewtopic.php?f=23&t=10251&p=72192#p72192

oliviers
Posts: 78
Joined: Wednesday 16 September 2015 22:10
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Paris area, France
Contact:

Re: Huawei 3G modem with domoticz

Post by oliviers » Sunday 10 April 2016 21:53

Another solution to send SMS from DOMOTICZ is to install SMS GATEWAY (Available on Google Play) on an Adroid phone (In my case, I use an old phone just for this purpose -- of course it must have a SIM card!). It creates an SMS server on the phone.
Then from DOMOTICZ one can send SMS by inserting this command in a script:

Code: Select all

wget "http://192.168.0.19:9090/sendsms?phone=0123456789&text="$txt

Where: 192.168.0.19:9090 is the [email protected]/port of the SMS Gateway server in the Android phone
0123456789 is the destination phone number
txt contains the text to be sent

No need to sign up with clikatel!
Paris area
Raspberry Pi 2B - RFXComm 433 - IrTrans - Zwave

mayyam
Posts: 36
Joined: Saturday 14 January 2017 12:29
Target OS: Raspberry Pi
Domoticz version: 3.5877
Location: Poland
Contact:

Re: Huawei 3G modem with domoticz

Post by mayyam » Tuesday 21 February 2017 13:54

Can You point to app You are using ? It's a few of them.
_______________
- Raspberry Pi 2
- RFLink 433Mhz / NRF 2.4GHz
- different species of ESP

MegaBOOBLIK
Posts: 1
Joined: Tuesday 25 July 2017 11:23
Target OS: Linux
Domoticz version:
Contact:

Re: Huawei 3G modem with domoticz

Post by MegaBOOBLIK » Tuesday 25 July 2017 11:46

1. folder
/home/USER/domoticz/scripts/

2. file
sendsms.sh

Code: Select all

#!/bin/bash

# Write ./sendsms.sh MESSAGE
# Phone numbers separated by a space
PHONE="22222222222 3333333333 4444444444"

for p in $PHONE
 do
  echo $1 | gammu sendsms TEXT $p -unicode
 done
exit 0
3. Events
10.png
10.png (10.8 KiB) Viewed 260 times
P.S. if u wana check gammu just
echo TEST | gammu sendsms TEXT 12345678901

12345678901 - phone number

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests