Tunnel – Switching of relays based on the MTX astronomical clock

¿Buscas alguna otra cosa?

Scenario details:

  • We want to switch a relay based on the sunrise and sunset to activate a lighting system
  • It is not possible to set a fixed time, as the time for sunrise/sunset depends on the location (sunrise/ sunset does not happen at the same time in Madrid than it does in Barcelona or Mexico DF) and on the time of year (sunrise/ sunset does not happen at the same time in Summer as it does in Winter). To do so, the modem MTX must be set up as an astronomical clock
  • We also want the lights to connect 30 minutes prior to sunset and disconnect 30 minutes after sunrise
  • The device location is the town of Cardedeu, with the GPS latitude: 41.6333 and longitude: 2.36667

Solution: MTX-Tunnel firmware + MTX-Java-IoT

EXAMPLE of settings (file config.txt) for such scenario:

Configuration Observations
MTX_pin: 0000
MTX_model: 199802407
MTX_mode: none
MTX_TPProtocol: ntp
MTX_TPServer: ntp.roa.es
MTX_TPServer2: es.pool.ntp.org
MTX_latitude: 41.6333
MTX_longtude: 2.36667
SMS_allPhones: on
SMS_ATEnabled: on
SMS_ATResponse: on
SMS_sendIP: on
GPRS_apn: movistar.es
GPRS_login: MOVISTAR
GPRS_password: MOVISTAR
GPRS_timeout: 1
OUTPUT_mode1: astronomical
OUTPUT_config1: -30;30
SIM Card PIN
MTX model
We do not want GPRS
Time synch. protocol
Time server (the MTX must sync the time)
Backup time server
GPS latitude
GPS longitude
All phones are allowed
IP by SMS authorized
AT by SMS allowed
SMS AT responses activated
APN GPRS provided by the GSM operator
GPRS login provided by the GSM operator
GPRS password provided by the GSM operator
The modem will not be permanently connected
OUTPUT 1 (relay 1) in function of Sun
Offset -30 minutes and 30 min

Details:

  • This scenario can also be combined with others that make simultaneous Serial/GPRS gateways to access serial devices (modbus or others), as well as others where MTX-Tunnel independently collects modbus records and sends them via JSON to a Web platform
  • As of the MTX-Tunnel v11.12 version, it is possible to use the command AT ^ MTXTUNNEL = SETIOMAINTENANCE, idGPIO, mode to establish a maintenance mode (mode = 1) in a specific output GPIO. When an output is in maintenance mode, the output does not obey the astronomical clock, but is managed by the command AT ^ MTXTUNNEL = SETIO, idGPIO, value