SMS enabled Gateway?


  • Admin

    Started playing with a GSM shield this weekend.

    Would it it be useful to allow sensors to send out SMS alerts? Or trigger SMS from controller side? Initially I was thinking of using a predefined set of destination numbers.

    This would also allow (in theory) allow triggering commands by sending in SMS from a phone.

    I know most controllers already have integration with SMS Gateways but these could fail if internet goes down. So for the paranoid a local GSM shield would probably be more robust.


  • Mod

    @hek I started the same a couple of weeks ago (did not finish it yet though).
    I decided that I want the controller to be in charge.
    Much more flexible imho.

    • the sensor reports anything to the controller
    • the controller has a trigger on a certain event
    • the controller takes action using the gsm shield

    This is totally transparent and, as an appetizer, completely independent of the type/make/protocol of the sensor(s).


  • Mod

    @hek said:

    SMS alerts

    It is 2014, is it?


  • Admin

    yea, yea.. tell that to your internet provider when it fails ๐Ÿ˜‰


  • Contest Winner

    I think sms capabilities is a good idea. But I would prefer that to be provided by a node instead of the gateway itself. Imo the gateway should be kept as simple as possible since if it hangs, fails or mess about in any way, the hole IoT system goes down. So assuming the controller cannot be entrusted with this (and considering most controllers dependency to a working Internet connection) I believe it makes more sense to have the controller plug in submit any alerts through the gateway to any connected "alert handlers" (or possibly have the gateway manage the "alert handlers") and sms input can be treated as node/sensor input, thus not complicating the gateway firmware.


  • Hero Member

    I follow @marceltrapman here, this seems to me like a typical task for the controller, but the controller needs "hardware" to do it..

    For the "hardware" part I follow @Anticimex in sense that doing this in a node seems to me a much better solution that doing it in the gateway.


  • Mod

    @daulagari said:

    For the "hardware" part I follow @Anticimex in sense that doing this in a node seems to me a much better solution that doing it in the gateway.

    I agree on the separate hardware. Obviously ๐Ÿ™‚
    For that I have an Arduino with the GSM Shield, connected to my server using the usb port.
    The controller communicates through usb.


  • Hardware Contributor

    I was considering the use of a SIM800L breakout in a sensornode itself. The problem I face is that I need to communicate over a serial port with this module (for AT commands control of the GSM module).

    So far I can combine my switch detection (using interupts on digital pins 3 and 4 - INT0 & INT1) and the software serial used in the Adafruit FONA library. But then I have no way of sending other sensor info to the MySensors gateway.

    Can someone confirm that there is a possibility to define a software serial port, also when loading the MySensors library into the sketch ?

    When I add the MySensors.h, the FONA library no longer works. I'm almost sure it is a conflict in interupt definition, but I'm not well versed enough in C++ to be able to confirm this (I'm more a hardware guy).

    I would like to use the MySensors library, so that I can use sleep() (I know there are other options). But also so that we can add a "GSM node" to the network, now that we can send V_TEXT between nodes. This last addition allows any node to send a string (e.g. with a command) to a GSM node, which can then send out a string based on the string-command. Even values of sensors could then be passed to the "SMS gateway" (if we are allowed to call it that), and this independant of the controller.

    So, how can I combine a software serial based library with MySensors library without losing the possibility of waking up on interrupt (from a switch on pin D3 or D4 - Arduino pins 2 and 3) ?

    Any feedback is welcome



  • I like to have a sms/ call functionality ๐Ÿ™‚



  • @GertSanders I have had a similar experience with the GSM board and at the end just returned it. I think MySensors has to be altered significantly to accommodate GSM library.

    Currently, I am using GSM-to-433Mhz board to switch on my boiler remotely via SMS. This is completely independent to MySensors. The problem I had with it was that it goes GSM offline within 3 days. Apparently, this is a "feature" of the GSM network - the cell just kicks stationary transceiver out. So the firmware has to be adjusted to reload every midnight of something. Never managed to fix that so just using an 240V electronic timers to reboot it every 24h - not an ideal solution but it works fine. ๐Ÿ™‚

    And yes, sms feature would be very nice. As I have Particle Photon as part of my IOT, I did look at Electron breifly - https://store.particle.io/collections/electron
    The problem is that it is expensive, but the size and power consumption is very appealing


  • Admin

    @GertSanders said:

    Can someone confirm that there is a possibility to define a software serial port, also when loading the MySensors library into the sketch ?

    Not sure why you shouldn't be able to use soft-serial... You can also disable the usage of the regular UART by MySenosors here:
    https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/MyConfig.h#L53


  • Hardware Contributor

    I should have added this reply to this topic some time ago. But I now do have a working SMS node. As @hek mentioned I needed to use softserial.

    I added a corrected Adafruit library to the repository of MySensors, but this is mostly to get rid of compiling errors. Even with the non-corrected version of the FONA library directly from Adafruit, it is not a problem to use a SIM800L together with the MySensors library.

    The reason for my original post was quite simple: I was using too much SRAM. After pruning the arrays which hold the SMS messages, I was able to fit every thing within the default 2K RAM an normal Arduino has. So I was just a tad too ambitious when I started coding.

    The sketch I'm using now is added as an example on Openhardware.io in my project for the battery/ac capable board:

    https://www.openhardware.io/view/11/ACDCBatteries-capable-atmega328p-board#tabs-source



  • I have been thinking about it for a while. I think the GSM shield has to be on the controller. Firstly, it will keep the gateway/node code simple and secondly, it would allow any node to send an SMS. Obviously, in Domoticz blockly or LUA can be used for complex scenarios.


  • Hardware Contributor

    @alexsh1

    Having SMS capability on the controller makes sense if you assume this one wil always be available (network up and running).

    I built a node which allows other nodes to pass text to a GSM via SMS. From the GSM phone you can send SMS to the SMS-node, and it will pass on those SMS texts to other nodes.

    I'm writing up this topic for the meetup in Breda (correction: I will be writing my presentation next week).

    But I have node running like this. If my Internet goes down, I could then still send an SMS.

    I do need to find some code to check the presence of the controller (this is still missing in my arsenal of tricks).



  • @GertSanders I think there is a better chance that the controller is going to be online. I have a mini UPS on my RPi for example if there are no mains supply. I also have a device pinging the controller and if it is not responding sending the halt/reboot signal to the RPi.

    If your node is working an a universal GSM gateway, that's a different story though. But does it have a power (battery) backup in case there is a blackout ?


Log in to reply
 

Suggested Topics

52
Online

11.4k
Users

11.1k
Topics

112.6k
Posts