Huawei 3G modem with domoticz

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

Post Reply
smq
Posts: 10
Joined: Monday 11 August 2014 23:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Huawei 3G modem with domoticz

Post by smq »

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

pi@raspberrypi ~ $ 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 / ODroid
Domoticz version: 3.5877
Location: Austria
Contact:

Re: Huawei 3G modem with domoticz

Post by Reinz »

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: 73
Joined: Wednesday 16 September 2015 22:10
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Paris area, France
Contact:

Re: Huawei 3G modem with domoticz

Post by oliviers »

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 IP@/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 4 - RFXComm 433 - IrTrans - Zwave
mayyam
Posts: 47
Joined: Saturday 14 January 2017 11:29
Target OS: Linux
Domoticz version: 4.11333
Location: Poland
Contact:

Re: Huawei 3G modem with domoticz

Post by mayyam »

Can You point to app You are using ? It's a few of them.
_______________
- Dell FX-160 / Ubuntu 16.04
- RFLink 433Mhz / NRF 2.4GHz
- 2x Xiaomi Gateway
- different species of ESP8266
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 »

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 3032 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 1 guest