Tunnel – Activate a relay by voice call and by dry contact inputs to open the parking gate.

¿Buscas alguna otra cosa?

Scenario details:

  • You need to be able to operate a relay with a 5 second pulse to open a motorized garage door. Such activation needs to be done by voice call through a mobile phone
  • It should only be possible to operate the relay from the authorized telephone numbers: +34666123456, +34666123457 and +346661234568
  • It must also be possible to operate the relay to open the garage door through 2 buttons located inside the garage. That is, when one of these buttons is pressed, the relay that activates the garage door must pulse for 5 seconds, in the same way as when receiving a voice call.
  • Finally, both when receiving the call and when pressing the buttons, a luminaire must be activated for 60 seconds to allow good maneuverability for the vehicle driver

Solution: MTX-Tunnel firmware + MTX-IOT-S [4-N]

Configuration example (config.txt file) for the indicated scenario:

Configuration Observations
MTX_pin: 0000
MTX_model: 199802407
MTX_mode: none
>MTX_mode: 2g
MTX_defaultPrefix: +34
SMS_allPhones: off
SMS_validPhone1: +34666123456
SMS_validPhone2: +34666123457
SMS_validPhone3: +34666123458
SMS_atEnabled: on
SMS_atResponse: on
GPIO_mode0: output
GPIO_config0: timer
GPIO_mode1: input
GPIO_config1: at;AT^MTXTUNNEL=EXECUTE,doorlight.txt;
GPIO_mode2: input
GPIO_config2: at;AT^MTXTUNNEL=EXECUTE,doorlight.txt;
GPIO_mode8: input
GPIO_config8: call;AT^MTXTUNNEL=EXECUTE,light.txt
PIN if it has one
Device model
Gateways used
Mode to receive audio calls
Default prefix for national calls
Phone numbers
Phone number 1
Phone number 2
Phone number 3
Remote AT commands
Responses to AT commands
GPIO0 configured as an output
Configuration as temporized output
GPIO1 configured as an input
Configuration as AT input
GPIO2 configured as an input
Configuration as AT input
GPIO8 mandatory output (relay)
Configuration as call output  

Details:

  • The MTX-IOT-S family modems have up to 8 digital I / Os (from GPIO0 to GPIO7) and 1 integrated relay (GPIO8). The digital outputs are open collector type with sufficient current to switch an external relay. In this example 1 gpio has been configured as output (GPIO0) and gpios GPIO1 and GPIO2 as inputs. Obviously the GPIO8 that corresponds to an internal relay of the MTX, is compulsorily configured as an output
  • In this example GPIO8 (the internal relay of the MTX) is used for door control. The GPIO0, configured as an output, is the one used to activate an external control relay for the luminaire. GPIO0 and GPIO1 are inputs, used to control button 1 and button 2 respectively
  • GPIO_config0: timer. This configuration configures the GPIO0 as TIMER OUTPUT, that is, as a timed output
  • GPIO_config8: call; AT ^ MTXTUNNEL = EXECUTE, light.txt. This configuration configures the GPIO8 as OUTPUT CALL. This implies that when the MTX-IOT-S modem receives a voice call from an authorized telephone number, it will activate said GPIO8 output for 5 seconds. Additionally it will execute the command AT ^ MTXTUNNEL = EXECUTE, light.txt
  • What this command does is execute the file found in the atscripts / light.txt directory, which is made up of the AT commands to execute. Said atscripts / light.txt file must have the following content That is, the modem will execute these AT commands (there is actually only one). The command AT ^ MTXTUNNEL = SETOUTPUTTIMER, 7.60 will activate GPIO7 (the output connected to the luminaire) for 60 seconds (la salida conectada a la luminaria) durante 60 segundos.
  • GPIO_config1: at; AT ^ MTXTUNNEL = EXECUTE, doorlight.txt ;. This configuration configures GPIO1 as INPUT AT. This implies that when the MTX-IOT-S modem activates the GPIO1 input (which has button 1 connected, bringing that input to GND when pressed) it will execute the command AT ^ MTXTUNNEL = EXECUTE, doorlight.txt
    What this command does is execute the file found in the atscripts / doorlight.txt directory, which is made up of the AT commands to execute. Said atscripts / doorlight.txt file must have the following content:
    In other words, the modem will execute these two AT commands. The command AT ^ MTXTUNNEL = SETOUTPUTTIMER, 8.5 will activate GPIO8 (the output connected to the motorized door) for 5 seconds AT ^ MTXTUNNEL = SETOUTPUTTIMER, 7.60 will activate GPIO7 (the output connected to the luminaire) for 60 seconds
  • It is possible to modify the authorized phone numbers by sending an SMS message to the MTX modem. For this it is necessary to send an SMS message from an authorized phone number with the text, for example:
    mtxtunnel at^mtxtunnel=setparam,SMS_validPhone1,+34666333444
  • The previous header marked in red (mtxtunnel) can be customized with the text you want, for this see the configuration parameter SMS_header