globalVar module

This module is imported from all the others and it stores the global variables and some global functions.

globalVar.getErrorTimeString()[source]

Called when an error occours ,return the current time and a progressive number of the error, incrementing the error_count. Used to send the error time and error_count to debug the software.

globalVar.getListPinsConfigByHardwareModel(hwName, pin_mode)[source]

Given hardware name and a pin mode , return a list containing the pin numbers that are configurated with that pin_mode

Parameters:
  • hwName

    The type of the hardware node for examples:

    • ProminiA
    • Plug6way
    • RouterGL
    • RouterGA
    • RouterRB
    • Any other hardware type added as hardwareModelDict key in globalVar.py
  • pin_mode

    The pin mode you are searching for:

    • sr_relay:
      Latch relay where the first pin in the tuple is set and the second is reset
    • digital_output:
      Output digital pins
    • digital_input :
      Input digital pins
    • analog_input :
      Analog input
    • servo_output :
      Servomotor control pin
    • analog_output :
      Pwm output pin
globalVar.getListUsedPinsByHardwareModel(hwName)[source]

Given an hardware name return a list with all the pins used by a hardware model

Parameters:hwName

The type of the harware node for examples:

  • ProminiA
  • Plug6way
  • RouterGL
  • RouterGA
  • RouterRB
  • Any other hardware type added as hardwareModelDict key in globalVar.py
globalVar.get_ip_address()[source]
globalVar.logprint(message, verbose=0, error_tuple=None)[source]

|Print the message passed and if the system is in debug mode or if the error is important send a mail |Remember, to clear syslog you could use : > /var/log/syslog |To read system log in openwrt type:logread