def get_remote_meter_data(request, read_bytes)

      logger.debug "get_remote_meter_data #{request} from meter# #{meter_number}" unless logger.nil?

      # connect to the meter and check to make sure we connected
      begin

        socket = TCPSocket.new(remote_address, remote_port)
        @logger.debug "Socket open"

        # Send request to the meter
        @logger.debug "Request: #{request}"
        socket.write(request)

        # Receive a response of 255 bytes
        response = socket.read(read_bytes)
        @logger.debug "Socket response #{response.length}"
        @logger.debug response

      rescue Exception => ex
        @logger.error "Exception\n#{ex.message}\n#{ex.backtrace.join("\n")}"
      ensure
        # EKM Meter software sends this just before closing the connection, so we will too
        socket.write "\x0a\x03\x32\x3d"
        socket.close
        @logger.debug "Socket closed"
      end

      return response

    end
def get_remote_meter_data(request, read_bytes)

      logger.debug "get_remote_meter_data #{request} from meter# #{meter_number}" unless logger.nil?

      # connect to the meter and check to make sure we connected
      begin

        socket = TCPSocket.new(remote_address, remote_port)
        @logger.debug "Socket open"

        # Send request to the meter
        @logger.debug "Request: #{request}"
        socket.write(request)

        # Receive a response of 255 bytes
        response = socket.read(read_bytes)
        @logger.debug "Socket response #{response.length}"
        @logger.debug response

      rescue Exception => ex
        @logger.error "Exception\n#{ex.message}\n#{ex.backtrace.join("\n")}"
      ensure
        # EKM Meter software sends this just before closing the connection, so we will too
        socket.write "\x0a\x03\x32\x3d"
        socket.close
        @logger.debug "Socket closed"
      end

      return response

    end
Gets remote EKM meter data using iSerial defaults
   meter_number is the meters serial number. leading 0s not required.
   remote_address is the IP address of the ethernet-RS485 converter
   remote_port is the TCP port number the converter is listening to (50000 in my case)
 We do not check the checksum - I'm lazy.  Probably should. Running for 8 months, querying
 once per minute..I've encountered one or two bad results from the meter.