Бортовой компьютер для Опель Зафира.

viki13viki
Offline
Зарегистрирован: 14.11.2016

да вроде как рисует теперь сразу. но посмотрю сегодня после поездки, потому что когда мы создали last и reNew была такая проблемка, завел стою все прорисовывается, гуляю по страницам, все гуд, выезжаю, еду, переключаю на другую страницу а данные или вообще нету или частично. сегодня проверю, завтра скажу.

Sergei H.
Offline
Зарегистрирован: 17.11.2018


Подскажите пожалуйста,Вы как бы ближе по теме.Я всё пытаюсь свой БК доделать Obduino32. В общем собрал на ардуино нано и l9637d ,скетч не загружается когда нано подключена к l9637d. Отключаю всё нормально но на нано потом мигают светодиоды Rx, Tx одновременно.Может из-за того ,что у нано стоит CH340. При мигании светодиодов напряжение на TX,Rx падает c 4.8 вольта до 0,23вольта.

/* OBDuino32K  (Requires Atmega328 for your Arduino)


 Copyright (C) 2008-2010


 Main coding/ISO/ELM: Frederic (aka Magister on ecomodder.com)
 ISO Communication Protocol: Russ, Antony, Mike
 Features: Mike, Antony, Eimantas
 Bugs & Fixes: Antony, Fredric, Mike, Eimantas
 LCD bignum: Frederic based on mpguino code by Dave, Eimantas


Latest Changes
Jul 11th, 2011 (v197)
 Buzzer for speed limit (active)
 Buzzer for coolant temperature (every 1min)
 Key response fixes
 
Apr 06-12th, 2011 (v193-v195)
 Summary logging to separate file
 Single pid and data collection logging (see #define useSDCard section)
 Log buffering (one access to SD card takes ~170-200ms)
 Logging to SD card (base) HOWTO in forum page 68
 TANK/TRIP/OUTING trip counters
 
Apr 06th, 2011 (v192)
 Removed not used PID_Desc (saved ~1200bytes)
 Changed SI and US units selection - if disabled saves ~1300bytes
 
Apr 04th, 2011 (v190)
 ATTENTION! this update needed additional parameters saving to EEPROM, last tank data will be lost.


 ISO reinit
 Driving and idling times for each trip (could be used for average speed and other in future)
 Max speed PID for each trip (max MAF, RPM, LOAD planned)
 ISO init first delay changes: 300ms, 600ms, 1200ms, 2400ms, 4800ms, 300ms...


 BIG pid can be configured
 do_ISO_Reinit and skip_ISO_Init disabled by default
 carAlarmScreen disabled by default and allowed to disable it separetly
 Big font type could be changed without recompiling (~400bytes fonts + ~200bytes config)
  
Mar 29th, 2011 (v189)
 AutoSave after 30min while driving (disabled by default)
 Config timeout (10s by default, last changes always accepted) (~100 bytes used)
 Battery voltage PID for ISO 9141 (was only for ELM) see get_batteryvoltage() for wiring instructions
 ISO 9141 initialization code trim (128 bytes saved)
 Gallons and litres conversion changed without functions (234 bytes saved)
 calcTimeDiff modified according to <a data-cke-saved-href="http://www.arduino.cc/playground/Code/TimingRollover" href="http://www.arduino.cc/playground/Code/TimingRollover" rel="nofollow">http://www.arduino.cc/playground/Code/TimingRollover</a> (200 bytes saved)
 Bug fix in get_icons() smoothed vss was wrongly compared with toggle_speed 
Mar 10th, 2011
 Add smoothing of instant cons
Nov 7th, 2010
 Added Hybrid Big Num Screen for display AVG in Bigfont, and instant in small font in the corner
Oct 28th, 2010
 Changes to make BigNum fuctions work more fluently
September 14th, 2010:
 Different currency strings for different currencies.
 PIDs caching during same calculation cycle.
 Adjusting tank used fuel and distance.
September 6th, 2010:
 If ISO_Reinit is used added modification to skip startup init. 
   ISO_Reinit is used for first and all other initalizations
 ISO delay constants (10ms and 55ms) moved to define section.
   Lower values then allowed in specification works on some cars.
 LCD bignum
August 31st, 2010:
 ISO 9141 VW MK4 compatible
 Gasoline/LPG/Diesel support - constant in define section
 DTC read & clear improvement
 DTC read enable/disable on start
 DTC read & clear rebuild tested and working
 External temperature sensor like KTY81-210 support
 Saving TRIP data in ISO reinit mode after engine is turned off
 Turning off backlight in ISO reinit mode if RPM = 0
August 30th, 2010:
 Some LCD optimizations, formula for MAP, fix check_mil (untested)
June 9th, 2009:
 ISO 9141 re-init, ECU polling, Car alarm and other tweaks by Antony
June 24, 2009:
 Added three parameters to the mix, removed unrequired RPM call,
   added off and full to backlight levels, added waste PIDs: Antony
June 25, 2009:
 Use the metric parameter for fuel price and tank size: Antony
June 27, 2009:
 Minor corrections and tweaks: Antony
July 23, 2009:
 New menuing system for parameters, and got rid of display flicker: Antony
Sept 01, 2009:
 Better handling of 14230 protocol. Tweak in clear button routine: Antony
Sept 27, 2009:
 Correct four line LCD positioning: Nickdigger (via ecomodder.com)


To-Do:
  Bugs:
    1. Fix code to retrieve stored trouble codes.
       (2010.08.22 fixed in ISO, ELM not tested):
    2. Make the Menu response less clunky
  
  Features Requested:
    1. Aero-Drag calculations?
    2. SD Card logging:
      a) PID time limitations; loging format; analizing software or xls charts;
         logging pid selection; internal pid logging; real time clock; and other improvements.
       
    3. Add another Fake PID to track max values (Speed, RPM, Tank KM's, etc...)
    4. Add a "Score" PID, to rate you for a trip (Quickness, IdleTime, Fuel Used etc as factors)
    5. Allow config for L/100 or km/l
  
  Other:
    1. Trim the Code as we are aproaching the 30.7K limit.
      a) in config always save params (~200-300 bytes expected)
    2. Add a "dirty" flag to tank data when the obduino detects that it has been
        disconnected from the car to indicate that the data may no longer be complete
    3. Config menu optimization (one universal function for all items)




 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any later
 version.


 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


 You should have received a copy of the GNU General Public License along with
 this program; if not, write to the Free Software Foundation, Inc.,
 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
 */


// Some source about fuel/air ratio mixtures: <a data-cke-saved-href="http://www.apvgn.pt/documentacao/iangv_rep_part2.pdf" href="http://www.apvgn.pt/documentacao/iangv_rep_part2.pdf" rel="nofollow">http://www.apvgn.pt/documentacao/iangv_rep_part2.pdf</a>


/**************************/
/* GASOLINE ENGINE CONFIG */
/**************************/
// [CONFIRMED] For gas car use 3355 (1/14.7/730*3600)*10000
#define GasConst 3355 
#define GasMafConst 107310 // 14.7*730*10


/************************/
/* LPG ENGINE CONFIG    */
/************************/
//LPG mass/volume is 520-580gr/ltr depending on propane/butane mix


// LPG/air ratio: 
// 15.8:1 if 50/50 propane/butate is used
// 15:1 if 100 propane is used
// 15.4 if 60/40 propane/butane is used
// experiments shows that something in middle should be used eg. 15.4:1 :)


// [TEST PROGRESS] For lpg(summer >20C) car use 4412 (1/15.4/540*3600)*10000
//#define GasConst 4329
//#define GasMafConst 83160  // 15.4*540*10 = 83160


/************************/
/* DIESEL ENGINE CONFIG */
/************************/
// [NOT TESTED] For diesel car use ??? (1/??/830*3600)*10000
//#define GasConst ????
//#define GasMafConst ???   // ??*830*10




// Compilation modifiers:
// The following will cause the compiler to add or remove features from the OBDuino build this keeps the
// build size down, will not allow 'on the fly' changes. Some features are dependant on other features.


// Comment out to disable big numebers (4th and 5th sceeens)
#define use_BIG_font


// Comment for normal build
// Uncomment for a debug build
//#define DEBUG


// Comment for normal output build
// Uncomment for a debug output build
//#define DEBUGOutput


// Comment to disable auto-save 
// Uncoment to enable auto-save after 30min (disabled in debug mode)
// EEPROM has limited write cycles 100.000 (probably more) and 
// saving more often could affect EEPROM, feel free to disable
//#define AutoSave


// Comment to use MC33290 ISO K line chip
// Uncomment to use ELM327
//#define ELM


// Comment out to use only the ISO 9141 K line
// Uncomment to also use the ISO 9141 L line
// This option requires additional wiring to function!
// Most newer cars do NOT require this
//#define useL_Line


// Uncomment only one of the below init sequences if using ISO
#define ISO_9141
//#define ISO_14230_fast
//#define ISO_14230_slow


// Define delay between ISO request bytes (min 5ms, max 20ms) slower is faster refresh rate. By default 10ms.
// 5ms gives 8.2pids/s, 10ms gives 6.6pids/s
// On some cars 1ms works fine, it will just poll the ECU until it is ready.
#define ISORequestByteDelay 5


// Define delay between ISO requests (min 55ms, max 5000ms) slower is faster refresh rate. By default 55ms.
// Some cars works with <55ms (faster refresh rate)
// ON VW MK4 1ms works fine (but is same as 10ms)
// Fasted PID read rate is 19-20pids/s
// Discusion about lower values then allowed in ISO9141 specification is in forum page 59-60


// This delay also affects config menu behaviour, because in accu_trip() minimum 3 pids are readed
// we get 3x55ms=165ms gap in ACCU_WAIT frame then buttons are inactive. 
// Need to minimize PID read delay or increase ACCU_WAIT for better config menu response.
#define ISORequestDelay 55


// Comment out to just try the PIDs without need to find ECU
// Uncomment to use ECU polling to see if car is On or Off
#define useECUState


// Uncomment to "disconnect" from ECU if RPM is 0 (set ECU state to off) 
// because VW (maybe others) keeps responding some time after turning car off, 
// but if engine is restarted - fails
// Comment out to disable 
// DEFAULT: commented
#define DisconnectECUIfRPMIsZero


// Comment out if ISO 9141 does not need to reinit
// Uncomment define below to force reinitialization of ISO 9141 after no ECU communication
// this requires ECU polling
// DEFAULT: commented
#define do_ISO_Reinit 


// Comment out if ISO 9141 initialization should be done on first startup
// Uncomment define below to skip initialization of ISO 9141 after first startup, initialization will be done in ISO_Reinit mode
// DEFAULT: commented
#define skip_ISO_Init 


// Comment out to use the PID screen when the car is off (This will interfere with ISO reinit process)
// Uncomment to use the Car Alarm Screen when the car is off
// DEFAULT: commented
//#define carAlarmScreen


// Comment out to disable trip data saving after engine is off and RPM = 0
// Uncomment to save trip data after engine is off and RPM = 0
// DEFAULT: uncommented
#define SaveTripDataAfterEngineTurnOff


// Comment out to read DTC on OBDuino start.
// Uncomment to disable DTC read.
// DEFAULT: commented
#define DisableDTCReadOnStart


// Comment out to do not use temperature sensor
// Uncomment to use temperature sensor
// DEFAULT: commented
#define UseInsideTemperatureSensor
#define UseOutsideTemperatureSensor
#define TemperatureSensorTypeKTY81_210


// Comment out to do not use voltage sensor
// Uncomment to use voltage sensor
// DEFAULT: commented
#define BatteryVoltageSensor


// Define currency symbols 
#define CurrencyPrintString "$%s"
//#define CurrencyPrintString "%s Lt"


#define CurrencyAdjustString "- $%s +  "
//#define CurrencyAdjustString "- %s Lt +"


// Uncomment to use PIDs cache, 
// it makes faster refresh rate in ISO mode, but uses ~200bytes of memory
// DEFAULT: uncommented
#define UsePIDCache


#ifdef DEBUG
 #undef do_ISO_Reinit
 #undef skip_ISO_Init 
#endif


// Uncoment to enable changing metric to US system
// If commented - saves 1300bytes in metric, and 600bytes in US
// DEFAULT: uncommented
#define AllowChangeUnits
#ifndef AllowChangeUnits
  #define UseSI
//  #define UseUS
#endif


// Uncoment to use buzzer for speed limits or other notification
// Wiring for buzzer with oscilator
// 5V ------------- 2N3906 --- (+)Buzzer(-) ---- 0V(GND)
//                    |
//                   220hm
//                    |
//                    A1 (analog pin)
// DEFAULT: commented
//#define UseBuzzer


#ifdef UseBuzzer
 #define BuzzerPin 15


  // Speed limit 60kmh, will trigger buzzer once on SpeedLimit (60kmh)
  #define SpeedLimit 60 
//  bool SpeedLimitReached = false;  //UNCOMENT if UseBuzzer


  // Coolant temperature limit 100C, will trigger buzzer if limit reached (every 1min)
  #define CoolantTemperatureLimit 100
//  unsigned long old_time_system_check; UNCOMENT if UseBuzzer:
#endif


#undef int
#include <stdio.h>
#include <limits.h>
#include <avr/eeprom.h>
#include <avr/pgmspace.h>


#include <LiquidCrystal.h>


#define LCD_RS 10
#define LCD_ENABLE 9


#define LCD_DATA1 8
#define LCD_DATA2 7
#define LCD_DATA3 6
#define LCD_DATA4 5


// Uncomment to use SD card logging, 
// need uncomment "#include <FileLogger.h>" too (few lines bellow) and "static char logString[logBufferSize] = {0};"
// arduino0022 is messing up with #include and static variables within #ifdef ... #endif


//#define useSDCard 


#ifdef useSDCard
  // NOTE: some cards must be formated with not Windows, 
  // but <a data-cke-saved-href="http://panasonic.jp/support/global/cs/sd/download/index.html" href="http://panasonic.jp/support/global/cs/sd/download/index.html" rel="nofollow">http://panasonic.jp/support/global/cs/sd/download/index.html</a> or others.
  
  // <a data-cke-saved-href="http://code.google.com/p/arduino-filelogger/" href="http://code.google.com/p/arduino-filelogger/" rel="nofollow">http://code.google.com/p/arduino-filelogger/</a>
//  #include <FileLogger.h>
  
  // PIDs and data collections goes to "data.log"
  //#define logEveryPid
  #define logDataCollections
  
  // Summary goes to "summary.log" (must be created in SD card but space for data log has to be continuous)
  #define logTripSummary


  // Choose only one type and at least one
  // Type logTypeSystem is more compact, uses less memory, 
  // but need some additional application for analizing
  //#define logTypeVerbose
  #define logTypeSystem
  
  // for faster writing need buffer, bigger is better, but 512 is maximum
  // if memory ussage is too big - reduce size
  #define logBufferSize 256
//  static char logString[logBufferSize] = {0};


  
  // Need to change LCD data pins 12 and 13 (rewire also)
  #define LCD_DATA3 2
  #define LCD_DATA4 3
  
  // wiring instructions:
  // <a data-cke-saved-href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/all" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/all" rel="nofollow">http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/all</a>
  // SCK_PIN   13 <-> SD 5 SCK    DIVIDER (1.8kOhm, 3.3kOhm) or (2.2kOhm, 3.9kOhm) or similar
  // MISO_PIN  12 <-> SD 7 DO     DIRECT
  // MOSI_PIN  11 <-> SD 2 DI     DIVIDER (1.8kOhm, 3.3kOhm) or (2.2kOhm, 3.9kOhm) or similar
  // SS_PIN    10 <-> SD 1 CS     DIVIDER (1.8kOhm, 3.3kOhm) or (2.2kOhm, 3.9kOhm) or similar
  // 3.3V         <-> SD 4 VCC    DIRECT
  // GND          <-> SD 3 GND    DIRECT
  // GND          <-> SD 6 GND1   DIRECT
#endif  


// LCD Pins same as mpguino
// rs=4, enable=5, data=7,8,12,13
LiquidCrystal lcd(LCD_RS, LCD_ENABLE, LCD_DATA1, LCD_DATA2, LCD_DATA3, LCD_DATA4);
#define ContrastPin 11
#define BrightnessPin 3


// LCD prototypes
void lcd_print_P(char *string);  // to work with string in flash and PSTR()
void lcd_cls_print_P(char *string);  // clear screen and display string
void lcd_char_init();


#ifdef use_BIG_font
void lcd_char_bignum();
void bigNum(char *txt, char *txt1);
#endif


// Memory prototypes
void params_load(void);
void params_save(void);


// Others prototypes
byte menu_selection(char ** menu, byte arraySize);
byte menu_select_yes_no(byte p);
void long_to_dec_str(long value, char *decs, byte prec);
int memoryTest(void);
void test_buttons(void);
void get_cost(char *retbuf, byte ctrip);


#define KEY_WAIT 200       // Wait for potential other key press //Was 1000, but 200 works better
#define ACCU_WAIT 1000     // Only accumulate data so often.
#define BUTTON_DELAY 100   // Not in use any more. Was 125, but 100 works better
#define MENU_TIMEOUT 5000 // Wait 10s and close config menu if no key is pressed


#ifdef UseOutsideTemperatureSensor
  #define OutsideTemperaturePin 15 // Inside temperature sensor, on analog 1
#endif


#ifdef UseInsideTemperatureSensor
  #define InsideTemperaturePin 16 // Inside temperature sensor, on analog 2
#endif


#ifdef BatteryVoltageSensor
  #define BatteryVoltagePin 14 // Battery voltage sensor, on analog 0
#endif


// use analog pins as digital pins for buttons
#define lbuttonPin 17 // Left Button, on analog 3
#define mbuttonPin 18 // Middle Button, on analog 4
#define rbuttonPin 19 // Right Button, on analog 5


#define lbuttonBit 8 //  pin17 is a bitmask 8 on port C
#define mbuttonBit 16 // pin18 is a bitmask 16 on port C
#define rbuttonBit 32 // pin19 is a bitmask 32 on port C
#define buttonsUp 0 // start with the buttons in the 'not pressed' state


byte buttonState = buttonsUp;


// Easy to read macros
#define LEFT_BUTTON_PRESSED   (buttonState&lbuttonBit)
#define MIDDLE_BUTTON_PRESSED (buttonState&mbuttonBit)
#define RIGHT_BUTTON_PRESSED  (buttonState&rbuttonBit)


#define brightnessLength 7 //array size
const byte brightness[brightnessLength]={
   0xFF,
   0xFF/(brightnessLength+10)*(brightnessLength+10-1), // in night needs more darker
   0xFF/brightnessLength*(brightnessLength-1),
   0xFF/brightnessLength*(brightnessLength-2),
   0xFF/brightnessLength*(brightnessLength-4),
   0xFF/brightnessLength*(brightnessLength-5),
   0x00}; // right button cycles through these brightness settings (off to on full)
byte brightnessIdx=2;


/* LCD Display parameters */
/* Adjust LCD_COLS or LCD_ROWS if LCD is different than 16 characters by 2 rows*/
// Note: Not currently tested on display larger than 16x2


// How many rows of characters for the LCD (must be at least two)
#define LCD_ROWS      2
// How many characters across for the LCD (must be at least sixteen)
#define LCD_COLS      16
// Calculate the middle point of the LCD display width
#define LCD_SPLIT    (LCD_COLS / 2)
//Calculate how many PIDs fit on a data screen (two per line)
#define LCD_PID_COUNT  (LCD_ROWS * 2)


/* PID stuff */


unsigned long  pid01to20_support;  // this one always initialized at setup()
unsigned long  pid21to40_support=0;
unsigned long  pid41to60_support=0;
#define PID_SUPPORT00 0x00
#define MIL_CODE      0x01
#define FREEZE_DTC    0x02
#define FUEL_STATUS   0x03
#define LOAD_VALUE    0x04
#define COOLANT_TEMP  0x05
#define STFT_BANK1    0x06
#define LTFT_BANK1    0x07
#define STFT_BANK2    0x08
#define LTFT_BANK2    0x09
#define FUEL_PRESSURE 0x0A
#define MAN_PRESSURE  0x0B
#define ENGINE_RPM    0x0C
#define VEHICLE_SPEED 0x0D
#define TIMING_ADV    0x0E
#define INT_AIR_TEMP  0x0F
#define MAF_AIR_FLOW  0x10
#define THROTTLE_POS  0x11
#define SEC_AIR_STAT  0x12
#define OXY_SENSORS1  0x13
#define B1S1_O2_V     0x14
#define B1S2_O2_V     0x15
#define B1S3_O2_V     0x16
#define B1S4_O2_V     0x17
#define B2S1_O2_V     0x18
#define B2S2_O2_V     0x19
#define B2S3_O2_V     0x1A
#define B2S4_O2_V     0x1B
#define OBD_STD       0x1C
#define OXY_SENSORS2  0x1D
#define AUX_INPUT     0x1E
#define RUNTIME_START 0x1F
#define PID_SUPPORT20 0x20
#define DIST_MIL_ON   0x21
#define FUEL_RAIL_P   0x22
#define FUEL_RAIL_DIESEL 0x23
#define O2S1_WR_V     0x24
#define O2S2_WR_V     0x25
#define O2S3_WR_V     0x26
#define O2S4_WR_V     0x27
#define O2S5_WR_V     0x28
#define O2S6_WR_V     0x29
#define O2S7_WR_V     0x2A
#define O2S8_WR_V     0x2B
#define EGR           0x2C
#define EGR_ERROR     0x2D
#define EVAP_PURGE    0x2E
#define FUEL_LEVEL    0x2F
#define WARM_UPS      0x30
#define DIST_MIL_CLR  0x31
#define EVAP_PRESSURE 0x32
#define BARO_PRESSURE 0x33
#define O2S1_WR_C     0x34
#define O2S2_WR_C     0x35
#define O2S3_WR_C     0x36
#define O2S4_WR_C     0x37
#define O2S5_WR_C     0x38
#define O2S6_WR_C     0x39
#define O2S7_WR_C     0x3A
#define O2S8_WR_C     0x3B
#define CAT_TEMP_B1S1 0x3C
#define CAT_TEMP_B2S1 0x3D
#define CAT_TEMP_B1S2 0x3E
#define CAT_TEMP_B2S2 0x3F
#define PID_SUPPORT40 0x40
#define MONITOR_STAT  0x41
#define CTRL_MOD_V    0x42
#define ABS_LOAD_VAL  0x43
#define CMD_EQUIV_R   0x44
#define REL_THR_POS   0x45
#define AMBIENT_TEMP  0x46
#define ABS_THR_POS_B 0x47
#define ABS_THR_POS_C 0x48
#define ACCEL_PEDAL_D 0x49
#define ACCEL_PEDAL_E 0x4A
#define ACCEL_PEDAL_F 0x4B
#define CMD_THR_ACTU  0x4C
#define TIME_MIL_ON   0x4D
#define TIME_MIL_CLR  0x4E
//
//
#define FUEL_TYPE     0x51
#define ETHYL_FUEL    0x52


#define LAST_PID      0x52  // same as the last one defined above


/* our internal fake PIDs */


#define FIRST_FAKE_PID 0xDE // same as the first one defined below


#define OUTING_MAX_VSS    0xDE
#define TRIP_MAX_VSS      0xDF
#define TANK_MAX_VSS      0xE0
#define OUTING_IDLE_TIME  0xE1
#define TRIP_IDLE_TIME    0xE2
#define TANK_IDLE_TIME    0xE3
#define OUTING_DRIVE_TIME 0xE4
#define TRIP_DRIVE_TIME   0xE5
#define TANK_DRIVE_TIME   0xE6


#define OUTSIDE_TEMP  0xE7    // temperature outside the car
#define INSIDE_TEMP   0xE8    // temperature inside the car


#define OUTING_WASTE  0xE9    // fuel wasted since car started
#define TRIP_WASTE    0xEA    // fuel wasted during trip
#define TANK_WASTE    0xEB    // fuel wasted for this tank
#define OUTING_COST   0xEC    // the money spent since car started
#define TRIP_COST     0xED    // money spent since on trip
#define TANK_COST     0xEE    // money spent of current tank
#define ENGINE_ON     0xEF    // The length of time car has been running.
#define NO_DISPLAY    0xF0
#define FUEL_CONS     0xF1    // instant cons
#define TANK_CONS     0xF2    // average cons of tank
#define TANK_FUEL     0xF3    // fuel used in tank
#define TANK_DIST     0xF4    // distance for tank
#define REMAIN_DIST   0xF5    // remaining distance of tank
#define TRIP_CONS     0xF6    // average cons of trip
#define TRIP_FUEL     0xF7    // fuel used in trip
#define TRIP_DIST     0xF8    // distance of trip
#define BATT_VOLTAGE  0xF9
#define OUTING_CONS   0xFA    // cons since the engine turned on
#define OUTING_FUEL   0xFB    // fuel used since engine turned on
#define OUTING_DIST   0xFC    // distance since engine turned on
#define CAN_STATUS    0xFD
#define PID_SEC       0xFE
#ifdef DEBUG                  //why waste a valueable PID space!!
#define FREE_MEM      0xFF
#else
#define ECO_VISUAL    0xFF   // Visually dispay relative economy with text (at end of program)
#endif


//The Textual Description of each PID
prog_char PID_Desc[(1+LAST_PID)+(0xFF-FIRST_FAKE_PID)+1][9] PROGMEM=
{
"PID00-21", // 0x00   PIDs supported
"Stat DTC", // 0x01   Monitor status since DTCs cleared.
"Frz DTC",  // 0x02   Freeze DTC
"Fuel SS",  // 0x03   Fuel system status
"Eng Load", // 0x04   Calculated engine load value
"CoolantT", // 0x05   Engine coolant temperature
"ST F%T 1", // 0x06   Short term fuel % trim Bank 1
"LT F%T 1", // 0x07   Long term fuel % trim Bank 1
"ST F%T 2", // 0x08   Short term fuel % trim Bank 2
"LT F%T 2", // 0x09   Long term fuel % trim Bank 2
"Fuel Prs", // 0x0A   Fuel pressure
"  MAP  ",  // 0x0B   Intake manifold absolute pressure
"  RPM  ",  // 0x0C   Engine RPM
" Speed ",  // 0x0D   Vehicle speed
"Timing A", // 0x0E   Timing advance
"Intake T", // 0x0F   Intake air temperature
"MAF rate", // 0x10   MAF air flow rate
"Throttle", // 0x11   Throttle position
"Cmd SAS",  // 0x12   Commanded secondary air status
"Oxy Sens", // 0x13   Oxygen sensors present
"Oxy B1S1", // 0x14   Oxygen Sensor Bank 1, Sensor 1
"Oxy B1S2", // 0x15   Oxygen Sensor Bank 1, Sensor 2
"Oxy B1S3", // 0x16   Oxygen Sensor Bank 1, Sensor 3
"Oxy B1S4", // 0x17   Oxygen Sensor Bank 1, Sensor 4
"Oxy B2S1", // 0x18   Oxygen Sensor Bank 2, Sensor 1
"Oxy B2S2", // 0x19   Oxygen Sensor Bank 2, Sensor 2
"Oxy B2S3", // 0x1A   Oxygen Sensor Bank 2, Sensor 3
"Oxy B2S4", // 0x1B   Oxygen Sensor Bank 2, Sensor 4
"OBD Std",  // 0x1C   OBD standards this vehicle conforms to
"Oxy Sens", // 0x1D   Oxygen sensors present
"AuxInpt",  // 0x1E   Auxiliary input status
"Run Time", // 0x1F   Run time since engine start
"PID21-40", // 0x20   PIDs supported 21-40
"Dist MIL", // 0x21   Distance traveled with malfunction indicator lamp (MIL) on
"FRP RMF",  // 0x22   Fuel Rail Pressure (relative to manifold vacuum)
"FRP Dies", // 0x23   Fuel Rail Pressure (diesel)
"OxyS1 V",  // 0x24   O2S1_WR_lambda(1): ER Voltage
"OxyS2 V",  // 0x25   O2S2_WR_lambda(1): ER Voltage
"OxyS3 V",  // 0x26   O2S3_WR_lambda(1): ER Voltage
"OxyS4 V",  // 0x27   O2S4_WR_lambda(1): ER Voltage
"OxyS5 V",  // 0x28   O2S5_WR_lambda(1): ER Voltage
"OxyS6 V",  // 0x29   O2S6_WR_lambda(1): ER Voltage
"OxyS7 V",  // 0x2A   O2S7_WR_lambda(1): ER Voltage
"OxyS8 V",  // 0x2B   O2S8_WR_lambda(1): ER Voltage
"Cmd EGR",  // 0x2C   Commanded EGR
"EGR Err",  // 0x2D   EGR Error
"Cmd EP",   // 0x2E   Commanded evaporative purge
"Fuel LI",  // 0x2F   Fuel Level Input
"WarmupCC", // 0x30   # of warm-ups since codes cleared
"Dist CC",  // 0x31   Distance traveled since codes cleared
"Evap SVP", // 0x32   Evap. System Vapor Pressure
"Barometr", // 0x33   Barometric pressure
"OxyS1 C",  // 0x34   O2S1_WR_lambda(1): ER Current
"OxyS2 C",  // 0x35   O2S2_WR_lambda(1): ER Current
"OxyS3 C",  // 0x36   O2S3_WR_lambda(1): ER Current
"OxyS4 C",  // 0x37   O2S4_WR_lambda(1): ER Current
"OxyS5 C",  // 0x38   O2S5_WR_lambda(1): ER Current
"OxyS6 C",  // 0x39   O2S6_WR_lambda(1): ER Current
"OxyS7 C",  // 0x3A   O2S7_WR_lambda(1): ER Current
"OxyS8 C",  // 0x3B   O2S8_WR_lambda(1): ER Current
"C T B1S1", // 0x3C   Catalyst Temperature Bank 1 Sensor 1
"C T B1S2", // 0x3D   Catalyst Temperature Bank 1 Sensor 2
"C T B2S1", // 0x3E   Catalyst Temperature Bank 2 Sensor 1
"C T B2S2", // 0x3F   Catalyst Temperature Bank 2 Sensor 2
"PID41-60", // 0x40   PIDs supported 41-60
" MStDC",   // 0x41   Monitor status this drive cycle
"Ctrl M V", // 0x42   Control module voltage
"Abs L V",  // 0x43   Absolute load value
"Cmd E R",  // 0x44   Command equivalence ratio
"R ThrotP", // 0x45   Relative throttle position
"Amb Temp", // 0x46   Ambient air temperature
"Acc PP B", // 0x47   Absolute throttle position B
"Acc PP C", // 0x48   Absolute throttle position C
"Acc PP D", // 0x49   Accelerator pedal position D
"Acc PP E", // 0x4A   Accelerator pedal position E
"Acc PP F", // 0x4B   Accelerator pedal position F
"Cmd T A",  // 0x4C   Commanded throttle actuator
"T MIL On", // 0x4D   Time run with MIL on
"T TC Crl", // 0x4E   Time since trouble codes cleared
"  0x4F",   // 0x4F   Unknown
"  0x50",   // 0x50   Unknown
"Fuel Typ", // 0x51   Fuel Type
"Ethyl F%", // 0x52   Ethanol fuel %


"Out MVSS", // 0xDE
"Trp MVSS", // 0xDF
"Tnk MVSS", // 0xE0
"Out Idle", // 0xE1
"Trp Idle", // 0xE2
"Tnk Idle", // 0xE3
"OutDrive", // 0xE4
"TrpDrive", // 0xE5
"TnkDrive", // 0xE6


"OutsideT", // 0xE7   temperature outside car
"Inside T", // 0xE8   temperature inside car


"OutWaste", // 0xE9   outing waste
"TrpWaste", // 0xEA   trip waste
"TnkWaste", // 0xEB   tank waste
"Out Cost", // 0xEC   outing cost
"Trp Cost", // 0xED   trip cost
"Tnk Cost", // 0xEE   tank cost
"Out Time", // 0xEF   The length of time car has been running
"No Disp",  // 0xF0   No display
"InstCons", // 0xF1   instant cons
"Tnk Cons", // 0xF2   average cons of tank
"Tnk Fuel", // 0xF3   fuel used in tank
"Tnk Dist", // 0xF4   distance for tank
"Dist2MT",  // 0xF5   remaining distance of tank
"Trp Cons", // 0xF6   average cons of trip
"Trp Fuel", // 0xF7   fuel used in trip
"Trp Dist", // 0xF8   distance of trip
"Batt Vlt", // 0xF9   Battery Voltage
"Out Cons", // 0xFA   cons since the engine turned on
"Out Fuel", // 0xFB   fuel used since engine turned on
"Out Dist", // 0xFC   distance since engine turned on
"Can Stat", // 0xFD   Can Status
"PID_SEC",  // 0xFE
"Eco Vis"  // 0xFF   Visually dispay relative economy with text
};


const prog_char obd_std_strings[17][9] PROGMEM =
{
/*00*/	/*{ "" },*/ 	{ "OBD2CARB" }, { "OBDEPA" }, { "OBDEPA&2" },
/*04*/  { "OBD1" }, 	{ "NO OBD"   },	{ "EOBD" },   { "EOBD&2" },
/*08*/  { "EOBD&EPA" }, { "E&EPA&2"  }, { "JOBD" },   { "JOBD&2" },
/*0C*/  { "J&EOBD"   }, { "J&EOBD&2" }, { "EURO4B1" }, { "EURO5B2" },
/*10*/  { "EURO C"   }, { "EMD" }
};


// returned length of the PID response.
// constants so put in flash
prog_uchar pid_reslen[] PROGMEM=
{
  // pid 0x00 to 0x1F
  4,4,2,2,1,1,1,1,1,1,1,1,2,1,1,1,
  2,1,1,1,2,2,2,2,2,2,2,2,1,1,1,4,


  // pid 0x20 to 0x3F
  4,2,2,2,4,4,4,4,4,4,4,4,1,1,1,1,
  1,2,2,1,4,4,4,4,4,4,4,4,2,2,2,2,


  // pid 0x40 to 0x4E
  4,8,2,2,2,1,1,1,1,1,1,1,1,2,2
};


// Number of screens of PIDs
#define NBSCREEN  3  // 12 PIDs should be enough for everyone


#ifdef use_BIG_font
#define BIG_NBSCREEN 2
#else
#define BIG_NBSCREEN 2
#endif


byte active_screen=0;  // 0,1,2,... selected by left button


prog_char pctd[] PROGMEM="- %d + "; // used in a couple of place
prog_char pctdpctpct[] PROGMEM="- %d%% + "; // used in a couple of place
prog_char pctspcts[] PROGMEM="%s %s"; // used in a couple of place
prog_char pctldpcts[] PROGMEM="%ld %s"; // used in a couple of place
prog_char select_no[]  PROGMEM="(NO) YES "; // for config menu
prog_char select_yes[] PROGMEM=" NO (YES)"; // for config menu
prog_char gasPrice[][10] PROGMEM={"-  %s\354 + ", CurrencyAdjustString}; // dual string for fuel price
prog_char noDTCcodes[] PROGMEM="No DTC codes"; // for MIL




// menu items used by menu_selection.
prog_char *topMenu[] PROGMEM = {"Configure menu", "Exit", "Display", "Adjust", "PIDs", "Clear DTC"};
prog_char *displayMenu[] PROGMEM = {"Display menu", "Exit", "Contrast", "Metric", "Fuel/Hour", "Font"};
prog_char *adjustMenu[] PROGMEM = {"Adjust menu", "Exit", "Tank Size", "Fuel Cost", "Fuel %", "Speed %", "Out Wait", "Trip Wait", "Tank Used", "Tank Dist", "Eng Disp", };
prog_char *PIDMenu[] PROGMEM = {"PID Screen menu", "Exit", "Scr 1", "Scr 2", "Scr 3", "Big 1", "Big 2"};


#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))


// Time information
#define MILLIS_PER_HOUR    3600000L
#define MILLIS_PER_MINUTE    60000L
#define MILLIS_PER_SECOND     1000L


// to differenciate trips
#define TANK         0
#define TRIP         1
#define OUTING       2  //Tracks your current outing
#define NBTRIP       3


prog_char * tripNames[NBTRIP] PROGMEM =
{
  "Tank",
  "Trip",
  "Outing"
};


// parameters
// each trip contains fuel used and distance done
typedef struct
{
  unsigned long dist;   // in cm
  unsigned long fuel;   // in uL
  unsigned long waste;  // in uL
}
trip_t;


// saving trip max data and time  
typedef struct
{
  unsigned char maxspeed;    // in km/h
  unsigned int maxrpm;       // in rpm 
  unsigned char maxmaf;      // in g


  unsigned char counter;     // in #
  
  unsigned long timedriving; // in ms
  unsigned long timeidling;  // in ms
}
trip_max;


// each screen contains n PIDs (two per line)
typedef struct
{
  byte PID[LCD_PID_COUNT];
}
screen_t;


#define MINUTES_GRANULARITY 10


typedef struct
{
  byte contrast;       // we only use 0-100 value in step 20
  byte use_metric;     // 0=rods and hogshead, 1=SI
  boolean use_comma;   // When using metric, also use the comma decimal separator
  byte per_hour_speed; // speed from which we toggle to fuel/hour (km/h or mph)
  byte fuel_adjust;    // because of variation from car to car, temperature, etc
  byte speed_adjust;   // because of variation from car to car, tire size, etc
  byte eng_dis;        // engine displacement in dL
  unsigned int gas_price; // price per unit of fuel in 10th of cents. 905 = $0.905
  unsigned int  tank_size;   // tank size in dL or dgal depending of unit
  byte OutingStopOver; // Allowable stop over time (in tens of minutes). Exceeding time starts a new outing.
  byte TripStopOver;   // Allowable stop over time (in hours). Exceeding time starts a new outing.
  trip_t trip[NBTRIP];        // trip0=tank, trip1=a trip, trip2=outing
  trip_max tripmax[NBTRIP];   // trip0=tank, trip1=a trip, trip2=outing
  screen_t screen[NBSCREEN + BIG_NBSCREEN];  // screen
  byte BigFontType;    // Posible values: 0 - 2x2_alpha; 1 - 2x2_beta; 2 - 2x3.
  byte MetricDisplayType; // Possible values: 0 - l/100km; 1 - km/l. //reserved place for future development
}
params_t;


// parameters default values
params_t params=
{
  40, // 40 does not work with some LCD, or some misterious problem so try 0 if it does not work
  1,
  true,
  20,
  100,
  100,
  15,
  1090,
  450,   
  6, // 60 minutes (6 X 10) stop or less will not cause outing reset
  12, // 12 hour stop or less will not cause trip reset
  {
    { 0,0,0 }, // tank:  dist, fuel, waste
    { 0,0,0 }, // trip:  dist, fuel, waste
    { 0,0,0 }  // outing:dist, fuel, waste
  },
  {
    { 0,0,0,0, 0,0 }, // tank:  speed,rpm,maf; trip count; time driving, time idling
    { 0,0,0,0, 0,0 }, // trip:  speed,rpm,maf; trip count; time driving, time idling
    { 0,0,0,0, 0,0 }  // outing:speed,rpm,maf; trip count; time driving, time idling
  },
  {
    { {FUEL_CONS,LOAD_VALUE,TANK_CONS,OUTING_FUEL
       #if LCD_ROWS == 4
         ,OUTING_WASTE,OUTING_COST,ENGINE_ON,LOAD_VALUE
       #endif
       } },
    { {TRIP_CONS,TRIP_DIST,TRIP_FUEL,COOLANT_TEMP
       #if LCD_ROWS == 4
         ,TRIP_WASTE,TRIP_COST,INT_AIR_TEMP,THROTTLE_POS
       #endif
       } },
    { {TANK_CONS,TANK_DIST,TANK_FUEL,REMAIN_DIST
       #if LCD_ROWS == 4
         ,TANK_WASTE,TANK_COST,ENGINE_RPM,VEHICLE_SPEED
       #endif
       } },
    { {FUEL_CONS,NO_DISPLAY,NO_DISPLAY,NO_DISPLAY
       #if LCD_ROWS == 4
         ,NO_DISPLAY,NO_DISPLAY,NO_DISPLAY,NO_DISPLAY
       #endif
       } },      
    { {ENGINE_RPM,FUEL_CONS,NO_DISPLAY,NO_DISPLAY
       #if LCD_ROWS == 4
         ,NO_DISPLAY,NO_DISPLAY,NO_DISPLAY,NO_DISPLAY
       #endif
       } }      
  },
  0, //BigFontType
  0 //MetricDisplayType
};


prog_char *econ_Visual[] PROGMEM=
{
  "Yuck!!8{",
  "Aweful:(",
  "Poor  :[",
  "OK    :|",
  "Good  :]",
  "Great :)",
  "Adroit:D",
  "HyprM 8D"
};


#define STRLEN  40


#ifdef ELM
#define NUL     '\0'
#define CR      '\r'  // carriage return = 0x0d = 13
#define PROMPT  '>'
#define DATA    1  // data with no cr/prompt
#else
/*
 * for ISO9141-2 Protocol
 */
#define K_IN    0
#define K_OUT   1
#ifdef useL_Line
  #define L_OUT 2
#endif
#endif


long tempLong; // Useful for transitory values while getting PID information.


// some globals, for trip calculation and others
unsigned long old_time;
byte has_rpm=0;
long vss=0;  // speed
long maf=0;  // MAF
long engineRPM=0; // RPM
unsigned long engine_on, engine_off; //used to track time of trip.


#ifdef AutoSave
unsigned long old_time_params;
#endif


#ifdef UsePIDCache
// Cache PID's value
#define MaxPIDCacheCount 5
typedef struct
{
  byte PID;
  long Value;
  unsigned long Time;
  char String[STRLEN];
} TPIDCache;


TPIDCache PIDCache[MaxPIDCacheCount];
//prog_char PIDCacheString[MaxPIDCacheCount][STRLEN] PROGMEM={"","","","",""}; // Must be initialized


byte PIDCacheCount=0;
#endif


unsigned long getpid_time;
byte nbpid_per_second=0;


// flag used to save distance/average consumption in eeprom only if required
byte engine_started=0;
byte param_saved=0;


#ifdef ELM
#if defined do_ISO_Reinit
#error do_ISO_Reinit is ONLY ISO 9141 It is not to be used with ELM!
#endif
#if defined skip_ISO_Init
#error skip_ISO_Init is ONLY ISO 9141 It is not to be used with ELM!
#endif
#endif


#ifndef useECUState
#if defined do_ISO_Reinit
#error do_ISO_Reinit must have useECUState also defined
#endif
#endif


#ifndef do_ISO_Reinit
#if defined skip_ISO_Init
#error skip_ISO_Init must have do_ISO_Reinit also defined
#endif
#endif


#if defined (DEBUG) && defined (do_ISO_Reinit)
#error Error: could not be defined DEBUG and do_ISO_Reinit at same time
#endif


#if defined (DEBUG) && defined (skip_ISO_Init)
#error Error: could not be defined DEBUG and skip_ISO_Init at same time
#endif


/*
// This check is not needed anymore
#ifdef do_ISO_Reinit
#ifndef carAlarmScreen  
#error ISO reinit will not function when not displaying the car alarm screen (#define carAlarmScreen)
#endif
#endif
*/


#ifdef DEBUG
#ifdef AutoSave
#error AutoSave could not be enabled in DEBUG mode (it will save crappy data)
#endif
#endif


#ifdef useECUState
boolean oldECUconnection;  // Used to test for change in ECU connection state
#endif


#ifdef carAlarmScreen
boolean refreshAlarmScreen; // Used to cause non-repeating screen data to display
#endif


#ifndef ELM
// ISO 9141 communication variables
byte ISO_InitStep = 0;  // Init is multistage, this is the counter
boolean ECUconnection;  // Have we connected to the ECU or not
unsigned long lastReceivedPIDTime = 0;


#ifdef DEBUGOutput // debug information for ISO9141 init debuging
  byte LastISO_InitStep = 0;  // Init is multistage, this is last stage memory


  byte LastReceived1 = 0;
  byte LastReceived2 = 0;
  byte LastReceived3 = 0;


  byte LastReceived1OK = 0;
  byte LastReceived2OK = 0;
  byte LastReceived3OK = 0;


  byte LastSend1 = 0;
#endif


#endif  


// the buttons interrupt
// this is the interrupt handler for button presses
ISR(PCINT1_vect)
{
#if 0
  // it is wrong to access timers in ISR, 
  // this code bellow in "#if 0" has to be removed

  static unsigned long last_millis = 0;
  unsigned long m = millis();


  if ((long)(m - last_millis) > 20)
  { // do pushbutton stuff
    buttonState |= ~PINC;
  }
  //  else ignore interrupt: probably a bounce problem
  last_millis = m;
  
#else
  buttonState |= ~PINC;
#endif
}


#ifdef ELM
/* each ELM response ends with '\r' followed at the end by the prompt
 so read com port until we find a prompt */
byte elm_read(char *str, byte size)
{
  int b;
  byte i=0;


  // wait for something on com port
  while((b=Serial.read())!=PROMPT && i<size)
  {
    if(/*b!=-1 &&*/ b>=' ')
      str[i++]=b;
  }


  if(i!=size)  // we got a prompt
  {
    str[i]=NUL;  // replace CR by NUL
    return PROMPT;
  }
  else
    return DATA;
}


// buf must be ASCIIZ
void elm_write(char *str)
{
  while(*str!=NUL)
    Serial.write(*str++);
}


// check header byte
byte elm_check_response(const char *cmd, char *str)
{
  // cmd is something like "010D"
  // str should be "41 0D blabla"
  if(cmd[0]+4 != str[0]
    || cmd[1]!=str[1]
    || cmd[2]!=str[3]
    || cmd[3]!=str[4])
    return 1;


  return 0;  // no error
}


byte elm_compact_response(byte *buf, char *str)
{
  byte i=0;


  // start at 6 which is the first hex byte after header
  // ex: "41 0C 1A F8"
  // return buf: 0x1AF8


  str+=6;
  while(*str!=NUL)
    buf[i++]=strtoul(str, &str, 16);  // 16 = hex


  return i;
}


// write simple string to ELM and return read result
// cmd is a PSTR !!
byte elm_command(char *str, char *cmd)
{
  strcpy_P(str, cmd);
  elm_write(str);
  return elm_read(str, STRLEN);
}


void elm_init()
{
  char str[STRLEN];


  Serial.begin(9600);
  Serial.flush();


#ifndef DEBUG
  // reset, wait for something and display it
  elm_command(str, PSTR("ATWS\r"));
  lcd.setCursor(0,1);
  if(str[0]=='A')  // we have read back the ATWS
    lcd.print(str+4);
  else
    lcd.print(str);
  lcd_print_P(PSTR(" Init"));


  // turn echo off
  elm_command(str, PSTR("ATE0\r"));


  // send 01 00 until we are connected
  do
  {
    elm_command(str, PSTR("0100\r"));
    delay(1000);
  }
  while(elm_check_response("0100", str)!=0);


  // ask protocol
  elm_command(str, PSTR("ATDPN\r"));
  // str[0] should be 'A' for automatic
  // set header to talk directly to ECU#1
  if(str[1]=='1')  // PWM
    elm_command(str, PSTR("ATSHE410F1\r"));
  else if(str[1]=='2')  // VPW
    elm_command(str, PSTR("ATSHA810F1\r"));
  else if(str[1]=='3')  // ISO 9141
    elm_command(str, PSTR("ATSH6810F1\r"));
  else if(str[1]=='6')  // CAN 11 bits
    elm_command(str, PSTR("ATSH7E0\r"));
  else if(str[1]=='7')  // CAN 29 bits
    elm_command(str, PSTR("ATSHDA10F1\r"));
#endif
}
#else


void serial_rx_on()
{
//  UCSR0B |= _BV(RXEN0);  //enable UART RX
  Serial.begin(10400);		//setting enable bit didn't work, so do beginSerial
}


void serial_rx_off()
{
  UCSR0B &= ~(_BV(RXEN0));  //disable UART RX
}


void serial_tx_off() 
{
   UCSR0B &= ~(_BV(TXEN0));  //disable UART TX
   delay(20);                 //allow time for buffers to flush
}


#ifdef DEBUG
#define READ_ATTEMPTS 2
#else
#define READ_ATTEMPTS 125
#endif


// User must pass in a pointer to a byte to recieve the data.
// Return value reflects success of the read attempt.
boolean iso_read_byte(byte * b)
{
  int readData;
  boolean success = true;
  byte t=0;


  while(t != READ_ATTEMPTS  && (readData=Serial.read())==-1) 
  {
    delay(1);
    t++;
  }
  
  if (t >= READ_ATTEMPTS) 
  {
    success = false;
  }
  
  if (success)
  {
    *b = (byte) readData;
  }


  return success;
}


void iso_write_byte(byte b)
{
  serial_rx_off();
  Serial.print(b);
  delay(ISORequestByteDelay);  // ISO requires 5-20 ms delay between bytes.
  serial_rx_on();
}


// inspired by SternOBDII\code\checksum.c
byte iso_checksum(byte *data, byte len)
{
  byte crc=0;
  for(byte i=0; i<len; i++)
    crc=crc+data[i];
  return crc;
}


// inspired by SternOBDII\code\iso.c
void iso_write_data(byte *data, byte len)
{
  byte i, n;
  byte buf[20];




  #ifdef ISO_9141
  // ISO header
  buf[0]=0x68;
  buf[1]=0x6A;		// 0x68 0x6A is an OBD-II request
  buf[2]=0xF1;		// our requesters address (off-board tool)
  #else
  // 14230 protocol header
  buf[0]=0xc2; // Request of 2 bytes
  buf[1]=0x33; // Target address
  buf[2]=0xF1; // our requesters address (off-board tool)
  #endif


  // append message
  for(i=0; i<len; i++)
    buf[i+3]=data[i];


  // calculate checksum
  i+=3;
  buf[i]=iso_checksum(buf, i);


  // send char one by one
  n=i;//+1;
  for(i=0; i<=n; i++)
    iso_write_byte(buf[i]);


// CodeOptimization (2bytes)
// function changed to 'void' (was byte, but not used, always returned 0)
//  return 0; 
}


// read n byte(s) of data (+ header + cmd and crc)
// return the count of bytes of message (includes all data in message)
byte iso_read_data(byte *data, byte len)
{
  byte i, c;
  byte buf[20];
  byte dataSize = 0;


  // header 3 bytes: [80+datalen] [destination=f1] [source=01]
  // data 1+1+len bytes: [40+cmd0] [cmd1] [result0]
  // checksum 1 bytes: [sum(header)+sum(data)]
  // a total of six extra bytes of data


  c = len+6;
  for(i=0; i<c; i++)
  {
    if (iso_read_byte(buf+i))
    {
      dataSize++;
    }
  }


  // test, skip header comparison
  // ignore failure for the moment (0x7f)
  // ignore crc for the moment


  // we send only one command, so result start at buf[4] Actually, result starts at buf[5], buf[4] is pid requested...
  memcpy(data, buf+5, len);


  lastReceivedPIDTime = millis();


  return dataSize - 6; // return payload length
}


/* ISO 9141 init */
// The init process is done in timed sections now so that during the reinit process
// the user can use the buttons, and the screen can be updated.
// Note: Due to the timed nature of this init process, if the display screen takes up too much CPU time, this will not succeed
void iso_init()
{
  long currentTime = millis();
  static long initTime;
  static int initFirstDelay = 300;
#ifdef ISO_9141


// CodeOptimization (128bytes)
// Changed ISO init 2-7 steps to take values from array (could be moved to PROGMEM)
// ISO_14230_slow could be changed too (same way)
  byte ISOSteps[8] = {
                       0,  //0 not used
                       30, //1 HIGH
                       20, //2 LOW
                       40, //3 HIGH
                       40, //4 LOW
                       40, //5 HIGH
                       40, //6 LOW
                       26  //7 HIGH
                     }; 


  if (ISO_InitStep == 0)
  {
    // setup
    ECUconnection = false;
    serial_tx_off(); //disable UART so we can "bit-Bang" the slow init.
    serial_rx_off();
    initTime = currentTime + initFirstDelay;
    initFirstDelay = (initFirstDelay % 4500) * 2; //if 4800 then down to 300ms AND sequence: 300, 600, 1200, 2400, 4800
    ISO_InitStep++;
  }
  else if (currentTime >= initTime)
  {
    if (ISO_InitStep > 0 && ISO_InitStep < 8) 
    {
      digitalWrite(K_OUT, ISO_InitStep % 2);
      #ifdef useL_Line
        digitalWrite(L_OUT, ISO_InitStep % 2);
      #endif
      initTime = currentTime + ISOSteps[ISO_InitStep] * 10;
      ISO_InitStep++;
    }    
    else if (ISO_InitStep == 8)
    {
      #ifdef useL_Line
        digitalWrite(L_OUT, LOW);
      #endif


      // bit banging done, now verify connection at 10400 baud
      byte b = 0;
      // switch now to 10400 bauds
      Serial.begin(10400);


      // wait for 0x55 from the ECU (up to 300ms)
      //since our time out for reading is 125ms, we will try it up to three times
      for (byte i=0; i<3; i++)
        if (iso_read_byte(&b))
          break;
          
      if(b == 0x55)
      {
        ISO_InitStep++;
      }
      else
      {
        // oops unexpected data, try again
        ISO_InitStep = 0;
      }
    }
    else // ISO_InitStep == 9
    {
      byte b;
      bool bread;
        
      bread = iso_read_byte(&b);  // read kw1
    #ifdef DEBUGOutput
      LastReceived1 = b;
      LastReceived1OK = bread ? 1 : 0;
    #endif
      
      bread = iso_read_byte(&b);  // read kw2
    #ifdef DEBUGOutput
      LastReceived2 = b;
      LastReceived2OK = bread ? 1 : 0;
    #endif


      // 25ms delay needed before reply (url with spec is on forum page 56)
      // it does not work without it on VW MK4
      delay(25);
        
      // send ~kw2 (invert of last keyword)
      iso_write_byte(~b);
    #ifdef DEBUGOutput
      LastSend1 = ~b;
    #endif
      
      // ECU answer by 0xCC (~0x33)
      // read several times, ECU not always responds in time
      for (byte i=0; i<3; i++)
      {
        bread = iso_read_byte(&b);
        if (bread)
          break;
      }
       
    #ifdef DEBUGOutput
      LastReceived3 = b;
      LastReceived3OK = bread ? 1 : 0;
    #endif
        
      if (b == 0xCC)
      {
         ECUconnection = true;
         // update for correct delta time in trip calculations.
         old_time = millis();
      }
      ISO_InitStep = 0;
    }
  }
#elif defined ISO_14230_fast
  switch (ISO_InitStep)
  {
    case 0:
      // setup
      ECUconnection = false;
      serial_tx_off(); //disable UART so we can "bit-Bang" the slow init.
      serial_rx_off();
      initTime = currentTime + initFirstDelay;
      initFirstDelay = (initFirstDelay % 4500) * 2; //if 4800 then down to 300ms AND sequence: 300, 600, 1200, 2400, 4800
      ISO_InitStep++;
      break;
    case 1:
      if (currentTime >= initTime)
      {
        // drive K line high for 300ms
        digitalWrite(K_OUT, HIGH);
        #ifdef useL_Line
          digitalWrite(L_OUT, HIGH);
        #endif
        initTime = currentTime + 300;
        ISO_InitStep++;
      }
      break;
    case 2:
    case 3:
      if (currentTime >= initTime)
      {
        // start or stop bit
        digitalWrite(K_OUT, (ISO_InitStep == 2 ? LOW : HIGH));
        #ifdef useL_Line
          digitalWrite(L_OUT, (ISO_InitStep == 2 ? LOW : HIGH));
        #endif
        initTime = currentTime + (ISO_InitStep == 2 ? 25 : 25);
        ISO_InitStep++;
      }
      break;
    case 4:
      if (currentTime >= initTime)
      {
        // bit banging done, now verify connection at 10400 baud
        byte dataStream[] = {0xc1, 0x33, 0xf1, 0x81, 0x66};
        byte dataStreamSize = ARRAY_SIZE(dataStream);
        boolean gotData = false;
        const byte dataResponseSize = 10;
        byte dataResponse[dataResponseSize];
        byte responseIndex = 0;
        byte dataCaught = '\0';


        // switch now to 10400 bauds
        Serial.begin(10400);


        // Send the message
        for (byte i = 0; i < dataStreamSize; i++)
        {
          iso_write_byte(dataStream[i]);
        }


        // Wait for response for 300 ms
        initTime = currentTime + 300;
        do
        {
           // If we find any data, keep catching it until it ends
           while(iso_read_byte(&dataCaught))
           {
              gotData = true;
              dataResponse[responseIndex] = dataCaught;
              responseIndex++;
           }
        } while (millis() <= initTime && !gotData);


        if (gotData) // or better yet validate the data...
        {
           ECUconnection = true;
           // update for correct delta time in trip calculations.
           old_time = millis();


           // Note: we do not actually validate this connection. It would be best to validate the connection.
           // Can someone validate this with a car that actually uses this connection?
        }


        ISO_InitStep = 0;
      }
      break;
  }
#elif defined ISO_14230_slow
  switch (ISO_InitStep)
  {
    case 0:
      // setup
      ECUconnection = false;
      serial_tx_off(); //disable UART so we can "bit-Bang" the slow init.
      serial_rx_off();
      initTime = currentTime  + initFirstDelay;
      initFirstDelay = (initFirstDelay % 4500) * 2; //if 4800 then down to 300ms AND sequence: 300, 600, 1200, 2400, 4800
      ISO_InitStep++;
      break;
    case 1:
      if (currentTime >= initTime)
      {
        // drive K line high for 300ms
        digitalWrite(K_OUT, HIGH);
        #ifdef useL_Line
          digitalWrite(L_OUT, HIGH);
        #endif
        initTime = currentTime + 300;
        ISO_InitStep++;
      }
      break;
    case 2:
    case 7:
      if (currentTime >= initTime)
      {
        // start or stop bit
        digitalWrite(K_OUT, (ISO_InitStep == 2 ? LOW : HIGH));
        #ifdef useL_Line
          digitalWrite(L_OUT, (ISO_InitStep == 2 ? LOW : HIGH));
        #endif
        initTime = currentTime + (ISO_InitStep == 2 ? 200 : 260);
        ISO_InitStep++;
      }
      break;
    case 3:
    case 5:
      if (currentTime >= initTime)
      {
        // two bits HIGH
        digitalWrite(K_OUT, HIGH);
        #ifdef useL_Line
          digitalWrite(L_OUT, HIGH);
        #endif
        initTime = currentTime + 400;
        ISO_InitStep++;
      }
      break;
    case 4:
    case 6:
      if (currentTime >= initTime)
      {
        // two bits LOW
        digitalWrite(K_OUT, LOW);
        #ifdef useL_Line
          digitalWrite(L_OUT, LOW);
          // Note: after this do we drive the L line back up high, or just leave it alone???
        #endif
        initTime = currentTime + 400;
        ISO_InitStep++;
      }
      break;
    case 8:
      if (currentTime >= initTime)
      {
        // bit banging done, now verify connection at 10400 baud
        byte dataStream[] = {0xc1, 0x33, 0xf1, 0x81, 0x66};
        byte dataStreamSize = ARRAY_SIZE(dataStream);
        boolean gotData = false;
        const byte dataResponseSize = 10;
        byte dataResponse[dataResponseSize];
        byte responseIndex = 0;
        byte dataCaught = '\0';


        // switch now to 10400 bauds
        Serial.begin(10400);


        // Send the message
        for (byte i = 0; i < dataStreamSize; i++)
        {
          iso_write_byte(dataStream[i]);
        }


        // Wait for response for 300 ms
        initTime = currentTime + 300;


        do
        {
           // If we find any data, keep catching it until it ends
           while (iso_read_byte(&dataCaught))
           {
              gotData = true;
              dataResponse[responseIndex] = dataCaught;
              responseIndex++;
           }
        } while (millis() <= initTime && !gotData);


        if (gotData)
        {
           ECUconnection = true;
           // update for correct delta time in trip calculations.
           old_time = millis();


           // Note: we do not actually validate this connection. It would be best to validate the connection.
           // Can someone validate this with a car that actually uses this connection?
        }


        ISO_InitStep = 0;
      }
      break;
  }
#else
#error No ISO protocol defined
#endif // protocol


#ifdef skip_ISO_Init // Need initial parammeters reading after successfull initialization
  if (ECUconnection)
  {
    // check supported PIDs
    check_supported_pids();
    old_time=millis();  // epoch
    getpid_time=old_time;
  }
#endif
}
#endif // ELM or ISO init


// remap pid to name array index
byte remap_pid(byte pid)
{
  return pid > LAST_PID ? pid - FIRST_FAKE_PID + LAST_PID + 1 : pid;
}


// return false if pid is not supported, true if it is.
// mode is 0 for get_pid() and 1 for menu config to allow pid > 0xF0
boolean is_pid_supported(byte pid, byte mode)
{
  if(pid==0)
    return true;
  else
  if(pid<=0x20)
  {
    if(1L<<(byte)(0x20-pid) & pid01to20_support)
      return true;
  }
  else
  if(pid<=0x40)
  {
    if(1L<<(byte)(0x40-pid) & pid21to40_support)
      return true;
  }
  else
  if(pid<=0x60)
  {
    if(1L<<(byte)(0x60-pid) & pid41to60_support)
      return true;
  }
  else
    if (mode && pid>=FIRST_FAKE_PID) 
      return true;


  return false;
}


// Get value of a PID, and place in long pointer
// and also formatted for string output in the return buffer
// Return value denotes successful retrieval of PID.
// User must pass in a long pointer to get the PID value.
boolean get_pid(byte pid, char *retbuf, long *ret)
{
#ifdef ELM
  char cmd_str[6];   // to send to ELM
  char str[STRLEN];   // to receive from ELM
#else
  byte cmd[2];    // to send the command
#endif
  byte i;
  byte buf[10];   // to receive the result
  byte reslen;
  char decs[16];
  unsigned long time_now, delta_time;
  static byte nbpid=0;


  nbpid++;
  // time elapsed
  time_now = millis();
  delta_time = (long)(time_now - getpid_time);
  if(delta_time>1000)
  {
    nbpid_per_second=nbpid;
    nbpid=0;
    getpid_time=time_now;
  }


  // check if PID is supported (should not happen except for some 0xFn)
  if(!is_pid_supported(pid, 0))
  {
    // nope
    sprintf_P(retbuf, PSTR("%02X N/A"), pid);
    return false;
  }
  
 #ifdef UsePIDCache
  // Check if PID is available in PID cache
  byte j=0;
  while (j < PIDCacheCount && PIDCache[j].PID != pid)
    j++;
  if (j < PIDCacheCount)  
  {
    *ret=PIDCache[j].Value;
    strcpy(retbuf, PIDCache[j].String);
//    strcpy_P(retbuf, PIDCacheString[j]);
    return true;
  }
 #endif


  // receive length depends on pid
  reslen=pgm_read_byte_near(pid_reslen+pid);


#ifdef ELM
  sprintf_P(cmd_str, PSTR("01%02X\r"), pid);
  elm_write(cmd_str);
#ifndef DEBUG
  elm_read(str, STRLEN);
  if(elm_check_response(cmd_str, str)!=0)
  {
    strcpy_P(retbuf, PSTR("ERROR"));
    return false;
  }
  // first 2 bytes are 0x41 and command, skip them,
  // convert response in hex and return in buf
  elm_compact_response(buf, str);
#endif
#else


  // if not connected - do not send any request, 
  // and do not disturb init proccess in case of reinit
  if (!ECUconnection)
    return false;    


  // wait until ISORequestDelay is delayed after last PID read
  while (long(millis() - ISORequestDelay) < lastReceivedPIDTime)
    delay(1);


  cmd[0]=0x01;    // ISO cmd 1, get PID
  cmd[1]=pid;
  // send command, length 2
  iso_write_data(cmd, 2);
  // read requested length, n bytes received in buf
  if (iso_read_data(buf, reslen) != reslen)
  {
    #ifndef DEBUG
      strcpy_P(retbuf, PSTR("ERROR"));
      return false;
    #endif
  }
#endif


  // a lot of formulas are the same so calculate a default return value here
  // even if it's scrapped after, we still saved 40 bytes!
  *ret=buf[0]*256U+buf[1];


  // formula and unit for each PID
  switch(pid)
  {
  case ENGINE_RPM:
#ifdef DEBUG
    *ret=1726;
#else
    *ret=*ret/4U;
#endif
    sprintf_P(retbuf, PSTR("%ld RPM"), *ret);
    break;
  case MAF_AIR_FLOW:
#ifdef DEBUG
    *ret=2048;
#endif
    // ret is not divided by 100 for return value!!
    long_to_dec_str(*ret, decs, 2);
    sprintf_P(retbuf, PSTR("%s g/s"), decs);
    break;
  case VEHICLE_SPEED:
#ifdef DEBUG
    *ret=100;
#else
    *ret=(buf[0] * params.speed_adjust) / 100U;
#endif


#ifdef AllowChangeUnits
    if(!params.use_metric)
      *ret=(*ret*1000U)/1609U;
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
    *ret=(*ret*1000U)/1609U;
  #endif  
#endif
    
    sprintf_P(retbuf, pctldpcts, *ret, 
    #ifdef AllowChangeUnits 
      params.use_metric?"\003\004":"\006\004" 
    #else
      #ifdef UseSI
        "\003\004" 
      #endif  
      #ifdef UseUS
        "\006\004" 
      #endif
    #endif
    );
    
    // do not touch vss, it is used by fuel calculation after, so reset it
#ifdef DEBUG
    *ret=100;
#else
    *ret=(buf[0] * params.speed_adjust) / 100U;
#endif
    break;
  case FUEL_STATUS:
#ifdef DEBUG
    *ret=0x0200;
#endif
    if(buf[0]==0x01)
      strcpy_P(retbuf, PSTR("OPENLOWT"));  // open due to insufficient engine temperature
    else if(buf[0]==0x02)
      strcpy_P(retbuf, PSTR("CLSEOXYS"));  // Closed loop, using oxygen sensor feedback to determine fuel mix. should be almost always this
    else if(buf[0]==0x04)
      strcpy_P(retbuf, PSTR("OPENLOAD"));  // Open loop due to engine load, can trigger DFCO
    else if(buf[0]==0x08)
      strcpy_P(retbuf, PSTR("OPENFAIL"));  // Open loop due to system failure
    else if(buf[0]==0x10)
      strcpy_P(retbuf, PSTR("CLSEBADF"));  // Closed loop, using at least one oxygen sensor but there is a fault in the feedback system
    else
      sprintf_P(retbuf, PSTR("%04lX"), *ret);
    break;
  case LOAD_VALUE:
  case THROTTLE_POS:
  case REL_THR_POS:
  case EGR:
  case EGR_ERROR:
  case FUEL_LEVEL:
  case ABS_THR_POS_B:
  case ABS_THR_POS_C:
  case ACCEL_PEDAL_D:
  case ACCEL_PEDAL_E:
  case ACCEL_PEDAL_F:
  case CMD_THR_ACTU:
#ifdef DEBUG
    *ret=17;
#else
    *ret=(buf[0]*100U)/255U;
#endif
    sprintf_P(retbuf, PSTR("%ld %%"), *ret);
    break;
  case ABS_LOAD_VAL:
    *ret=(*ret*100)/255;
    sprintf_P(retbuf, PSTR("%ld %%"), *ret);
    break;
  case B1S1_O2_V:
  case B1S2_O2_V:
  case B1S3_O2_V:
  case B1S4_O2_V:
  case B2S1_O2_V:
  case B2S2_O2_V:
  case B2S3_O2_V:
  case B2S4_O2_V:
    *ret=buf[0]*5U;  // not divided by 1000 for return!!
    if(buf[1]==0xFF)  // not used in trim calculation
      sprintf_P(retbuf, PSTR("%ld mV"), *ret);
    else
      sprintf_P(retbuf, PSTR("%ldmV/%d%%"), *ret, ((buf[1]-128)*100)/128);
    break;
  case O2S1_WR_V:
  case O2S2_WR_V:
  case O2S3_WR_V:
  case O2S4_WR_V:
  case O2S5_WR_V:
  case O2S6_WR_V:
  case O2S7_WR_V:
  case O2S8_WR_V:
  case O2S1_WR_C:
  case O2S2_WR_C:
  case O2S3_WR_C:
  case O2S4_WR_C:
  case O2S5_WR_C:
  case O2S6_WR_C:
  case O2S7_WR_C:
  case O2S8_WR_C:
  case CMD_EQUIV_R:
    *ret=(*ret*100)/32768; // not divided by 1000 for return!!
    long_to_dec_str(*ret, decs, 2);
    sprintf_P(retbuf, PSTR("l:%s"), decs);
    break;
  case DIST_MIL_ON:
  case DIST_MIL_CLR:


#ifdef AllowChangeUnits 
    if(!params.use_metric)
      *ret=(*ret*1000U)/1609U;
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
    *ret=(*ret*1000U)/1609U;
  #endif
#endif


    sprintf_P(retbuf, pctldpcts, *ret,
    #ifdef AllowChangeUnits 
      params.use_metric?"\003":"\006"
    #else
      #ifdef UseSI
        "\003" 
      #endif  
      #ifdef UseUS
        "\006" 
      #endif
    #endif
    );
    break;
  case TIME_MIL_ON:
  case TIME_MIL_CLR:
    sprintf_P(retbuf, PSTR("%ld min"), *ret);
    break;
  case COOLANT_TEMP:
  case INT_AIR_TEMP:
  case AMBIENT_TEMP:
  case CAT_TEMP_B1S1:
  case CAT_TEMP_B2S1:
  case CAT_TEMP_B1S2:
  case CAT_TEMP_B2S2:
    if(pid>=CAT_TEMP_B1S1 && pid<=CAT_TEMP_B2S2)
#ifdef DEBUG
      *ret=600;
#else
      *ret=*ret/10U - 40;
#endif
    else
#ifdef DEBUG
      *ret=40;
#else
      *ret=buf[0]-40;
#endif


#ifdef AllowChangeUnits 
    if(!params.use_metric)
      *ret=(*ret*9)/5+32;
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
    *ret=(*ret*9)/5+32;
  #endif
#endif


    sprintf_P(retbuf, PSTR("%ld\005%c"), *ret, 
    #ifdef AllowChangeUnits 
      params.use_metric?'C':'F'
    #else
      #ifdef UseSI
        'C' 
      #endif  
      #ifdef UseUS
        'F'
      #endif
    #endif
    );
    break;
  case STFT_BANK1:
  case LTFT_BANK1:
  case STFT_BANK2:
  case LTFT_BANK2:
    *ret=buf[0]; // Added to avoid 65536 limitation in next operation
    *ret=(*ret-128)*7812;  // not divided by 10000 for return value
    long_to_dec_str(*ret/100, decs, 2);
    sprintf_P(retbuf, PSTR("%s %%"), decs);
    break;
  case FUEL_PRESSURE:
  case MAN_PRESSURE:
  case BARO_PRESSURE:
    *ret=buf[0];
    if(pid==FUEL_PRESSURE)
      *ret*=3U;
    sprintf_P(retbuf, PSTR("%ld kPa"), *ret);
    break;
  case EVAP_PRESSURE:
    *ret=((int)buf[0]*256+buf[1])/4;
    sprintf_P(retbuf, PSTR("%d kPa"), (int)*ret);
    break;
  case TIMING_ADV:
    *ret=(buf[0]/2)-64;
    sprintf_P(retbuf, PSTR("%ld\005"), *ret);
    break;
  case CTRL_MOD_V:
    long_to_dec_str(*ret/10, decs, 2);
    sprintf_P(retbuf, PSTR("%s V"), decs);
    break;
  case RUNTIME_START:
    sprintf_P(retbuf, PSTR("%u:%02u:%02u"), (unsigned int)*ret/3600, (unsigned int)(*ret/60)%60, (unsigned int)*ret%60);
    break;
  case OBD_STD:
    *ret=buf[0];
    if(buf[0]<=0x11)
      strcpy_P(retbuf, obd_std_strings[buf[0]-1]);
    else
      sprintf_P(retbuf, PSTR("OBD:%02X"), buf[0]);
    break;
    // for the moment, everything else, display the raw answer
  default:
    // transform buffer to an hex value
    *ret=0;
    for(i=0; i<reslen; i++)
    {
      *ret*=256L;
      *ret+=buf[i];
    }
    sprintf_P(retbuf, PSTR("%08lX"), *ret);
    break;
  }


 #ifdef UsePIDCache
  // Write result to PID cache
  if (PIDCacheCount < MaxPIDCacheCount)
  {
    PIDCache[PIDCacheCount].PID = pid;
    PIDCache[PIDCacheCount].Value = *ret;
    PIDCache[PIDCacheCount].Time = millis();    
//    strcpy_P(PIDCacheString[PIDCacheCount], retbuf);
    strcpy(PIDCache[PIDCacheCount].String, retbuf);
    
    PIDCacheCount++;
  }
 #endif
 
 #ifdef logEveryPid
  logpid(pid, retbuf, ret);
 #endif
  
  return true;
}


// ex: get a long as 687 with prec 2 and output the string "6.87"
// precision is 1 or 2
void long_to_dec_str(long value, char *decs, byte prec)
{
  byte pos;


  // sprintf_P does not allow * for the width so manually change precision
  sprintf_P(decs, prec==2?PSTR("%03ld"):PSTR("%02ld"), value);


  pos=strlen(decs)+1;  // move the \0 too
  // a simple loop takes less space than memmove()
  for(byte i=0; i<=prec; i++)
  {
    decs[pos]=decs[pos-1];  // move digit
    pos--;
  }


  // then insert decimal separator
  decs[pos] = (params.use_metric && params.use_comma) ? ',' : '.';
}


#ifdef BatteryVoltageSensor
// Wiring:
// 12V ---- 30kOhm ---|--- 10kOhm ---- 0V(GND)
//                    |
//                    A0 (analog pin)
void get_batteryvoltage(char *retbuf)
{
  #define VoltageDevider 1955L // (30kOhm+10kOhm) / 10kOhm * 5V / 1023 * 100000
  
  long Voltage = analogRead(BatteryVoltagePin-14);
#ifdef DEBUGOutput
  Voltage = 535;
#endif
  Voltage = (Voltage * VoltageDevider) / 1000L; 
  
  char decs[16];
  long_to_dec_str(Voltage, decs, 2);
  sprintf_P(retbuf, PSTR("%s V"), decs);
}
#endif


#if defined UseInsideTemperatureSensor || defined UseOutsideTemperatureSensor
void get_temperature(char *retbuf, byte TemperatureSensorPin)
{
#ifdef TemperatureSensorTypeKTY81_210
  #define TemperatureSensorReferenceResistance 2000L // 2kOhm
  #define TemperatureListSize 17
  static prog_int16_t TemperatureList[TemperatureListSize][2] PROGMEM =
  {
    {1135, -400},
    {1247, -300},
    {1367, -200},
    {1495, -100},
    {1630, 0},
    {1772, 100},
    {1922, 200},
    {2080, 300},
    {2245, 400},
    {2417, 500},
    {2597, 600},
    {2785, 700},
    {2980, 800},
    {3182, 900},
    {3392, 1000},
    {3607, 1100},
    {3817, 1200}
  };
#endif


  
  int Voltage = analogRead(TemperatureSensorPin - 14);
  char decs[16];


#ifdef DEBUGOutput
  Voltage = 535;
#endif


  // convert from V to R(ohm)
  long Resistance = (Voltage * TemperatureSensorReferenceResistance) / (1024 - Voltage);
  
  // convert from R to �C
  int Temperature = -450;
  int LowestResistance = pgm_read_word(&(TemperatureList[0][0]));
  
  if (Resistance > LowestResistance)
  {
    byte TemperatureIndex = 0;
    while (TemperatureIndex < TemperatureListSize - 1 && Resistance > pgm_read_word(&(TemperatureList[TemperatureIndex + 1][0])))
      TemperatureIndex++;
      
    if (TemperatureIndex < TemperatureListSize - 1)
    {
      int UpperResistance = pgm_read_word(&(TemperatureList[TemperatureIndex + 1][0])); 
      int LowerResistance = pgm_read_word(&(TemperatureList[TemperatureIndex][0]));
      int ResistanceTemperature = pgm_read_word(&(TemperatureList[TemperatureIndex][1]));
      Temperature = ResistanceTemperature + (Resistance - LowerResistance) * 100 / (UpperResistance - LowerResistance);
    }
    else
      Temperature = 1250;
  }


  Temperature = Temperature - 15; // Sensor is showing 1.5�C more then realy it is
  
   // convert �C in F if requested
#ifdef AllowChangeUnits 
  if(!params.use_metric)
    Temperature = convertToFarenheit(Temperature);
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
    Temperature = convertToFarenheit(Temperature);
  #endif
#endif


  long_to_dec_str(Temperature, decs, 1);
  sprintf_P(retbuf, PSTR("%s\005%c"), decs, 
  #ifdef AllowChangeUnits 
    params.use_metric?'C':'F'
  #else
    #ifdef UseSI
      'C' 
    #endif  
    #ifdef UseUS
      'F'
    #endif
  #endif
  );
}
#endif


#define NBSMOOTH	8
byte tvss[NBSMOOTH];  // last n speed
unsigned int tmaf[NBSMOOTH];  // last n MAF
static void clear_icons_tvss(void)
{
  for(byte i=0; i<NBSMOOTH; i++)
    tvss[i]=0;
}
static void clear_icons_tmaf(void)
{
  for(byte i=0; i<NBSMOOTH; i++)
    tmaf[i]=0;
}
// instant fuel consumption
unsigned int get_icons(char *retbuf)
{
  unsigned int vss=0;
  unsigned long maf=0;
  byte nb_entry=0;
  long cons;
  char decs[16];
  long toggle_speed = params.per_hour_speed;


#ifdef AllowChangeUnits
  if (!params.use_metric)
    toggle_speed = (toggle_speed *1609) / 1000;
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
    toggle_speed = (toggle_speed *1609) / 1000;
  #endif  
#endif


  for(byte i=0; i<NBSMOOTH; i++)
  {
     vss+=tvss[i];
     maf+=tmaf[i];
     if(tmaf[i]!=0)
       nb_entry++;
  }


  if(nb_entry!=0)
  {
    maf=(maf*params.fuel_adjust)/((unsigned int)nb_entry*100);
  }


  vss/=NBSMOOTH;		// average the N latest speed


  // divide MAF by 100 because our function return MAF*100
  // but multiply by 100 for double digits precision
  // divide MAF by 14.7 air/fuel ratio to have g of fuel/s
  // divide by 730 (g/L at 15C) according to Canadian Gov to have L/s
  // multiply by 3600 to get litre per hour
  // formula: (3600 * MAF) / (14.7 * 730 * VSS)
  // = maf*0.3355/vss L/km
  // mul by 100 to have L/100km


  //need to remember if speed was too low, because later it is 
  //multiplied by speed_adjust and does not match condition anymore
  boolean lowSpeed = false; 
  if(vss<toggle_speed)
  {
    vss=10000;
    lowSpeed=true;
  }  
  else
    vss*=params.speed_adjust;


  // if maf is 0 it will just output 0
  cons=(maf * GasConst)/vss;


  // MPG
  // 6.17 pounds per gallon
  // 454 g in a pound
  // 14.7 * 6.17 * 454 * (VSS * 0.621371) / (3600 * MAF / 100)
  // multipled by 10 for single digit precision
  // new comment: convert from L/100 to MPG


#ifdef AllowChangeUnits
  if(!params.use_metric)
  {
    if(lowSpeed)
      cons=(cons*10)/378;   // convert to gallon, can be 0 G/h
    else
    {
      if(cons==0)             // if cons is 0 (DFCO?) display 999.9MPG
        cons=9999;
      else
        cons=235214/cons;     // convert to MPG
    }
  }
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
    if(lowSpeed)
      cons=(cons*10)/378;   // convert to gallon, can be 0 G/h
    else
    {
      if(cons==0)             // if cons is 0 (DFCO?) display 999.9MPG
        cons=9999;
      else
        cons=235214/cons;     // convert to MPG
    }
  #endif  
#endif


  long_to_dec_str(cons, decs, (1+params.use_metric));
  sprintf_P(retbuf, pctspcts, decs, 
  #ifdef AllowChangeUnits 
    params.use_metric?(lowSpeed?"L\004":"\001\002"):(lowSpeed?"G\004":"\006\007")
  #else
    #ifdef UseSI
      lowSpeed?"L\004":"\001\002" 
    #endif  
    #ifdef UseUS
      lowSpeed?"G\004":"\006\007"
    #endif
  #endif
  );


  return (unsigned int) cons;
}


// trip 0 is tank
// trip 1 is trip
// trip 2 is outing
unsigned int get_cons(char *retbuf, byte ctrip)
{
  unsigned long cfuel;
  unsigned long cdist;
  long trip_cons;
  char decs[16];


  cfuel=params.trip[ctrip].fuel;
  cdist=params.trip[ctrip].dist;


  // the car has not moved yet or no fuel used
  if(cdist<1000 || cfuel==0)
  {
    // will display 0.00L/100 or 999.9mpg
    trip_cons=0;
  #ifdef AllowChangeUnits
    if (!params.use_metric)
      trip_cons=9999;
  #else
    #ifdef UseSI
    #endif  
    #ifdef UseUS
      trip_cons=9999;
    #endif  
  #endif
  }
  else  // the car has moved and fuel used
  {
    // from uL/cm to L/100 so div by 1000000 for L and mul by 10000000 for 100km
    // multiply by 100 to have 2 digits precision
    // we can not mul fuel by 1000 else it can go higher than ULONG_MAX
    // so divide distance by 1000 instead (resolution of 10 metres)


    trip_cons=cfuel/(cdist/1000); // div by 0 avoided by previous test




  #ifdef AllowChangeUnits
    if(params.use_metric)
    {
      if(trip_cons>9999)    // SI
        trip_cons=9999;     // display 99.99 L/100 maximum
    }
    else
    {
      // it's imperial, convert.
      // from m/mL to MPG so * by 3.78541178 to have gallon and * by 0.621371 for mile
      // multiply by 10 to have a digit precision
      // new comment: convert L/100 to MPG
      trip_cons=235214/trip_cons;
      if(trip_cons<10)
        trip_cons=10;  // display 1.0 MPG min
    }
  #else
    #ifdef UseSI
      if(trip_cons>9999)    // SI
        trip_cons=9999;     // display 99.99 L/100 maximum
    #endif  
    #ifdef UseUS
      trip_cons=235214/trip_cons;
      if(trip_cons<10)
        trip_cons=10;  // display 1.0 MPG min
    #endif  
  #endif
  }


#if 1
  long_to_dec_str(trip_cons, decs, (1+params.use_metric));  // hack
#else
  if(params.use_metric)
    long_to_dec_str(trip_cons, decs, 2);
  else
    long_to_dec_str(trip_cons, decs, 1);
#endif


  sprintf_P(retbuf, pctspcts, decs, 
  #ifdef AllowChangeUnits 
    params.use_metric?"\001\002":"\006\007"
  #else
    #ifdef UseSI
      "\001\002" 
    #endif  
    #ifdef UseUS
      "\006\007"
    #endif
  #endif
  );


  return (unsigned int)trip_cons;
}


// trip 0 is tank
// trip 1 is trip
// trip 2 is outing
void get_fuel(char *retbuf, byte ctrip)
{
  unsigned long cfuel;
  char decs[16];


  // convert from uL to cL
  cfuel=params.trip[ctrip].fuel/10000;


  // convert in gallon if requested
#ifdef AllowChangeUnits
  if(!params.use_metric)
    cfuel = (cfuel * 100L) / 378L;//convertToGallons(cfuel);
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
    cfuel = (cfuel * 100L) / 378L;//convertToGallons(cfuel);
  #endif  
#endif


  long_to_dec_str(cfuel, decs, 2);
  sprintf_P(retbuf, pctspcts, decs, 
  #ifdef AllowChangeUnits 
    params.use_metric?"L":"G"
  #else
    #ifdef UseSI
      "L" 
    #endif  
    #ifdef UseUS
      "G"
    #endif
  #endif
  );
}


// trip 0 is tank
// trip 1 is trip
// trip 2 is outing
void get_waste(char *retbuf, byte ctrip)
{
  unsigned long cfuel;
  char decs[16];


  // convert from uL to cL
  cfuel=params.trip[ctrip].waste/10000;


  // convert in gallon if requested
#ifdef AllowChangeUnits
  if(!params.use_metric)
    cfuel = (cfuel * 100L) / 378L;//convertToGallons(cfuel);
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
    cfuel = (cfuel * 100L) / 378L;//convertToGallons(cfuel);
  #endif  
#endif


  long_to_dec_str(cfuel, decs, 2);
  sprintf_P(retbuf, pctspcts, decs, 
  #ifdef AllowChangeUnits 
    params.use_metric?"L":"G"
  #else
    #ifdef UseSI
      "L" 
    #endif  
    #ifdef UseUS
      "G"
    #endif
  #endif
  );
}


// trip 0 is tank
// trip 1 is trip
// trip 2 is outing
void get_dist(char *retbuf, byte ctrip)
{
  unsigned long cdist;
  char decs[16];


  // convert from cm to hundreds of meter
  cdist=params.trip[ctrip].dist/10000;


  // convert in miles if requested
#ifdef AllowChangeUnits
  if(!params.use_metric)
    cdist=(cdist*1000)/1609;
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
    cdist=(cdist*1000)/1609;
  #endif  
#endif


  long_to_dec_str(cdist, decs, 1);
  sprintf_P(retbuf, pctspcts, decs, 
  #ifdef AllowChangeUnits
    params.use_metric?"\003":"\006"
  #else
    #ifdef UseSI
      "\003"
    #endif  
    #ifdef UseUS
      "\006"
    #endif  
  #endif
  );
}


// distance you can do with the remaining fuel in your tank
void get_remain_dist(char *retbuf)
{
  long tank_tmp;
  long remain_dist;
  long remain_fuel;
  long tank_cons;


  // tank size is in litres (converted at input time)
  tank_tmp=params.tank_size;


  // convert from uL to dL
  remain_fuel=tank_tmp - params.trip[TANK].fuel/100000;


  // calculate remaining distance using tank cons and remaining fuel
  if(params.trip[TANK].dist<1000)
    remain_dist=9999;
  else
  {
    tank_cons=params.trip[TANK].fuel/(params.trip[TANK].dist/1000);
    remain_dist=remain_fuel*1000/tank_cons;


  #ifdef AllowChangeUnits
    if(!params.use_metric)  // convert to miles
      remain_dist=(remain_dist*1000)/1609;
  #else
    #ifdef UseSI
    #endif  
    #ifdef UseUS
      remain_dist=(remain_dist*1000)/1609;
    #endif  
  #endif
  }


  sprintf_P(retbuf, pctldpcts, remain_dist, 
  #ifdef AllowChangeUnits
    params.use_metric?"\003":"\006"
  #else
    #ifdef UseSI
      "\003"
    #endif  
    #ifdef UseUS
      "\006"
    #endif  
  #endif
  );
}


//get_max_vss returns max speed achieved in trip
void get_max_vss(char *retbuf, byte trip)
{
  long maxspeed = params.tripmax[trip].maxspeed;


#ifdef AllowChangeUnits
  if(!params.use_metric)
     maxspeed=(maxspeed*100U)/161U; //low differense between 1609 and 1610
#else
  #ifdef UseSI
  #endif  
  #ifdef UseUS
     maxspeed=(maxspeed*100U)/161U; //low differense between 1609 and 1610
  #endif  
#endif


  sprintf_P(retbuf, pctldpcts, maxspeed, 
  #ifdef AllowChangeUnits
    params.use_metric?"\003\004":"\006\004"
  #else
    #ifdef UseSI
      "\003\004"
    #endif  
    #ifdef UseUS
      "\006\004"
    #endif  
  #endif
  );  
}


/*
 * accumulate data for trip, called every loop()
 */
void accu_trip(void)
{
  static byte tindex=0;	// index in the smoothing table
  static byte min_throttle_pos=255;   // idle throttle position, start high
  byte throttle_pos;   // current throttle position
  byte open_load;      // to detect open loop
  char str[STRLEN];
  unsigned long delta_dist, delta_fuel;
  unsigned long time_now, delta_time;
  
 #ifdef UsePIDCache
  // read values from ECU, not from cache
  PIDCacheCount=0;
 #endif
 
  // if we return early set MAF to 0
  maf=0;


  // time elapsed
  time_now = millis();
  delta_time = (long)(time_now - old_time); //must take care of rollover
  old_time = time_now;
  
  // distance in cm
  // 3km/h = 83cm/s and we can sample n times per second or so with CAN
  // so having the value in cm is not too large, not too weak.
  // ulong so max value is 4'294'967'295 cm or 42'949 km or 26'671 miles
  if (!get_pid(VEHICLE_SPEED, str, &vss))
  {
    return; // not valid, exit
  }


  if ((byte)vss>0)
  {
    delta_dist=(vss*delta_time)/36;
    // accumulate for all trips
    for(byte i=0; i<NBTRIP; i++)
    {
      params.trip[i].dist+=delta_dist;


      // collect max data
      if ((byte)vss > params.tripmax[i].maxspeed)
        params.tripmax[i].maxspeed = (byte)vss;
    }  
  }




#ifdef UseBuzzer
  if ((byte)vss > SpeedLimit)
  {
    if (!SpeedLimitReached)
    {
      Buzzer(20); //20*10ms=200ms
      SpeedLimitReached = true;
    }
  }  
  // Allow to drop speed before beeping again
  if ((byte)vss < SpeedLimit - 5)
    SpeedLimitReached = false;
    
  if ((long)(time_now - old_time_system_check) > 1L * 60000L) // more then 1min
  {
    boolean SomethingWrong = false;
    
    old_time_system_check = millis();   
    if (get_pid(COOLANT_TEMP, str, &tempLong))
      if ((byte)tempLong >= CoolantTemperatureLimit)
        SomethingWrong = true;
        
//    if (get_pid(MIL_CODE, str, &tempLong))
//      if (1L<<31 & (unsigned long)tempLong)
//        SomethingWrong = true;
          
    if (SomethingWrong)     
    {
      Buzzer(10);
      Buzzer(-10);
      Buzzer(10);
      Buzzer(-10);
      Buzzer(10);
    }
  }    
#endif  


  // if engine is stopped, we can get out now
  if (!has_rpm)
  {
    return;
  }


  // need auto-save if car is running
  #ifdef AutoSave
    if ((long)(time_now - old_time_params) > 30L * 60000L) // more then 30min
      params_save();
  #endif   


  // accumulate fuel only if not in DFCO
  // if throttle position is close to idle and we are in open loop -> DFCO


  // detect idle pos
  if (get_pid(THROTTLE_POS, str, &tempLong))
  {
    throttle_pos = (byte)tempLong;


    if(throttle_pos<min_throttle_pos && throttle_pos != 0) //And make sure its not '0' returned by no response in read byte function
      min_throttle_pos=throttle_pos;
  }
  else
  {
    return;
  }


  // get fuel status
  if(get_pid(FUEL_STATUS, str, &tempLong))
  {
    open_load = (tempLong & 0x0400) ? 1 : 0;
  }
  else
  {
    return;
  }


  if(throttle_pos<(min_throttle_pos+4) && open_load)
  {
    clear_icons_tmaf();
    maf=0;  // decellerate fuel cut-off, fake the MAF as 0 :)
  }
  else
  {
    // check if MAF is supported
    if(is_pid_supported(MAF_AIR_FLOW, 0))
    {
      // yes, just request it
      maf = (get_pid(MAF_AIR_FLOW, str, &tempLong)) ? tempLong : 0;
    }
    else
    {
      /*
      I just hope if you don't have a MAF, you have a MAP!!


       No MAF (Uses MAP and Absolute Temp to approximate MAF):
       IMAP = RPM * MAP / IAT
       MAF = (IMAP/120)*(VE/100)*(ED)*(MM)/(R)
       MAP - Manifold Absolute Pressure in kPa
       IAT - Intake Air Temperature in Kelvin
       R - Specific Gas Constant (8.314472 J/(mol.K)
       MM - Average molecular mass of air (28.9644 g/mol)
       VE - volumetric efficiency measured in percent, let's say 80%
       ED - Engine Displacement in liters
       This method requires tweaking of the VE for accuracy.
       */
      long imap, rpm, manp, iat;


      // get_pid successful, assign variable, otherwise quit
      if (get_pid(ENGINE_RPM, str, &engineRPM)) rpm = engineRPM;
      else return;
      if (get_pid(MAN_PRESSURE, str, &tempLong)) manp = tempLong;
      else return;
      if (get_pid(INT_AIR_TEMP, str, &tempLong)) iat = tempLong;
      else return;


      imap=(rpm*manp)/(iat+273);


      // does not divide by 100 at the end because we use (MAF*100) in formula
      // but divide by 10 because engine displacement is in dL
      // imap * VE * ED * MM / (120 * 100 * R * 10) = 0.0020321
      // ex: VSS=80km/h, MAP=64kPa, RPM=1800, IAT=21C
      //     engine=2.2L, efficiency=70%
      // maf = ( (1800*64)/(21+273) * 22 * 20 ) / 100
      // maf = 17.24 g/s which is about right at 80km/h
      maf=(imap*params.eng_dis)/5;
    }
    // add MAF result to trip
    // we want fuel used in uL
    // maf gives grams of air/s
    // divide by 100 because our MAF return is not divided!
    // divide by 14.7 (a/f ratio) to have grams of fuel/s
    // divide by 730 to have L/s
    // mul by 1000000 to have uL/s
    // divide by 1000 because delta_time is in ms


    // at idle MAF output is about 2.25 g of air /s on my car
    // so about 0.15g of fuel or 0.210 mL
    // or about 210 uL of fuel/s so uL is not too weak nor too large
    // as we sample about 4 times per second at 9600 bauds
    // ulong so max value is 4'294'967'295 uL or 4'294 L (about 1136 gallon)
    // also, adjust maf with fuel param, will be used to display instant cons
    delta_fuel=(maf*params.fuel_adjust*delta_time) / GasMafConst;
    for(byte i=0; i<NBTRIP; i++) 
    {
      params.trip[i].fuel+=delta_fuel;
      //code to accumlate fuel wasted while idling
      if ( vss == 0 )
      {//car not moving
        params.trip[i].waste+=delta_fuel;
        params.tripmax[i].timeidling += delta_time;
      }
      else
        params.tripmax[i].timedriving += delta_time;
      
      // collect max data
      if (maf > params.tripmax[i].maxmaf)
        params.tripmax[i].maxmaf = maf;
    }
  }
  tvss[tindex]=vss;
  tmaf[tindex]=maf;
  // increment index and roll over
  tindex = (tindex+1) % NBSMOOTH;
  
  #ifdef logDataCollections
    //log data speed, maf, etc
    logdata(throttle_pos);
  #endif
}


// this function is needet for normal PID display and BIG PID display
// as well in this form, compiled size is lower in 70bytes, why?
void get_pid_internal(char *str, byte pid)
{
  /* check if it's a real PID or our internal one */
  if(pid==NO_DISPLAY)
    return;
  else if(pid==OUTING_MAX_VSS)
    get_max_vss(str, OUTING);
  else if(pid==TRIP_MAX_VSS)
    get_max_vss(str, TRIP);
  else if(pid==TANK_MAX_VSS)
    get_max_vss(str, TANK);   
  else if(pid==OUTING_IDLE_TIME)
    get_trip_time(str, OUTING, 1);
  else if(pid==TRIP_IDLE_TIME)
    get_trip_time(str, TRIP, 1);
  else if(pid==TANK_IDLE_TIME)
    get_trip_time(str, TANK, 1);
  else if(pid==OUTING_DRIVE_TIME)
    get_trip_time(str, OUTING, 0);
  else if(pid==TRIP_DRIVE_TIME)
    get_trip_time(str, TRIP, 0);
  else if(pid==TANK_DRIVE_TIME)
    get_trip_time(str, TANK, 0);    
  else if(pid==OUTING_COST)
    get_cost(str, OUTING);
  else if(pid==TRIP_COST)
    get_cost(str, TRIP);
  else if(pid==TANK_COST)
    get_cost(str, TANK);
  else if(pid==ENGINE_ON)
    get_engine_on_time(str);
  else if(pid==FUEL_CONS)
    get_icons(str);
  else if(pid==TANK_CONS)
    get_cons(str, TANK);
  else if(pid==TANK_FUEL)
    get_fuel(str, TANK);
  else if (pid==TANK_WASTE)
    get_waste(str,TANK);
  else if(pid==TANK_DIST)
    get_dist(str, TANK);
  else if(pid==REMAIN_DIST)
    get_remain_dist(str);
  else if(pid==TRIP_CONS)
    get_cons(str, TRIP);
  else if(pid==TRIP_FUEL)
    get_fuel(str, TRIP);
  else if (pid==TRIP_WASTE)
    get_waste(str,TRIP);
  else if(pid==TRIP_DIST)
    get_dist(str, TRIP);
#ifdef ELM
  else if(pid==BATT_VOLTAGE)
    elm_command(str, PSTR("ATRV\r"));
  else if(pid==CAN_STATUS)
    elm_command(str, PSTR("ATCS\r"));
#endif
#ifdef BatteryVoltageSensor
  else if(pid==BATT_VOLTAGE)
    get_batteryvoltage(str);
#endif
  else if (pid==OUTING_CONS)
    get_cons(str,OUTING);
  else if (pid==OUTING_FUEL)
    get_fuel(str,OUTING);
  else if (pid==OUTING_WASTE)
    get_waste(str,OUTING);
  else if (pid==OUTING_DIST)
    get_dist(str,OUTING);
#ifdef UseInsideTemperatureSensor    
  else if (pid==INSIDE_TEMP)
    get_temperature(str, InsideTemperaturePin);
#endif    
#ifdef UseOutsideTemperatureSensor    
  else if (pid==OUTSIDE_TEMP)
    get_temperature(str, OutsideTemperaturePin);
#endif    
  else if(pid==PID_SEC)
    sprintf_P(str, PSTR("%d pid/s"), nbpid_per_second);
#ifdef DEBUG
  else if(pid==FREE_MEM)
    sprintf_P(str, PSTR("%d free"), memoryTest());
#else
  else if(pid==ECO_VISUAL)
    eco_visual(str);
#endif
  else
    get_pid(pid, str, &tempLong);
}


void display(byte location, byte pid)
{
  char str[STRLEN];
  
  if(pid==NO_DISPLAY)
    return;


  get_pid_internal(str, pid);


  // left locations are left aligned
  // right locations are right aligned


  // truncate any string that is too long to display correctly
  str[LCD_SPLIT] = '\0';


  byte row = location / 2;  // Two PIDs per line
  boolean isLeft = location % 2 == 0; // First PID per line is always left


// CodeOptimization (10 bytes)
// same "if condition" should be done in one "if"
//  byte textPos    = isLeft ? 0 : LCD_COLS - strlen(str);
//  byte clearStart = isLeft ? strlen(str) : LCD_SPLIT;
//  byte clearEnd   = isLeft ? LCD_SPLIT : textPos;


  byte textPos    = 0;
  byte clearStart = strlen(str);
  byte clearEnd   = LCD_SPLIT;
  if (!isLeft)
  {
    textPos    = LCD_COLS - strlen(str);
    clearStart = LCD_SPLIT;
    clearEnd   = textPos;
  }   


  lcd.setCursor(textPos,row);
  lcd.print(str);


  // clean up any possible leading or trailing data
  lcd.setCursor(clearStart,row);
  for (byte cleanup = clearStart; cleanup < clearEnd; cleanup++)
  {
    lcd.write(' ');
  }
}


void check_supported_pids(void)
{
  char str[STRLEN];
  //long tempPID; //local variable is 4bytes less then global tempLong, why?
  
#ifdef DEBUG
  pid01to20_support=0xBE1FA812;
#else
  // on some ECU first PID read attemts some time fails, changed to 3 attempts
  for (byte i=0; i<3; i++)
  {
    pid01to20_support = (get_pid(PID_SUPPORT00, str, &tempLong)) ? tempLong : 0;
    if (pid01to20_support) 
      break; 
  }
#endif


  if(is_pid_supported(PID_SUPPORT20, 0))
    if (get_pid(PID_SUPPORT20, str, &tempLong))
      pid21to40_support = tempLong; 


  if(is_pid_supported(PID_SUPPORT40, 0))
    if (get_pid(PID_SUPPORT40, str, &tempLong))
      pid41to60_support = tempLong;
}


void display_mil_code_count(char *str, unsigned long *n, byte *count)
{
  // we have MIL on
  *count=(*n>>24) & 0x7F;
  lcd_cls_print_P(PSTR("CHECK ENGINE ON"));
  lcd.setCursor(0,1);
  sprintf_P(str, PSTR("%d CODE(S) IN ECU"), *count);
  lcd.print(str);
  delay(1500);
  lcd.clear();
}  
  
// might be incomplete
void check_mil_code(bool Silent)
{
  unsigned long n;
  char str[STRLEN];
  byte nb;
#ifndef ELM
  byte cmd[2];
  byte i, j, k;
#endif


#ifndef ELM
  Serial.flush();
#endif;


  if (!get_pid(MIL_CODE, str, &tempLong))
    return;  // Invalid return so abort 
  
  n = (unsigned long) tempLong;


  /* A request for this PID returns 4 bytes of data. The first byte contains
   two pieces of information. Bit A7 (the seventh bit of byte A, the first byte)
   indicates whether or not the MIL (check engine light) is illuminated. Bits A0
   through A6 represent the number of diagnostic trouble codes currently flagged
   in the ECU. The second, third, and fourth bytes give information about the
   availability and completeness of certain on-board tests. Note that test
   availability signified by set (1) bit; completeness signified by reset (0)
   bit. (from Wikipedia)
   */
  if(1L<<31 & n)  // test bit A7
  {
    display_mil_code_count(str, &n, &nb);
    
#ifdef ELM
    // retrieve code
    elm_command(str, PSTR("03\r"));
    // ELM returns something like 43 01 33 00 00 00 00
    if(str[0]!='4' && str[1]!='3')
      return;  // something wrong


    // must convert to P/C/B/U etc
    lcd.print(str+3);
    delay(5000);
#else
    // we display only the first 6 codes
    // if you have more than 6 in your ECU
    // your car is obviously wrong :-/


    // retrieve code
    cmd[0]=0x03;
    iso_write_data(cmd, 1);


    // Reading ECU in raw method (normal method is wrong because of different size header 5 vs 4)
    byte DTCBuf[32];
    int DTCBufSize = 0;
    
    // Wait until first byte available
    byte i = 0;
    byte b;
    while(i < 3 && !iso_read_byte(&b))
    {
      i++;
    }
    
    if (i == 3) 
    {
      lcd_cls_print_P(PSTR("Error reading DTC"));
      delay(2000);
      lcd.clear();
      return;
    }
     
    DTCBuf[0] = b;
    DTCBufSize++;
    
    // Read until last byte, or until buffer is full
    while (DTCBufSize < 31 && iso_read_byte(&b))
    {
      DTCBuf[DTCBufSize] = b;
      DTCBufSize++;
    }
    Serial.flush();
    
    // VW Jetta 2001 example read: 48 6B 10 43 04 20 00 00 00 00 2A (11 bytes, 1 DTC)
    // 48 6B 10 - header
    // 43 - responce to 03
    // 04 20 - first code
    // 00 00 - second code
    // 00 00 - third code
    // 2A - checsum
    // Next 3 DTC would be same order, all 11 bytes.


    lcd.clear();


    for (j = 0; j < (nb-1)/3 + 1; j++)
    {
      k = 0;
      byte DataShift = (j==0 ? 4 : 15);
              
      for (i = 0; i < 3; i++)
      {
        if (DTCBuf[DataShift + i*2] > 0 || DTCBuf[DataShift + i*2 + 1] > 0)
        {
          switch (DTCBuf[DataShift + i*2] & 0xC0)
          {
            case 0x00:
              str[k]='P';  // powertrain
              break;
            case 0x40:
              str[k]='C';  // chassis
              break;
            case 0x80:
              str[k]='B';  // body
              break;
            case 0xC0:
              str[k]='U';  // network
              break;
          }
          k++;
          str[k++] = '0' + ((DTCBuf[DataShift + i*2] & 0x30) >> 4);   // first digit is 0-3 only
          str[k++] = '0' + (DTCBuf[DataShift + i*2] & 0x0F);
          str[k++] = '0' + ((DTCBuf[DataShift + i*2 + 1] & 0xF0) >> 4);
          str[k++] = '0' + (DTCBuf[DataShift + i*2 + 1] & 0x0F);
        }
      }
      str[k]='\0';  // make asciiz
    
      lcd.print(str);
      lcd.setCursor(0, 1);  // go to next line to display the 3 next
      delay(1000);
    }
    delay(2000);
  
    lcd_cls_print_P(PSTR("Clear DTC?"));
    byte ClearDTC = menu_select_yes_no(0);
    if (ClearDTC == 1)
      clear_mil_code();


    lcd.clear();
    
#endif
  }
  else 
    if (!Silent)
    {
      lcd_cls_print_P(noDTCcodes);
      delay(1500);
      lcd.clear();
    }  
}


// might be incomplete
void clear_mil_code(void)
{
  unsigned long n;
  char str[STRLEN];
  byte nb;
#ifndef ELM
  byte cmd[2];
  byte buf[6];
  byte i, j, k;
#endif


#ifndef ELM
  Serial.flush();
#endif;


  if (!get_pid(MIL_CODE, str, &tempLong))
    return;  // Invalid return so abort 
  
  n = (unsigned long) tempLong;


  /* A request for this PID returns 4 bytes of data. The first byte contains
   two pieces of information. Bit A7 (the seventh bit of byte A, the first byte)
   indicates whether or not the MIL (check engine light) is illuminated. Bits A0
   through A6 represent the number of diagnostic trouble codes currently flagged
   in the ECU. The second, third, and fourth bytes give information about the
   availability and completeness of certain on-board tests. Note that test
   availability signified by set (1) bit; completeness signified by reset (0)
   bit. (from Wikipedia)
   */
  if(1L<<31 & n)  // test bit A7
  {
    display_mil_code_count(str, &n, &nb);
  }  
  else
  {
    lcd_cls_print_P(noDTCcodes);
    delay(1000);
    lcd.clear();
  }
  
  // Clear codes always. If no MIL is iluminated, clearing codes still clears Long time fuel trim.
  
  lcd_cls_print_P(PSTR("Clearing codes..."));
  
#ifdef ELM
  //Need some code to work :)
  delay(1000);
  lcd.clear();
#else
  // clear code
  cmd[0]=0x04;
  iso_write_data(cmd, 1);


  lcd_cls_print_P(PSTR("Codes cleared"));
  delay(1000);


  Serial.flush();
  lcd.clear();
#endif
}


/*
 * Configuration menu
 */


boolean delay_reset_button(void)
{
  byte DelayCount = 0;
  
  // accumulate data for trip while in the menu config, do not pool too often.
  // but anyway you should not configure your OBDuino while driving!


  // If there has been a key press, then don't accumulate trip data just yet,
  // wait a little past the last key press before doing trip data.
  // Rapid key presses take priority...
  static unsigned long lastButtonTime = 0;
  unsigned int timeSinceLastButton;
  
  if (buttonState != buttonsUp)
  {
    lastButtonTime = millis();


    #ifdef UseBuzzer
      Buzzer(3);
    #endif


    // Waiting until buttons are released (for real) and wait for next button
    while (analogRead(lbuttonPin-14) + analogRead(mbuttonPin-14) + analogRead(rbuttonPin-14) < 3 * 1024 - 64)
      delay(50);


    while (buttonState != buttonsUp)
    {
      buttonState = buttonsUp;
      delay(50);
    }
  }
  else
  {
    while (buttonState == buttonsUp && DelayCount < 100)
    {
      DelayCount++;
      
      //should be unsigned long if timeout is more 60s
      timeSinceLastButton = calcTimeDiff(lastButtonTime, millis()); //calcTimeDiff uses 40-50bytes each call
    
      if (timeSinceLastButton > KEY_WAIT && calcTimeDiff(old_time, millis()) > ACCU_WAIT)
      {
        accu_trip();
      }
    
      if (timeSinceLastButton > MENU_TIMEOUT)
        return true;
      
      // Some delay for less cycles
      delay(20);
    }
  }
  return false;
}


// common code used in a couple of menu section
byte menu_select_yes_no(byte p)
{
  boolean exitMenu = false;


  // set value with left/right and set with middle
  exitMenu = delay_reset_button();  // make sure to clear button


  do
  {
    if(LEFT_BUTTON_PRESSED)
      p=0;
    else if(RIGHT_BUTTON_PRESSED)
      p=1;
    else if(MIDDLE_BUTTON_PRESSED)
      exitMenu = true;


    lcd.setCursor(4,1);
    if(p==0)
      lcd_print_P(select_no);
    else
      lcd_print_P(select_yes);


    exitMenu |= delay_reset_button();
  }
  while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


  return p;
}


// Menu selection
//
// This function is passed in a array of strings which comprise of the menu
// The first string is the MENU TITLE,
// The second string is the EXIT option (always first option)
// The following strings are the other options in the menu
//
// The returned value denotes the selection of the user:
// A return of zero represents the exit
// A return of a real number represents the selection from the menu past exit (ie 2 would be the second item past EXIT)
byte menu_selection(char ** menu, byte arraySize)
{
  byte selection = 1; // Menu title takes up the first string in the list so skip it
  byte screenChars = 0;  // Characters currently sent to screen
  byte menuItem = 0;     // Menu items past current selection
  boolean exitMenu = false;
  boolean forceExit = false;


  // Note: values are changed with left/right and set with middle
  // Default selection is always the first selection, which should be 'Exit'


  lcd.clear();
  lcd.print((char *)pgm_read_word(&(menu[0])));
  forceExit = delay_reset_button();  // make sure to clear button
  if (forceExit) 
    return 0; // selection "exit"
    
  do
  {
    if(LEFT_BUTTON_PRESSED && selection > 1)
    {
      selection--;
    }
    else if(RIGHT_BUTTON_PRESSED && selection < arraySize - 1)
    {
      selection++;
    }
    else if (MIDDLE_BUTTON_PRESSED)
    {
      exitMenu = true;
      //return from function, menu does not need repaiting
      return selection - 1; 
    }   


    // Potential improvements:
    // Currently the selection is ALWAYS the first presented menu item.
    // Current selection could be in the middle if possible.
    // If few selections and screen size permits, selections could be centered?


    lcd.setCursor(0,1);
    screenChars = 1;
    lcd.write('('); // Wrap the current selection with brackets
    menuItem = 0;
    do
    {
      lcd.print((char*)pgm_read_word(&(menu[selection+menuItem])));


      if (menuItem == 0)
      {
        // include closing bracket
        lcd.write(')');
        screenChars++;
      }
      lcd.write(' ');
      screenChars += (strlen((char*)pgm_read_word(&(menu[selection+menuItem]))) + 1);
      menuItem++;
    }
    while (screenChars < LCD_COLS && selection + menuItem < arraySize);


    // Do any cover up of old data
    while (screenChars < LCD_COLS)
    {
      lcd.write(' ');
      screenChars++;
    }


    // Clean up button presses
    forceExit = delay_reset_button();
  }
  while(!MIDDLE_BUTTON_PRESSED && !exitMenu && !forceExit);


  if (forceExit) 
    return 0;
    
  return selection - 1;
}


void config_menu(void)
{
  char str[STRLEN];
  char decs[16];
  int lastButton = 0;  //we'll use this to speed up button pushes
  unsigned int fuelUnits = 0;
  unsigned long tankUnits = 0;
  boolean changed = false;
  boolean exitMenu = false;


#ifdef ELM
#ifndef DEBUG  // it takes 98 bytes
  // display protocol, just for fun
  lcd.clear();
  memset(str, 0, STRLEN);
  elm_command(str, PSTR("ATDP\r"));
  if(str[0]=='A')  // string start with "AUTO, ", skip it
  {
    lcd.print(str+6);
    lcd.setCursor(0,1);
    lcd.print(str+6+16);
  }
  else
  {
    lcd.print(str);
    lcd.setCursor(0,1);
    lcd.print(str+16);
  }
  delay(2000);
#endif
#endif


  boolean saveParams = false;  // Currently a button press will cause a save, smarter would be to verify a change in value...
  byte selection = 0;
  byte oldByteValue;             // used to determine if new value is different and we need to save the change
  unsigned int oldUIntValue;     // ditto
  unsigned long oldULongValue;   // tank used and tank distance adjust


  do
  {
    selection = menu_selection(topMenu, ARRAY_SIZE(topMenu));


    if (selection == 1) // display
    {
      byte displaySelection = 0;


      do
      {
        displaySelection = menu_selection(displayMenu, ARRAY_SIZE(displayMenu));


        if (displaySelection == 1) // Contrast
        {
          lcd_cls_print_P(PSTR("LCD contrast"));
          oldByteValue = params.contrast;


          do
          {
            if(LEFT_BUTTON_PRESSED && params.contrast!=0)
              params.contrast-=10;
            else if(RIGHT_BUTTON_PRESSED && params.contrast!=100)
              params.contrast+=10;


            analogWrite(ContrastPin, params.contrast);  // change dynamicaly
            sprintf_P(str, pctd, params.contrast);
            exitMenu = displaySecondLine(5, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (oldByteValue != params.contrast)
          {
            saveParams = true;
          }
        }
      #ifdef AllowChangeUnits        
        else if (displaySelection == 2)  // Metric
        {
          lcd_cls_print_P(PSTR("Use metric unit"));
          oldByteValue = params.use_metric;
          params.use_metric=menu_select_yes_no(params.use_metric);


          if (oldByteValue != params.use_metric)
          {
            saveParams = true;
          }


          // Only if metric do we have the option of using the comma as a decimal
          if(params.use_metric)
          {
            lcd_cls_print_P(PSTR("Use comma format"));
            oldByteValue = (byte) params.use_comma;
            params.use_comma = menu_select_yes_no(params.use_comma);


            if (oldByteValue != (byte) params.use_comma)
            {
              saveParams = true;
            }
          }
        }
      #endif  
        else if (displaySelection == 3) // Display speed
        {
          oldByteValue = params.per_hour_speed;


          // speed from which we toggle to fuel/hour
          lcd_cls_print_P(PSTR("Fuel/hour speed"));
          // set value with left/right and set with middle
          do
          {
            if(LEFT_BUTTON_PRESSED && params.per_hour_speed!=0)
              params.per_hour_speed--;
            else if(RIGHT_BUTTON_PRESSED && params.per_hour_speed!=255)
              params.per_hour_speed++;


            sprintf_P(str, pctd, params.per_hour_speed);
            exitMenu = displaySecondLine(5, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (oldByteValue != params.per_hour_speed)
          {
            saveParams = true;
          }
        }
        else if (displaySelection == 4) // Font
        {
          #ifdef use_BIG_font
          oldByteValue = params.BigFontType;


          // speed from which we toggle to fuel/hour
          lcd_cls_print_P(PSTR("Font type"));
          // set value with left/right and set with middle
          do
          {
            if(LEFT_BUTTON_PRESSED && params.BigFontType!=0)
              params.BigFontType--;
            else if(RIGHT_BUTTON_PRESSED && params.BigFontType!=2)
              params.BigFontType++;


            sprintf_P(str, pctd, params.BigFontType);
            exitMenu = displaySecondLine(5, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (oldByteValue != params.BigFontType)
          {
            if(active_screen>=NBSCREEN)
              lcd_char_bignum();
            saveParams = true;
          }
          #endif
        }
      } while (displaySelection != 0); // exit from this menu
    }
    else if (selection == 2) // Adjust
    {
      byte adjustSelection = 0;
      byte count = ARRAY_SIZE(adjustMenu);
      if (is_pid_supported(MAF_AIR_FLOW, 0))
      {
        // Use the "Eng Displ" parameter (the last one) only when MAF_AIR_FLOW is not supported
        count--;
      }


      do
      {
        adjustSelection = menu_selection(adjustMenu, count);


        if (adjustSelection == 1)
        {
          lcd_cls_print_P(PSTR("Tank size ("));


          oldUIntValue = params.tank_size;


          fuelUnits = params.tank_size;
          // convert in gallon if requested


        #ifdef AllowChangeUnits
          if(params.use_metric)
          {
            lcd_print_P(PSTR("L)"));
          }
          else
          {
            fuelUnits = params.tank_size * 100L / 378L;//convertToGallons(params.tank_size);
            lcd_print_P(PSTR("G)"));
          }
        #else
          #ifdef UseSI
            lcd_print_P(PSTR("L)"));
          #endif  
          #ifdef UseUS
            fuelUnits = params.tank_size * 100L / 378L;//convertToGallons(params.tank_size);
            lcd_print_P(PSTR("G)"));
          #endif  
        #endif


          // set value with left/right and set with middle
          do
          {
            if(LEFT_BUTTON_PRESSED)
            {
              changed = true;
              fuelUnits--;
            }
            else if(RIGHT_BUTTON_PRESSED)
            {
              changed = true;
              fuelUnits++;
            }


            long_to_dec_str(fuelUnits, decs, 1);
            sprintf_P(str, PSTR("- %s + "), decs);
            exitMenu = displaySecondLine(4, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (changed)
          {
          #ifdef AllowChangeUnits
            if(!params.use_metric)
              fuelUnits = (fuelUnits * 378L) / 100L; //convertToLitres(fuelUnits);
          #else
            #ifdef UseSI
            #endif  
            #ifdef UseUS
              fuelUnits = (fuelUnits * 378L) / 100L; //convertToLitres(fuelUnits);
            #endif  
          #endif


            params.tank_size = fuelUnits;


            changed = false;
          }


          if (oldUIntValue != params.tank_size)
          {
            saveParams = true;
          }
        }
        else if (adjustSelection == 2)  // cost
        {
          int lastButton = 0;


          lcd_cls_print_P(PSTR("Fuel Price ("));
          oldUIntValue = params.gas_price;


          fuelUnits = params.gas_price;
          // convert in gallons if requested


        #ifdef AllowChangeUnits
          if(params.use_metric)
          {
            lcd_print_P(PSTR("L)"));
          }
          else
          {
            // Convert unit price to litres for the cost per gallon. (ie $1 a litre = $3.785 per gallon)
            fuelUnits = (fuelUnits * 378L) / 100L; //convertToLitres(params.gas_price);
            lcd_print_P(PSTR("G)"));
          }
        #else
          #ifdef UseSI
            lcd_print_P(PSTR("L)"));
          #endif  
          #ifdef UseUS
            // Convert unit price to litres for the cost per gallon. (ie $1 a litre = $3.785 per gallon)
            fuelUnits = (fuelUnits * 378L) / 100L; //convertToLitres(params.gas_price);
            lcd_print_P(PSTR("G)"));
          #endif  
        #endif


          // set value with left/right and set with middle
          do
          {
            if(LEFT_BUTTON_PRESSED)
            {
              changed = true;
              lastButton--;
              if(lastButton >= 0) 
              {
                lastButton = 0;
                fuelUnits--;
              } else if (lastButton < -3 && lastButton > -7) 
              {
                fuelUnits-=2;
              } else if (lastButton <= -7) 
              {
                fuelUnits-=10;
              } else 
              {
                fuelUnits--;
              }
            } else if(RIGHT_BUTTON_PRESSED)
            {
              changed = true;
              lastButton++;
              if(lastButton <= 0) 
              {
                lastButton = 0;
                fuelUnits++;
              } else if (lastButton > 3 && lastButton < 7) 
              {
                fuelUnits+=2;
              } else if (lastButton >= 7) 
              {
                fuelUnits+=10;
              } else 
              {
                fuelUnits++;
              }
            }


            long_to_dec_str(fuelUnits, decs, fuelUnits > 999 ? 3 : 1);
            sprintf_P(str, gasPrice[fuelUnits > 999], decs);
            exitMenu = displaySecondLine(3, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (changed)
          {
          #ifdef AllowChangeUnits
            if(!params.use_metric)
              fuelUnits = (fuelUnits * 100L) / 378L; //convertToGallons(fuelUnits);
          #else
            #ifdef UseSI
            #endif  
            #ifdef UseUS
              fuelUnits = (fuelUnits * 100L) / 378L; //convertToGallons(fuelUnits);
            #endif  
          #endif


            params.gas_price = fuelUnits;
            
            changed = false;
          }


          if (oldUIntValue != params.gas_price)
          {
            saveParams = true;
          }
        }
        else if (adjustSelection == 3)
        {
          lcd_cls_print_P(PSTR("Fuel adjust"));
          oldByteValue = params.fuel_adjust;


          do
          {
            if(LEFT_BUTTON_PRESSED)
              params.fuel_adjust--;
            else if(RIGHT_BUTTON_PRESSED)
              params.fuel_adjust++;


            sprintf_P(str, pctdpctpct, params.fuel_adjust);
            exitMenu = displaySecondLine(4, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (oldByteValue != params.fuel_adjust)
          {
            saveParams = true;
          }
        }
        else if (adjustSelection == 4)
        {
          lcd_cls_print_P(PSTR("Speed adjust"));
          oldByteValue = params.speed_adjust;


          do
          {
            if(LEFT_BUTTON_PRESSED)
              params.speed_adjust--;
            else if(RIGHT_BUTTON_PRESSED)
              params.speed_adjust++;


            sprintf_P(str, pctdpctpct, params.speed_adjust);
            exitMenu = displaySecondLine(4, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (oldByteValue != params.fuel_adjust)
          {
            saveParams = true;
          }
        }
        else if (adjustSelection == 5)
        {
          lcd_cls_print_P(PSTR("Outing stop over"));
          oldByteValue = params.OutingStopOver;


          do
          {
            if(LEFT_BUTTON_PRESSED && params.OutingStopOver > 0)
              params.OutingStopOver--;
            else if(RIGHT_BUTTON_PRESSED && params.OutingStopOver < UCHAR_MAX)
              params.OutingStopOver++;


            sprintf_P(str, PSTR("- %2d Min + "), params.OutingStopOver * MINUTES_GRANULARITY);
            exitMenu = displaySecondLine(3, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (oldByteValue != params.OutingStopOver)
          {
            saveParams = true;
          }


        }
        else if (adjustSelection == 6)
        {
          lcd_cls_print_P(PSTR("Trip stop over"));
          oldByteValue = params.TripStopOver;


          do
          {
            unsigned long TripStopOver;   // Allowable stop over time (in milliseconds). Exceeding time starts a new outing.


            if(LEFT_BUTTON_PRESSED && params.TripStopOver > 1)
              params.TripStopOver--;
            else if(RIGHT_BUTTON_PRESSED && params.TripStopOver < UCHAR_MAX)
              params.TripStopOver++;


            sprintf_P(str, PSTR("- %2d Hrs + "), params.TripStopOver);
            exitMenu = displaySecondLine(3, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (oldByteValue != params.TripStopOver)
          {
            saveParams = true;
          }
        }
        else if (adjustSelection == 7) // tank used params.trip[0].fuel
        {
          lcd_cls_print_P(PSTR("Tank used ("));


          oldULongValue = params.trip[0].fuel;


          tankUnits = params.trip[0].fuel / 1000 / 100; // converted from uL to dL


        #ifdef AllowChangeUnits
          // convert in gallon if requested
          if(params.use_metric)
          {
            lcd_print_P(PSTR("L)"));
          }
          else
          {
            tankUnits = params.trip[0].fuel * 100L / 378L; //convertToGallons(params.trip[0].fuel / 1000 / 100); // converted from uL to dL
            lcd_print_P(PSTR("G)"));
          }
        #else
          #ifdef UseSI
            lcd_print_P(PSTR("L)"));
          #endif  
          #ifdef UseUS
            tankUnits = params.trip[0].fuel * 100L / 378L; //convertToGallons(params.trip[0].fuel / 1000 / 100); // converted from uL to dL
            lcd_print_P(PSTR("G)"));
          #endif  
        #endif


          // set value with left/right and set with middle
          do
          {
            if(LEFT_BUTTON_PRESSED)
            {
              changed = true;
              tankUnits-=1; // decrement by 0.1L or G
            }
            else if(RIGHT_BUTTON_PRESSED)
            {
              changed = true;
              tankUnits+=1; // increment by 0.1L or G
            }


            long_to_dec_str(tankUnits, decs, 1);
            sprintf_P(str, PSTR("- %s + "), decs);
            exitMenu = displaySecondLine(4, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (changed)
          {
          #ifdef AllowChangeUnits
            if(!params.use_metric)
              tankUnits = tankUnits * 378L / 100L; //convertToLitres(tankUnits) * 1000 * 100;
          #else
            #ifdef UseSI
            #endif  
            #ifdef UseUS
              tankUnits = tankUnits * 378L / 100L; //convertToLitres(tankUnits) * 1000 * 100;
            #endif  
          #endif


            params.trip[0].fuel = tankUnits * 1000 * 100;


            changed = false;
          }


          if (oldULongValue != params.trip[0].fuel)
          {
            saveParams = true;
          }
        }  
        else if (adjustSelection == 8) // tank distance params.trip[0].dist
        {
          lcd_cls_print_P(PSTR("Tank dist ("));


          oldULongValue = params.trip[0].dist;


          tankUnits = params.trip[0].dist / 100 / 1000;
          


        #ifdef AllowChangeUnits
          // convert in miles if requested
          if(params.use_metric)
          {
            lcd_print_P(PSTR("KM)"));
          }
          else
          {
            tankUnits = (tankUnits * 1000) / 1609; // converted from cm to km
            lcd_print_P(PSTR("M)"));
          }
        #else
          #ifdef UseSI
            lcd_print_P(PSTR("KM)"));
          #endif  
          #ifdef UseUS
            tankUnits = (tankUnits * 1000) / 1609; // converted from cm to km
            lcd_print_P(PSTR("M)"));
          #endif  
        #endif


          // set value with left/right and set with middle
          do
          {
            if(LEFT_BUTTON_PRESSED)
            {
              changed = true;
              tankUnits-=1; // decrement by 0.1km or mile
            }
            else if(RIGHT_BUTTON_PRESSED)
            {
              changed = true;
              tankUnits+=1; // increment by 0.1km or mile
            }


            long_to_dec_str(tankUnits, decs, 0);
            sprintf_P(str, PSTR("- %s + "), decs);
            exitMenu = displaySecondLine(4, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (changed)
          {
          #ifdef AllowChangeUnits
            if(!params.use_metric)
              tankUnits = tankUnits * 1609 / 1000;
          #else
            #ifdef UseSI
            #endif  
            #ifdef UseUS
              tankUnits = tankUnits * 1609 / 1000;
            #endif  
          #endif


            params.trip[0].dist = tankUnits * 100 * 1000;
            
            changed = false;
          }


          if (oldULongValue != params.trip[0].dist)
          {
            saveParams = true;
          }
        }  
        else if (adjustSelection == 9)
        {
          lcd_cls_print_P(PSTR("Eng dplcmt (MAP)"));
          oldByteValue = params.eng_dis;


          // the following setting is for MAP only
          // engine displacement


          do
          {
            if(LEFT_BUTTON_PRESSED && params.eng_dis!=0)
              params.eng_dis--;
            else if(RIGHT_BUTTON_PRESSED && params.eng_dis!=100)
              params.eng_dis++;


            long_to_dec_str(params.eng_dis, decs, 1);
            sprintf_P(str, PSTR("- %sL + "), decs);
            exitMenu = displaySecondLine(4, str);
          } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


          if (oldByteValue != params.eng_dis)
          {
            saveParams = true;
          }
        }
      } while (adjustSelection != 0);
    }
    else if (selection == 3) // PIDs
    {
      // go through all the configurable items
      byte PIDSelection = 0;
      byte cur_screen;
      byte pid = 0;


      // Set PIDs required for the selected screen
      do
      {
        PIDSelection = menu_selection(PIDMenu, ARRAY_SIZE(PIDMenu));


        if (PIDSelection != 0 && PIDSelection <= NBSCREEN + BIG_NBSCREEN)
        {
          cur_screen = PIDSelection - 1;
          for(byte current_PID=0; current_PID<LCD_PID_COUNT; current_PID++)
          {
            lcd.clear();
            sprintf_P(str, PSTR("Scr %d      PID %d"), cur_screen+1, current_PID+1);
            lcd.print(str);
            oldByteValue = pid = params.screen[cur_screen].PID[current_PID];


            do
            {
              if(LEFT_BUTTON_PRESSED)
              {
                // while we do not find a supported PID, decrease
                while(!is_pid_supported(--pid, 1));
              }
              else if(RIGHT_BUTTON_PRESSED)
              {
                // while we do not find a supported PID, increase
                while(!is_pid_supported(++pid, 1));
              }


              char strpid[10];
              strcpy_P(strpid, PID_Desc[remap_pid(pid)]);
              sprintf_P(str, PSTR("- %8s +  "), strpid);
              exitMenu = displaySecondLine(2, str);
            } while(!MIDDLE_BUTTON_PRESSED && !exitMenu);


            // PID has changed so set it
            if (oldByteValue != pid)
            {
              params.screen[cur_screen].PID[current_PID]=pid;
              saveParams = true;
            }
          }
        }
      } while (PIDSelection != 0);
    }  
    else if (selection == 4)
    {
       lcd_cls_print_P(PSTR("Clear DTC?"));
       byte ClearDTC = menu_select_yes_no(1);
       if (ClearDTC == 1)
         clear_mil_code();
    }
  } while (selection != 0);


  if (saveParams)
  {
    // save params in EEPROM
    lcd_cls_print_P(PSTR("Saving config"));
    lcd.setCursor(0,1);
    lcd_print_P(PSTR("Please wait..."));
    params_save();
  }
  lcd.clear(); //Clean up display (important if displaying with "BigNum"
}


// This helps reduce code size by containing repeated functionality.
boolean displaySecondLine(byte position, char * str)
{
  lcd.setCursor(position,1);
  lcd.print(str);
  return delay_reset_button();
}


// Reworked a little to allow all trip types to be reset from one function.
void trip_reset(byte ctrip, boolean ask)
{
  boolean reset = true;
  char str[STRLEN];


  // Display the intent
  lcd.clear();
  sprintf_P(str, PSTR("Zero %s data"), (char*)pgm_read_word(&(tripNames[ctrip])));
  lcd.print(str);


  if(ask)
  {
    reset=menu_select_yes_no(0);  // init to "no"
  }


  if(reset)
  {
    #ifdef logTripSummary
      logSummary();
    #endif
    
    params.trip[ctrip].dist=0L;
    params.trip[ctrip].fuel=0L;
    params.trip[ctrip].waste=0L;


    params.tripmax[ctrip].maxspeed = 0;
    params.tripmax[ctrip].maxrpm = 0;
    params.tripmax[ctrip].maxmaf = 0;


    // Increase trip counter (if 255 then 0)
    params.tripmax[ctrip].counter++;
    // Reset lower level counts (if TANK then reset TRIP and OUTING; if TRIP then reset OUTING)
    if (ctrip < TRIP)
      params.tripmax[TRIP].counter = 0; 
    if (ctrip < OUTING)
      params.tripmax[OUTING].counter = 0; 


    params.tripmax[ctrip].timedriving = 0L;
    params.tripmax[ctrip].timeidling = 0L;


// memset is better, should be tested some time    
//    memset(&params.tripmax[ctrip], 0, sizeof(trip_max));


    if (ctrip == OUTING && ask)
    {
      // Reset the start time to now too
      engine_on = millis();
    }
  }


  if (!ask)
  {
    delay(750); // let user see (if they are paying attention)
  }
}


/*
unsigned int convertToGallons(unsigned int litres)
{
  return (unsigned int) ( ((unsigned long)litres*100L) / 378L );
}
*/


/*
unsigned int convertToLitres(unsigned int gallons)
{
  return (unsigned int) ( ((unsigned long)gallons*378L) / 100L );
}
*/


int convertToFarenheit(int celsius)
{
  return ((celsius * 9) / 5) + 320;
}


void test_buttons(void)
{
  // if any button pressed, wait for other buttons if any
  if (buttonState != buttonsUp)
    delay(KEY_WAIT);
  
  // middle + left + right = mil check
  if (MIDDLE_BUTTON_PRESSED && LEFT_BUTTON_PRESSED && RIGHT_BUTTON_PRESSED)
  {
     needBacklight(true);
     check_mil_code(false);
  }
  // middle + left = tank reset
  else if (MIDDLE_BUTTON_PRESSED && LEFT_BUTTON_PRESSED)
  {
    needBacklight(true);
    trip_reset(TANK, true);
  }
  // middle + right = trip reset
  else if(MIDDLE_BUTTON_PRESSED && RIGHT_BUTTON_PRESSED)
  {
    // Added choice to reset OUTING trip also. We could merge TANK here too, and then just use the menu selection
    // to select the trip type to reset (maybe ask confirmation or not, since the menu has an exit).
    needBacklight(true);
    trip_reset(TRIP, true);
    trip_reset(OUTING, true);
  }
  // left + right = flash pid info
  else if(LEFT_BUTTON_PRESSED && RIGHT_BUTTON_PRESSED)
  {
    display_PID_names();
  }
  // left is cycle through active screen
  else if(LEFT_BUTTON_PRESSED)
  {
    #ifdef use_BIG_font
      active_screen = (active_screen+1) % (NBSCREEN+BIG_NBSCREEN);
    #else  
      active_screen = (active_screen+1) % (NBSCREEN);
    #endif  
    if(active_screen<NBSCREEN)
    {
      lcd.clear();
      lcd_char_init();
      display_PID_names();
    }
    else
    {
      lcd.clear();
      #ifdef use_BIG_font
      lcd_char_bignum();
      #endif
    }  
  }
  // right is cycle through brightness settings
  else if(RIGHT_BUTTON_PRESSED)
  {
    char str[STRLEN] = {0};


    brightnessIdx = (brightnessIdx + 1) % brightnessLength;
    analogWrite(BrightnessPin, brightness[brightnessIdx]);


    lcd_cls_print_P(PSTR(" LCD backlight"));
    lcd.setCursor(6,1);
    sprintf_P(str,PSTR("%d / %d"),brightnessIdx + 1,brightnessLength);
    lcd.print(str);
    delay(500);
  }
  // middle is go into menu
  else if(MIDDLE_BUTTON_PRESSED)
  {
    needBacklight(true);
    config_menu();
  }


  // reset buttons state
  if (buttonState!=buttonsUp)
  {
    #ifdef carAlarmScreen
      refreshAlarmScreen = true;
    #endif


    delay_reset_button();
    needBacklight(false);
  }
}


void display_PID_names(void)
{
  needBacklight(true);
  lcd.clear();
  // Lets flash up the description of the PID's we use when screen changes
  byte count = 0;
  for (byte row = 0; row < LCD_ROWS; row++)
  {
    for (byte col = 0; col == 0 || col == LCD_SPLIT; col+=LCD_SPLIT)
    {
      lcd.setCursor(col,row);
      lcd_print_P(PID_Desc[remap_pid(params.screen[active_screen].PID[count++])]);
    }
  }


  delay(750); // give user some time to see new PID titles
}


void needBacklight(boolean On)
{
  //only if ECU or engine are off do we need the backlight.
#ifdef useECUState
  if (!ECUconnection)
#else
  if (!engine_started)
#endif
  {
    // Assume backlight is normally off, so set according to input On
    analogWrite(BrightnessPin, brightness[On ? brightnessIdx : 0]);
  }
}


/*
 * Initialization
 */


void setup()                    // run once, when the sketch starts
{
#ifndef ELM
  boolean success;


  // init pinouts
  pinMode(K_OUT, OUTPUT);
  pinMode(K_IN, INPUT);
  #ifdef useL_Line
  pinMode(L_OUT, OUTPUT);
  #endif
#endif


  // buttons init
  pinMode(lbuttonPin, INPUT);
  pinMode(mbuttonPin, INPUT);
  pinMode(rbuttonPin, INPUT);
  
  // "turn on" the internal pullup resistors
  digitalWrite(lbuttonPin, HIGH);
  digitalWrite(mbuttonPin, HIGH);
  digitalWrite(rbuttonPin, HIGH);


  // low level interrupt enable stuff
  // interrupt 1 for the 3 buttons
  PCMSK1 |= (1 << PCINT11) | (1 << PCINT12) | (1 << PCINT13);
  PCICR  |= (1 << PCIE1);


  // load parameters
  params_load();  // if something is wrong, default parms are used


  // LCD pin init
#ifndef skip_ISO_Init
  analogWrite(BrightnessPin,brightness[brightnessIdx]);
#endif
  analogWrite(ContrastPin, params.contrast);
  lcd.begin(LCD_COLS, LCD_ROWS);
  lcd_char_init();


  // Temperature sensors init
#ifdef UseInsideTemperatureSensor
  pinMode(InsideTemperaturePin, INPUT);
#endif
#ifdef UseOutsideTemperatureSensor
  pinMode(OutsideTemperaturePin, INPUT);
#endif


  // Voltage sensor init
#ifdef BatteryVoltageSensor
  pinMode(BatteryVoltagePin, INPUT);
#endif


  // Buzzer init
#ifdef UseBuzzer
  pinMode(BuzzerPin, OUTPUT);
  digitalWrite(BuzzerPin, HIGH);
#endif


  engine_off = engine_on = millis();


  lcd_cls_print_P(PSTR("OBDuino32k  v198"));
#if !defined( ELM ) && !defined(skip_ISO_Init)
  do // init loop
  {
    lcd.setCursor(2,1);
    #ifdef ISO_9141
      lcd_print_P(PSTR("ISO9141 Init"));
    #elif defined ISO_14230_fast
      lcd_print_P(PSTR("ISO14230 Fast"));
    #elif defined ISO_14230_slow
      lcd_print_P(PSTR("ISO14230 Slow"));
    #endif




    #ifdef DEBUG // In debug mode we need to skip init.
      success=true;
    #else
      ISO_InitStep = 0;
      do
      {
        #ifdef DEBUGOutput
        LastISO_InitStep = ISO_InitStep;
        #endif
        iso_init();
      } while (ISO_InitStep != 0);


      success = ECUconnection;
      #ifdef useECUState
        oldECUconnection != ECUconnection; // force 'turn on' stuff in main loop
      #endif
    #endif


    lcd.setCursor(2,1);
    char str[STRLEN] = {0};
    if (success)
      sprintf_P(str, PSTR("Successful!  "));
    else
    {
     #ifdef DEBUGOutput
       if (LastISO_InitStep != 9)
         sprintf_P(str, PSTR("Failed!   %d   "), LastISO_InitStep);
       else
       {
         sprintf_P(str, PSTR("F!%X%d %X%d %X %X%d  "), LastReceived1, LastReceived1OK, LastReceived2, LastReceived2OK, LastSend1, LastReceived3, LastReceived3OK);
         lcd.setCursor(0, 1);
       }  
     #else
       sprintf_P(str, PSTR("Failed!       "));
     #endif
    }  
    lcd.print(str);
    delay(1000);


    lcd.setCursor(0, 1);
    sprintf_P(str, PSTR("                "));
    lcd.print(str);
  }
  while(!success); // end init loop
#else
  #ifdef ELM
    elm_init();
  #endif  
#endif


#ifdef carAlarmScreen
  refreshAlarmScreen = true;
#endif


#ifndef skip_ISO_Init
  // check supported PIDs
  check_supported_pids();


  #ifndef DisableDTCReadOnStart
   // check if we have MIL code
   check_mil_code(true);
  #endif


  lcd.clear();
  old_time=millis();  // epoch
  getpid_time=old_time;
#else
  //ISO_InitStep = 0; //Variable already initialized in define section, no need of additional init
  ECUconnection = oldECUconnection = false;
  engine_started = has_rpm = 0;
#endif 
}


static void DisplayLCDPIDS(char *str, char *str2)
{
  if (active_screen<NBSCREEN)
    for(byte current_PID=0; current_PID<LCD_PID_COUNT; current_PID++)
      display(current_PID, params.screen[active_screen].PID[current_PID]);
  #ifdef use_BIG_font
  else
  if (active_screen==NBSCREEN)
  {
    get_pid_internal(str, params.screen[active_screen].PID[0]);
    bigNum(str, "");
  } else 
  {
    //params.screen[active_screen].PID[0]
    if (params.BigFontType < 2)
    {
      get_pid_internal(str2, params.screen[active_screen].PID[1]);
      str2[5] ='\0';


      get_pid_internal(str, params.screen[active_screen].PID[0]);
      bigNum(str, str2);
    }  
    else
    {
      get_pid_internal(str, params.screen[active_screen].PID[0]);
      bigNum(str, "");
    }  
  }
  #endif
}


/*
 * Main loop
 */


void loop()                     // run over and over again
{
  char str[STRLEN];
  char str2[STRLEN];


  #ifdef useECUState


    #ifdef DEBUG
      ECUconnection = true;
      has_rpm = true;
    #else
      ECUconnection = verifyECUAlive();
    #endif


  if (oldECUconnection != ECUconnection)
  {
    if (ECUconnection)
    {
      unsigned long nowOn = millis();
      unsigned long engineOffPeriod = calcTimeDiff(engine_off, nowOn);
      
      if (has_rpm > 0)
        analogWrite(BrightnessPin, brightness[brightnessIdx]);
 
      if (engineOffPeriod > (params.OutingStopOver * MINUTES_GRANULARITY * MILLIS_PER_MINUTE))
      {
        trip_reset(OUTING, false);
        // zero instant cons
        clear_icons_tvss();
        clear_icons_tmaf();
        engine_on = nowOn;
      }
      else
      {
        // combine last trip time to this one! Not including the stop over time
        engine_on = nowOn - calcTimeDiff(engine_on, engine_off);
      }


      if (engineOffPeriod > (params.TripStopOver * MILLIS_PER_HOUR))
      {
        trip_reset(TRIP, false);
      }
    }
    else  // Car is off
    {
      #ifdef do_ISO_Reinit
        ISO_InitStep = 0;
      #endif


      save_params_and_display();
      //clear screen after turn off
      lcd.clear();
      
      #ifdef carAlarmScreen
      refreshAlarmScreen = true;
      #endif
    }
    oldECUconnection = ECUconnection;
  }


  // If engine was on, and RPM is 0 - save trip data and turn engine off
  if (engine_started == 1 && has_rpm == 0)
  {
    engine_started = 0;
    
   #ifdef SaveTripDataAfterEngineTurnOff
     save_params_and_display();


     //Turn the Backlight off
     analogWrite(BrightnessPin, brightness[0]);
   #endif
  }
  
  if (ECUconnection)
  {
    // If car was off, backlight was turned off, we need to turn it back on
    if (engine_started == 0 && has_rpm != 0)
    {
      engine_started = 1;
      analogWrite(BrightnessPin, brightness[brightnessIdx]);
      
      #ifdef carAlarmScreen
      lcd.clear();  // Clear away any debris from Car Alarm Screen
      #endif
    }
    
    // this read and assign vss and maf and accumulate trip data
    accu_trip();


    // display on LCD
    DisplayLCDPIDS(str, str2);
  }
  else
  {
    #ifdef carAlarmScreen
     // ECU is off so print ready screen instead of PIDS while we wait for ECU action
     if (ISO_InitStep < 2) // Print to LCD if idle only
       displayAlarmScreen();
    #else
     // for some reason the display on LCD
     if (ISO_InitStep < 2) // Print to LCD if idle only
       DisplayLCDPIDS(str, str2);
    #endif


    #ifdef do_ISO_Reinit
      iso_init();
    #endif
  }
#else


  // test if engine is started
  has_rpm = (get_pid(ENGINE_RPM, str, &engineRPM) && engineRPM > 0) ? 1 : 0;


  if (engine_started==0 && has_rpm!=0)
  {
    unsigned long nowOn = millis();
    unsigned long engineOffPeriod = calcTimeDiff(engine_off, nowOn);
    engine_started=1;
    param_saved=0;
    
    analogWrite(BrightnessPin, brightness[brightnessIdx]);


    if (engineOffPeriod > (params.OutingStopOver * MINUTES_GRANULARITY * MILLIS_PER_MINUTE))
    {
      //Reset the current outing trip from last trip
      trip_reset(OUTING, false);
      // zero instant cons
      clear_icons_tvss();
      clear_icons_tmaf();
      engine_on = nowOn; //Reset the time at which the car starts at
    }
    else
    {
       // combine last trip time to this one! Not including the stop over time
       engine_on = nowOn - calcTimeDiff(engine_on, engine_off);
    }


    if (engineOffPeriod > (params.TripStopOver * MILLIS_PER_HOUR))
    {
      trip_reset(TRIP, false);
    }
  }


  // if engine was started but RPM is now 0
  // save param only once, by flopping param_saved
  if (has_rpm==0 && param_saved==0 && engine_started!=0)
  {
    save_params_and_display();


    #ifdef carAlarmScreen
      refreshAlarmScreen = true;
    #endif
  }


  if (engine_started)
  {
    // this read and assign vss and maf and accumulate trip data
    accu_trip();
    // display on LCD
    DisplayLCDPIDS(str, str2);
  }  
  else
  {
    #ifdef carAlarmScreen
      displayAlarmScreen();
    #else
      DisplayLCDPIDS(str, str2);
    #endif  
  }


#endif


  // test buttons
  test_buttons();
}


// Calculate the time difference, and account for roll over too
unsigned long calcTimeDiff(unsigned long start, unsigned long end)
{
/*
if (start < end)
  {
    return end - start;
  }
  else // roll over
  {
    return ULONG_MAX - start + end;
  }
*/
  // inspired by <a data-cke-saved-href="http://www.arduino.cc/playground/Code/TimingRollover" href="http://www.arduino.cc/playground/Code/TimingRollover" rel="nofollow">http://www.arduino.cc/playground/Code/TimingRollover</a> saves 200bytes
  return (long)(end - start);
}


#ifdef useECUState
boolean verifyECUAlive(void)
{
#ifdef ELM
  char cmd_str[6];   // to send to ELM
  char str[STRLEN];   // to receive from ELM
  sprintf_P(cmd_str, PSTR("01%02X\r"), ENGINE_RPM);
  elm_write(cmd_str);
  elm_read(str, STRLEN);
  return elm_check_response(cmd_str, str) == 0;
#else //ISO
  #ifdef do_ISO_Reinit
  if (!ECUconnection) // only check for off, finding active ECU is handled by successful reiniting
  {
    return ECUconnection;
  }
  #endif


  // Send command to ECU, if it is active, we will get data back.
  // Set RPM to 1 if ECU active and RPM above 0, otherwise zero.
  char str[STRLEN];
  boolean connected = get_pid(ENGINE_RPM, str, &engineRPM);
  has_rpm = (connected && engineRPM > 0) ? 1 : 0;
    
  #ifdef DisconnectECUIfRPMIsZero
   connected = has_rpm;
  #endif
    
  return connected;
#endif
}
#endif


#ifdef carAlarmScreen
// This screen will display a fake security heading,
// then emulate an array of LED's blinking in Knight Rider style.
// This could be modified to blink a real LED (or maybe a short array depending on available pins)
void displayAlarmScreen(void)
{
  static byte pingPosition;
  static boolean pingDirection;
  static long nextMoveTime;
  const long pingTimeOut = 1000;
  const byte lastLCDChar = 15;


  if (refreshAlarmScreen)
  {
    pingPosition = 0;
    pingDirection = 0;


    lcd_cls_print_P(PSTR("OBDuino Security"));
    lcd.setCursor(pingPosition,1);
    lcd.write('*');


    refreshAlarmScreen = false;
    nextMoveTime = millis() + pingTimeOut;
  }
  else if (millis() > nextMoveTime)
  {
    lcd.setCursor(pingPosition,1);
    lcd.write(' ');


    if(pingPosition == 0 || pingPosition == lastLCDChar)
    {
      // Change direction
      pingDirection = !pingDirection;
    }


    // Move the character
    if(pingDirection)
    {
      pingPosition+= 3;
    }
    else
    {
      pingPosition-=3;
    }


    lcd.setCursor(pingPosition,1);
    lcd.write('*');


    nextMoveTime = millis() + pingTimeOut;
  }
}
#endif


/*
 * Memory related functions
 */


// we have 512 bytes of EEPROM on the 168P, more than enough
void params_save(void)
{
  uint16_t crc;
  byte *p;


  // CRC will go at the end
  crc=0;
  p=(byte*)&params;
  for(byte i=0; i<sizeof(params_t); i++)
    crc+=p[i];


  // start at address 0
  eeprom_write_block((const void*)&params, (void*)0, sizeof(params_t));
  // write CRC after params struct
  eeprom_write_word((uint16_t*)sizeof(params_t), crc);
  
  #ifdef AutoSave
    old_time_params = millis();
  #endif  
}


void params_load(void)
{
  params_t params_tmp;
  uint16_t crc, crc_calc;
  byte *p;


  #ifdef AutoSave
    old_time_params = millis();
  #endif  


  // read params
  eeprom_read_block((void*)&params_tmp, (void*)0, sizeof(params_t));
  // read crc
  crc=eeprom_read_word((const uint16_t*)sizeof(params_t));


  // calculate crc from read stuff
  crc_calc=0;
  p=(byte*)&params_tmp;
  for(byte i=0; i<sizeof(params_t); i++)
    crc_calc+=p[i];


  // compare CRC
  if(crc==crc_calc)     // good, copy read params to params
    params=params_tmp;
    
#ifdef AllowChangeUnits
#else
  #ifdef UseSI
    params.use_metric = 1;
  #endif  
  #ifdef UseUS
    params.use_metric = 0;
  #endif  
#endif    
}


#ifdef DEBUG  // how can this takes 578 bytes!!
// this function will return the number of bytes currently free in RAM
// there is about 670 bytes free in memory when OBDuino is running
extern int  __bss_end;
extern int  *__brkval;
int memoryTest(void)
{
  int free_memory;
  if((int)__brkval == 0)
    free_memory = ((int)&free_memory) - ((int)&__bss_end);
  else
    free_memory = ((int)&free_memory) - ((int)__brkval);
  return free_memory;
}
#endif


/*
 * LCD functions
 */
void lcd_print_P(char *string)
{
  char c;
  while( (c = pgm_read_byte(string++)) )
    lcd.write(c);
}


void lcd_cls_print_P(char *string)
{
  lcd.clear();
  lcd_print_P(string);
}


void lcd_char_init()
{
  //creating the custom fonts (8 char max)
  // char 0 is not used
  // 1&2 is the L/100 datagram in 2 chars only
  // 3&4 is the km/h datagram in 2 chars only
  // 5 is the ? char (degree)
  // 6&7 is the mi/g char
#define NB_CHAR  7
  // set cg ram to address 0x08 (B001000) to skip the
  // first 8 rows as we do not use char 0
  lcd.command(B01001000);
  static prog_uchar chars[] PROGMEM ={
    B10000,B00000,B10000,B00010,B00111,B11111,B00010,
    B10000,B00000,B10100,B00100,B00101,B10101,B00100,
    B11001,B00000,B11000,B01000,B00111,B10101,B01000,
    B00010,B00000,B10100,B10000,B00000,B00000,B10000,
    B00100,B00000,B00000,B00100,B00000,B00100,B00111,
    B01001,B11011,B11111,B00100,B00000,B00000,B00100,
    B00001,B11011,B10101,B00111,B00000,B00100,B00101,
    B00001,B11011,B10101,B00101,B00000,B00100,B00111,
  };


  for(byte x=0;x<NB_CHAR;x++)
    for(byte y=0;y<8;y++)  // 8 rows
      lcd.write(pgm_read_byte(&chars[y*NB_CHAR+x])); //write the character data to the character generator ram
}


#ifdef use_BIG_font
void lcd_char_bignum()
{
  //creating the custom fonts:
  lcd.command(B01001000); // set cgram


  #define BIGFontFontCount 3
  #define BIGFontSymbolCount 8
  
  static prog_uchar chars[BIGFontFontCount*BIGFontSymbolCount*8] PROGMEM = {
    //2x2_alpha 
    B00000, B11111, B11000, B00011, B11111, B11111, B11111, B11111,
    B00000, B11111, B11000, B00011, B11111, B11111, B11111, B11111,
    B00000, B00011, B11000, B00011, B11000, B00011, B00000, B00000,
    B00000, B00011, B11000, B00011, B11000, B00011, B00000, B00000,
    B00000, B00011, B11000, B00011, B11000, B00011, B00000, B00000,
    B00000, B00011, B11000, B00011, B11000, B00011, B00000, B00000,
    B11111, B00011, B11111, B11111, B11111, B11111, B00000, B11111,
    B11111, B00011, B11111, B11111, B11111, B11111, B00000, B11111,


    //2x2_beta
    B11111, B11111, B11000, B00011, B11111, B11111, B11111, B00000,
    B11111, B11111, B11000, B00011, B11111, B11111, B11111, B00000,
    B11000, B00011, B11000, B00011, B11000, B00011, B00000, B00000,
    B11000, B00011, B11000, B00011, B11000, B00011, B00000, B00000,
    B11000, B00011, B11000, B00011, B11000, B00011, B00000, B00000,
    B11000, B00011, B11000, B00011, B11000, B00011, B00000, B00000,
    B11000, B00011, B11111, B11111, B11111, B11111, B00000, B11111,
    B11000, B00011, B11111, B11111, B11111, B11111, B00000, B11111,


    //2x3
    B11111, B00000, B11111, B11111, B00000, B00000, B00000, B00000,
    B11111, B00000, B11111, B11111, B00000, B00000, B00000, B00000, 
    B00000, B00000, B00000, B11111, B00000, B00000, B00000, B00000, 
    B00000, B00000, B00000, B11111, B00000, B00000, B00000, B00000, 
    B00000, B00000, B00000, B11111, B00000, B00000, B00000, B00000, 
    B00000, B00000, B00000, B11111, B01110, B00000, B00000, B00000, 
    B00000, B11111, B11111, B11111, B01110, B00000, B00000, B00000, 
    B00000, B11111, B11111, B11111, B01110, B00000, B00000, B00000 
  };


  for (byte x = 0; x < BIGFontSymbolCount; x++)
    for (byte y = 0; y < 8; y++)
      lcd.write(pgm_read_byte(&chars[params.BigFontType*BIGFontSymbolCount*8 + y*BIGFontSymbolCount + x])); //write the character data to the character generator ram
}
#endif


char fBuff[7];//used by format
char *format(unsigned long num)
{
  byte dp = 3;


  while (num > 999999)
  {
    num /= 10;
    dp++;
    if (dp == 5)
      break; // We'll lose the top numbers like an odometer
  }


  if (dp == 5)
    dp = 99; // We don't need a decimal point here.


  // Round off the non-printed value.
  if ((num % 10) > 4)
    num += 10;
  num /= 10;


  byte x = 6;
  while (x > 0)
  {
    x--;
    if (x == dp)
    { //time to poke in the decimal point?{
      fBuff[x] = '.';
    }
    else
    {
      fBuff[x] = '0' + (num % 10);//poke the ascii character for the digit.
      num /= 10;
    }
  }
  fBuff[6] = 0;
  return fBuff;
}


#ifdef use_BIG_font
void bigNum(char *txt, char *txt1)
{
  static prog_char bignumchars1[40*BIGFontFontCount] PROGMEM = { 
                          5,  2, 0, 0,
                          2, 32, 0, 0,
                          8,  6, 0, 0,
                          7,  6, 0, 0,
                          3,  4, 0, 0,
                          5,  8, 0, 0,
                          5,  8, 0, 0,
                          7,  2, 0, 0,
                          5,  6, 0, 0,
                          5,  6, 0, 0,


                          1,  2, 0, 0,
                          2, 32, 0, 0,
                          7,  6, 0, 0,
                          7,  6, 0, 0,
                          3,  4, 0, 0,
                          5,  7, 0, 0,
                          1,  7, 0, 0,
                          7,  2, 0, 0,
                          5,  6, 0, 0,
                          5,  6, 0, 0,


                          4, 1, 4, 0,
                          1, 4, 32, 0,
                          3, 3, 4, 0,
                          1, 3, 4, 0,
                          4, 2, 4, 0,
                          4, 3, 3, 0,
                          4, 3, 3, 0,
                          1, 1, 4, 0,
                          4, 3, 4, 0,
                          4, 3, 4, 0
                        };
  static prog_char bignumchars2[40*BIGFontFontCount] PROGMEM = { 
                          3,  4,  0, 0,
                          4,  1,  0, 0,
                          3,  1,  0, 0,
                          1,  4,  0, 0,
                          32, 2,  0, 0,
                          1,  4,  0, 0,
                          3,  4,  0, 0,
                          32, 2,  0, 0,
                          3,  4,  0, 0,
                          1,  4,  0, 0,


                          3,  4,  0, 0,
                          4,  8,  0, 0,
                          5,  8,  0, 0,
                          8,  4,  0, 0,
                          32, 2,  0, 0,
                          8,  6,  0, 0,
                          5,  6,  0, 0,
                          32, 2,  0, 0,
                          3,  4,  0, 0,
                          8,  4,  0, 0,
                          
                          4, 2, 4, 0,
                          2, 4, 2, 0,
                          4, 2, 2, 0,
                          2, 2, 4, 0,
                          32, 32, 4, 0,
                          2, 2, 4, 0,
                          4, 2, 4, 0,
                          32, 4, 32, 0,
                          4, 2, 4, 0,
                          2, 2, 4, 0
                        };


  //byte DecimalPointSymbols[BIGFontFontCount] = {5, '.', '.'};
  //DecimalPointSymbols[params.BigFontType]


  byte CharPos = 40*params.BigFontType;


  for (byte line = 0; line < 2; line++)
  {
    lcd.setCursor(0, line);
    byte pos = 0;
    byte digitcount = 0;
    while (digitcount < 4)
    {
      digitcount++;
      if (txt[pos] >= '0' && txt[pos] <= '9')
      {
        byte address = CharPos + (txt[pos] - '0') * 4;
        lcd_print_P(line==0?&bignumchars1[address]:&bignumchars2[address]);
        
        char mark = ' ';
        if (txt[pos+1] == '.' || txt[pos+1] == ',')
        {
          if (line == 1)
            mark = txt[pos+1];
          pos++;
        }  
        lcd.write(mark);
        pos++;
      }
      else
        for (byte i=0; i<3; i++)
          lcd.write(' ');
    }


    byte ScreenPos = 12;
    // print units on first row
    if (line == 0)
    {
      // need convert L/KM, MPG, C or F to normal symbols
      pos++; //skip space
      while (pos < 8 && txt[pos] != 0)
      {
        switch (txt[pos])
        {
          case 1 : 
          lcd.write('L');
          ScreenPos+=1;
          break;
          case 2 : 
          lcd.write('/');
          lcd.write('k');
          lcd.write('m');        
          ScreenPos+=3;
          break;
          case 3 : 
          lcd.write('k');
          lcd.write('m');
          ScreenPos+=2;
          break;
          case 4 : 
          lcd.write('/');
          lcd.write('h');
          ScreenPos+=2;
          break;
          case 5 : 
          break;
          case 6 : 
          lcd.write('M');
          ScreenPos+=1;
          break;
          case 7 : 
          lcd.write('P');
          lcd.write('G');
          ScreenPos+=2;
          break;
          default : 
          lcd.write(txt[pos]);
          ScreenPos+=1;
          break;
        }  
        pos++;
      }  
    }      
    else
    {
      // print any text on second row
      lcd.print(txt1);
    }
    
    // clear end of line  
    for (byte i=ScreenPos; i<LCD_COLS; i++)
      lcd.write(' ');    
  }    
}
#endif


/*
Adj %
	 0   	 1 	 2 	 3 	 4 	4	5	6	7	8     <==star count
1%	91%	92%	93%	94%	95%	105%	106%	107%	108%	109%
2%	88%	89%	91%	93%	95%	105%	107%	109%	111%	114%
3%	84%	87%	89%	92%	95%	105%	108%	111%	115%	118%
4%	81%	84%	88%	91%	95%	105%	109%	114%	118%	123%
5%	77%	81%	86%	90%	95%	105%	110%	116%	122%	128%
6%	74%	79%	84%	89%	95%	105%	111%	118%	125%	133%
7%	71%	76%	82%	88%	95%	105%	112%	120%	129%	138%
8%	68%	74%	80%	87%	95%	105%	113%	122%	132%	143%
9%	65%	72%	79%	86%	95%	105%	114%	125%	136%	148%
10%	62%	69%	77%	86%	95%	105%	116%	127%	140%	154%
11%	60%	67%	75%	85%	95%	105%	117%	129%	144%	159%
12%	57%	65%	74%	84%	95%	105%	118%	132%	148%	165%
13%	54%	63%	72%	83%	95%	105%	119%	134%	152%	171%
*/
#define PERCENTAGE_RANGE 108  //108 = 8%
void eco_visual(char *retbuf) {
  //enable our varriables
  unsigned long tank_cons, outing_cons;
  unsigned long tfuel, tdist;
  int stars;


  tfuel = params.trip[OUTING].fuel;
  tdist = params.trip[OUTING].dist;


  if(tdist > 100 && tfuel!=0) {//Make sure no devisions by Zero.
    outing_cons = tfuel / (tdist / 1000);  //our current trip since engine start
    tfuel = params.trip[TANK].fuel;
    tdist = params.trip[TANK].dist;
    tank_cons = tfuel / (tdist / 1000);  //our results for the current tank of gas
  } else {  //give some dummy numbers to avoid devide by zero numbers
    tank_cons = 100;
    outing_cons = 101;
  }


  //lets start off in the middle
  stars = 3; // 3 = Average.
  if ( outing_cons < tank_cons ) {          //doing good :)
    outing_cons = (outing_cons*105) / 100; //Check if within 5% of TANK for Average result
    //Loop to check how much better we are doing
    //Each time the smaller number will be increased by a set percentage
    //in order to add or subtract from our star count.
    while(outing_cons < tank_cons && stars < 7) {
      outing_cons = (outing_cons*PERCENTAGE_RANGE) / 100;
      stars++;
    }
    outing_cons=0;
  } else if (outing_cons > tank_cons) {  //doing bad... so far...
    tank_cons = (tank_cons*105) / 100;   //Check if within 5% of TANK for Average result
    while(outing_cons > tank_cons  && stars > 0) {  //Loop to check how much worse we are doing
      tank_cons = (tank_cons*PERCENTAGE_RANGE) / 100;
      stars--;
    }
  } //else they are equal, do nothing.


  //Now we have our star count, use it as an index to access the text
  sprintf_P(retbuf, PSTR("%s"), (char*)pgm_read_word(&(econ_Visual[stars])));
}


//get_trip_time will return trip driving or idling
void get_trip_time(char *retbuf, byte trip, byte time)
{
  unsigned long run_time = params.tripmax[trip].timedriving;
  if (time == 1) 
    run_time = params.tripmax[trip].timeidling;
    
  int hours, minutes, seconds;  //to store the time


  hours =   (run_time / MILLIS_PER_HOUR);
  minutes = (run_time % MILLIS_PER_HOUR) / MILLIS_PER_MINUTE;
  seconds = (run_time % MILLIS_PER_MINUTE) / MILLIS_PER_SECOND;


  //Now we have our varriables parsed, lets display them
  sprintf_P(retbuf, PSTR("%d:%02d:%02d"), hours, minutes, seconds);
}


//get_engine_on_time will return the time since the engine has started
void get_engine_on_time(char *retbuf)
{
  unsigned long run_time;
  int hours, minutes, seconds;  //to store the time


#ifdef useECUState
  if (ECUconnection) {//update with current time, if the car is running
#else
  if(has_rpm) {//update with current time, if the car is running
#endif
    run_time = calcTimeDiff(engine_on, millis());    //We now have the number of ms
  } else { //car is not running.  Display final time when stopped.
    run_time = calcTimeDiff(engine_on, engine_off);
  }
  //Lets display the running time
  //hh:mm:ss
  hours =   run_time / MILLIS_PER_HOUR;
  minutes = (run_time % MILLIS_PER_HOUR) / MILLIS_PER_MINUTE;
  seconds = (run_time % MILLIS_PER_MINUTE) / MILLIS_PER_SECOND;


  //Now we have our varriables parsed, lets display them
  sprintf_P(retbuf, PSTR("%d:%02d:%02d"), hours, minutes, seconds);
}


void get_cost(char *retbuf, byte ctrip)
{
  unsigned long cents;
  unsigned long fuel;
  char decs[16];
  params.gas_price;  // x/1000 = dollars
  fuel = params.trip[ctrip].fuel / 10000; //cL
  cents =  fuel * params.gas_price / 1000; //now have $$$$cc
  long_to_dec_str(cents, decs, 2);
  sprintf_P(retbuf, PSTR(CurrencyPrintString), decs);
}


void save_params_and_display(void)
{
  engine_off = millis();  //record the time the engine was shut off


  params_save();
  param_saved = 1;
  engine_started = 0;
  
  lcd_cls_print_P(PSTR("TRIPS SAVED!"));
 
  //Lets Display how much fuel for the tank we wasted.
  char str[STRLEN] = {0};
  lcd.setCursor(0,1);
  lcd_print_P(PSTR("Wasted:"));
  lcd.setCursor(LCD_SPLIT,1);
  get_waste(str,TANK);
  lcd.print(str);


  delay(2000);
  
  //Turn the Backlight off
  needBacklight(false);
}


// SD card functions
#ifdef useSDCard 


void logbuffer(void)
{
  int length = strlen(logString);
  if (length >= logBufferSize - 60)
  {
    FileLogger::append("data.log", (byte*)logString, length); 
    logString[0] = 0;
  }  
}


// driving time, engine on time etc.
// limit time intervals (maybe)
void logpid(byte pid, char *str, long *value)
{
  char engine_time[9];
  get_engine_on_time(engine_time);
  
 #ifdef logTypeVerbose
  sprintf_P(&logString[strlen(logString)], 
            PSTR("%d\t%d\t%d\t%s\t%d\t%ld\t%s\r\n"),
            params.tripmax[TANK].counter, 
            params.tripmax[TRIP].counter, 
            params.tripmax[OUTING].counter,
            engine_time, 
            pid, *value, str);
 #endif                    
 #ifdef logTypeSystem
  sprintf_P(&logString[strlen(logString)],
            PSTR("%02X%02X%02X%02X%08lX\r\n"),
            params.tripmax[TANK].counter, 
            params.tripmax[TRIP].counter, 
            params.tripmax[OUTING].counter,
            pid, *value);
 #endif


  logbuffer();
}


// log data collection every accu_trip() cycle
void logdata(byte throttle_pos)
{
  char engine_time[9];
  get_engine_on_time(engine_time);


  sprintf_P(&logString[strlen(logString)],
            PSTR("%02X%02X%02X\t%s\t%ld\t%ld\t%ld\t%d\r\n"),
            params.tripmax[TANK].counter, 
            params.tripmax[TRIP].counter, 
            params.tripmax[OUTING].counter,
            engine_time,
            vss, engineRPM, maf, throttle_pos);
            
  logbuffer();
}


// log trip summary
#ifdef logTripSummary
void logSummary(void)
{
 #ifdef logTypeVerbose
 // write params_t structure in verbose mode to SD card (300bytes of code)
  char string[60];
  
  for (byte i=OUTING; i<NBTRIP; i++)
  {
    sprintf_P(string,
              PSTR("%02X%02X%02X\t%ld\t%ld\t%ld\t%ud\t%ud\t%ud\t%ld\t%ld\t\r\n"),
              params.tripmax[TANK].counter, 
              params.tripmax[TRIP].counter, 
              params.tripmax[OUTING].counter,
              params.trip[i].dist,
              params.trip[i].fuel,
              params.trip[i].waste,
              params.tripmax[i].maxspeed,
              params.tripmax[i].maxrpm,
              params.tripmax[i].maxmaf,
              params.tripmax[i].timedriving,
              params.tripmax[i].timeidling
             );
    FileLogger::append("summary.log", (byte*)string, strlen(string)); 
  }          
 #endif                    
 #ifdef logTypeSystem
  // write params_t structure dump to SD card (30bytes of code)
  FileLogger::append("summary.log", (byte*)&params, sizeof(params_t)); 
/*
  char string[sizeof(params_t)+1];
  memcpy(string, &params, sizeof(params_t));
  string[sizeof(params_t)] = 0;


  FileLogger::append("summary.log", (byte*)string, strlen(string)); 
*/   
 #endif 
}
#endif //logTripSummary


#endif //useSDCard


#ifdef UseBuzzer
// Time in 10th of ms (1 = 10ms, 12 = 120ms) 
// If negative - delay only
void Buzzer(char Time)
{
  byte Delay = Time>0?Time:(-1)*Time;
  if (Time>0)
    digitalWrite(BuzzerPin, LOW);
  delay(Delay*10);
  digitalWrite(BuzzerPin, HIGH);
}
#endif

 

Sergei H.
Offline
Зарегистрирован: 17.11.2018

А возможно Ваш БК переделать под дисплей 1602? У меня как раз место под него.

viki13viki
Offline
Зарегистрирован: 14.11.2016

Отредактируй свой пост. Когда вставляешь код, на второй вкладке есть сворачивать по умолчанию. Всю страницу занял.
Под любой дисплей можно, но нужно переписывать параметры отображения параметров, и понятное дело чем меньше экран, тем меньше информации влезет, придётся делать больше страниц

Sergei H.
Offline
Зарегистрирован: 17.11.2018

Спасибо подсказали,как код сворачивать.Понял переписывать под 1602 долго.А на счёт ардуино нано и l9637d подскажите в чём дело.Так и должно быть,скетч не будет загружаться пока l9637d не отключишь? 

viki13viki
Offline
Зарегистрирован: 14.11.2016

Дождись когда появится MaksaVV он у нас спец в программировании бортовиков. Он что-то дельное подскажет.

Komandir
Komandir аватар
Offline
Зарегистрирован: 18.08.2018

В нано один UART и вы пытаетесь через него и прошивать и обмениваться по шине с микросхемой. Надо либо отключать RX TX (может достаточно отключить RX) от микросхемы при прошивке, либо прошивать при помощи программатора.

viki13viki
Offline
Зарегистрирован: 14.11.2016

Макс твоя система новая, работает отлично 1929 (сейчас в 1999), всему виной все таки был стороний шрифт. Ща попробую датчики добавить, и потестю пару дней. Пока все гуд. Командир вчерашняя твоя подсказка с датой и часами работает отлично.

Добавил датчики, этих два параметра h = dht.readHumidity(); t = dht.readTemperature(); закинул сюда, не знаю или правильно

if (curmillis - prevWatch > 4000)  { Watch (); prevWatch = curmillis; Trip (); h = dht.readHumidity(); t = dht.readTemperature();}

и добавил остальные вещи, подглядел с самого последнего твоего скетча.

IntTemp температура показывает бред, 53 градуса. Внутренняя и влага вроде норм. подправил вот

//------------все для связи по K-line (тут настраиваем UARTы к-лайников, адреса блоков, скорость инита и отладку) 
#include <SoftwareSerial.h>
 #define TX_PCM 13
 SoftwareSerial K_LINE_PCM   (12, TX_PCM); //RХ,TХ    //UART на котором висит K_line к PCM

#define K_LINE_GAUGE Serial2   //UART     на котором висит K_line к приборке 
#define TX_gauge 16            //TX UARTa на котором висит K_line к приборке 

#define PCM_address  0x11      // адрес PCM 
#define DIAG_address 0xF1      // адрес диагностики

const byte BAUD=200;           // init baudrate - скорость инита при подключении к приборке 
const byte addressGUAGE = 0xB8;// init GAUGE address - адрес щитка приборов при ините (установке связи)

//#define debugPCM             // раскоментировать эту строку для отладки в Serial порту обмена с PCM
#define debugGAUGE             // раскоментировать эту строку для отладки в Serial порту обмена co щитком приборов
 
uint32_t curmillis = 0;        // снимок текущего времени 
 
//------------------------------------------переменные для организации протокола связи с PCM

uint32_t prevRequest  = 0;     // таймер периодических запосов на PCM
uint16_t RequestPeriod = 3500; // периодичность запросов на PCM
uint32_t prevRESETheader=0;    // таймер сброса сообщения, если данные оборвались посередине сообщения 
bool RESETheader_timer;        // таймер сброса сообщения, если данные оборвались посередине сообщения 
uint32_t prev_NOanswer=0;      // таймер контроля неответов от ЭБУ после подачи запросов
bool NOanswer_timer = 0;       // таймер контроля неответов от ЭБУ после подачи запросов
byte noanswers = 0;            // количество подряд неответов от ЭБУ 
uint32_t timerdelay = 0;       // таймер ожидания байт (для успевания появления данных в буфере UART)
bool Delay = 0;                // таймер ожидания байт (для успевания появления данных в буфере UART)
byte waitbyte_RX = 1;          // задержка, мс для успевания появления данных в буфере RX 
                               // (подрегулировать в зависимости от уровня жизнидеятельности на Марсе) 
 #define TIMER_DELAY Delay = 0; timerdelay = curmillis  // включение этого таймера
byte delaybyte_TX  = 1;        // задержка между отправкой байт в запросах, мс
byte header = 0;               // состояние заголовка
byte message_size = 0;         // размер тела сообщения
byte j = 3;                    // инкремент
byte n = 3;                    // количество старт байт
const byte bufsize = 150;      // размер буфера принятого сообщения
byte MessageRx_PCM [bufsize] = {0}; // буфер принятого сообщения
byte crc =0;                   // байт контрольной суммы 
  
// возможные варианты запросов на ЭБУ:
enum REQUEST {INIT, PID, DTCERASE, DTCREAD, PRESENT,};

// текстовки запросов для отладки 
char* textRequest[] = {"INIT", "PID_2101", "DTC_ERASE", "DTC_READ", "PRESENT",} ;

 // сами запросы
 byte PCM_Message_TX[][5] = {
 {1,  0x81,           0,0,0},    // запрос инициализации
 {2,  0x21,0x01,        0,0},    // запрос пид 2101
 {3,  0x14,0xFF,0x00,     0},    // запрос на стирание ошибок
 {4,  0x18,0x00,0xFF,0x00  },    // запрос на чтение ошибок
 {1,  0x3E,           0,0,0},    // запрос присутствия 
                            };
byte request = INIT;             // переменная, показывающая какой запрос будем делать

//------------------------------------------ переменные для организации протокола связи со щитком приборов 

uint32_t prevRESETheaderGAUGE=0; // таймер сброса сообщения, если данные оборвались посередине сообщения 
bool RESETheader_timerGAUGE;     // таймер сброса сообщения, если данные оборвались посередине сообщения  
uint32_t timerdelayGAUGE = 0;    // таймер ожидания байт (для успевания появления данных в буфере UART)
bool DelayGAUGE = 0;             // таймер ожидания байт (для успевания появления данных в буфере UART)
uint32_t prevNoconnect = 0;      // таймер периодической проверки наличия связи со щитком приборов
byte waitbyte_RX_GAUGE = 1;      // задержка, мс для успевания появления данных в буфере RX 
                                 // (подрегулировать в зависимости от уровня жизнидеятельности на Марсе) 
 #define TIMER_DELAYGAUGE DelayGAUGE = 0; timerdelayGAUGE = curmillis  // включение этого таймера
uint32_t prevInitbusGauge = 0;   // таймер для инита щитка приборов
byte NoconnectsGAUGE = 0 ;       // счетчик неответов от щитка приборов 
byte headerGAUGE = 0;            // состояние заголовка
byte message_sizeGAUGE = 0;      // размер тела сообщения
byte jGAUGE = 3;                 // инкремент
byte nGAUGE = 3;                 // количество старт байт
int ChecksumGAUGE =0;            // байт контрольной суммы 
byte InitGauge = 0;              // автомат состояния инита щитка приборов 
const byte bufsizeG = 150;       // размер буфера принятого сообщения
byte MessageRx_GAUGE [bufsizeG] = {0};   // буфер принятого сообщения
byte PIDgauge[] = {0x02,0x11,0x00,0x13}; // запрос параметоров щитка приборов

//-------------------------------------------переменные бортовика

 float L100M = 0; float L100M_last = 1;             //расход на 100 км измеренный за поездку
 float L100 = 0; float L100_last = 1;               //мгновенный расход литров на 100км
 float LHor = 0; float LHor_last = 1;               //мгновенный расход топлива литров в час
 float L100SR = 0;         //расход литров на 100км измеренный раз в интервал kmL  
 float L100SR_TFT = 0;  float L100SR_TFT_last = 1;  // самый средний из расходов на 100км, он выводится на экран

 int L100_Eeprom[11]= {10,10,10,10,10,10,10,10,10,10,10};
 int FuelZamer[10]= {0};  // массив для измерения уровня (количества) топлива 
 int ZamerNumber = 0;     // номер замера уровня (количества) топлива 
 int n_eeprom = 0;        // текущий адрес ячейки еепром для записи расхода
 
 int MAF = 0;            int MAF_last = 1;           //26,27 байты   Sensor de flujo de aire en masa
 float BoostPres = 0;    float BoostPres_last = 1;   //28,29 байты   Presión de refuerzo
 int RPM = 0;            int RPM_last = 1;           //32,33 байты   Velocidad del motor
 int EGRmg = 0;          int EGRmg_last = 1;         //34,35 байты   Comando EGR (Comando de recirculación de gases de escape)
 float BoostPresCom = 0; float BoostPresCom_last = 1;//38,39 байты   Comando de presión de refuerzo
 int Speed = 0;          int Speed_last = 1;         //44,45 байты   Velocidad del vehículo
 float DesaInjQua = 0;   float DesaInjQua_last = 1;  //50,51 байты   Cantidad de inyección deseada
 float InjQua = 0;       float InjQua_last = 1;      //52,53 байты   Cantidad de la inyección
 float StaDaliv = 0;     float StaDaliv_last = 1;    //54,55 байты   Inicio de la entrega
 int PumpRPM = 0;        int PumpRPM_last = 1;       //56,57 байты   Velocidad de la bomba
 float EGRPul = 0;       float EGRPul_last = 1;      //62,63 байты   Relación de impulsos EGR (recirculación de gases de escape
 float SolenPul = 0;     float SolenPul_last = 1;    //64,65 байты   Velocidad de solenoide de control de nivel de remolino Relación de impulsos
 float SolenPre = 0;     float SolenPre_last = 1;    //70,71 байты   Relación de impulsos Presión Electroválvula de presión
 float DesInj = 0;       float DesInj_last = 1;      //72,73 байты   Inyección deseada Inicio
 float ActInj = 0;       float ActInj_last = 1;      //16,17 байты   Inicio de la inyección real
 int TempAir = 0;        int TempAir_last = 1;       //74,75 байты   Temperatura del aire de admisión
 int Temp = 0;           int Temp_last = 1;          //14,15 байты   Temperatura del refrigerante
 int TempOil = 0;        int TempOil_last = 1;       //18,19 байты   Temperatura del aceite del motor
 int TempFuel = 0;       int TempFuel_last = 1;      //58,59 байты   Temperatura del combustible
 int IntTemp = 0;        int IntTemp_last =  1;      //Температура улицы
 
 //все что касается топлива
 float Fuel = 0;       //остаток топлива 
 float Fuel2 = 0;    float Fuel2_last = 1; //остаток мгновенного топлива байт 16 , датчика в баке
 int FuelIGN = 0;      // количество топлвива в баке на момент включения зажигания
 int Fuel_last = 0;    // для формул
 bool flagFuelIGN = 0; // флаг записан ли остаток топлива в момент вкл. зажигания 
 float FuelTrip = 0; float FuelTrip_last = 1;    // количество литров топлива, израсходованное за один цикл включения зажигания
 
 //все что касается километража
 float kmAge = 0;           //пробег, полученный со щитка приборов
 int kmAgeIGN = 0;          //пробег который был в момент включения зажигания 
 int kmAge_last = 0;        // для формул
 bool flagkmAgeIGN = 0;     //флаг записан ли пробег в момент вкл. зажигания 
 float kmTrip = 0; float kmTrip_last = 1;           //пробег за один цикл включения зажигания
 int kmL = 10;              // интервал, через который будет происходить обновление среднего расхода на 100км
 int km = 0;                // переменная для расчетов
 int kmeeprom = 10;         // интервал, через который будет происходить подсчет среднеарифмитического расхода  L100SR_TFT
 int kmTFT =  0;     // переменная для расчетов периодического подсчета среднеарифмитического расхода топлива L100SR_TFT
 int kmREFUELING = 0; int kmREFUELING_last = 1;     // пробег до заправки на остатке топлива 
 
 unsigned long prevWatch = 0;
 unsigned long prevDvoet = 0;
 unsigned long prevData  = 0;

//----------------------------------------------для экрана 
#include <Adafruit_GFX.h>
 #include <MCUFRIEND_kbv.h>
 #include <UTFTGLUE.h>//use GLUE class and constructor
 #include "TouchScreen.h"
 #include <stdint.h>
 #include <SPI.h>
 #include <EEPROM.h>
 //#include "Fonts/Chosence_Bold16pt7b.h";

#define MINPRESSURE 200
#define MAXPRESSURE 1000

//pin 20 SCL , 21 SDA датчик реального времени
 #include <Wire.h>
 #include "RTClib.h"
 RTC_DS3231 rtc;       

UTFTGLUE myGLCD(0x1581,A2,A1,A3,A4,A0); //all dummy args
 
 const int XP = 6, XM = A2, YP = A1, YM = 7; 
 const int TS_LEFT = 136, TS_RT = 907, TS_TOP = 139, TS_BOT = 942;
 TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
 uint16_t ID;
 int x, y;
 char currentPage;
 float h; int h_last = 1; 
 float t; int t_last = 1; 
 bool Dvoet = 0;
 bool reNew = 0;
 #define BLACK 0x0000
 #define WHITE 0xFFFF
 #define RED   0xF800
 #define GREEN 0x07E0

 //--------------------------------------датчики t

byte DSaddress[] = {0x28, 0xFF, 0xA6, 0x19, 0xA8, 0x15, 0x01, 0xD2};
//датчик внутринней температуры и влаги
 #include "DHT.h"
 #define DHTPIN 26   
 #define DHTTYPE DHT22 
 DHT dht(DHTPIN, DHTTYPE);
#include <OneWire.h>
 #define ONE_WIRE_BUS 22   
 OneWire ds(ONE_WIRE_BUS);



 
void setup() {
   uint16_t ID = myGLCD.readID();
   if (ID == 0xD3D3) ID = 0x1581; // write-only shield
   myGLCD.begin(ID);  
   myGLCD.InitLCD(3);
   myGLCD.clrScr();
   myGLCD.setTextSize(2);
   //myGLCD.setFont(&Chosence_Bold16pt7b);
   Wire.begin();
   rtc.begin();
   dht.begin();
   //загрузка стартовой страницы
   currentPage = '0';       
   drawHomeScreen();  

   //подсчет среднеарифметического усредненного расхода
   for (int i = 0; i < 11; i++) L100_Eeprom [i]= EEPROM.read(i);
   for (int i = 0; i < 11; i++) L100SR_TFT = L100SR_TFT +  L100_Eeprom [i];
   L100SR_TFT = (float)L100SR_TFT/110.0;
   if (L100SR_TFT<0) L100SR_TFT = 0;
   if (L100SR_TFT>99) L100SR_TFT = 99;
  
   // строка ниже используется для настройки даты и времени часов 
   // раскоментировать, выставить времая и дату, залить в ардуино. в скетче закоментировать
   // обратно и залить еще раз, иначе каждый раз будет по новой выствлятся это же время и дата
   // (год, месяц, день, часы, минуты, секунды)
   //rtc.adjust(DateTime(2019, 7, 2, 10, 48, 0));
  
 #if defined debugPCM or defined debugGAUGE   
   Serial.begin(115200);
 #endif
   K_LINE_PCM.begin(10400);
   pinMode(TX_PCM, OUTPUT);
  
             }


    void loop() 
                {
                  
curmillis = millis();              // снимок текущего времени

if (curmillis - prevRequest > RequestPeriod && header == 0 ) 
    {
  if (request == INIT) fastinit();                                          // при необходимости делаем переподключение к PCM
  else {sendMessagePCM(request);                                            // отправляем на PCM текущий запрос
         if (request == PID) RequestPeriod = 600; 
         if (request == DTCERASE || request == DTCREAD) RequestPeriod = 2500;} 
  prevRequest = curmillis;
    }

receivePCM ();   // приём сообщений от PCM
receiveGAUGE (); // приём сообщений от щитка приборов
if (header == 0) {Menu ();}
if (curmillis - prevWatch > 4000)  { Watch (); prevWatch = curmillis; Trip (); h = dht.readHumidity(); t = dht.readTemperature();}
//if (curmillis - prevDvoet > 500)  { if (!Dvoet) {myGLCD.setTextColor(WHITE); } else {myGLCD.setTextColor(BLACK); }  myGLCD.print(":", 290, 5); prevDvoet = curmillis; Dvoet=!Dvoet;}                
if (millis() - prevDvoet > 500)  { if (!Dvoet) {myGLCD.print(":", 280, 5);} else {myGLCD.print(" ", 290, 5);} prevDvoet = millis(); Dvoet=!Dvoet;}
                }// end loop


void Trip () {
 
 if (flagkmAgeIGN){

 FuelTrip = FuelIGN - Fuel;                          
  if (kmAge>kmAgeIGN) kmTrip = kmAge - kmAgeIGN;
  if (kmAge<kmAgeIGN) kmTrip = 2000 - (kmAgeIGN - kmAge);  // 2000 это через сколько км у тебя суточный пробег сбрасывается на ноль, поменяй если другое число
  if (kmAge==kmAgeIGN) kmTrip = 0;
 
 //подсчет расхода на 100км за поездку
 L100M = ((float)FuelTrip*100.00)/(float)kmTrip;
  if (L100M<0) L100M = 0;
  if (L100M>99) L100M = 99;

 // ниже цикл считает среднеарифметический расход из еепром раз в пробег, указанный в переменной kmeeprom
  if (kmTrip-kmTFT>kmeeprom) {kmTFT = kmTrip; 

 // тут считаем среднеарифметический усредненного расход из ячеек еепром 
  for (int i = 0; i < 11; i++) L100_Eeprom [i]= EEPROM.read(i);
  for (int i = 0; i < 11; i++) L100SR_TFT = L100SR_TFT +  L100_Eeprom [i];
  L100SR_TFT = (float)L100SR_TFT/110.00;
  if (L100SR_TFT<0) L100SR_TFT = 0;
  if (L100SR_TFT>99) L100SR_TFT = 99;}
 
 // ниже цикл считает расход топлива за пробег, указанный в переменной kmL, здесь же запись в ячейки еепром 
  if (kmTrip-km>kmL) {km=kmTrip; 

 L100SR = ((float)(Fuel_last-Fuel)*100.00)/(float)kmL; // расход/100км  - обновляется раз в 10км, меняется км в int kmL = 10;
 Fuel_last = Fuel;      // сохранение параметров с последнего измерениея 
  if (L100SR<0) L100SR = 0;
  if (L100SR>99) L100SR = 99;

 //расчет остатка километров в баке
 if (L100SR>0) kmREFUELING=((float)Fuel*100.0)/(float)L100SR; //если средний расход больше нуля, то расчитывать км в баке из него
 else kmREFUELING=((float)Fuel*100.00)/(float)L100SR_TFT;    //если ноль или ментше то расчитывать км в баке с устредненного расхода

 // тут записываем  L100SR последовательно в одну из 11 ячеек еепром
 //EEPROM.write (12,n_eeprom);      // ЗДЕСЬ ВНИМАТЕЛЬНО. ЗАГРУЗИТЬ ПРОШИВКУ С ЭТОЙ СТРОКОЙ ОДИН РАЗ, ПОТОМ ЗАКОМЕНТИРОВАТЬ И ЕЩЁ РАЗ ЗАГРУЗИТЬ
 n_eeprom = EEPROM.read (12);    // в ячейке 12 хранится № текущей ячейки для записи расхода, чтобы где остановился при выкл питания, от туда и продолжил
 EEPROM.write(n_eeprom, L100SR*10); 
 n_eeprom++; if (n_eeprom>10) n_eeprom=0;
 EEPROM.write (12,n_eeprom); }}}


 void fastinit() {
   digitalWrite (TX_PCM, HIGH);  // bus idle
   delay(1500);              
   digitalWrite (TX_PCM, LOW);  // first part fastinit  (25 ms LOW)
   delay(25);
   digitalWrite (TX_PCM, HIGH); // second part fastinit (25 ms HIGH)
   delay(25);               
   K_LINE_PCM.begin(10400);
   sendMessagePCM(INIT);        // send start communication message 
      }  
 
  
  void receivePCM () {

 if (K_LINE_PCM.available() ){
    
 // первый старт байт
 if (header == 0 && Delay){TIMER_DELAY ; MessageRx_PCM[0]=K_LINE_PCM.read();  
         if (MessageRx_PCM[0]!=0xFF && bitRead (MessageRx_PCM[0],7)){header = 1; RESETheader_timer = 1; prevRESETheader = curmillis; 
               #ifdef debugPCM
                  Serial.print (F("Receive PCM: ")); printDebugRX(MessageRx_PCM[0]);
               #endif               
                                                }
                          }                  

 // второй старт байт
 if (header == 1 && Delay){TIMER_DELAY ; MessageRx_PCM[1]=K_LINE_PCM.read(); 
 #ifdef debugPCM
      printDebugRX (MessageRx_PCM[1]);
 #endif
      if (MessageRx_PCM[1]==DIAG_address){ header = 2;} 
      else {
        #ifdef debugPCM 
        Serial.println(F(" PCM Message fail address")); 
        #endif
        header = 0; RESETheader_timer = 0;}} 

 // третий старт байт
 if (header == 2 && Delay){ 
  TIMER_DELAY ;
  MessageRx_PCM[2]=K_LINE_PCM.read(); 
  #ifdef debugPCM
  printDebugRX (MessageRx_PCM[2]);
  #endif
  if (MessageRx_PCM[2]==PCM_address){ message_size = MessageRx_PCM[0]; prevRESETheader = curmillis;
       if (MessageRx_PCM[0] !=0x80) {header = 4;  bitWrite (message_size, 7 , 0);j=3;n=3;}
       else {header = 3; j=4;n=4;}
       if (message_size > bufsize) message_size = bufsize;  crc = 0;} 
  else {header = 0; 
        #ifdef debugPCM 
        Serial.println(F("PCM Message fail address")); 
        #endif
        RESETheader_timer = 0;}
  
                          }  
// если размер сообщения указан в дополнительном байте (нулевой байт 0x80) читаем этот дополнительный байт:
if (header == 3 && Delay){
  TIMER_DELAY ; prevRESETheader = curmillis;
  MessageRx_PCM[3]=K_LINE_PCM.read(); 
  #ifdef debugPCM
  printDebugRX(MessageRx_PCM[3]);
  #endif
  message_size = MessageRx_PCM[3]; 
  if (message_size > bufsize) message_size = bufsize;  
  crc = 0; header = 4;  
                         }

  // пишем тело сообщения 
 if (header == 4 && Delay && j< message_size+n+1) {
 MessageRx_PCM[j] = K_LINE_PCM.read(); prevRESETheader = curmillis;
 if (j<message_size+n) crc+= MessageRx_PCM[j]; // подсчёт КС
 
 if (j==message_size+n) header = 5; 
 TIMER_DELAY ; 
 #ifdef debugPCM
 printDebugRX(MessageRx_PCM[j]);
 #endif  
 j++;                                             } 
 }

 // сообщение приняли, действуем
 if (header == 5) {TIMER_DELAY ;  
 #ifdef debugPCM
 Serial.println();
 #endif  
 NOanswer_timer = 0; noanswers = 0;              // сбрасываем таймер контроля неответов 
  
for(byte i = 0; i<n; i++) crc+=MessageRx_PCM[i]; // прибавляем к контрольной сумме старт байты

 // если контрольная сумма верна: 
if ( crc == MessageRx_PCM[message_size+n]) 
{  
  #ifdef debugPCM
  Serial.print (F("Received message is OK! Checksum is correct!"));  Serial.print (F("  ")); Serial.println (millis()); // Если КС совпала, тут чёнибудь нужное делаем
  printDebugRX_CSgood(); 
  #endif
      if (MessageRx_PCM[n]==0xC1 && MessageRx_PCM[n+1]==0x6B && MessageRx_PCM[n+2]==0x8F) {
              if (currentPage!=3) {request = PID; RequestPeriod = 70;} else request = PRESENT, RequestPeriod = 4000; prevRequest = curmillis; // receive good INIT
                                                                                          }
 else if (MessageRx_PCM[n]==0x58) Troublecodes (); // DTC
 else if (MessageRx_PCM[n]==0x54 && MessageRx_PCM[n+1]==0xFF && MessageRx_PCM[n+2]==0x00){ request = PRESENT; RequestPeriod = 4000; prevRequest = curmillis;} // DTC are cleared
 else if (MessageRx_PCM[n]==0x61 && MessageRx_PCM[n+1]==0x01) {dataVars() ; RequestPeriod = 70; prevRequest = curmillis; }           // receive DataStream
 
 
 }   

// если контрольная сумма не совпала: 
#ifdef debugPCM
  else Serial.println("CRC fail!!!" );
#endif
message_size = 0; header=0; RESETheader_timer = 0; j=3; crc = 0;
}

// таймер ожидания байт (для успевания появления данных в буфере UART)
if (!Delay && curmillis - timerdelay > waitbyte_RX) Delay = 1; 

// таймер сброса целостности сообщения (если данные оборвались посередине сообщения)
if (RESETheader_timer && curmillis - prevRESETheader > 200) { 
  #ifdef debugPCM 
  Serial.println(F("Message fail timeout")); 
  #endif 
  RESETheader_timer = 0; header = 0;}   

 
// если нет ответа после запроса: +1 к счетчику неответов. Если накопилось 6 и более: делаем реинит.  
if (request!=INIT && NOanswer_timer && curmillis - prev_NOanswer > RequestPeriod - RequestPeriod/10) 
         {
     NOanswer_timer = 0; noanswers++; 
     if (noanswers>=6) { noanswers = 0; request = INIT; RequestPeriod = 3500;}
         }
}// end receivePCM


void Troublecodes () 
{
  if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1]==0x00){
    myGLCD.clrScr();             
    drawscreen_three();      
    myGLCD.print("NO DTC", 180, 145);
    
                         }
 
  // при получении сообщения о наличии ошибок DTC разберем сообщение выведем на экран ошибки
  if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1]>0){
     
     myGLCD.clrScr();             
     drawscreen_three();       

  for (int i=0; i<MessageRx_PCM[n+8-7]; i++ ) {
     int y = i*35;
     bool nolA=0; bool nolB =0;
  if (!bitRead(MessageRx_PCM[n+11-7+(i*3)],6) && bitRead(MessageRx_PCM[n+11-7+(i*3)],7)){ myGLCD.setTextColor(GREEN, BLACK); 
     myGLCD.print(" -Passive-", 300, (75+y));} // если DTC пасивныый делаем цвет зеленый 
  if (bitRead(MessageRx_PCM[n+11-7+(i*3)],7) && bitRead(MessageRx_PCM[n+11-7+(i*3)],6)) { myGLCD.setTextColor(RED, BLACK);  
     myGLCD.print(" -Active-", 300, (75+y));} // если DTC активный, делаем цвет красный 
     myGLCD.print("ERROR ", 50, (75+y));
     myGLCD.printNumI((i+1), 150, (75+y));
     
  if (!bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && !bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": P", 170, (75+y));
  if (bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && !bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": C", 170, (75+y));
  if (!bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": B", 170, (75+y));
  if (bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": U", 170, (75+y));

  if (MessageRx_PCM[n+9-7+(i*3)]==0x00) {myGLCD.print("00", 230, (75+y)); nolA = 1;}
  if (MessageRx_PCM[n+9-7+(i*3)]<=0x0F&&MessageRx_PCM[n+9-7+(i*3)]!=0) {myGLCD.print("0", 230, (75+y)); nolA = 1;} 
  if (nolA)myGLCD.print(String (MessageRx_PCM[n+9-7+(i*3)],HEX), 246, (75+y)); 
  else myGLCD.print(String (MessageRx_PCM[n+9-7+(i*3)],HEX), 230, (75+y));

  if (MessageRx_PCM[n+10-7+(i*3)]==0x00) {myGLCD.print("00", 262, (75+y)); nolB = 1;}
  if (MessageRx_PCM[n+10-7+(i*3)]<=0x0F&&MessageRx_PCM[n+10-7+(i*3)]!=0) {myGLCD.print("0", 262, (75+y)); nolB = 1;}
  if (nolB)myGLCD.print(String (MessageRx_PCM[n+10-7+(i*3)]),HEX, 278, (75+y)); 
  else myGLCD.print(String (MessageRx_PCM[n+10-7+(i*3)],HEX), 262, (75+y));}} 

request = PRESENT; RequestPeriod = 4000;  prevRequest = curmillis;

}



void dataVars() 
{
  //Barom = MessageRx_PCM[39];
   L100 = (float)LHor*100.0/(float)Speed;
   LHor = (float)RPM* (float)InjQua*2.00/1000.0*60.00/1000.0/0.85;
   MAF =  ((MessageRx_PCM[n+22]*256)+MessageRx_PCM[n+23])/10;
   BoostPres =  ((MessageRx_PCM[n+24]*256)+MessageRx_PCM[n+25])/1000.0;
   RPM =  (MessageRx_PCM[n+35-7]*256)+MessageRx_PCM[n+36-7];
   EGRmg =  ((MessageRx_PCM[n+37-7]*256)+MessageRx_PCM[n+38-7])/10.0;
   BoostPresCom =  ((MessageRx_PCM[n+41-7]*256)+MessageRx_PCM[n+42-7])/1000.0;
   Speed =  ((MessageRx_PCM[n+47-7]*256)+MessageRx_PCM[n+48-7])/100;
   DesaInjQua =  ((MessageRx_PCM[n+53-7]*256)+MessageRx_PCM[n+54-7])/100.0;
   InjQua =  ((MessageRx_PCM[n+55-7]*256)+MessageRx_PCM[n+56-7])/100.0;
   StaDaliv =  ((MessageRx_PCM[n+57-7]*256)+MessageRx_PCM[n+58-7])/100.0;
   PumpRPM =  (MessageRx_PCM[n+59-7]*256)+MessageRx_PCM[n+60-7];
   EGRPul =  ((MessageRx_PCM[n+65-7]*256)+MessageRx_PCM[n+66-7])/100.0;
   SolenPul =  ((MessageRx_PCM[n+67-7]*256)+MessageRx_PCM[n+68-7])/100.0;
   SolenPre =  ((MessageRx_PCM[n+73-7]*256)+MessageRx_PCM[n+74-7])/100.0;
   DesInj =  ((MessageRx_PCM[n+75-7]*3)+(MessageRx_PCM[n+76-7])/100.0)+0.3;
   ActInj =  ((MessageRx_PCM[n+19-7]*3)+(MessageRx_PCM[n+20-7])/100.0)+0.3;
   //TempAir =  ((MessageRx_PCM[n+77-7]*26)-278)+MessageRx_PCM[n+78-7]/10.0;
   //Temp =  ((MessageRx_PCM[n+17-7]*26)-278)+MessageRx_PCM[n+18-7]/10.0;
   //TempOil =  ((MessageRx_PCM[n+21-7]*26)-278)+MessageRx_PCM[n+22-7]/10.0;
   //TempFuel =  ((MessageRx_PCM[n+61-7]*26)-278)+MessageRx_PCM[n+62-7]/10.0;
   //ниже идут расчетные формулы более точные чем те что закоментированы выше
   int A = 0;
   if  (MessageRx_PCM[n+77-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+77-7]==0x0B || MessageRx_PCM[n+77-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+77-7]>=0x0D) A = 279;
   double B = MessageRx_PCM[n+78-7]/10.0;
   double cel , drob ;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     TempAir =  ((MessageRx_PCM[n+77-7]*26)-A)+cel;
   
   if  (MessageRx_PCM[n+17-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+17-7]==0x0B || MessageRx_PCM[n+17-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+17-7]>=0x0D) A = 279;
   B = MessageRx_PCM[n+18-7]/10.0;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     Temp =  ((MessageRx_PCM[n+17-7]*26)-A)+cel;


   if  (MessageRx_PCM[n+21-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+21-7]==0x0B || MessageRx_PCM[n+21-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+21-7]>=0x0D) A = 279;
   B = MessageRx_PCM[n+22-7]/10.0;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     TempOil =  ((MessageRx_PCM[n+21-7]*26)-A)+cel;


   if  (MessageRx_PCM[n+61-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+61-7]==0x0B || MessageRx_PCM[n+61-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+61-7]>=0x0D) A = 279;
   B = MessageRx_PCM[n+62-7]/10.0;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     TempFuel =  ((MessageRx_PCM[n+61-7]*26)-A)+cel;   
     
  //----------------------------------------------------------
  //страниц HOME
  //----------------------------------------------------------
     
     //myGLCD.setBackColor(RED);
     myGLCD.setTextColor(WHITE, BLACK);
     //myGLCD.setBackColor(RED);
     if ((Speed != Speed_last) || reNew) {myGLCD.printNumI(Speed, 360, 7, 3); Speed_last=Speed;}
  if (currentPage == '0') {
     if ((LHor != LHor_last) || reNew) {myGLCD.printNumF(LHor, 1, 75, 40, '.',4); LHor_last=LHor;}
     if ((L100 != L100_last) || reNew) {myGLCD.printNumF(L100, 1, 225, 40,'.',4 ); L100_last=L100;}
     if ((L100M != L100M_last) || reNew) {myGLCD.printNumF(L100M, 1, 75, 75,'.',4 ); L100M_last=L100M;}
     if ((L100SR_TFT != L100SR_TFT_last) || reNew) {myGLCD.printNumF(L100SR_TFT, 1, 225, 75,'.',4 ); L100SR_TFT_last=L100SR_TFT;}
     if ((kmREFUELING != kmREFUELING_last) || reNew) {myGLCD.printNumI(kmREFUELING, 90, 110,3 ); kmREFUELING_last=kmREFUELING;} 
     //if (Fuel<53) 
     if ((Fuel != Fuel_last) || reNew) {myGLCD.printNumF(Fuel, 1, 225, 110,'.',4); Fuel_last=Fuel;}
     //else myGLCD.print("MAX", 210, 110); 
     if ((kmTrip != kmTrip_last) || reNew) {myGLCD.printNumF(kmTrip, 1, 60, 145,'.',5); kmTrip_last=kmTrip;}
     if ((FuelTrip != FuelTrip_last) || reNew) {myGLCD.printNumF(FuelTrip, 1, 210, 145,'.',5); FuelTrip_last=FuelTrip;}
     if ((PumpRPM != PumpRPM_last) || reNew) {myGLCD.printNumI(PumpRPM, 230, 180,4); PumpRPM_last=PumpRPM;}
     if ((RPM != RPM_last) || reNew) {myGLCD.printNumI(RPM, 230, 215,4); RPM_last=RPM;}
     if ((Fuel2 != Fuel2_last) || reNew) {myGLCD.printNumF(Fuel2, 1, 10, 215,'.',4); Fuel2_last=Fuel2;}      
     if ((Temp != Temp_last) || reNew) {myGLCD.printNumI(Temp, 415, 40, 3); Temp_last=Temp;}
     if ((TempOil != TempOil_last) || reNew) {myGLCD.printNumI(TempOil, 415, 75, 3); TempOil_last=TempOil;}
     if ((TempFuel != TempFuel_last) || reNew) {myGLCD.printNumI(TempFuel, 415, 110,3); TempFuel_last=TempFuel;} 
     if ((IntTemp != IntTemp_last) || reNew)   {myGLCD.printNumI(TempFuel, 415, 145 , 3); IntTemp_last=IntTemp;} 
     if ((t != t_last) || reNew) {myGLCD.printNumI(t, 415, 180, 3); t_last=t;}
     if ((TempAir != TempAir_last) || reNew) {myGLCD.printNumI(TempAir, 415, 215, 3); TempAir_last=TempAir;}
     reNew = 0; 
     }
   //----------------------------------------------------------
   //страниц INF1
   //----------------------------------------------------------
   if (currentPage == '1') {
     if ((StaDaliv != StaDaliv_last) || reNew) {myGLCD.printNumF(StaDaliv,1, 385, 40,'.', 4); StaDaliv_last=StaDaliv;}
     if ((DesInj != DesInj_last) || reNew) {myGLCD.printNumF(DesInj,1, 385, 75, '.', 4); DesInj_last=DesInj;}
     if ((ActInj != ActInj_last) || reNew) {myGLCD.printNumF(ActInj,1, 385, 110,'.', 4); ActInj_last=ActInj;} 
     if ((DesaInjQua != DesaInjQua_last) || reNew) {myGLCD.printNumF(DesaInjQua,1, 385, 145,'.', 4);DesaInjQua_last=DesaInjQua;}  
     if ((InjQua != InjQua_last) || reNew) {myGLCD.printNumF(InjQua,1, 385, 180,'.', 4); InjQua_last=InjQua;} 
     if ((MAF != MAF_last) || reNew) {myGLCD.printNumI(MAF, 170, 215, 4); MAF_last=MAF;}
     if ((h != h_last) || reNew) {myGLCD.printNumF(h, 1, 430, 215, 3); h_last=h;}
     reNew = 0; 
     }
   //----------------------------------------------------------
   //страниц INF2
   //----------------------------------------------------------
   if (currentPage == '2') {    
     if ((BoostPres != BoostPres_last) || reNew) {myGLCD.printNumF(BoostPres,1, 400, 40,'.', 4); BoostPres_last=BoostPres;}  
     if ((BoostPresCom != BoostPresCom_last) || reNew) {myGLCD.printNumF(BoostPresCom,1, 400, 75,'.', 4); BoostPresCom_last=BoostPresCom;} 
     if ((EGRmg != EGRmg_last) || reNew) {myGLCD.printNumI(EGRmg, 400, 110, 4); EGRmg_last=EGRmg;}  
     if ((EGRPul != EGRPul_last) || reNew) {myGLCD.printNumF(EGRPul,1, 400, 145,'.', 4); EGRPul_last=EGRPul;}
     if ((SolenPul != SolenPul_last) || reNew) {myGLCD.printNumF(SolenPul, 1, 400, 180,'.', 4); SolenPul_last=SolenPul;} 
     if ((SolenPre != SolenPre_last) || reNew) {myGLCD.printNumF(SolenPre, 0, 400, 215,'.', 4); SolenPre_last=SolenPre;}
     reNew = 0; 
     }
 //reNew = 0;
}



 void sendMessagePCM(const byte &command)
{
 #ifdef debugPCM                         
Serial.print (F("Send request "));  Serial.print (textRequest[command]); Serial.print (F(" to PCM  ")); Serial.println (millis());
 #endif
if (command != INIT) {NOanswer_timer = 1; prev_NOanswer = curmillis;}  //т.к. сейчас будем делать запрос, то запускаем таймер контроля неответов 
  byte size =  PCM_Message_TX[command][0];
  const byte siZe = size+4;
  byte Mes[siZe];
  byte Checksum = 0;
  for(byte i=0; i<siZe; i++) {
    if (i==0) {Mes[i]=size; bitWrite(Mes[i], 7 , 1);}
    if (i==1) Mes[i] = PCM_address;
    if (i==2) Mes[i] = DIAG_address;    
    if (i==3) {for (byte t=1; t<size+1; t++ ) {
           Mes[i]=PCM_Message_TX [command][t]; 
           Checksum+=Mes[i] ; 
           K_LINE_PCM.write (Mes[i]); 
           if (command == INIT) delay (5); else delay (delaybyte_TX);  
           K_LINE_PCM.read(); 
           i++;}}
    if (i!=siZe-1) Checksum+=Mes[i];
    else Mes[i] = Checksum;    
    K_LINE_PCM.write (Mes[i]);
   if (command == INIT) delay (5); else delay (delaybyte_TX);
    K_LINE_PCM.read();
                             }
}// end sendMessagePCM


void receiveGAUGE () {

 if (K_LINE_GAUGE.available() ){
    
 // первый старт байт
 if (headerGAUGE == 0 && DelayGAUGE){TIMER_DELAYGAUGE ; MessageRx_GAUGE[0]=K_LINE_GAUGE.read();  
   if ((InitGauge ==1 && MessageRx_GAUGE[0]==0x55) || (InitGauge ==2 && MessageRx_GAUGE[0]!=0xFF && MessageRx_GAUGE[0]!=0x7F)
   || (InitGauge ==3 && MessageRx_GAUGE[0]!=0xFF && MessageRx_GAUGE[0]!=0x7F)
      )
          {headerGAUGE = 1; RESETheader_timerGAUGE = 1; prevRESETheaderGAUGE = curmillis; 
               #ifdef debugGAUGE
                  Serial.print (F("Receive GAUGE: ")); printDebugRX(MessageRx_GAUGE[0]);
               #endif               
          }
                                    }                  

 // второй старт байт
 if (headerGAUGE == 1 && DelayGAUGE){TIMER_DELAYGAUGE ; MessageRx_GAUGE[1]=K_LINE_GAUGE.read(); 
 #ifdef debugGAUGE
      printDebugRX (MessageRx_GAUGE[1]);
 #endif
      if ( (InitGauge ==1 && MessageRx_GAUGE[1]==0x52)  ||     (InitGauge ==2 && (MessageRx_GAUGE[1]==0xA0 || MessageRx_GAUGE[1]==0xF0))  
      || (InitGauge == 3 && MessageRx_GAUGE[1]==0xA1)){ headerGAUGE = 2;} 
      else {
        #ifdef debugGAUGE 
        Serial.println(F(" GAUGE Message fail address")); 
        #endif
        headerGAUGE = 0; RESETheader_timerGAUGE = 0;}} 

 // третий старт байт
 if (headerGAUGE == 2 && DelayGAUGE){ 
  TIMER_DELAYGAUGE ;
  MessageRx_GAUGE[2]=K_LINE_GAUGE.read(); 
  #ifdef debugGAUGE
  printDebugRX (MessageRx_GAUGE[2]);
  #endif
  if ((InitGauge ==2 && (MessageRx_GAUGE[2]==0x48 || MessageRx_GAUGE[2]==0x55 || MessageRx_GAUGE[2]==0xAA)) || (InitGauge == 3 && MessageRx_GAUGE[2]==0x04)){ message_sizeGAUGE = MessageRx_GAUGE[0]-2; prevRESETheaderGAUGE = curmillis;
       headerGAUGE = 4;  jGAUGE=3; nGAUGE=3;
      
       if (message_sizeGAUGE > bufsizeG) message_sizeGAUGE = bufsizeG;  ChecksumGAUGE = 0;} 
  else if (InitGauge ==1 && MessageRx_GAUGE[2]==0x80) {InitGauge = 2; K_LINE_GAUGE.write(0x7F); delay (2); K_LINE_GAUGE.read();  headerGAUGE = 0; RESETheader_timerGAUGE = 0; 
             #ifdef debugGAUGE
             Serial.println ("Gauge INIT is good!"); 
             #endif
                                                      }     
  else {headerGAUGE = 0; 
        #ifdef debugGAUGE 
        Serial.println(F("GAUGE Message fail address")); 
        #endif
        RESETheader_timerGAUGE = 0;}
  
                          }  

  // пишем тело сообщения 
 if (headerGAUGE == 4 && DelayGAUGE && jGAUGE< message_sizeGAUGE+nGAUGE+1) {
 MessageRx_GAUGE[jGAUGE] = K_LINE_GAUGE.read(); prevRESETheaderGAUGE = curmillis;
 if (jGAUGE<message_sizeGAUGE+nGAUGE-1) ChecksumGAUGE+= MessageRx_GAUGE[jGAUGE]; // подсчёт КС
 
 if (jGAUGE==message_sizeGAUGE+nGAUGE) headerGAUGE = 5; 
 TIMER_DELAYGAUGE ; 
 #ifdef debugGAUGE
 printDebugRX(MessageRx_GAUGE[jGAUGE]);
 #endif  
 jGAUGE++;                                             } 
 }

 // сообщение приняли, действуем
 if (headerGAUGE == 5) {TIMER_DELAYGAUGE ;  
 #ifdef debugGAUGE
 Serial.println();
 #endif  
 
  
for(byte i = 0; i<nGAUGE; i++) ChecksumGAUGE+=MessageRx_GAUGE[i]; // прибавляем к контрольной сумме старт байты
int ChecksumG =  ( ( unsigned int )MessageRx_GAUGE[message_sizeGAUGE+nGAUGE-1] << 8 ) | MessageRx_GAUGE[message_sizeGAUGE+nGAUGE]; // парсинг контрольной суммы из 2 последних байт 
 // если контрольная сумма верна: 
if ( ChecksumGAUGE == ChecksumG) 
{  NoconnectsGAUGE = 0; // сбрасываем на 0 отсутствие связи с панелью
  #ifdef debugGAUGE
  Serial.print (F("Received message is OK! Checksum is correct!"));  Serial.print (F("  ")); Serial.println (millis()); // Если КС совпала, тут чёнибудь нужное делаем
  #endif

      if (MessageRx_GAUGE[1]== 0xA0 && MessageRx_GAUGE[2]== 0x48) {
           #ifdef debugGAUGE
           Serial.println ("ID panel receive! Send request PIDGauge"); 
           #endif
           InitGauge = 3; 
           for (byte i=0; i<sizeof(PIDgauge); i++) { K_LINE_GAUGE.write (PIDgauge[i]); delay (1); K_LINE_GAUGE.read();}
                                                                  }

       if (MessageRx_GAUGE[1]== 0xF0 && (MessageRx_GAUGE[2]== 0xAA || MessageRx_GAUGE[2]== 0x55)) {
           #ifdef debugGAUGE
           Serial.println ("receive present from Gauge. I send PID to Gauge"); 
           #endif
           InitGauge = 3; 
           for (byte i=0; i<sizeof(PIDgauge); i++) { K_LINE_GAUGE.write (PIDgauge[i]); delay (1); K_LINE_GAUGE.read();}
                                                                  }

                                                                  

      if (MessageRx_GAUGE[1]== 0xA1 && MessageRx_GAUGE[2]== 0x04) {
           #ifdef debugGAUGE
           Serial.println (" receive Datastream Gauge!");
           #endif
 Fuel2 = MessageRx_GAUGE[nGAUGE + 16]/2.0; 
 if (!flagFuelIGN) {  Fuel = MessageRx_GAUGE[nGAUGE + 16]/2.0;  kmREFUELING=((float)Fuel*100.00)/(float)L100SR_TFT;} //стартовая запись литров в баке для подсчета затраченных литро
 else Fuel = MessageRx_GAUGE[nGAUGE + 17]/2.0; //для усреднения болтания в баке закоментировать эту строку, а раскоментировать ниже
 
 //для усреднения болтания топлива в баке, раскоментировать, высчитывает среднее
 /*else { FuelZamer[ZamerNumber] = MessageRxGauge[17]/2.00;
 if (ZamerNumber==9) {
 Fuel = 0 ;
 for (int i = 0; i < 10; i++) Fuel = Fuel + FuelZamer[i];
 Fuel = (float)Fuel/10.0;}
 ZamerNumber++; if (ZamerNumber>9) ZamerNumber = 0;}
*/

  kmAge = (MessageRx_GAUGE[nGAUGE + 23]+(MessageRx_GAUGE[nGAUGE + 24]*256))/10.0; //суточный пробег с панели приборов

  //бак у меня на 59 литров, а датчик показывает максимально 53 литра. для этого эта формула
  //если у вас тоже датчик имеет лимит то подправте 53 на свой лимит. 
  //если ваш датчик показывает одинаково с полным баком то закоментировать три нижние строки. 
  if (Fuel<53){
  if (!flagkmAgeIGN) { kmAgeIGN = kmAge; flagkmAgeIGN =1;}
  if (!flagFuelIGN) { FuelIGN = Fuel; Fuel_last = Fuel; flagFuelIGN = 1;}}


           
                                                                  }
 }   

// если контрольная сумма не совпала: 
#ifdef debugGAUGE
  else Serial.println("CRC fail!!!" );
#endif
message_sizeGAUGE = 0; headerGAUGE=0; RESETheader_timerGAUGE = 0; jGAUGE=3; ChecksumGAUGE = 0;
}

// таймер ожидания байт (для успевания появления данных в буфере UART)
if (!DelayGAUGE && curmillis - timerdelayGAUGE > waitbyte_RX_GAUGE) DelayGAUGE = 1; 

// таймер сброса целостности сообщения (если данные оборвались посередине сообщения)
if (RESETheader_timerGAUGE && curmillis - prevRESETheaderGAUGE > 1000) { 
  #ifdef debugGAUGE 
  Serial.println(F("Message fail timeout")); 
  #endif 
  RESETheader_timerGAUGE = 0; headerGAUGE = 0;}   

 if (curmillis - prevNoconnect > 500) {NoconnectsGAUGE ++ ; if (NoconnectsGAUGE>=8){
 #ifdef debugGAUGE 
  Serial.println (F("       Connect GAUGE failed!!! ")) ;
 #endif
  NoconnectsGAUGE = 0 ;InitGauge = 0 ; } prevNoconnect = curmillis; }
 
 InitBusGAUGE ();
}// end receiveGAUGE


void InitBusGAUGE () 
{
  if (InitGauge == 0){
#ifdef debugGAUGE 
  Serial.println ("Send startsession - address Gauge");
#endif   
  K_LINE_GAUGE.end();
   pinMode(TX_gauge, OUTPUT);
   digitalWrite (TX_gauge, HIGH);                                           // BUS IDLE
   InitGauge = 5; prevInitbusGauge = curmillis;
   }  
 if (InitGauge == 5 && curmillis - prevInitbusGauge>1500)  {InitGauge = 6;} // BUS IDLE
 if (InitGauge == 6)
 {    
   byte boudrate = 1000/BAUD;
   digitalWrite (TX_gauge, LOW);   delay (boudrate); // старт бит
   for (byte i=0; i<8; i++){digitalWrite (TX_gauge, bitRead(addressGUAGE, i)); delay (boudrate);} // биты тела адреса 
   digitalWrite (TX_gauge, HIGH);  delay (boudrate); // стоп бит
   K_LINE_GAUGE.begin(9600);
   InitGauge = 1; 
 }
}




#if defined debugPCM or defined debugGAUGE
void printDebugRX (const byte &inbyte) {if (inbyte<=15) Serial.print(F("0")); Serial.print (inbyte, HEX);  Serial.print (F(" "));}
#endif

#ifdef debugPCM
void printDebugRX_CSgood(){
if (MessageRx_PCM[n]==0xC1 && MessageRx_PCM[n+1]==0x6B && MessageRx_PCM[n+2]==0x8F) {Serial.println (F("   Initialization OK!!!!")); }
 else if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1]==0x00) {Serial.println (F("     NO DTC  "));}
 else if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1] >0x00) {Serial.println (F("     DTC is found!"));} 
 else if (MessageRx_PCM[n]==0x54 && MessageRx_PCM[n+1]==0xFF && MessageRx_PCM[n+2]==0x00){Serial.println (F("     DTC CLEARED  "));}
 else if (MessageRx_PCM[n]==0x61 && MessageRx_PCM[n+1]==0x01) {Serial.println (F("     Receive PCM DATAstream"));}}
#endif                          



void Menu () {
     TouchHOME();
    if (currentPage == '0') {
     
     TouchINF1();
     TouchINF2();
     TouchCHECK(); }
    if (currentPage == '1') { 
     
     TouchINF2();
     TouchCHECK(); }
    if (currentPage == '2') { 
     
     TouchINF1();
     TouchCHECK(); }
    if (currentPage == '3') { 
     
     TouchREAD();
     TouchERASE(); }}   
 
 
  void drawHomeScreen() {
    line() ;
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии и текста красный
    myGLCD.drawLine(295,35,295,248); // линия вертикальная
    myGLCD.drawLine(145,35,145,178); // линия вертикальная
    myGLCD.drawLine(80,178,80,247); // линия вертикальная
    myGLCD.print("L/H", 10, 40);
    myGLCD.print("L/A", 148, 40);
    myGLCD.print("L/V", 10, 75);
    myGLCD.print("L/M", 148, 75);
    myGLCD.print("D/K", 10, 110);
    myGLCD.print("D/L", 148, 110);
    myGLCD.print("V/K", 10, 145);
    myGLCD.print("V/L", 148, 145);
    myGLCD.print("PUMP  RPM", 82, 180);
    myGLCD.print("ENGI   RPM", 82, 215);
    myGLCD.print("D/L/A", 10, 180);
    myGLCD.print("Motor C", 300, 40);
    myGLCD.print("OIL     C", 300, 75);
    myGLCD.print("FUEL   C", 300, 110);
    myGLCD.print("FUERA  C", 300, 145);
    myGLCD.print("DENTRO  C", 300, 180);
    myGLCD.print("INTAIR  C", 300, 215);
    //myGLCD.setTextColor(RED); 
    myGLCD.drawRoundRect (15, 255, 145, 310);
    myGLCD.print("INF 1", 55, 270);
    myGLCD.drawRoundRect (175, 255, 305, 310);
    myGLCD.print("INF 2", 215, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("CHECK", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 7);
    myGLCD.print("Km/h", 410, 7);
    reNew = 1;
    Watch ();
  }
 //-------------------------------------------------
   void drawscreen_one() {
    line() ;
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии и текста красный
    myGLCD.print("Start of Delivery   *CA:", 10, 40);
    myGLCD.print("Desir inject Start  *CA:", 10, 75);
    myGLCD.print("Actua Inject Start  *CA:", 10, 110);
    myGLCD.print("Desir Inject Quan  mg/s:", 10, 145);
    myGLCD.print("Actu Inject Quant mg/s:", 10, 180);
    myGLCD.print("MAF  mg/s:", 10, 215);
    myGLCD.print("Humedad %:", 255, 215);
    //myGLCD.setTextColor(RED);
    myGLCD.drawRoundRect (175, 255, 305, 310);
    myGLCD.print("INF 2", 215, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("CHECK", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 7);
    myGLCD.print("Km/h", 410, 7);
    reNew = 1;
    Watch ();
    }
 //-------------------------------------------------
  void drawscreen_two() {
    line() ;
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии и текста красный
    myGLCD.print("Boost Press       Bar:", 10, 40);
    myGLCD.print("Boost Press Com  Bar:", 10, 75);
    myGLCD.print("EGR command     mg/s:", 10, 110);
    myGLCD.print("EGR Pulse Ratio      %:", 10, 145);
    myGLCD.print("Solenoide Pulse      %:", 10, 180);
    myGLCD.print("Solenoide Boost      %:", 10, 215);
    //myGLCD.setColor(RED);
    myGLCD.drawRoundRect (15, 255, 145, 310);
    myGLCD.print("INF 1", 55, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("CHECK", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 7);
    myGLCD.print("Km/h", 410, 7);
    reNew = 1;
    Watch ();
    }
 //----------------------------------------------------------------------------
  void drawscreen_three() {
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии красный
    myGLCD.drawLine(1,35,479,35); // линия горизонтальная
    myGLCD.drawLine(1,248,479,248); // линия горизонтальная
    //myGLCD.setTextColor(RED);
    myGLCD.drawRoundRect (15, 255, 145, 310);
    myGLCD.print("ERASE", 55, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("READ", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 5);
    reNew = 1;
    Watch ();
   }

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//кнопки тач . координаты и переходы
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void TouchHOME(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {if (p.x > 140 && p.x < 320 && p.y > 140 && p.y < 260 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (1, 1, 77, 37);
        currentPage = '0';     
        request = PID; RequestPeriod = 10; prevRequest = curmillis; // на PCM в этом окне посылается запрос текущих параметров
        myGLCD.clrScr();             
        drawHomeScreen();
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchINF1(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
      if (p.x > 150 && p.x < 450 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (15, 255, 145, 310);
        currentPage = '1';    
        request = PID; RequestPeriod = 10; prevRequest = curmillis; // на PCM в этом окне посылается запрос текущих параметров       
        myGLCD.clrScr();             
        drawscreen_one();
        x = 0;
        y = 0;
        p.z = 0;}}}
    
void TouchINF2(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
    if (p.x > 450 && p.x < 680 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (175, 255, 305, 310);
        currentPage = '2';     
        request = PID; RequestPeriod = 600; prevRequest = curmillis; // на PCM в этом окне посылается запрос текущих параметров      
        myGLCD.clrScr();             
        drawscreen_two();
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchCHECK(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
if (p.x > 690 && p.x < 950 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (335, 255, 465, 310);
        currentPage = '3';  
  //     request = DTCREAD; RequestPeriod = 10; prevRequest = curmillis; // на PCM в этом окне посылается запрос чтения ошибок  
        myGLCD.clrScr();             
        drawscreen_three();
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchREAD(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
if (p.x > 690 && p.x < 950 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (335, 255, 465, 310);
        request = DTCREAD; RequestPeriod = 300; prevRequest = curmillis; // на PCM при нажатии этой кнопки посылается запрос чтения ошибок  
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchERASE(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
if (p.x > 150 && p.x < 450 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      {myGLCD.drawRoundRect (15, 255, 145, 310);
       request = DTCERASE; RequestPeriod = 300;  prevRequest = curmillis; // на PCM при нажатии этой кнопки посылается запрос удаления ошибок
       myGLCD.clrScr();
       drawscreen_three();
       myGLCD.print("DTC BORRADO", 180, 145);
       
        x = 0;
        y = 0;
        p.z = 0;}}}
 ////////////////////////////////////////////////////////////////////////////////////////
 //прорисовка линий
 ///////////////////////////////////////////////////////////////////////////////////////
 void line() {
    //myGLCD.setTextColor(RED); // цвет линии красный
    myGLCD.drawLine(1,35,479,35); // линия горизонтальная
    myGLCD.drawLine(1,73,479,73); // линия горизонтальная
    myGLCD.drawLine(1,108,479,108); // линия горизонтальная
    myGLCD.drawLine(1,143,479,143); // линия горизонтальная
    myGLCD.drawLine(1,178,479,178); // линия горизонтальная
    myGLCD.drawLine(1,212,479,212); // линия горизонтальная
    myGLCD.drawLine(1,248,479,248); // линия горизонтальная
             }


void Watch (){
   DateTime now = rtc.now();
   int minut = now.minute(); 
   int hour = now.hour();
   int mon = now.month();
   int date = now.day();
   int Year = now.year();
 static  int minut_last; 
 static  int hour_last;
 static  int mon_last;
 static  int date_last;
 static  int Year_last;
 myGLCD.setTextColor(WHITE, BLACK); //белый цвет цифры

 if (date != date_last || reNew){ myGLCD.printNumI(date, 85, 7, 2, '0'); date_last = date; }

 if (mon!=mon_last || reNew){myGLCD.printNumI(mon, 130, 7, 2, '0'); mon_last = mon; }  
 
 if (Year!=Year_last || reNew) {  myGLCD.printNumI(Year, 175, 7); Year_last = Year; }
   
 if (hour!=hour_last || reNew){ myGLCD.printNumI(hour, 255, 7, 2, '0'); hour_last = hour; } 
   
 if (minut!=minut_last || reNew ){ myGLCD.printNumI(minut, 300, 7, 2, '0'); minut_last = minut; }
   } 

void Temperature () { 

     static boolean p=0; // флаг работы: запрос температуры или её чтение
p=!p;
if (p) {ds.reset();      // сброс шины
        ds.write(0xCC);  // обращение ко всем датчикам
        ds.write(0x44);  // начать преобразование (без паразитного питания)  
       }
else   {
 
        int Temper_= 20;  byte buff[9];
        ds.reset();
        ds.select(DSaddress);    
        ds.write(0xBE); // Read Scratchpad (чтение регистров)  
        for (byte j = 0; j<9; j++) buff[j]= ds.read(); //читаем все 9 байт от датчика 
        ds.reset();
        if (OneWire::crc8(buff, 8) == buff[8]){        // если контрольная сумма совпадает
        Temper_ =  buff[0] | (buff[1]<<8);             // читаем температуру из первых двух байт (остальные были нужны для проверки CRC)
        Temper_ = Temper_ / 16;
        if  (Temper_ < 150 && Temper_ > -50 && Temper_ !=85 && Temper_!=-127)  IntTemp =  Temper_;
                 
                                              }
                                                      
}
   }

может я чета упустил с IntTemp?

Sergei H.
Offline
Зарегистрирован: 17.11.2018

Извините ,что влез в Вашу тему.Спасибо ,что разъясняете. Сделал выключатель между Rx ардуино и L9637.загружается без проблем теперь. А загрузчик CH340 в ардуино нано может влиять на инициализацию с ЭБУ. У меня получается ,что выводы Rx загрузчика CH340 через 1КОм по схеме соединяются с Rx L9637d.

 

MaksVV
Offline
Зарегистрирован: 06.08.2015

повесьте свой к-лайн адаптер l9637d на софт_сериал, например 10 11 пины. Тогда и скетч загружать сможете и отладку в порт выводить. и скетч ваш на 6 тыщ строк, избавьте)))

Sergei H.
Offline
Зарегистрирован: 17.11.2018

Скетч не мой,взял отсюда https://code.google.com/p/opengauge/wiki/OBDuino. В программировании я почти ноль,если поможете код переписать буду премного благодарен.У меня дисплей 1602 встает в штатное место из под часов почти без переделок.Плюс датчики температуры KTY81/210  49руб всего.Кстати показывает температуру довольно точно.

MaksVV
Offline
Зарегистрирован: 06.08.2015

viki13viki пишет:

Добавил датчики, этих два параметра h = dht.readHumidity(); t = dht.readTemperature(); закинул сюда, не знаю или правильно

if (curmillis - prevWatch > 4000)  { Watch (); prevWatch = curmillis; Trip (); h = dht.readHumidity(); t = dht.readTemperature();}

и добавил остальные вещи, подглядел с самого последнего твоего скетча.

IntTemp температура показывает бред, 53 градуса. Внутренняя и влага вроде норм. подправил вот

может я чета упустил с IntTemp?

да упустил. Во первых забыл вызывать функцию Temperature()

сделай так 

if (curmillis - prevWatch > 4000)  { Watch (); prevWatch = curmillis; Trip (); h = dht.readHumidity(); t = dht.readTemperature(); Temperature();}

и вместо переменной IntTemp ты в итоге чтото другое на экране распечатываешь, температуру топлива чтоли. 

viki13viki
Offline
Зарегистрирован: 14.11.2016

Возможно топливо, очень похожи температуры, завтра все проверю.

MaksVV
Offline
Зарегистрирован: 06.08.2015

ещё #1742 ты писал 

viki13viki пишет:
следующая проблем 

при переходе на другую страницу на всех экранах пропадают часы и дата, остаются только разделительные линии, но когда меняются минуты, минуты появляются. какгбудто прорисовывает только изменяющийся элемент

потом смотри 1743 проблема была устранена!

Далее у тебя опять Watch относительно reNew как то переместилось. И командир тоже самое тебе опять подсказывает. Одни и теже проблемы решаем :( 

Потом Temperature() куда то пропала...

MaksVV
Offline
Зарегистрирован: 06.08.2015

с часами даже могу сказать когда у тебя съехало: #1891 ты скетч выкладывал ещё было всё хорошо. Потом #1911 выкладываешь - у тебя там часы съехали.

и естественно в моих последующих скетчах  везде тоже часы съехали -  я ж с твоих "последних" скетчей переделываю, надеясь что там всё гуд. 

viki13viki
Offline
Зарегистрирован: 14.11.2016

Да я уже сам запутался. Потому что когда не хотел в очередной раз вам голову морочить, сам пытался что то менять, и уже запутался. Если ты видишь где я накосячил, если сможешь, и будет время кинь правильный скетчь на твои профессиональный взгляд. Спасибо.
Не идёт мне программирование, как-то все тяжело и запущено для меня.

MaksVV
Offline
Зарегистрирован: 06.08.2015
//------------все для связи по K-line (тут настраиваем UARTы к-лайников, адреса блоков, скорость инита и отладку) 
#include <SoftwareSerial.h>
 #define TX_PCM 13
 SoftwareSerial K_LINE_PCM   (12, TX_PCM); //RХ,TХ    //UART на котором висит K_line к PCM

#define K_LINE_GAUGE Serial2   //UART     на котором висит K_line к приборке 
#define TX_gauge 16            //TX UARTa на котором висит K_line к приборке 

#define PCM_address  0x11      // адрес PCM 
#define DIAG_address 0xF1      // адрес диагностики

const byte BAUD=200;           // init baudrate - скорость инита при подключении к приборке 
const byte addressGUAGE = 0xB8;// init GAUGE address - адрес щитка приборов при ините (установке связи)

//#define debugPCM             // раскоментировать эту строку для отладки в Serial порту обмена с PCM
#define debugGAUGE             // раскоментировать эту строку для отладки в Serial порту обмена co щитком приборов
 
uint32_t curmillis = 0;        // снимок текущего времени 
 
//------------------------------------------переменные для организации протокола связи с PCM

uint32_t prevRequest  = 0;     // таймер периодических запосов на PCM
uint16_t RequestPeriod = 3500; // периодичность запросов на PCM
uint32_t prevRESETheader=0;    // таймер сброса сообщения, если данные оборвались посередине сообщения 
bool RESETheader_timer;        // таймер сброса сообщения, если данные оборвались посередине сообщения 
uint32_t prev_NOanswer=0;      // таймер контроля неответов от ЭБУ после подачи запросов
bool NOanswer_timer = 0;       // таймер контроля неответов от ЭБУ после подачи запросов
byte noanswers = 0;            // количество подряд неответов от ЭБУ 
uint32_t timerdelay = 0;       // таймер ожидания байт (для успевания появления данных в буфере UART)
bool Delay = 0;                // таймер ожидания байт (для успевания появления данных в буфере UART)
byte waitbyte_RX = 1;          // задержка, мс для успевания появления данных в буфере RX 
                               // (подрегулировать в зависимости от уровня жизнидеятельности на Марсе) 
 #define TIMER_DELAY Delay = 0; timerdelay = curmillis  // включение этого таймера
byte delaybyte_TX  = 1;        // задержка между отправкой байт в запросах, мс
byte header = 0;               // состояние заголовка
byte message_size = 0;         // размер тела сообщения
byte j = 3;                    // инкремент
byte n = 3;                    // количество старт байт
const byte bufsize = 150;      // размер буфера принятого сообщения
byte MessageRx_PCM [bufsize] = {0}; // буфер принятого сообщения
byte crc =0;                   // байт контрольной суммы 
  
// возможные варианты запросов на ЭБУ:
enum REQUEST {INIT, PID, DTCERASE, DTCREAD, PRESENT,};

// текстовки запросов для отладки 
char* textRequest[] = {"INIT", "PID_2101", "DTC_ERASE", "DTC_READ", "PRESENT",} ;

 // сами запросы
 byte PCM_Message_TX[][5] = {
 {1,  0x81,           0,0,0},    // запрос инициализации
 {2,  0x21,0x01,        0,0},    // запрос пид 2101
 {3,  0x14,0xFF,0x00,     0},    // запрос на стирание ошибок
 {4,  0x18,0x00,0xFF,0x00  },    // запрос на чтение ошибок
 {1,  0x3E,           0,0,0},    // запрос присутствия 
                            };
byte request = INIT;             // переменная, показывающая какой запрос будем делать

//------------------------------------------ переменные для организации протокола связи со щитком приборов 

uint32_t prevRESETheaderGAUGE=0; // таймер сброса сообщения, если данные оборвались посередине сообщения 
bool RESETheader_timerGAUGE;     // таймер сброса сообщения, если данные оборвались посередине сообщения  
uint32_t timerdelayGAUGE = 0;    // таймер ожидания байт (для успевания появления данных в буфере UART)
bool DelayGAUGE = 0;             // таймер ожидания байт (для успевания появления данных в буфере UART)
uint32_t prevNoconnect = 0;      // таймер периодической проверки наличия связи со щитком приборов
byte waitbyte_RX_GAUGE = 1;      // задержка, мс для успевания появления данных в буфере RX 
                                 // (подрегулировать в зависимости от уровня жизнидеятельности на Марсе) 
 #define TIMER_DELAYGAUGE DelayGAUGE = 0; timerdelayGAUGE = curmillis  // включение этого таймера
uint32_t prevInitbusGauge = 0;   // таймер для инита щитка приборов
byte NoconnectsGAUGE = 0 ;       // счетчик неответов от щитка приборов 
byte headerGAUGE = 0;            // состояние заголовка
byte message_sizeGAUGE = 0;      // размер тела сообщения
byte jGAUGE = 3;                 // инкремент
byte nGAUGE = 3;                 // количество старт байт
int ChecksumGAUGE =0;            // байт контрольной суммы 
byte InitGauge = 0;              // автомат состояния инита щитка приборов 
const byte bufsizeG = 150;       // размер буфера принятого сообщения
byte MessageRx_GAUGE [bufsizeG] = {0};   // буфер принятого сообщения
byte PIDgauge[] = {0x02,0x11,0x00,0x13}; // запрос параметоров щитка приборов

//-------------------------------------------переменные бортовика

 float L100M = 0; float L100M_last = 1;             //расход на 100 км измеренный за поездку
 float L100 = 0; float L100_last = 1;               //мгновенный расход литров на 100км
 float LHor = 0; float LHor_last = 1;               //мгновенный расход топлива литров в час
 float L100SR = 0;         //расход литров на 100км измеренный раз в интервал kmL  
 float L100SR_TFT = 0;  float L100SR_TFT_last = 1;  // самый средний из расходов на 100км, он выводится на экран

 int L100_Eeprom[11]= {10,10,10,10,10,10,10,10,10,10,10};
 int FuelZamer[10]= {0};  // массив для измерения уровня (количества) топлива 
 int ZamerNumber = 0;     // номер замера уровня (количества) топлива 
 int n_eeprom = 0;        // текущий адрес ячейки еепром для записи расхода
 
 int MAF = 0;            int MAF_last = 1;           //26,27 байты   Sensor de flujo de aire en masa
 float BoostPres = 0;    float BoostPres_last = 1;   //28,29 байты   Presión de refuerzo
 int RPM = 0;            int RPM_last = 1;           //32,33 байты   Velocidad del motor
 int EGRmg = 0;          int EGRmg_last = 1;         //34,35 байты   Comando EGR (Comando de recirculación de gases de escape)
 float BoostPresCom = 0; float BoostPresCom_last = 1;//38,39 байты   Comando de presión de refuerzo
 int Speed = 0;          int Speed_last = 1;         //44,45 байты   Velocidad del vehículo
 float DesaInjQua = 0;   float DesaInjQua_last = 1;  //50,51 байты   Cantidad de inyección deseada
 float InjQua = 0;       float InjQua_last = 1;      //52,53 байты   Cantidad de la inyección
 float StaDaliv = 0;     float StaDaliv_last = 1;    //54,55 байты   Inicio de la entrega
 int PumpRPM = 0;        int PumpRPM_last = 1;       //56,57 байты   Velocidad de la bomba
 float EGRPul = 0;       float EGRPul_last = 1;      //62,63 байты   Relación de impulsos EGR (recirculación de gases de escape
 float SolenPul = 0;     float SolenPul_last = 1;    //64,65 байты   Velocidad de solenoide de control de nivel de remolino Relación de impulsos
 float SolenPre = 0;     float SolenPre_last = 1;    //70,71 байты   Relación de impulsos Presión Electroválvula de presión
 float DesInj = 0;       float DesInj_last = 1;      //72,73 байты   Inyección deseada Inicio
 float ActInj = 0;       float ActInj_last = 1;      //16,17 байты   Inicio de la inyección real
 int TempAir = 0;        int TempAir_last = 1;       //74,75 байты   Temperatura del aire de admisión
 int Temp = 0;           int Temp_last = 1;          //14,15 байты   Temperatura del refrigerante
 int TempOil = 0;        int TempOil_last = 1;       //18,19 байты   Temperatura del aceite del motor
 int TempFuel = 0;       int TempFuel_last = 1;      //58,59 байты   Temperatura del combustible
 int IntTemp = 0;        int IntTemp_last =  1;      //Температура улицы
 
 //все что касается топлива
 float Fuel = 0;       //остаток топлива 
 float Fuel2 = 0;    float Fuel2_last = 1; //остаток мгновенного топлива байт 16 , датчика в баке
 int FuelIGN = 0;      // количество топлвива в баке на момент включения зажигания
 int Fuel_last = 0;    // для формул
 bool flagFuelIGN = 0; // флаг записан ли остаток топлива в момент вкл. зажигания 
 float FuelTrip = 0; float FuelTrip_last = 1;    // количество литров топлива, израсходованное за один цикл включения зажигания
 
 //все что касается километража
 float kmAge = 0;           //пробег, полученный со щитка приборов
 int kmAgeIGN = 0;          //пробег который был в момент включения зажигания 
 int kmAge_last = 0;        // для формул
 bool flagkmAgeIGN = 0;     //флаг записан ли пробег в момент вкл. зажигания 
 float kmTrip = 0; float kmTrip_last = 1;           //пробег за один цикл включения зажигания
 int kmL = 10;              // интервал, через который будет происходить обновление среднего расхода на 100км
 int km = 0;                // переменная для расчетов
 int kmeeprom = 10;         // интервал, через который будет происходить подсчет среднеарифмитического расхода  L100SR_TFT
 int kmTFT =  0;     // переменная для расчетов периодического подсчета среднеарифмитического расхода топлива L100SR_TFT
 int kmREFUELING = 0; int kmREFUELING_last = 1;     // пробег до заправки на остатке топлива 
 
 unsigned long prevWatch = 0;
 unsigned long prevDvoet = 0;
 

//----------------------------------------------для экрана 
#include <Adafruit_GFX.h>
 #include <MCUFRIEND_kbv.h>
 #include <UTFTGLUE.h>//use GLUE class and constructor
 #include "TouchScreen.h"
 #include <stdint.h>
 #include <SPI.h>
 #include <EEPROM.h>
 //#include "Fonts/Chosence_Bold16pt7b.h";

#define MINPRESSURE 200
#define MAXPRESSURE 1000

//pin 20 SCL , 21 SDA датчик реального времени
 #include <Wire.h>
 #include "RTClib.h"
 RTC_DS3231 rtc;       

UTFTGLUE myGLCD(0x1581,A2,A1,A3,A4,A0); //all dummy args
 
 const int XP = 6, XM = A2, YP = A1, YM = 7; 
 const int TS_LEFT = 136, TS_RT = 907, TS_TOP = 139, TS_BOT = 942;
 TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
 uint16_t ID;
 int x, y;
 char currentPage;
 float h; int h_last = 1; 
 float t; int t_last = 1; 
 bool Dvoet = 0;
 bool reNew = 0;
 #define BLACK 0x0000
 #define WHITE 0xFFFF
 #define RED   0xF800
 #define GREEN 0x07E0

 //--------------------------------------датчики t

byte DSaddress[] = {0x28, 0xFF, 0xA6, 0x19, 0xA8, 0x15, 0x01, 0xD2};
//датчик внутринней температуры и влаги
 #include "DHT.h"
 #define DHTPIN 26   
 #define DHTTYPE DHT22 
 DHT dht(DHTPIN, DHTTYPE);
#include <OneWire.h>
 #define ONE_WIRE_BUS 22   
 OneWire ds(ONE_WIRE_BUS);



 
void setup() {
   uint16_t ID = myGLCD.readID();
   if (ID == 0xD3D3) ID = 0x1581; // write-only shield
   myGLCD.begin(ID);  
   myGLCD.InitLCD(3);
   myGLCD.clrScr();
   myGLCD.setTextSize(2);
   //myGLCD.setFont(&Chosence_Bold16pt7b);
   Wire.begin();
   rtc.begin();
   dht.begin();
   //загрузка стартовой страницы
   currentPage = '0';       
   drawHomeScreen();  

   //подсчет среднеарифметического усредненного расхода
   for (int i = 0; i < 11; i++) L100_Eeprom [i]= EEPROM.read(i);
   for (int i = 0; i < 11; i++) L100SR_TFT = L100SR_TFT +  L100_Eeprom [i];
   L100SR_TFT = (float)L100SR_TFT/110.0;
   if (L100SR_TFT<0) L100SR_TFT = 0;
   if (L100SR_TFT>99) L100SR_TFT = 99;
  
   // строка ниже используется для настройки даты и времени часов 
   // раскоментировать, выставить времая и дату, залить в ардуино. в скетче закоментировать
   // обратно и залить еще раз, иначе каждый раз будет по новой выствлятся это же время и дата
   // (год, месяц, день, часы, минуты, секунды)
   //rtc.adjust(DateTime(2019, 7, 2, 10, 48, 0));
  
 #if defined debugPCM or defined debugGAUGE   
   Serial.begin(115200);
 #endif
   K_LINE_PCM.begin(10400);
   pinMode(TX_PCM, OUTPUT);
  
             }


    void loop() 
                {
                  
curmillis = millis();              // снимок текущего времени

if (curmillis - prevRequest > RequestPeriod && header == 0 ) 
    {
  if (request == INIT) fastinit();                                          // при необходимости делаем переподключение к PCM
  else {sendMessagePCM(request);                                            // отправляем на PCM текущий запрос
         if (request == PID) RequestPeriod = 600; 
         if (request == DTCERASE || request == DTCREAD) RequestPeriod = 2500;} 
  prevRequest = curmillis;
    }

receivePCM ();   // приём сообщений от PCM
receiveGAUGE (); // приём сообщений от щитка приборов
if (header == 0) {Menu ();}
if (curmillis - prevWatch > 4000)  { Watch (); prevWatch = curmillis; Trip (); h = dht.readHumidity(); t = dht.readTemperature();Temperature ();}
//if (curmillis - prevDvoet > 500)  { if (!Dvoet) {myGLCD.setTextColor(WHITE); } else {myGLCD.setTextColor(BLACK); }  myGLCD.print(":", 290, 5); prevDvoet = curmillis; Dvoet=!Dvoet;}                
if (millis() - prevDvoet > 500)  { if (!Dvoet) {myGLCD.print(":", 280, 5);} else {myGLCD.print(" ", 290, 5);} prevDvoet = millis(); Dvoet=!Dvoet;}
                }// end loop


void Trip () {
 
 if (flagkmAgeIGN){

 FuelTrip = FuelIGN - Fuel;                          
  if (kmAge>kmAgeIGN) kmTrip = kmAge - kmAgeIGN;
  if (kmAge<kmAgeIGN) kmTrip = 2000 - (kmAgeIGN - kmAge);  // 2000 это через сколько км у тебя суточный пробег сбрасывается на ноль, поменяй если другое число
  if (kmAge==kmAgeIGN) kmTrip = 0;
 
 //подсчет расхода на 100км за поездку
 L100M = ((float)FuelTrip*100.00)/(float)kmTrip;
  if (L100M<0) L100M = 0;
  if (L100M>99) L100M = 99;

 // ниже цикл считает среднеарифметический расход из еепром раз в пробег, указанный в переменной kmeeprom
  if (kmTrip-kmTFT>kmeeprom) {kmTFT = kmTrip; 

 // тут считаем среднеарифметический усредненного расход из ячеек еепром 
  for (int i = 0; i < 11; i++) L100_Eeprom [i]= EEPROM.read(i);
  for (int i = 0; i < 11; i++) L100SR_TFT = L100SR_TFT +  L100_Eeprom [i];
  L100SR_TFT = (float)L100SR_TFT/110.00;
  if (L100SR_TFT<0) L100SR_TFT = 0;
  if (L100SR_TFT>99) L100SR_TFT = 99;}
 
 // ниже цикл считает расход топлива за пробег, указанный в переменной kmL, здесь же запись в ячейки еепром 
  if (kmTrip-km>kmL) {km=kmTrip; 

 L100SR = ((float)(Fuel_last-Fuel)*100.00)/(float)kmL; // расход/100км  - обновляется раз в 10км, меняется км в int kmL = 10;
 Fuel_last = Fuel;      // сохранение параметров с последнего измерениея 
  if (L100SR<0) L100SR = 0;
  if (L100SR>99) L100SR = 99;

 //расчет остатка километров в баке
 if (L100SR>0) kmREFUELING=((float)Fuel*100.0)/(float)L100SR; //если средний расход больше нуля, то расчитывать км в баке из него
 else kmREFUELING=((float)Fuel*100.00)/(float)L100SR_TFT;    //если ноль или ментше то расчитывать км в баке с устредненного расхода

 // тут записываем  L100SR последовательно в одну из 11 ячеек еепром
 //EEPROM.write (12,n_eeprom);      // ЗДЕСЬ ВНИМАТЕЛЬНО. ЗАГРУЗИТЬ ПРОШИВКУ С ЭТОЙ СТРОКОЙ ОДИН РАЗ, ПОТОМ ЗАКОМЕНТИРОВАТЬ И ЕЩЁ РАЗ ЗАГРУЗИТЬ
 n_eeprom = EEPROM.read (12);    // в ячейке 12 хранится № текущей ячейки для записи расхода, чтобы где остановился при выкл питания, от туда и продолжил
 EEPROM.write(n_eeprom, L100SR*10); 
 n_eeprom++; if (n_eeprom>10) n_eeprom=0;
 EEPROM.write (12,n_eeprom); }}}


 void fastinit() {
   digitalWrite (TX_PCM, HIGH);  // bus idle
   delay(1500);              
   digitalWrite (TX_PCM, LOW);  // first part fastinit  (25 ms LOW)
   delay(25);
   digitalWrite (TX_PCM, HIGH); // second part fastinit (25 ms HIGH)
   delay(25);               
   K_LINE_PCM.begin(10400);
   sendMessagePCM(INIT);        // send start communication message 
      }  
 
  
  void receivePCM () {

 if (K_LINE_PCM.available() ){
    
 // первый старт байт
 if (header == 0 && Delay){TIMER_DELAY ; MessageRx_PCM[0]=K_LINE_PCM.read();  
         if (MessageRx_PCM[0]!=0xFF && bitRead (MessageRx_PCM[0],7)){header = 1; RESETheader_timer = 1; prevRESETheader = curmillis; 
               #ifdef debugPCM
                  Serial.print (F("Receive PCM: ")); printDebugRX(MessageRx_PCM[0]);
               #endif               
                                                }
                          }                  

 // второй старт байт
 if (header == 1 && Delay){TIMER_DELAY ; MessageRx_PCM[1]=K_LINE_PCM.read(); 
 #ifdef debugPCM
      printDebugRX (MessageRx_PCM[1]);
 #endif
      if (MessageRx_PCM[1]==DIAG_address){ header = 2;} 
      else {
        #ifdef debugPCM 
        Serial.println(F(" PCM Message fail address")); 
        #endif
        header = 0; RESETheader_timer = 0;}} 

 // третий старт байт
 if (header == 2 && Delay){ 
  TIMER_DELAY ;
  MessageRx_PCM[2]=K_LINE_PCM.read(); 
  #ifdef debugPCM
  printDebugRX (MessageRx_PCM[2]);
  #endif
  if (MessageRx_PCM[2]==PCM_address){ message_size = MessageRx_PCM[0]; prevRESETheader = curmillis;
       if (MessageRx_PCM[0] !=0x80) {header = 4;  bitWrite (message_size, 7 , 0);j=3;n=3;}
       else {header = 3; j=4;n=4;}
       if (message_size > bufsize) message_size = bufsize;  crc = 0;} 
  else {header = 0; 
        #ifdef debugPCM 
        Serial.println(F("PCM Message fail address")); 
        #endif
        RESETheader_timer = 0;}
  
                          }  
// если размер сообщения указан в дополнительном байте (нулевой байт 0x80) читаем этот дополнительный байт:
if (header == 3 && Delay){
  TIMER_DELAY ; prevRESETheader = curmillis;
  MessageRx_PCM[3]=K_LINE_PCM.read(); 
  #ifdef debugPCM
  printDebugRX(MessageRx_PCM[3]);
  #endif
  message_size = MessageRx_PCM[3]; 
  if (message_size > bufsize) message_size = bufsize;  
  crc = 0; header = 4;  
                         }

  // пишем тело сообщения 
 if (header == 4 && Delay && j< message_size+n+1) {
 MessageRx_PCM[j] = K_LINE_PCM.read(); prevRESETheader = curmillis;
 if (j<message_size+n) crc+= MessageRx_PCM[j]; // подсчёт КС
 
 if (j==message_size+n) header = 5; 
 TIMER_DELAY ; 
 #ifdef debugPCM
 printDebugRX(MessageRx_PCM[j]);
 #endif  
 j++;                                             } 
 }

 // сообщение приняли, действуем
 if (header == 5) {TIMER_DELAY ;  
 #ifdef debugPCM
 Serial.println();
 #endif  
 NOanswer_timer = 0; noanswers = 0;              // сбрасываем таймер контроля неответов 
  
for(byte i = 0; i<n; i++) crc+=MessageRx_PCM[i]; // прибавляем к контрольной сумме старт байты

 // если контрольная сумма верна: 
if ( crc == MessageRx_PCM[message_size+n]) 
{  
  #ifdef debugPCM
  Serial.print (F("Received message is OK! Checksum is correct!"));  Serial.print (F("  ")); Serial.println (millis()); // Если КС совпала, тут чёнибудь нужное делаем
  printDebugRX_CSgood(); 
  #endif
      if (MessageRx_PCM[n]==0xC1 && MessageRx_PCM[n+1]==0x6B && MessageRx_PCM[n+2]==0x8F) {
              if (currentPage!=3) {request = PID; RequestPeriod = 70;} else request = PRESENT, RequestPeriod = 4000; prevRequest = curmillis; // receive good INIT
                                                                                          }
 else if (MessageRx_PCM[n]==0x58) Troublecodes (); // DTC
 else if (MessageRx_PCM[n]==0x54 && MessageRx_PCM[n+1]==0xFF && MessageRx_PCM[n+2]==0x00){ request = PRESENT; RequestPeriod = 4000; prevRequest = curmillis;} // DTC are cleared
 else if (MessageRx_PCM[n]==0x61 && MessageRx_PCM[n+1]==0x01) {dataVars() ; RequestPeriod = 70; prevRequest = curmillis; }           // receive DataStream
 
 
 }   

// если контрольная сумма не совпала: 
#ifdef debugPCM
  else Serial.println("CRC fail!!!" );
#endif
message_size = 0; header=0; RESETheader_timer = 0; j=3; crc = 0;
}

// таймер ожидания байт (для успевания появления данных в буфере UART)
if (!Delay && curmillis - timerdelay > waitbyte_RX) Delay = 1; 

// таймер сброса целостности сообщения (если данные оборвались посередине сообщения)
if (RESETheader_timer && curmillis - prevRESETheader > 200) { 
  #ifdef debugPCM 
  Serial.println(F("Message fail timeout")); 
  #endif 
  RESETheader_timer = 0; header = 0;}   

 
// если нет ответа после запроса: +1 к счетчику неответов. Если накопилось 6 и более: делаем реинит.  
if (request!=INIT && NOanswer_timer && curmillis - prev_NOanswer > RequestPeriod - RequestPeriod/10) 
         {
     NOanswer_timer = 0; noanswers++; 
     if (noanswers>=6) { noanswers = 0; request = INIT; RequestPeriod = 3500;}
         }
}// end receivePCM


void Troublecodes () 
{
  if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1]==0x00){
    myGLCD.clrScr();             
    drawscreen_three();      
    myGLCD.print("NO DTC", 180, 145);
    
                         }
 
  // при получении сообщения о наличии ошибок DTC разберем сообщение выведем на экран ошибки
  if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1]>0){
     
     myGLCD.clrScr();             
     drawscreen_three();       

  for (int i=0; i<MessageRx_PCM[n+8-7]; i++ ) {
     int y = i*35;
     bool nolA=0; bool nolB =0;
  if (!bitRead(MessageRx_PCM[n+11-7+(i*3)],6) && bitRead(MessageRx_PCM[n+11-7+(i*3)],7)){ myGLCD.setTextColor(GREEN, BLACK); 
     myGLCD.print(" -Passive-", 300, (75+y));} // если DTC пасивныый делаем цвет зеленый 
  if (bitRead(MessageRx_PCM[n+11-7+(i*3)],7) && bitRead(MessageRx_PCM[n+11-7+(i*3)],6)) { myGLCD.setTextColor(RED, BLACK);  
     myGLCD.print(" -Active-", 300, (75+y));} // если DTC активный, делаем цвет красный 
     myGLCD.print("ERROR ", 50, (75+y));
     myGLCD.printNumI((i+1), 150, (75+y));
     
  if (!bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && !bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": P", 170, (75+y));
  if (bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && !bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": C", 170, (75+y));
  if (!bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": B", 170, (75+y));
  if (bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": U", 170, (75+y));

  if (MessageRx_PCM[n+9-7+(i*3)]==0x00) {myGLCD.print("00", 230, (75+y)); nolA = 1;}
  if (MessageRx_PCM[n+9-7+(i*3)]<=0x0F&&MessageRx_PCM[n+9-7+(i*3)]!=0) {myGLCD.print("0", 230, (75+y)); nolA = 1;} 
  if (nolA)myGLCD.print(String (MessageRx_PCM[n+9-7+(i*3)],HEX), 246, (75+y)); 
  else myGLCD.print(String (MessageRx_PCM[n+9-7+(i*3)],HEX), 230, (75+y));

  if (MessageRx_PCM[n+10-7+(i*3)]==0x00) {myGLCD.print("00", 262, (75+y)); nolB = 1;}
  if (MessageRx_PCM[n+10-7+(i*3)]<=0x0F&&MessageRx_PCM[n+10-7+(i*3)]!=0) {myGLCD.print("0", 262, (75+y)); nolB = 1;}
  if (nolB)myGLCD.print(String (MessageRx_PCM[n+10-7+(i*3)]),HEX, 278, (75+y)); 
  else myGLCD.print(String (MessageRx_PCM[n+10-7+(i*3)],HEX), 262, (75+y));}} 

request = PRESENT; RequestPeriod = 4000;  prevRequest = curmillis;

}



void dataVars() 
{
  //Barom = MessageRx_PCM[39];
   L100 = (float)LHor*100.0/(float)Speed;
   LHor = (float)RPM* (float)InjQua*2.00/1000.0*60.00/1000.0/0.85;
   MAF =  ((MessageRx_PCM[n+22]*256)+MessageRx_PCM[n+23])/10;
   BoostPres =  ((MessageRx_PCM[n+24]*256)+MessageRx_PCM[n+25])/1000.0;
   RPM =  (MessageRx_PCM[n+35-7]*256)+MessageRx_PCM[n+36-7];
   EGRmg =  ((MessageRx_PCM[n+37-7]*256)+MessageRx_PCM[n+38-7])/10.0;
   BoostPresCom =  ((MessageRx_PCM[n+41-7]*256)+MessageRx_PCM[n+42-7])/1000.0;
   Speed =  ((MessageRx_PCM[n+47-7]*256)+MessageRx_PCM[n+48-7])/100;
   DesaInjQua =  ((MessageRx_PCM[n+53-7]*256)+MessageRx_PCM[n+54-7])/100.0;
   InjQua =  ((MessageRx_PCM[n+55-7]*256)+MessageRx_PCM[n+56-7])/100.0;
   StaDaliv =  ((MessageRx_PCM[n+57-7]*256)+MessageRx_PCM[n+58-7])/100.0;
   PumpRPM =  (MessageRx_PCM[n+59-7]*256)+MessageRx_PCM[n+60-7];
   EGRPul =  ((MessageRx_PCM[n+65-7]*256)+MessageRx_PCM[n+66-7])/100.0;
   SolenPul =  ((MessageRx_PCM[n+67-7]*256)+MessageRx_PCM[n+68-7])/100.0;
   SolenPre =  ((MessageRx_PCM[n+73-7]*256)+MessageRx_PCM[n+74-7])/100.0;
   DesInj =  ((MessageRx_PCM[n+75-7]*3)+(MessageRx_PCM[n+76-7])/100.0)+0.3;
   ActInj =  ((MessageRx_PCM[n+19-7]*3)+(MessageRx_PCM[n+20-7])/100.0)+0.3;
   //TempAir =  ((MessageRx_PCM[n+77-7]*26)-278)+MessageRx_PCM[n+78-7]/10.0;
   //Temp =  ((MessageRx_PCM[n+17-7]*26)-278)+MessageRx_PCM[n+18-7]/10.0;
   //TempOil =  ((MessageRx_PCM[n+21-7]*26)-278)+MessageRx_PCM[n+22-7]/10.0;
   //TempFuel =  ((MessageRx_PCM[n+61-7]*26)-278)+MessageRx_PCM[n+62-7]/10.0;
   //ниже идут расчетные формулы более точные чем те что закоментированы выше
   int A = 0;
   if  (MessageRx_PCM[n+77-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+77-7]==0x0B || MessageRx_PCM[n+77-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+77-7]>=0x0D) A = 279;
   double B = MessageRx_PCM[n+78-7]/10.0;
   double cel , drob ;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     TempAir =  ((MessageRx_PCM[n+77-7]*26)-A)+cel;
   
   if  (MessageRx_PCM[n+17-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+17-7]==0x0B || MessageRx_PCM[n+17-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+17-7]>=0x0D) A = 279;
   B = MessageRx_PCM[n+18-7]/10.0;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     Temp =  ((MessageRx_PCM[n+17-7]*26)-A)+cel;


   if  (MessageRx_PCM[n+21-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+21-7]==0x0B || MessageRx_PCM[n+21-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+21-7]>=0x0D) A = 279;
   B = MessageRx_PCM[n+22-7]/10.0;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     TempOil =  ((MessageRx_PCM[n+21-7]*26)-A)+cel;


   if  (MessageRx_PCM[n+61-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+61-7]==0x0B || MessageRx_PCM[n+61-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+61-7]>=0x0D) A = 279;
   B = MessageRx_PCM[n+62-7]/10.0;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     TempFuel =  ((MessageRx_PCM[n+61-7]*26)-A)+cel;   
     
  //----------------------------------------------------------
  //страниц HOME
  //----------------------------------------------------------
     
     //myGLCD.setBackColor(RED);
     myGLCD.setTextColor(WHITE, BLACK);
     //myGLCD.setBackColor(RED);
     if ((Speed != Speed_last) || reNew) {myGLCD.printNumI(Speed, 360, 7, 3); Speed_last=Speed;}
  if (currentPage == '0') {
     if ((LHor != LHor_last) || reNew) {myGLCD.printNumF(LHor, 1, 75, 40, '.',4); LHor_last=LHor;}
     if ((L100 != L100_last) || reNew) {myGLCD.printNumF(L100, 1, 225, 40,'.',4 ); L100_last=L100;}
     if ((L100M != L100M_last) || reNew) {myGLCD.printNumF(L100M, 1, 75, 75,'.',4 ); L100M_last=L100M;}
     if ((L100SR_TFT != L100SR_TFT_last) || reNew) {myGLCD.printNumF(L100SR_TFT, 1, 225, 75,'.',4 ); L100SR_TFT_last=L100SR_TFT;}
     if ((kmREFUELING != kmREFUELING_last) || reNew) {myGLCD.printNumI(kmREFUELING, 90, 110,3 ); kmREFUELING_last=kmREFUELING;} 
     //if (Fuel<53) 
     if ((Fuel != Fuel_last) || reNew) {myGLCD.printNumF(Fuel, 1, 225, 110,'.',4); Fuel_last=Fuel;}
     //else myGLCD.print("MAX", 210, 110); 
     if ((kmTrip != kmTrip_last) || reNew) {myGLCD.printNumF(kmTrip, 1, 60, 145,'.',5); kmTrip_last=kmTrip;}
     if ((FuelTrip != FuelTrip_last) || reNew) {myGLCD.printNumF(FuelTrip, 1, 210, 145,'.',5); FuelTrip_last=FuelTrip;}
     if ((PumpRPM != PumpRPM_last) || reNew) {myGLCD.printNumI(PumpRPM, 230, 180,4); PumpRPM_last=PumpRPM;}
     if ((RPM != RPM_last) || reNew) {myGLCD.printNumI(RPM, 230, 215,4); RPM_last=RPM;}
     if ((Fuel2 != Fuel2_last) || reNew) {myGLCD.printNumF(Fuel2, 1, 10, 215,'.',4); Fuel2_last=Fuel2;}      
     if ((Temp != Temp_last) || reNew) {myGLCD.printNumI(Temp, 415, 40, 3); Temp_last=Temp;}
     if ((TempOil != TempOil_last) || reNew) {myGLCD.printNumI(TempOil, 415, 75, 3); TempOil_last=TempOil;}
     if ((TempFuel != TempFuel_last) || reNew) {myGLCD.printNumI(TempFuel, 415, 110,3); TempFuel_last=TempFuel;} 
     if ((IntTemp != IntTemp_last) || reNew)   {myGLCD.printNumI(IntTemp, 415, 145 , 3); IntTemp_last=IntTemp;} 
     if ((t != t_last) || reNew) {myGLCD.printNumI(t, 415, 180, 3); t_last=t;}
     if ((TempAir != TempAir_last) || reNew) {myGLCD.printNumI(TempAir, 415, 215, 3); TempAir_last=TempAir;}
     reNew = 0; 
     }
   //----------------------------------------------------------
   //страниц INF1
   //----------------------------------------------------------
   if (currentPage == '1') {
     if ((StaDaliv != StaDaliv_last) || reNew) {myGLCD.printNumF(StaDaliv,1, 385, 40,'.', 4); StaDaliv_last=StaDaliv;}
     if ((DesInj != DesInj_last) || reNew) {myGLCD.printNumF(DesInj,1, 385, 75, '.', 4); DesInj_last=DesInj;}
     if ((ActInj != ActInj_last) || reNew) {myGLCD.printNumF(ActInj,1, 385, 110,'.', 4); ActInj_last=ActInj;} 
     if ((DesaInjQua != DesaInjQua_last) || reNew) {myGLCD.printNumF(DesaInjQua,1, 385, 145,'.', 4);DesaInjQua_last=DesaInjQua;}  
     if ((InjQua != InjQua_last) || reNew) {myGLCD.printNumF(InjQua,1, 385, 180,'.', 4); InjQua_last=InjQua;} 
     if ((MAF != MAF_last) || reNew) {myGLCD.printNumI(MAF, 170, 215, 4); MAF_last=MAF;}
     if ((h != h_last) || reNew) {myGLCD.printNumF(h, 1, 430, 215, 3); h_last=h;}
     reNew = 0; 
     }
   //----------------------------------------------------------
   //страниц INF2
   //----------------------------------------------------------
   if (currentPage == '2') {    
     if ((BoostPres != BoostPres_last) || reNew) {myGLCD.printNumF(BoostPres,1, 400, 40,'.', 4); BoostPres_last=BoostPres;}  
     if ((BoostPresCom != BoostPresCom_last) || reNew) {myGLCD.printNumF(BoostPresCom,1, 400, 75,'.', 4); BoostPresCom_last=BoostPresCom;} 
     if ((EGRmg != EGRmg_last) || reNew) {myGLCD.printNumI(EGRmg, 400, 110, 4); EGRmg_last=EGRmg;}  
     if ((EGRPul != EGRPul_last) || reNew) {myGLCD.printNumF(EGRPul,1, 400, 145,'.', 4); EGRPul_last=EGRPul;}
     if ((SolenPul != SolenPul_last) || reNew) {myGLCD.printNumF(SolenPul, 1, 400, 180,'.', 4); SolenPul_last=SolenPul;} 
     if ((SolenPre != SolenPre_last) || reNew) {myGLCD.printNumF(SolenPre, 0, 400, 215,'.', 4); SolenPre_last=SolenPre;}
     reNew = 0; 
     }
 //reNew = 0;
}



 void sendMessagePCM(const byte &command)
{
 #ifdef debugPCM                         
Serial.print (F("Send request "));  Serial.print (textRequest[command]); Serial.print (F(" to PCM  ")); Serial.println (millis());
 #endif
if (command != INIT) {NOanswer_timer = 1; prev_NOanswer = curmillis;}  //т.к. сейчас будем делать запрос, то запускаем таймер контроля неответов 
  byte size =  PCM_Message_TX[command][0];
  const byte siZe = size+4;
  byte Mes[siZe];
  byte Checksum = 0;
  for(byte i=0; i<siZe; i++) {
    if (i==0) {Mes[i]=size; bitWrite(Mes[i], 7 , 1);}
    if (i==1) Mes[i] = PCM_address;
    if (i==2) Mes[i] = DIAG_address;    
    if (i==3) {for (byte t=1; t<size+1; t++ ) {
           Mes[i]=PCM_Message_TX [command][t]; 
           Checksum+=Mes[i] ; 
           K_LINE_PCM.write (Mes[i]); 
           if (command == INIT) delay (5); else delay (delaybyte_TX);  
           K_LINE_PCM.read(); 
           i++;}}
    if (i!=siZe-1) Checksum+=Mes[i];
    else Mes[i] = Checksum;    
    K_LINE_PCM.write (Mes[i]);
   if (command == INIT) delay (5); else delay (delaybyte_TX);
    K_LINE_PCM.read();
                             }
}// end sendMessagePCM


void receiveGAUGE () {

 if (K_LINE_GAUGE.available() ){
    
 // первый старт байт
 if (headerGAUGE == 0 && DelayGAUGE){TIMER_DELAYGAUGE ; MessageRx_GAUGE[0]=K_LINE_GAUGE.read();  
   if ((InitGauge ==1 && MessageRx_GAUGE[0]==0x55) || (InitGauge ==2 && MessageRx_GAUGE[0]!=0xFF && MessageRx_GAUGE[0]!=0x7F)
   || (InitGauge ==3 && MessageRx_GAUGE[0]!=0xFF && MessageRx_GAUGE[0]!=0x7F)
      )
          {headerGAUGE = 1; RESETheader_timerGAUGE = 1; prevRESETheaderGAUGE = curmillis; 
               #ifdef debugGAUGE
                  Serial.print (F("Receive GAUGE: ")); printDebugRX(MessageRx_GAUGE[0]);
               #endif               
          }
                                    }                  

 // второй старт байт
 if (headerGAUGE == 1 && DelayGAUGE){TIMER_DELAYGAUGE ; MessageRx_GAUGE[1]=K_LINE_GAUGE.read(); 
 #ifdef debugGAUGE
      printDebugRX (MessageRx_GAUGE[1]);
 #endif
      if ( (InitGauge ==1 && MessageRx_GAUGE[1]==0x52)  ||     (InitGauge ==2 && (MessageRx_GAUGE[1]==0xA0 || MessageRx_GAUGE[1]==0xF0))  
      || (InitGauge == 3 && MessageRx_GAUGE[1]==0xA1)){ headerGAUGE = 2;} 
      else {
        #ifdef debugGAUGE 
        Serial.println(F(" GAUGE Message fail address")); 
        #endif
        headerGAUGE = 0; RESETheader_timerGAUGE = 0;}} 

 // третий старт байт
 if (headerGAUGE == 2 && DelayGAUGE){ 
  TIMER_DELAYGAUGE ;
  MessageRx_GAUGE[2]=K_LINE_GAUGE.read(); 
  #ifdef debugGAUGE
  printDebugRX (MessageRx_GAUGE[2]);
  #endif
  if ((InitGauge ==2 && (MessageRx_GAUGE[2]==0x48 || MessageRx_GAUGE[2]==0x55 || MessageRx_GAUGE[2]==0xAA)) || (InitGauge == 3 && MessageRx_GAUGE[2]==0x04)){ message_sizeGAUGE = MessageRx_GAUGE[0]-2; prevRESETheaderGAUGE = curmillis;
       headerGAUGE = 4;  jGAUGE=3; nGAUGE=3;
      
       if (message_sizeGAUGE > bufsizeG) message_sizeGAUGE = bufsizeG;  ChecksumGAUGE = 0;} 
  else if (InitGauge ==1 && MessageRx_GAUGE[2]==0x80) {InitGauge = 2; K_LINE_GAUGE.write(0x7F); delay (2); K_LINE_GAUGE.read();  headerGAUGE = 0; RESETheader_timerGAUGE = 0; 
             #ifdef debugGAUGE
             Serial.println ("Gauge INIT is good!"); 
             #endif
                                                      }     
  else {headerGAUGE = 0; 
        #ifdef debugGAUGE 
        Serial.println(F("GAUGE Message fail address")); 
        #endif
        RESETheader_timerGAUGE = 0;}
  
                          }  

  // пишем тело сообщения 
 if (headerGAUGE == 4 && DelayGAUGE && jGAUGE< message_sizeGAUGE+nGAUGE+1) {
 MessageRx_GAUGE[jGAUGE] = K_LINE_GAUGE.read(); prevRESETheaderGAUGE = curmillis;
 if (jGAUGE<message_sizeGAUGE+nGAUGE-1) ChecksumGAUGE+= MessageRx_GAUGE[jGAUGE]; // подсчёт КС
 
 if (jGAUGE==message_sizeGAUGE+nGAUGE) headerGAUGE = 5; 
 TIMER_DELAYGAUGE ; 
 #ifdef debugGAUGE
 printDebugRX(MessageRx_GAUGE[jGAUGE]);
 #endif  
 jGAUGE++;                                             } 
 }

 // сообщение приняли, действуем
 if (headerGAUGE == 5) {TIMER_DELAYGAUGE ;  
 #ifdef debugGAUGE
 Serial.println();
 #endif  
 
  
for(byte i = 0; i<nGAUGE; i++) ChecksumGAUGE+=MessageRx_GAUGE[i]; // прибавляем к контрольной сумме старт байты
int ChecksumG =  ( ( unsigned int )MessageRx_GAUGE[message_sizeGAUGE+nGAUGE-1] << 8 ) | MessageRx_GAUGE[message_sizeGAUGE+nGAUGE]; // парсинг контрольной суммы из 2 последних байт 
 // если контрольная сумма верна: 
if ( ChecksumGAUGE == ChecksumG) 
{  NoconnectsGAUGE = 0; // сбрасываем на 0 отсутствие связи с панелью
  #ifdef debugGAUGE
  Serial.print (F("Received message is OK! Checksum is correct!"));  Serial.print (F("  ")); Serial.println (millis()); // Если КС совпала, тут чёнибудь нужное делаем
  #endif

      if (MessageRx_GAUGE[1]== 0xA0 && MessageRx_GAUGE[2]== 0x48) {
           #ifdef debugGAUGE
           Serial.println ("ID panel receive! Send request PIDGauge"); 
           #endif
           InitGauge = 3; 
           for (byte i=0; i<sizeof(PIDgauge); i++) { K_LINE_GAUGE.write (PIDgauge[i]); delay (1); K_LINE_GAUGE.read();}
                                                                  }

       if (MessageRx_GAUGE[1]== 0xF0 && (MessageRx_GAUGE[2]== 0xAA || MessageRx_GAUGE[2]== 0x55)) {
           #ifdef debugGAUGE
           Serial.println ("receive present from Gauge. I send PID to Gauge"); 
           #endif
           InitGauge = 3; 
           for (byte i=0; i<sizeof(PIDgauge); i++) { K_LINE_GAUGE.write (PIDgauge[i]); delay (1); K_LINE_GAUGE.read();}
                                                                  }

                                                                  

      if (MessageRx_GAUGE[1]== 0xA1 && MessageRx_GAUGE[2]== 0x04) {
           #ifdef debugGAUGE
           Serial.println (" receive Datastream Gauge!");
           #endif
 Fuel2 = MessageRx_GAUGE[nGAUGE + 16]/2.0; 
 if (!flagFuelIGN) {  Fuel = MessageRx_GAUGE[nGAUGE + 16]/2.0;  kmREFUELING=((float)Fuel*100.00)/(float)L100SR_TFT;} //стартовая запись литров в баке для подсчета затраченных литро
 else Fuel = MessageRx_GAUGE[nGAUGE + 17]/2.0; //для усреднения болтания в баке закоментировать эту строку, а раскоментировать ниже
 
 //для усреднения болтания топлива в баке, раскоментировать, высчитывает среднее
 /*else { FuelZamer[ZamerNumber] = MessageRxGauge[17]/2.00;
 if (ZamerNumber==9) {
 Fuel = 0 ;
 for (int i = 0; i < 10; i++) Fuel = Fuel + FuelZamer[i];
 Fuel = (float)Fuel/10.0;}
 ZamerNumber++; if (ZamerNumber>9) ZamerNumber = 0;}
*/

  kmAge = (MessageRx_GAUGE[nGAUGE + 23]+(MessageRx_GAUGE[nGAUGE + 24]*256))/10.0; //суточный пробег с панели приборов

  //бак у меня на 59 литров, а датчик показывает максимально 53 литра. для этого эта формула
  //если у вас тоже датчик имеет лимит то подправте 53 на свой лимит. 
  //если ваш датчик показывает одинаково с полным баком то закоментировать три нижние строки. 
  if (Fuel<53){
  if (!flagkmAgeIGN) { kmAgeIGN = kmAge; flagkmAgeIGN =1;}
  if (!flagFuelIGN) { FuelIGN = Fuel; Fuel_last = Fuel; flagFuelIGN = 1;}}


           
                                                                  }
 }   

// если контрольная сумма не совпала: 
#ifdef debugGAUGE
  else Serial.println("CRC fail!!!" );
#endif
message_sizeGAUGE = 0; headerGAUGE=0; RESETheader_timerGAUGE = 0; jGAUGE=3; ChecksumGAUGE = 0;
}

// таймер ожидания байт (для успевания появления данных в буфере UART)
if (!DelayGAUGE && curmillis - timerdelayGAUGE > waitbyte_RX_GAUGE) DelayGAUGE = 1; 

// таймер сброса целостности сообщения (если данные оборвались посередине сообщения)
if (RESETheader_timerGAUGE && curmillis - prevRESETheaderGAUGE > 1000) { 
  #ifdef debugGAUGE 
  Serial.println(F("Message fail timeout")); 
  #endif 
  RESETheader_timerGAUGE = 0; headerGAUGE = 0;}   

 if (curmillis - prevNoconnect > 500) {NoconnectsGAUGE ++ ; if (NoconnectsGAUGE>=8){
 #ifdef debugGAUGE 
  Serial.println (F("       Connect GAUGE failed!!! ")) ;
 #endif
  NoconnectsGAUGE = 0 ;InitGauge = 0 ; } prevNoconnect = curmillis; }
 
 InitBusGAUGE ();
}// end receiveGAUGE


void InitBusGAUGE () 
{
  if (InitGauge == 0){
#ifdef debugGAUGE 
  Serial.println ("Send startsession - address Gauge");
#endif   
  K_LINE_GAUGE.end();
   pinMode(TX_gauge, OUTPUT);
   digitalWrite (TX_gauge, HIGH);                                           // BUS IDLE
   InitGauge = 5; prevInitbusGauge = curmillis;
   }  
 if (InitGauge == 5 && curmillis - prevInitbusGauge>1500)  {InitGauge = 6;} // BUS IDLE
 if (InitGauge == 6)
 {    
   byte boudrate = 1000/BAUD;
   digitalWrite (TX_gauge, LOW);   delay (boudrate); // старт бит
   for (byte i=0; i<8; i++){digitalWrite (TX_gauge, bitRead(addressGUAGE, i)); delay (boudrate);} // биты тела адреса 
   digitalWrite (TX_gauge, HIGH);  delay (boudrate); // стоп бит
   K_LINE_GAUGE.begin(9600);
   InitGauge = 1; 
 }
}




#if defined debugPCM or defined debugGAUGE
void printDebugRX (const byte &inbyte) {if (inbyte<=15) Serial.print(F("0")); Serial.print (inbyte, HEX);  Serial.print (F(" "));}
#endif

#ifdef debugPCM
void printDebugRX_CSgood(){
if (MessageRx_PCM[n]==0xC1 && MessageRx_PCM[n+1]==0x6B && MessageRx_PCM[n+2]==0x8F) {Serial.println (F("   Initialization OK!!!!")); }
 else if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1]==0x00) {Serial.println (F("     NO DTC  "));}
 else if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1] >0x00) {Serial.println (F("     DTC is found!"));} 
 else if (MessageRx_PCM[n]==0x54 && MessageRx_PCM[n+1]==0xFF && MessageRx_PCM[n+2]==0x00){Serial.println (F("     DTC CLEARED  "));}
 else if (MessageRx_PCM[n]==0x61 && MessageRx_PCM[n+1]==0x01) {Serial.println (F("     Receive PCM DATAstream"));}}
#endif                          



void Menu () {
     TouchHOME();
    if (currentPage == '0') {
     
     TouchINF1();
     TouchINF2();
     TouchCHECK(); }
    if (currentPage == '1') { 
     
     TouchINF2();
     TouchCHECK(); }
    if (currentPage == '2') { 
     
     TouchINF1();
     TouchCHECK(); }
    if (currentPage == '3') { 
     
     TouchREAD();
     TouchERASE(); }}   
 
 
  void drawHomeScreen() {
    line() ;
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии и текста красный
    myGLCD.drawLine(295,35,295,248); // линия вертикальная
    myGLCD.drawLine(145,35,145,178); // линия вертикальная
    myGLCD.drawLine(80,178,80,247); // линия вертикальная
    myGLCD.print("L/H", 10, 40);
    myGLCD.print("L/A", 148, 40);
    myGLCD.print("L/V", 10, 75);
    myGLCD.print("L/M", 148, 75);
    myGLCD.print("D/K", 10, 110);
    myGLCD.print("D/L", 148, 110);
    myGLCD.print("V/K", 10, 145);
    myGLCD.print("V/L", 148, 145);
    myGLCD.print("PUMP  RPM", 82, 180);
    myGLCD.print("ENGI   RPM", 82, 215);
    myGLCD.print("D/L/A", 10, 180);
    myGLCD.print("Motor C", 300, 40);
    myGLCD.print("OIL     C", 300, 75);
    myGLCD.print("FUEL   C", 300, 110);
    myGLCD.print("FUERA  C", 300, 145);
    myGLCD.print("DENTRO  C", 300, 180);
    myGLCD.print("INTAIR  C", 300, 215);
    //myGLCD.setTextColor(RED); 
    myGLCD.drawRoundRect (15, 255, 145, 310);
    myGLCD.print("INF 1", 55, 270);
    myGLCD.drawRoundRect (175, 255, 305, 310);
    myGLCD.print("INF 2", 215, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("CHECK", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 7);
    myGLCD.print("Km/h", 410, 7);
    reNew = 1;
    Watch ();
  }
 //-------------------------------------------------
   void drawscreen_one() {
    line() ;
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии и текста красный
    myGLCD.print("Start of Delivery   *CA:", 10, 40);
    myGLCD.print("Desir inject Start  *CA:", 10, 75);
    myGLCD.print("Actua Inject Start  *CA:", 10, 110);
    myGLCD.print("Desir Inject Quan  mg/s:", 10, 145);
    myGLCD.print("Actu Inject Quant mg/s:", 10, 180);
    myGLCD.print("MAF  mg/s:", 10, 215);
    myGLCD.print("Humedad %:", 255, 215);
    //myGLCD.setTextColor(RED);
    myGLCD.drawRoundRect (175, 255, 305, 310);
    myGLCD.print("INF 2", 215, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("CHECK", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 7);
    myGLCD.print("Km/h", 410, 7);
    reNew = 1;
    Watch ();
    }
 //-------------------------------------------------
  void drawscreen_two() {
    line() ;
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии и текста красный
    myGLCD.print("Boost Press       Bar:", 10, 40);
    myGLCD.print("Boost Press Com  Bar:", 10, 75);
    myGLCD.print("EGR command     mg/s:", 10, 110);
    myGLCD.print("EGR Pulse Ratio      %:", 10, 145);
    myGLCD.print("Solenoide Pulse      %:", 10, 180);
    myGLCD.print("Solenoide Boost      %:", 10, 215);
    //myGLCD.setColor(RED);
    myGLCD.drawRoundRect (15, 255, 145, 310);
    myGLCD.print("INF 1", 55, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("CHECK", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 7);
    myGLCD.print("Km/h", 410, 7);
    reNew = 1;
    Watch ();
    }
 //----------------------------------------------------------------------------
  void drawscreen_three() {
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии красный
    myGLCD.drawLine(1,35,479,35); // линия горизонтальная
    myGLCD.drawLine(1,248,479,248); // линия горизонтальная
    //myGLCD.setTextColor(RED);
    myGLCD.drawRoundRect (15, 255, 145, 310);
    myGLCD.print("ERASE", 55, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("READ", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 5);
    reNew = 1;
    Watch ();
   }

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//кнопки тач . координаты и переходы
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void TouchHOME(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {if (p.x > 140 && p.x < 320 && p.y > 140 && p.y < 260 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (1, 1, 77, 37);
        currentPage = '0';     
        request = PID; RequestPeriod = 10; prevRequest = curmillis; // на PCM в этом окне посылается запрос текущих параметров
        myGLCD.clrScr();             
        drawHomeScreen();
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchINF1(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
      if (p.x > 150 && p.x < 450 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (15, 255, 145, 310);
        currentPage = '1';    
        request = PID; RequestPeriod = 10; prevRequest = curmillis; // на PCM в этом окне посылается запрос текущих параметров       
        myGLCD.clrScr();             
        drawscreen_one();
        x = 0;
        y = 0;
        p.z = 0;}}}
    
void TouchINF2(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
    if (p.x > 450 && p.x < 680 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (175, 255, 305, 310);
        currentPage = '2';     
        request = PID; RequestPeriod = 600; prevRequest = curmillis; // на PCM в этом окне посылается запрос текущих параметров      
        myGLCD.clrScr();             
        drawscreen_two();
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchCHECK(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
if (p.x > 690 && p.x < 950 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (335, 255, 465, 310);
        currentPage = '3';  
  //     request = DTCREAD; RequestPeriod = 10; prevRequest = curmillis; // на PCM в этом окне посылается запрос чтения ошибок  
        myGLCD.clrScr();             
        drawscreen_three();
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchREAD(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
if (p.x > 690 && p.x < 950 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (335, 255, 465, 310);
        request = DTCREAD; RequestPeriod = 300; prevRequest = curmillis; // на PCM при нажатии этой кнопки посылается запрос чтения ошибок  
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchERASE(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
if (p.x > 150 && p.x < 450 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      {myGLCD.drawRoundRect (15, 255, 145, 310);
       request = DTCERASE; RequestPeriod = 300;  prevRequest = curmillis; // на PCM при нажатии этой кнопки посылается запрос удаления ошибок
       myGLCD.clrScr();
       drawscreen_three();
       myGLCD.print("DTC BORRADO", 180, 145);
       
        x = 0;
        y = 0;
        p.z = 0;}}}
 ////////////////////////////////////////////////////////////////////////////////////////
 //прорисовка линий
 ///////////////////////////////////////////////////////////////////////////////////////
 void line() {
    //myGLCD.setTextColor(RED); // цвет линии красный
    myGLCD.drawLine(1,35,479,35); // линия горизонтальная
    myGLCD.drawLine(1,73,479,73); // линия горизонтальная
    myGLCD.drawLine(1,108,479,108); // линия горизонтальная
    myGLCD.drawLine(1,143,479,143); // линия горизонтальная
    myGLCD.drawLine(1,178,479,178); // линия горизонтальная
    myGLCD.drawLine(1,212,479,212); // линия горизонтальная
    myGLCD.drawLine(1,248,479,248); // линия горизонтальная
             }


void Watch (){
   DateTime now = rtc.now();
   int minut = now.minute(); 
   int hour = now.hour();
   int mon = now.month();
   int date = now.day();
   int Year = now.year();
 static  int minut_last; 
 static  int hour_last;
 static  int mon_last;
 static  int date_last;
 static  int Year_last;
 myGLCD.setTextColor(WHITE, BLACK); //белый цвет цифры

 if (date != date_last || reNew){ myGLCD.printNumI(date, 85, 7, 2, '0'); date_last = date; }

 if (mon!=mon_last || reNew){myGLCD.printNumI(mon, 130, 7, 2, '0'); mon_last = mon; }  
 
 if (Year!=Year_last || reNew) {  myGLCD.printNumI(Year, 175, 7); Year_last = Year; }
   
 if (hour!=hour_last || reNew){ myGLCD.printNumI(hour, 255, 7, 2, '0'); hour_last = hour; } 
   
 if (minut!=minut_last || reNew ){ myGLCD.printNumI(minut, 300, 7, 2, '0'); minut_last = minut; }
   } 

void Temperature () { 

     static boolean p=0; // флаг работы: запрос температуры или её чтение
p=!p;
if (p) {ds.reset();      // сброс шины
        ds.write(0xCC);  // обращение ко всем датчикам
        ds.write(0x44);  // начать преобразование (без паразитного питания)  
       }
else   {
 
        int Temper_= 20;  byte buff[9];
        ds.reset();
        ds.select(DSaddress);    
        ds.write(0xBE); // Read Scratchpad (чтение регистров)  
        for (byte j = 0; j<9; j++) buff[j]= ds.read(); //читаем все 9 байт от датчика 
        ds.reset();
        if (OneWire::crc8(buff, 8) == buff[8]){        // если контрольная сумма совпадает
        Temper_ =  buff[0] | (buff[1]<<8);             // читаем температуру из первых двух байт (остальные были нужны для проверки CRC)
        Temper_ = Temper_ / 16;
        if  (Temper_ < 150 && Temper_ > -50 && Temper_ !=85 && Temper_!=-127)  IntTemp =  Temper_;
                 
                                              }
                                                      
}
   }

 

viki13viki
Offline
Зарегистрирован: 14.11.2016

Ок. Завтра проверю

Sergei H.
Offline
Зарегистрирован: 17.11.2018


//все что касается OBD2 



046 
  #include <SoftwareSerial.h> 



047 
  SoftwareSerial mySerial(10, 11); //RХ,TХ 



048 
  #define TX 11 



049 
  



050 
  int length5 = 5; 



051 
  int length6 = 6; 



052 
  



053 
  int pid = 1; // очередность пида 



054 
  bool Init = 0; 



055 
  



056 
  int PIDTime = 150;    // задержка между посылками запросов пидов, мс 



057 
  int PresTime = 9000;    // задержка между посылками запросов присутствия, мс  



058 
  int waitbyte = 1;       // задержка между отправкой байт в сообщении, мс 



059 
     



060 
  int MAF = 0;           //26,27 байты 



061 
  int BoostPres = 0;     //28,29 байты 



062 
  int RPM = 0;           //32,33 байты 



063 
  int EGRmg = 0;         //34,35 байты 



064 
  int BoostPresCom = 0;  //38,39 байты 



065 
  int Speed = 0;        //44,45 байты 



066 
  int DesaInjQua = 0;   //50,51 байты 



067 
  int InjQua = 0;    //52,53 байты 



068 
  int StaDaliv = 0;  //54,55 байты 



069 
  int PumpRPM = 0;   //56,57 байты 



070 
  int EGRPul = 0;    //62,63 байты 



071 
  int SolenPul = 0;  //64,65 байты 



072 
  int SolenPre = 0;  //70,71 байты 



073 
  int DesInj = 0;    //72,73 байты  



074 
  int ActInj = 0;    //16,17 байты 



075 
  int TempAir = 0;   //74,75 байты 



076 
  int Temp = 0;      //14,15 байты 



077 
  int TempOil = 0;   //18,19 байты 



078 
  int TempFuel = 0;   //58,59 байты 



079 
  



080 
  



081 
  // массив байтов принимаемого сообщения 



082 
  byte MessageRx[110] = {0};  // массив байтов принимаемого сообщения 



083 
  //массивы сообщений (пидов) 



084 
  byte messageInit[5] = {0x81, 0x11, 0xF1, 0x81, 0x04};    // запрос инициализации 



085 
  byte messagePresent[5] = {0x81,0x11,0xF1,0x3E,0xC1};      // запрос присутствия  



086 
  byte messagePids[6] = {0x82,0x11,0xF1,0x21,0x01,0xA6};    // запрос температуры 1 



087 
    



088 
  unsigned long prevPID = 0; 



089 
  unsigned long prevpres = 0; 



090 
  



091 
  



092 
  unsigned long TimewaitPID, timerwaitPID = 0; 



093 
  bool timerenabledPID = 0; 



094 
  #define TIMEREXPIRED_PID (TimewaitPID - timerwaitPID)> 60 // здесь задержка на ожидание правильного ответа пидов, мс 



095 
  



096 
  unsigned long TimewaitInit, timerwaitInit = 0; 



097 
  bool timerenabledInit = 0; 



098 
  #define TIMEREXPIRED_Init (TimewaitInit - timerwaitInit)> 500 // здесь задержка на ожидание ответа об удачной инициализации, мс 

 

Sergei H.
Offline
Зарегистрирован: 17.11.2018

MaksVV подскажите пожалуйста, как мне соединить код, указал в верхнем посте, с моим. Пины 10,11 у меня заняты под дисплей.

viki13viki
Offline
Зарегистрирован: 14.11.2016

Макс. Первое, данные с панели висели нули и через сикунд 40 появились, но усредненные литры в баке (не актуальные!) ждал минуту так и не появились, пока не перешел со страницы на страницу. остальное вроде все норма, нужно катать.

Сергей перекинь пины экрана на другие пины и в скетче подправь на те что поменял

Sergei H.
Offline
Зарегистрирован: 17.11.2018

Пины то я поправлю,только код не перепишу под мой дисплей.Сегодня как ни пытался установить связь с ЭБУ моего БК так ничего и не получилось.Попробую отключить CH340.

viki13viki
Offline
Зарегистрирован: 14.11.2016

Макс, первая проблема это 2021, вторая проблема, выехал с работы, средний расход 0.5 топлива в баке на 4420 км, пока ехал домой поменялось средний 0.0 топлива на - 22340 км. Приехал зашёл домой, вышел и поехал. Намотки около 60 км, средний так и остался 0.0 а км в баке 0 км. И ещё средний расход за поездку всегда 0.0. Яничего не трогал в скетче.

утром проехал на работу 25 км. Средний так и остался 0.0 , километров в баке остался 0, средний за поездку чета показывал. Я так понимаю проблема с расчетами, все остальное работает гуд.

viki13viki
Offline
Зарегистрирован: 14.11.2016

Сергей код не нужно весь переписывать, просто перекидываешь пины экрана на другие пины и в коде подправляешь номера пинов на те что перекинул.

MaksVV
Offline
Зарегистрирован: 06.08.2015

Sergei H. пишет:
MaksVV подскажите пожалуйста, как мне соединить код, указал в верхнем посте, с моим. Пины 10,11 у меня заняты под дисплей.

ну поставь какие не заняты, в чем проблема то

MaksVV
Offline
Зарегистрирован: 06.08.2015

viki13viki пишет:

Макс, первая проблема это 2021, вторая проблема, выехал с работы, средний расход 0.5 топлива в баке на 4420 км, пока ехал домой поменялось средний 0.0 топлива на - 22340 км. Приехал зашёл домой, вышел и поехал. Намотки около 60 км, средний так и остался 0.0 а км в баке 0 км. И ещё средний расход за поездку всегда 0.0. Яничего не трогал в скетче.

утром проехал на работу 25 км. Средний так и остался 0.0 , километров в баке остался 0, средний за поездку чета показывал. Я так понимаю проблема с расчетами, все остальное работает гуд.

с панели мы получаем данные по пробегу и уровню топлива в баке, если эти данные неправильно принимаются, понятно, что всё остальное будет лажа, так как расчёт от них ведётся. 

снимай логи PCM и gauge. Выводи в отладку остаток топлива и пробег, полученные от панели, чтобы убедиться в их корректности 

viki13viki
Offline
Зарегистрирован: 14.11.2016

остаток топлива в баке и пробег на экране показывают коректно. ща сниму логи

viki13viki
Offline
Зарегистрирован: 14.11.2016

GUAGE

Send startsession - address Gauge
Receive GAUGE: 55 52 80 Gauge INIT is good!
Receive GAUGE: 52 80  GAUGE Message fail address
       Connect GAUGE failed!!! 
Send startsession - address Gauge
Receive GAUGE: 55 52 80 Gauge INIT is good!
Receive GAUGE: 2D A0 48 54 20 32 34 34 31 39 35 36 30 20 31 34 30 30 20 34 31 39 39 20 31 33 30 31 20 30 34 32 20 31 20 30 30 30 30 30 30 30 30 30 30 08 F0 
Received message is OK! Checksum is correct!  10105
ID panel receive! Send request PIDGauge
Receive GAUGE: 13 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C1 00  GAUGE Message fail address
Receive GAUGE: 64 46  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C4 00  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C1 00  GAUGE Message fail address
Receive GAUGE: 64 46  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C1 00  GAUGE Message fail address
Receive GAUGE: 64 46  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 05 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 10 C6  GAUGE Message fail address
Receive GAUGE: 63 46  GAUGE Message fail address
Receive GAUGE: 18 46  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 2D 04  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 05 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C1 00  GAUGE Message fail address
Receive GAUGE: 64 45  GAUGE Message fail address
Receive GAUGE: 18 46  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C6 00  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 04  GAUGE Message fail address
Receive GAUGE: C1 46  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 92 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C6 00  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 6F 2D  GAUGE Message fail address
Receive GAUGE: 92 B3  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: F1 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C1 00  GAUGE Message fail address
Receive GAUGE: 64 46  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 46  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 92 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: C6 FF  GAUGE Message fail address
Receive GAUGE: 45 45  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C5 00 FF 62 00 6F 20 2D 92 04 B3 01 00 05 F1 23 A1 04 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C3 00  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 23  GAUGE Message fail address
Receive GAUGE: A1 00  GAUGE Message fail address
Receive GAUGE: 10 FF  GAUGE Message fail address
Receive GAUGE: 18 00  GAUGE Message fail address
Receive GAUGE: 20 04  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 45 00  GAUGE Message fail address
Receive GAUGE: 6F 04  GAUGE Message fail address
Receive GAUGE: 00 EF  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 04 00 46 46 6F 92 01 F0 23 A1 04 00 00 00 00 04 00 45 00 6F 01 EE 23 A1 04 00 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 45  GAUGE Message fail address
Receive GAUGE: 46 6F  GAUGE Message fail address
Receive GAUGE: 92 00  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 10 FF  GAUGE Message fail address
Receive GAUGE: 45 00  GAUGE Message fail address
Receive GAUGE: 20 B3  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 61 18  GAUGE Message fail address
Receive GAUGE: 00 20  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 10 FF 18 00 20 B3 00 23 A1 04 00 00 00 00 00 04 FF 45 00 20 04 00 23 A1 04 00 00 00 00 
CRC fail!!!
Receive GAUGE: 04 FF  GAUGE Message fail address
Receive GAUGE: 45 00  GAUGE Message fail address
Receive GAUGE: 20 04  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 10  GAUGE Message fail address
Receive GAUGE: 18 00  GAUGE Message fail address
Receive GAUGE: 2D B3  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 C0  GAUGE Message fail address
Receive GAUGE: 64 18  GAUGE Message fail address
Receive GAUGE: 00 2D  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 18 00 2D B3 00 23 A1 04 00 00 00 00 00 46 2D 00 23 A1 00 04 45 00 20 2D B3 05 23 A1 04 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 C5 63 92 01 F1 23 A1 04 00 00 62 00 04 EB 23 A1 00 00 00 FF 46 6F 92 04 00 F1 23 A1 04 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 10  GAUGE Message fail address
Receive GAUGE: 64 46  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 6F 92  GAUGE Message fail address
Receive GAUGE: 01 EE  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C5 00 FF 62 45 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 F0 
Received message is OK! Checksum is correct!  13956
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 64 46 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  14056
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C3 00 FF 62 45 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  14153
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 64 45 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 ED 
Received message is OK! Checksum is correct!  14231
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 63 45 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EC 
Received message is OK! Checksum is correct!  14426
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 64 46 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 23 
CRC fail!!!
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C4 00  GAUGE Message fail address
Receive GAUGE: 63 46  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 F1  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 63 46 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 ED 
Received message is OK! Checksum is correct!  14768
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 20 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 FF 64 46 45 19 46 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C5 00  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: F1 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 92  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 10 00 FF 45 18 00 00 20 2D EF 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 
CRC fail!!!
Receive GAUGE: 10 C4  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 63 45  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 20 92  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: F0 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C4 00  GAUGE Message fail address
Receive GAUGE: 63 45  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 23 A1 00 GAUGE Message fail address
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 45 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 20 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 ED  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C4 00 FF 63 46 45 46 00 00 20 92 04 01 00 F1 23 A1 04 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C3 00  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: F0 00  GAUGE Message fail address
Receive GAUGE: 00 2D  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 62 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 ED 
Received message is OK! Checksum is correct!  15976
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C5 00 FF 62 44 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EF 
Received message is OK! Checksum is correct!  16053
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 2D 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C1 00 FF 61 46 45 18 46 00 00 00 6F 
CRC fail!!!
Receive GAUGE: 20 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 EC  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 63 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  16356
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 01 23 A1 04 00 00 00 00 00 00 00 00 00 04 C0 00 46 45 19 46 00 00 00 6F 20 2D 92 
CRC fail!!!
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C5 00 FF 63 45 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 F2 
Received message is OK! Checksum is correct!  16645
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B3 23 A1 04 00 00 00 00 00 00 00 00 00 04 10 C5 00 FF 62 45 45 19 
CRC fail!!!
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 05 F1  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C1 00 FF 62 46 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 ED 
Received message is OK! Checksum is correct!  16942
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C4 00 23 A1 04 00 00 00 04 10 C5 00 FF 63 46 45 18 46 00 00 00 6F 
CRC fail!!!
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: F2 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C5 00  GAUGE Message fail address
Receive GAUGE: 63 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: F3 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BF 00  GAUGE Message fail address
Receive GAUGE: 63 EB  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 63 46 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 ED 
Received message is OK! Checksum is correct!  17613
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C3 00 FF 61 44 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EC 
Received message is OK! Checksum is correct!  17688
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 63 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  17801
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C3 00 FF 61 45 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  17876
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 63 46 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 ED 
Received message is OK! Checksum is correct!  18131
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 63 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 F0 
Received message is OK! Checksum is correct!  18228
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 63 46 45 19 46 00 23 00 04 00 46 00 00 00 6F 20 2D 92 04 
CRC fail!!!
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 F1  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 63 46 45 18 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 ED 
Received message is OK! Checksum is correct!  18532
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C4 00 FF 62 45 45 18 46 00 00 00 6F 20 2D 00 63 19 00 2D B3 00 05 
CRC fail!!!
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C4 00  GAUGE Message fail address
Receive GAUGE: 62 44  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C2 00  GAUGE Message fail address
Receive GAUGE: 63 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: F0 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 46  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 92 01  GAUGE Message fail address
Receive GAUGE: 05 F0  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 62 46 45 19 00 00 20 2D 04 01 00 05 23 A1 04 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C4 00  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 20 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 EF  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 23 A1 04 00 00 00 10 C4 00 FF 61 46 45 18 46 00 00 6F 20 2D 92 04 B3 01 00 
CRC fail!!!
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 00  GAUGE Message fail address
Receive GAUGE: 63 46  GAUGE Message fail address
Receive GAUGE: 18 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: ED 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C2 00  GAUGE Message fail address
Receive GAUGE: 61 44  GAUGE Message fail address
Receive GAUGE: 45 18  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 00  GAUGE Message fail address
Receive GAUGE: 00 10  GAUGE Message fail address
Receive GAUGE: 19 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 05  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C4 00  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 20  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: F1 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 00  GAUGE Message fail address
Receive GAUGE: 63 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 45 B3  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 00  GAUGE Message fail address
Receive GAUGE: 63 46  GAUGE Message fail address
Receive GAUGE: 45 46  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 20 04  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C4 00  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 46  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 F0  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 63 23 A1 00 00 00 10 FF 45 00 6F 20 2D 92 04 B3 00 05 23 
CRC fail!!!
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C1 00  GAUGE Message fail address
Receive GAUGE: 63 46  GAUGE Message fail address
Receive GAUGE: 45 46  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 20 92  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C3 00  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: F0 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 92 00  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C3 00  GAUGE Message fail address
Receive GAUGE: 62 44  GAUGE Message fail address
Receive GAUGE: 19 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 2D 04  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C3 00  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 18 46  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C3 00 FF 61 23 A1 04 00 00 00 10 C0 00 FF 63 44 45 00 00 6F 20 04 
CRC fail!!!
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 05 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C3 00  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 46  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 20 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 EF  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 62 46 45 19 46 00 00 00 6F 20 2D 92 04 23 00 10 61 FF 63 
CRC fail!!!
Receive GAUGE: 46 45  GAUGE Message fail address
Receive GAUGE: 19 46  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 20 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 EE  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C3 00 FF 61 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EF 
Received message is OK! Checksum is correct!  21642
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 62 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 ED 
Received message is OK! Checksum is correct!  21718
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 62 45 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  21828
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C1 00 FF 62 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  21905
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 62 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EF 
Received message is OK! Checksum is correct!  22091
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C1 00 FF 62 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  22167
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 62 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EF 
Received message is OK! Checksum is correct!  22342
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 61 45 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 ED 
Received message is OK! Checksum is correct!  22419
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 46 04 00 EF 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C1 
CRC fail!!!
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C2 00  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: C3 00  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 20  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: F0 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 00  GAUGE Message fail address
Receive GAUGE: 61 45  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 EB  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C3 00 FF 61 46 45 19 46 00 00 00 6F 20 2D 00 FF 19 00 2D B3 00 05 
CRC fail!!!
Receive GAUGE: EB 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BF 00  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 00  GAUGE Message fail address
Receive GAUGE: 61 45  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EB 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 45  GAUGE Message fail address
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 62 45 46 00 00 20 92 04 01 00 EC 23 A1 04 00 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 C3  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 19 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 20 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 EF  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C0 00 FF 62 EC 23 00 00 00 04 00 45 00 00 6F 20 2D 92 04 B3 01 00 
CRC fail!!!
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C1 00  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 45 46  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 20 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 ED  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C3 00 FF 61 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 A1 00 C1 61 
CRC fail!!!
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 2D 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 05 EC  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 61 46 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  24339
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 62 45 45 19 46 00 00 00 6F 20 2D 92 04 B3 01 00 00 05 EE 
Received message is OK! Checksum is correct!  24417
 receive Datastream Gauge!
Receive GAUGE: 23 00  GAUGE Message fail address
Receive GAUGE: 10 00  GAUGE Message fail address
Receive GAUGE: 2D B3  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 00  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EC 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C2 00  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 19 B3  GAUGE Message fail address
Receive GAUGE: 05 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 20  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: ED 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 00  GAUGE Message fail address
Receive GAUGE: 45 45  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EC 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 00  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 23  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 00 45  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 01  GAUGE Message fail address
Receive GAUGE: 00 EC  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 60 45 46 00 00 20 92 04 01 00 EC 23 A1 04 00 00 00 00 00 
CRC fail!!!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 61 45 45 19 46 00 00 00 6F 20 92 04 B3 01 00 46 01 EE 23 
CRC fail!!!
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C2 00  GAUGE Message fail address
Receive GAUGE: 61 45  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: ED 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C2 00  GAUGE Message fail address
Receive GAUGE: 61 45  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: ED 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: C2 6F  GAUGE Message fail address
Receive GAUGE: 92 00  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 FF  GAUGE Message fail address
Receive GAUGE: 45 45  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 92 B3  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 61 45 45 46 00 00 00 20 2D 92 04 B3 01 00 00 05 ED 23 A1 
CRC fail!!!
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BF  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 62 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 10  GAUGE Message fail address
Receive GAUGE: C2 00  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BF 00  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EB 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C1 00  GAUGE Message fail address
Receive GAUGE: 61 45  GAUGE Message fail address
Receive GAUGE: 23 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: BF 62  GAUGE Message fail address
Receive GAUGE: 19 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: EB 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C0 00  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 2D 04  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 05 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BF 00  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EB 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 45 B3  GAUGE Message fail address
Receive GAUGE: 00 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BF 00  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 19 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 2D 04  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 05 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C2 00  GAUGE Message fail address
Receive GAUGE: 61 45  GAUGE Message fail address
Receive GAUGE: 19 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 20 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BF 00  GAUGE Message fail address
Receive GAUGE: 62 45  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 04 C2 00 FF 61 46 45 19 00 00 20 2D B3 01 00 05 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C1 
CRC fail!!!
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 00  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 2D 04  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 05 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: C2 00  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: 00 19  GAUGE Message fail address
Receive GAUGE: 00 20  GAUGE Message fail address
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 05 ED  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 C2 00 FF 61 46 45 19 46 00 00 00 6F 20 92 04 01 00 EE 23 A1 04 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BF  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 61 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EB 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 20  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BF 00 FF 62 45 45 19 46 00 00 00 6F 20 2D B3 01 00 05 23 A1 04 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 C2  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 00 6F  GAUGE Message fail address
Receive GAUGE: 20 2D  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: B3 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: EE 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BF 00  GAUGE Message fail address
Receive GAUGE: 62 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
Receive GAUGE: 46 23  GAUGE Message fail address
Receive GAUGE: A1 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 10 FF  GAUGE Message fail address
Receive GAUGE: 45 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 6F 20  GAUGE Message fail address
Receive GAUGE: 2D 92  GAUGE Message fail address
Receive GAUGE: 04 B3  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 05  GAUGE Message fail address
Receive GAUGE: ED 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00        Connect GAUGE failed!!! 
Send startsession - address Gauge

PCM

Send request INIT to PCM  5051
Receive PCM: 83 F1 11 C1 6B 8F 40 
Received message is OK! Checksum is correct!  5497
   Initialization OK!!!!
Send request PID_2101 to PCM  5569
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 68 00 00 00 00 04 3F 00 00 00 00 32 C8 03 A2 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 70 03 A3 00 02 8D 
Received message is OK! Checksum is correct!  5772
     Receive PCM DATAstream
Send request PID_2101 to PCM  6137
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 68 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 70 03 A3 00 02 89 
Received message is OK! Checksum is correct!  6343
     Receive PCM DATAstream
Send request PID_2101 to PCM  6416
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 68 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 72 03 A3 00 02 90 
Received message is OK! Checksum is correct!  6618
     Receive PCM DATAstream
Send request PID_2101 to PCM  6689
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 68 00 00 00 00 04 3F 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8E 
Received message is OK! Checksum is correct!  6892
     Receive PCM DATAstream
Send request PID_2101 to PCM  6965
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 68 00 00 00 00 04 41 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 70 03 A3 00 02 8E 
Received message is OK! Checksum is correct!  7175
     Receive PCM DATAstream
Send request PID_2101 to PCM  7247
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F6 00 00 0C A2 00 00 02 68 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8D 
Received message is OK! Checksum is correct!  7467
     Receive PCM DATAstream
Send request PID_2101 to PCM  7539
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 68 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8D 
Received message is OK! Checksum is correct!  7755
     Receive PCM DATAstream
Send request PID_2101 to PCM  7828
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 68 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8B 
Received message is OK! Checksum is correct!  8038
     Receive PCM DATAstream
Send request PID_2101 to PCM  8111
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 68 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8D 
Received message is OK! Checksum is correct!  8324
     Receive PCM DATAstream
Send request PID_2101 to PCM  8396
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 68 00 00 00 00 04 42 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 91 
Received message is OK! Checksum is correct!  8608
     Receive PCM DATAstream
Send request PID_2101 to PCM  8681
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8C 
Received message is OK! Checksum is correct!  8885
     Receive PCM DATAstream
Send request PID_2101 to PCM  8957
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 88 
Received message is OK! Checksum is correct!  9450
     Receive PCM DATAstream
Send request PID_2101 to PCM  9523
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 68 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 70 03 A3 00 02 8B 
Received message is OK! Checksum is correct!  9779
     Receive PCM DATAstream
Send request PID_2101 to PCM  9851
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 67 00 00 00 00 04 3A 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8D 
Received message is OK! Checksum is correct!  10061
     Receive PCM DATAstream
Send request PID_2101 to PCM  10134
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8A 
Received message is OK! Checksum is correct!  10342
     Receive PCM DATAstream
Send request PID_2101 to PCM  10414
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 41 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8D 
Received message is OK! Checksum is correct!  10624
     Receive PCM DATAstream
Send request PID_2101 to PCM  10696
Send request PID_2101 to PCM  11297
Receive PCM: 80 21  PCM Message fail address
Receive PCM: F7 00  PCM Message fail address
Receive PCM: A3 00  PCM Message fail address
Receive PCM: C8 03  PCM Message fail address
Receive PCM: A3 04  PCM Message fail address
Receive PCM: E5 62  PCM Message fail address
Receive PCM: DE 00  PCM Message fail address
Receive PCM: AE A0  PCM Message fail address
Receive PCM: 90 00  PCM Message fail address
Receive PCM: A9 08  PCM Message fail address
Receive PCM: 94 0C  PCM Message fail address
Receive PCM: A3 Message fail timeout
Send request PID_2101 to PCM  12055
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 3F 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8F 
Received message is OK! Checksum is correct!  12272
     Receive PCM DATAstream
Send request PID_2101 to PCM  12345
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 67 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 73 03 A3 00 02 8D 
Received message is OK! Checksum is correct!  12554
     Receive PCM DATAstream
Send request PID_2101 to PCM  12626
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A5 00 00 02 67 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 8C 
Received message is OK! Checksum is correct!  12845
     Receive PCM DATAstream
Send request PID_2101 to PCM  12917
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 3F 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 AD Message fail timeout
Receive PCM: 94 0C  PCM Message fail address
Receive PCM: A3 00  PCM Message fail address
Receive PCM: 92 Message fail timeout
Send request PID_2101 to PCM  13657
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 88 
Received message is OK! Checksum is correct!  13869
     Receive PCM DATAstream
Send request PID_2101 to PCM  13941
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A2 00 00 02 66 00 00 00 00 04 40 00 00 00 00 32 C8 03 A2 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 89 
Received message is OK! Checksum is correct!  14145
     Receive PCM DATAstream
Send request PID_2101 to PCM  14218
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 67 00 00 00 00 04 40 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 72 03 A3 00 02 92 
Received message is OK! Checksum is correct!  14424
     Receive PCM DATAstream
Send request PID_2101 to PCM  14495
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A2 00 00 02 67 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 75 03 A3 00 02 8C 
Received message is OK! Checksum is correct!  14714
     Receive PCM DATAstream
Send request PID_2101 to PCM  14787
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A2 00 00 02 67 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 88 
Received message is OK! Checksum is correct!  15002
     Receive PCM DATAstream
Send request PID_2101 to PCM  15075
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 67 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 73 03 A3 00 02 8D 
Received message is OK! Checksum is correct!  15283
     Receive PCM DATAstream
Send request PID_2101 to PCM  15355
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5B 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 88 
Received message is OK! Checksum is correct!  15567
     Receive PCM DATAstream
Send request PID_2101 to PCM  15640
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 67 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 73 03 A3 00 02 8D 
Received message is OK! Checksum is correct!  15856
     Receive PCM DATAstream
Send request PID_2101 to PCM  15929
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A2 00 00 02 67 00 00 00 00 04 3F 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 73 03 A3 00 02 8B 
Received message is OK! Checksum is correct!  16193
     Receive PCM DATAstream
Send request PID_2101 to PCM  16266
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 89 
Received message is OK! Checksum is correct!  16472
     Receive PCM DATAstream
Send request PID_2101 to PCM  16543
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 67 00 00 00 00 04 39 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 72 03 A3 00 02 85 
Received message is OK! Checksum is correct!  16758
     Receive PCM DATAstream
Send request PID_2101 to PCM  16831
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F6 00 00 0C A3 00 00 02 66 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 9F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 73 03 A3 00 02 CF 
Received message is OK! Checksum is correct!  17036
     Receive PCM DATAstream
Send request PID_2101 to PCM  17382
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 67 00 00 00 00 04 37 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 73 03 A3 00 02 86 
Received message is OK! Checksum is correct!  17593
     Receive PCM DATAstream
Send request PID_2101 to PCM  17666
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A2 00 00 02 67 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 AD 08 01 20 00 00 01 94 0C 73 03 A3 00 02 8E 
Received message is OK! Checksum is correct!  17880
     Receive PCM DATAstream
Send request PID_2101 to PCM  17952
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A2 00 00 02 67 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DE 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 73 03 A3 00 02 8A 
Received message is OK! Checksum is correct!  18162
     Receive PCM DATAstream
Send request PID_2101 to PCM  18235
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F8 00 00 0C A3 00 00 02 67 00 00 00 00 04 3C 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5F 00 00 00 00 08 DD 00 00 0C AE A0 00 01 90 00 00 A9 08 01 20 00 00 01 94 0C 73 03 A3 00 02 8B 
Received message is OK! Checksum is correct!  18450
     Receive PCM DATAstream
Send request PID_2101 to PCM  18523
Receive PCM: 80 F1 11 4C 61 01 00 00 00 00 00 00 00 00 0C F7 00 00 0C A3 00 00 02 67 00 00 00 00 04 3E 00 00 00 00 32 C8 03 A3 04 29 03 20 E5 62 00 00 00 00 0B 5D 00 00 0

и еще, когда я скопировал первый раз была строчка

unsigned long prevData  = 0; вместе с этими

unsigned long prevWatch = 0; unsigned long prevDvoet = 0;,

сейчас скопировал ее уже нету.

и появилась Temperature (); в строке

if (curmillis - prevWatch > 4000)  { Watch (); prevWatch = curmillis; Trip (); h = dht.readHumidity(); t = dht.readTemperature();Temperature ();}

я так понимаю ты корректировал..... вообщем эти логи с тем 2017 свеже скопированым

щас вроде как сразу выдает данные с панели не как вчера через 40 сек или больше.

Sergei H.
Offline
Зарегистрирован: 17.11.2018

Понял почему у меня связи нет с ЭБУ. У меня Делфи стоит,а там протокол ISO14230. На счёт пинов я понимаю, просто я хочу Ваш код с пинами 10.11 RX,Tx соединить с моим и  переделать под мой дисплей 1602.

Komandir
Komandir аватар
Offline
Зарегистрирован: 18.08.2018

Слишком мал 1602 для скетча от ТС. Что конкретно хочется видеть на дисплее ?

viki13viki
Offline
Зарегистрирован: 14.11.2016

дак свои пины от экрана которые на 10 и 11 перекинь на например 6 и 7 и в скетче где у тебя указаны эти пины от экрана 10 и 11 замени на 6 и 7. и все....

Sergei H.
Offline
Зарегистрирован: 17.11.2018

У меня только 12 и 4 пины свободные получаются. Хочется температуру ОЖ, напряжение ,температуры внутри ,за бортом, мгновенный расход, расход за 100км.

viki13viki
Offline
Зарегистрирован: 14.11.2016

который был на 10 тыкни на 4 который на 11 тыкни на 12 в скетче где экран прописан замени 10 и 11 на 4 и 12

viki13viki
Offline
Зарегистрирован: 14.11.2016

Макс вывел литры в баке и километры в сериал

бак
Receive GAUGE: 5E 46  GAUGE Message fail address
Receive GAUGE: 45 19  GAUGE Message fail address
34.50
34.50
Receive GAUGE: 47 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address

километры

Send startsession - address Gauge
830.30
       Connect GAUGE failed!!!
Send startsession - address Gauge
830.30

все четко как и на панели
 

MaksVV
Offline
Зарегистрирован: 06.08.2015

мда корявый лог на панель. Попробуй так. 

//------------все для связи по K-line (тут настраиваем UARTы к-лайников, адреса блоков, скорость инита и отладку) 
#include <SoftwareSerial.h>
 #define TX_PCM 13
 SoftwareSerial K_LINE_PCM   (12, TX_PCM); //RХ,TХ    //UART на котором висит K_line к PCM

#define K_LINE_GAUGE Serial2   //UART     на котором висит K_line к приборке 
#define TX_gauge 16            //TX UARTa на котором висит K_line к приборке 

#define PCM_address  0x11      // адрес PCM 
#define DIAG_address 0xF1      // адрес диагностики

const byte BAUD=200;           // init baudrate - скорость инита при подключении к приборке 
const byte addressGUAGE = 0xB8;// init GAUGE address - адрес щитка приборов при ините (установке связи)

//#define debugPCM             // раскоментировать эту строку для отладки в Serial порту обмена с PCM
#define debugGAUGE             // раскоментировать эту строку для отладки в Serial порту обмена co щитком приборов
//#define debugTRIP             // раскоментировать эту строку для отладки в Serial порту данных бортовика
 
uint32_t curmillis = 0;        // снимок текущего времени 
 
//------------------------------------------переменные для организации протокола связи с PCM

uint32_t prevRequest  = 0;     // таймер периодических запосов на PCM
uint16_t RequestPeriod = 3500; // периодичность запросов на PCM
byte header = 0;               // состояние заголовка
bool NOanswer_timer = 0;       // таймер контроля неответов от ЭБУ после подачи запросов
uint32_t prev_NOanswer=0;      // таймер контроля неответов от ЭБУ после подачи запросов
// возможные варианты запросов на ЭБУ:
enum REQUEST {INIT, PID, DTCERASE, DTCREAD, PRESENT,};

// текстовки запросов для отладки 
char* textRequest[] = {"INIT", "PID_2101", "DTC_ERASE", "DTC_READ", "PRESENT",} ;

 // сами запросы
 byte PCM_Message_TX[][5] = {
 {1,  0x81,           0,0,0},    // запрос инициализации
 {2,  0x21,0x01,        0,0},    // запрос пид 2101
 {3,  0x14,0xFF,0x00,     0},    // запрос на стирание ошибок
 {4,  0x18,0x00,0xFF,0x00  },    // запрос на чтение ошибок
 {1,  0x3E,           0,0,0},    // запрос присутствия 
                            };
byte request = INIT;             // переменная, показывающая какой запрос будем делать
static byte headerGAUGE = 0;            // состояние заголовка сообщений щитка  приборов

const byte bufsize = 150;           // размер буфера принятого сообщения
byte MessageRx_PCM [bufsize] = {0}; // буфер принятого сообщения


//-------------------------------------------переменные бортовика

 float L100M = 0; float L100M_last = 1;             //расход на 100 км измеренный за поездку
 float L100 = 0; float L100_last = 1;               //мгновенный расход литров на 100км
 float LHor = 0; float LHor_last = 1;               //мгновенный расход топлива литров в час
 float L100SR = 0;         //расход литров на 100км измеренный раз в интервал kmL  
 float L100SR_TFT = 0;  float L100SR_TFT_last = 1;  // самый средний из расходов на 100км, он выводится на экран

 int L100_Eeprom[11]= {10,10,10,10,10,10,10,10,10,10,10};
 int FuelZamer[10]= {0};  // массив для измерения уровня (количества) топлива 
 int ZamerNumber = 0;     // номер замера уровня (количества) топлива 
 int n_eeprom = 0;        // текущий адрес ячейки еепром для записи расхода
 
 int MAF = 0;            int MAF_last = 1;           //26,27 байты   Sensor de flujo de aire en masa
 float BoostPres = 0;    float BoostPres_last = 1;   //28,29 байты   Presión de refuerzo
 int RPM = 0;            int RPM_last = 1;           //32,33 байты   Velocidad del motor
 int EGRmg = 0;          int EGRmg_last = 1;         //34,35 байты   Comando EGR (Comando de recirculación de gases de escape)
 float BoostPresCom = 0; float BoostPresCom_last = 1;//38,39 байты   Comando de presión de refuerzo
 int Speed = 0;          int Speed_last = 1;         //44,45 байты   Velocidad del vehículo
 float DesaInjQua = 0;   float DesaInjQua_last = 1;  //50,51 байты   Cantidad de inyección deseada
 float InjQua = 0;       float InjQua_last = 1;      //52,53 байты   Cantidad de la inyección
 float StaDaliv = 0;     float StaDaliv_last = 1;    //54,55 байты   Inicio de la entrega
 int PumpRPM = 0;        int PumpRPM_last = 1;       //56,57 байты   Velocidad de la bomba
 float EGRPul = 0;       float EGRPul_last = 1;      //62,63 байты   Relación de impulsos EGR (recirculación de gases de escape
 float SolenPul = 0;     float SolenPul_last = 1;    //64,65 байты   Velocidad de solenoide de control de nivel de remolino Relación de impulsos
 float SolenPre = 0;     float SolenPre_last = 1;    //70,71 байты   Relación de impulsos Presión Electroválvula de presión
 float DesInj = 0;       float DesInj_last = 1;      //72,73 байты   Inyección deseada Inicio
 float ActInj = 0;       float ActInj_last = 1;      //16,17 байты   Inicio de la inyección real
 int TempAir = 0;        int TempAir_last = 1;       //74,75 байты   Temperatura del aire de admisión
 int Temp = 0;           int Temp_last = 1;          //14,15 байты   Temperatura del refrigerante
 int TempOil = 0;        int TempOil_last = 1;       //18,19 байты   Temperatura del aceite del motor
 int TempFuel = 0;       int TempFuel_last = 1;      //58,59 байты   Temperatura del combustible
 int IntTemp = 0;        int IntTemp_last =  1;      //Температура улицы
 
 //все что касается топлива
 float Fuel = 0;       //остаток топлива 
 float Fuel2 = 0;    float Fuel2_last = 1; //остаток мгновенного топлива байт 16 , датчика в баке
 int FuelIGN = 0;      // количество топлвива в баке на момент включения зажигания
 int Fuel_last = 0;    // для формул
 bool flagFuelIGN = 0; // флаг записан ли остаток топлива в момент вкл. зажигания 
 float FuelTrip = 0; float FuelTrip_last = 1;    // количество литров топлива, израсходованное за один цикл включения зажигания
 
 //все что касается километража
 float kmAge = 0;           //пробег, полученный со щитка приборов
 int kmAgeIGN = 0;          //пробег который был в момент включения зажигания 
 int kmAge_last = 0;        // для формул
 bool flagkmAgeIGN = 0;     //флаг записан ли пробег в момент вкл. зажигания 
 float kmTrip = 0; float kmTrip_last = 1;           //пробег за один цикл включения зажигания
 int kmL = 10;              // интервал, через который будет происходить обновление среднего расхода на 100км
 int km = 0;                // переменная для расчетов
 int kmeeprom = 10;         // интервал, через который будет происходить подсчет среднеарифмитического расхода  L100SR_TFT
 int kmTFT =  0;     // переменная для расчетов периодического подсчета среднеарифмитического расхода топлива L100SR_TFT
 int kmREFUELING = 0; int kmREFUELING_last = 1;     // пробег до заправки на остатке топлива 
 
 unsigned long prevWatch = 0;
 unsigned long prevDvoet = 0;
 

//----------------------------------------------для экрана 
#include <Adafruit_GFX.h>
 #include <MCUFRIEND_kbv.h>
 #include <UTFTGLUE.h>//use GLUE class and constructor
 #include "TouchScreen.h"
 #include <stdint.h>
 #include <SPI.h>
 #include <EEPROM.h>
 //#include "Fonts/Chosence_Bold16pt7b.h";

#define MINPRESSURE 200
#define MAXPRESSURE 1000

//pin 20 SCL , 21 SDA датчик реального времени
 #include <Wire.h>
 #include "RTClib.h"
 RTC_DS3231 rtc;       

UTFTGLUE myGLCD(0x1581,A2,A1,A3,A4,A0); //all dummy args
 
 const int XP = 6, XM = A2, YP = A1, YM = 7; 
 const int TS_LEFT = 136, TS_RT = 907, TS_TOP = 139, TS_BOT = 942;
 TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
 uint16_t ID;
 int x, y;
 char currentPage;
 float h; int h_last = 1; 
 float t; int t_last = 1; 
 bool Dvoet = 0;
 bool reNew = 0;
 #define BLACK 0x0000
 #define WHITE 0xFFFF
 #define RED   0xF800
 #define GREEN 0x07E0

 //--------------------------------------датчики t

byte DSaddress[] = {0x28, 0xFF, 0xA6, 0x19, 0xA8, 0x15, 0x01, 0xD2};
//датчик внутринней температуры и влаги
 #include "DHT.h"
 #define DHTPIN 26   
 #define DHTTYPE DHT22 
 DHT dht(DHTPIN, DHTTYPE);
#include <OneWire.h>
 #define ONE_WIRE_BUS 22   
 OneWire ds(ONE_WIRE_BUS);



 
void setup() {
   uint16_t ID = myGLCD.readID();
   if (ID == 0xD3D3) ID = 0x1581; // write-only shield
   myGLCD.begin(ID);  
   myGLCD.InitLCD(3);
   myGLCD.clrScr();
   myGLCD.setTextSize(2);
   //myGLCD.setFont(&Chosence_Bold16pt7b);
   Wire.begin();
   rtc.begin();
   dht.begin();
   //загрузка стартовой страницы
   currentPage = '0';       
   drawHomeScreen();  

   //подсчет среднеарифметического усредненного расхода
   for (int i = 0; i < 11; i++) L100_Eeprom [i]= EEPROM.read(i);
   for (int i = 0; i < 11; i++) L100SR_TFT = L100SR_TFT +  L100_Eeprom [i];
   L100SR_TFT = (float)L100SR_TFT/110.0;
   if (L100SR_TFT<0) L100SR_TFT = 0;
   if (L100SR_TFT>99) L100SR_TFT = 99;
  
   // строка ниже используется для настройки даты и времени часов 
   // раскоментировать, выставить времая и дату, залить в ардуино. в скетче закоментировать
   // обратно и залить еще раз, иначе каждый раз будет по новой выствлятся это же время и дата
   // (год, месяц, день, часы, минуты, секунды)
   //rtc.adjust(DateTime(2019, 7, 2, 10, 48, 0));
  
 #if defined debugPCM or defined debugGAUGE or defined debugTRIP
   Serial.begin(115200);
 #endif
   K_LINE_PCM.begin(10400);
   pinMode(TX_PCM, OUTPUT);
  
             }


    void loop() 
                {
                  
curmillis = millis();              // снимок текущего времени

if (curmillis - prevRequest > RequestPeriod && header == 0 ) 
    {
  if (request == INIT) fastinit();                                          // при необходимости делаем переподключение к PCM
  else {sendMessagePCM(request);                                            // отправляем на PCM текущий запрос
         if (request == PID) RequestPeriod = 600; 
         if (request == DTCERASE || request == DTCREAD) RequestPeriod = 2500;} 
  prevRequest = curmillis;
    }

receivePCM ();   // приём сообщений от PCM
receiveGAUGE (); // приём сообщений от щитка приборов
if (header == 0 && headerGAUGE == 0) {Menu ();}
if (curmillis - prevWatch > 4000)  { Watch (); prevWatch = curmillis; Trip (); h = dht.readHumidity(); t = dht.readTemperature();Temperature ();}
//if (curmillis - prevDvoet > 500)  { if (!Dvoet) {myGLCD.setTextColor(WHITE); } else {myGLCD.setTextColor(BLACK); }  myGLCD.print(":", 290, 5); prevDvoet = curmillis; Dvoet=!Dvoet;}                
if (millis() - prevDvoet > 500)  { if (!Dvoet) {myGLCD.print(":", 280, 5);} else {myGLCD.print(" ", 290, 5);} prevDvoet = millis(); Dvoet=!Dvoet;}
                }// end loop

 void fastinit() {
   digitalWrite (TX_PCM, HIGH);  // bus idle
   delay(1500);              
   digitalWrite (TX_PCM, LOW);  // first part fastinit  (25 ms LOW)
   delay(25);
   digitalWrite (TX_PCM, HIGH); // second part fastinit (25 ms HIGH)
   delay(25);               
   K_LINE_PCM.begin(10400);
   sendMessagePCM(INIT);        // send start communication message 
      }  
 
  
  void receivePCM () {

static uint32_t prevRESETheader=0;    // таймер сброса сообщения, если данные оборвались посередине сообщения 
static bool RESETheader_timer;        // таймер сброса сообщения, если данные оборвались посередине сообщения 
static byte noanswers = 0;            // количество подряд неответов от ЭБУ 
static byte message_size = 0;         // размер тела сообщения
static byte j = 3;                    // инкремент
static byte n = 3;                    // количество старт байт
static byte crc =0;                   // байт контрольной суммы 



 if (K_LINE_PCM.available() ){
    
 // первый старт байт
 if (header == 0){ MessageRx_PCM[0]=K_LINE_PCM.read();  
         if (MessageRx_PCM[0]!=0xFF && bitRead (MessageRx_PCM[0],7)){header = 1; RESETheader_timer = 1; prevRESETheader = curmillis; 
               #ifdef debugPCM
                  Serial.print (F("Receive PCM: ")); printDebugRX(MessageRx_PCM[0]);
               #endif               
                                                }
                          }                  

 // второй старт байт
 else if (header == 1){ MessageRx_PCM[1]=K_LINE_PCM.read(); 
 #ifdef debugPCM
      printDebugRX (MessageRx_PCM[1]);
 #endif
      if (MessageRx_PCM[1]==DIAG_address){ header = 2;} 
      else {
        #ifdef debugPCM 
        Serial.println(F(" PCM Message fail address")); 
        #endif
        header = 0; RESETheader_timer = 0;}} 

 // третий старт байт
 else if (header == 2){ 
  MessageRx_PCM[2]=K_LINE_PCM.read(); 
  #ifdef debugPCM
  printDebugRX (MessageRx_PCM[2]);
  #endif
  if (MessageRx_PCM[2]==PCM_address){ message_size = MessageRx_PCM[0]; prevRESETheader = curmillis;
       if (MessageRx_PCM[0] !=0x80) {header = 4;  bitWrite (message_size, 7 , 0);j=3;n=3;}
       else {header = 3; j=4;n=4;}
       if (message_size > bufsize) message_size = bufsize;  crc = 0;} 
  else {header = 0; 
        #ifdef debugPCM 
        Serial.println(F("PCM Message fail address")); 
        #endif
        RESETheader_timer = 0;}
  
                          }  
// если размер сообщения указан в дополнительном байте (нулевой байт 0x80) читаем этот дополнительный байт:
else if (header == 3){
   prevRESETheader = curmillis;
  MessageRx_PCM[3]=K_LINE_PCM.read(); 
  #ifdef debugPCM
  printDebugRX(MessageRx_PCM[3]);
  #endif
  message_size = MessageRx_PCM[3]; 
  if (message_size > bufsize) message_size = bufsize;  
  crc = 0; header = 4;  
                         }

  // пишем тело сообщения 
 else if (header == 4 && j< message_size+n+1) {
 MessageRx_PCM[j] = K_LINE_PCM.read(); prevRESETheader = curmillis;
 if (j<message_size+n) crc+= MessageRx_PCM[j]; // подсчёт КС
 
 if (j==message_size+n) header = 5; 
 #ifdef debugPCM
 printDebugRX(MessageRx_PCM[j]);
 #endif  
 j++;                                             } 
 }

 // сообщение приняли, действуем
 if (header == 5) {
 #ifdef debugPCM
 Serial.println();
 #endif  
 NOanswer_timer = 0; noanswers = 0;              // сбрасываем таймер контроля неответов 
  
for(byte i = 0; i<n; i++) crc+=MessageRx_PCM[i]; // прибавляем к контрольной сумме старт байты

 // если контрольная сумма верна: 
if ( crc == MessageRx_PCM[message_size+n]) 
{  
  #ifdef debugPCM
  Serial.print (F("Received message is OK! Checksum is correct!"));  Serial.print (F("  ")); Serial.println (millis()); // Если КС совпала, тут чёнибудь нужное делаем
  printDebugRX_CSgood(); 
  #endif
      if (MessageRx_PCM[n]==0xC1 && MessageRx_PCM[n+1]==0x6B && MessageRx_PCM[n+2]==0x8F) {
              if (currentPage!=3) {request = PID; RequestPeriod = 70;} else request = PRESENT, RequestPeriod = 4000; prevRequest = curmillis; // receive good INIT
                                                                                          }
 else if (MessageRx_PCM[n]==0x58) Troublecodes (n); // DTC
 else if (MessageRx_PCM[n]==0x54 && MessageRx_PCM[n+1]==0xFF && MessageRx_PCM[n+2]==0x00){ request = PRESENT; RequestPeriod = 4000; prevRequest = curmillis;} // DTC are cleared
 else if (MessageRx_PCM[n]==0x61 && MessageRx_PCM[n+1]==0x01) {dataVars(n) ; RequestPeriod = 70; prevRequest = curmillis; }           // receive DataStream
 
 
 }   

// если контрольная сумма не совпала: 
#ifdef debugPCM
  else Serial.println("CRC fail!!!" );
#endif
message_size = 0; header=0; RESETheader_timer = 0; j=3; crc = 0;
}

// таймер сброса целостности сообщения (если данные оборвались посередине сообщения)
if (RESETheader_timer && curmillis - prevRESETheader > 200) { 
  #ifdef debugPCM 
  Serial.println(F("Message fail timeout")); 
  #endif 
  RESETheader_timer = 0; header = 0;}   

 
// если нет ответа после запроса: +1 к счетчику неответов. Если накопилось 6 и более: делаем реинит.  
if (request!=INIT && NOanswer_timer && curmillis - prev_NOanswer > RequestPeriod - RequestPeriod/10) 
         {
     NOanswer_timer = 0; noanswers++; 
     if (noanswers>=6) { noanswers = 0; request = INIT; RequestPeriod = 3500;}
         }
}// end receivePCM


void Troublecodes (const byte &n) 
{
  if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1]==0x00){
    myGLCD.clrScr();             
    drawscreen_three();      
    myGLCD.print("NO DTC", 180, 145);
    
                         }
 
  // при получении сообщения о наличии ошибок DTC разберем сообщение выведем на экран ошибки
  if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1]>0){
     
     myGLCD.clrScr();             
     drawscreen_three();       

  for (int i=0; i<MessageRx_PCM[n+8-7]; i++ ) {
     int y = i*35;
     bool nolA=0; bool nolB =0;
  if (!bitRead(MessageRx_PCM[n+11-7+(i*3)],6) && bitRead(MessageRx_PCM[n+11-7+(i*3)],7)){ myGLCD.setTextColor(GREEN, BLACK); 
     myGLCD.print(" -Passive-", 300, (75+y));} // если DTC пасивныый делаем цвет зеленый 
  if (bitRead(MessageRx_PCM[n+11-7+(i*3)],7) && bitRead(MessageRx_PCM[n+11-7+(i*3)],6)) { myGLCD.setTextColor(RED, BLACK);  
     myGLCD.print(" -Active-", 300, (75+y));} // если DTC активный, делаем цвет красный 
     myGLCD.print("ERROR ", 50, (75+y));
     myGLCD.printNumI((i+1), 150, (75+y));
     
  if (!bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && !bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": P", 170, (75+y));
  if (bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && !bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": C", 170, (75+y));
  if (!bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": B", 170, (75+y));
  if (bitRead(MessageRx_PCM[n+9-7+(i*3)],6) && bitRead(MessageRx_PCM[n+9-7+(i*3)],7)) myGLCD.print(": U", 170, (75+y));

  if (MessageRx_PCM[n+9-7+(i*3)]==0x00) {myGLCD.print("00", 230, (75+y)); nolA = 1;}
  if (MessageRx_PCM[n+9-7+(i*3)]<=0x0F&&MessageRx_PCM[n+9-7+(i*3)]!=0) {myGLCD.print("0", 230, (75+y)); nolA = 1;} 
  if (nolA)myGLCD.print(String (MessageRx_PCM[n+9-7+(i*3)],HEX), 246, (75+y)); 
  else myGLCD.print(String (MessageRx_PCM[n+9-7+(i*3)],HEX), 230, (75+y));

  if (MessageRx_PCM[n+10-7+(i*3)]==0x00) {myGLCD.print("00", 262, (75+y)); nolB = 1;}
  if (MessageRx_PCM[n+10-7+(i*3)]<=0x0F&&MessageRx_PCM[n+10-7+(i*3)]!=0) {myGLCD.print("0", 262, (75+y)); nolB = 1;}
  if (nolB)myGLCD.print(String (MessageRx_PCM[n+10-7+(i*3)]),HEX, 278, (75+y)); 
  else myGLCD.print(String (MessageRx_PCM[n+10-7+(i*3)],HEX), 262, (75+y));}} 

request = PRESENT; RequestPeriod = 4000;  prevRequest = curmillis;

}



void dataVars(const byte &n) 
{
  //Barom = MessageRx_PCM[39];
   L100 = (float)LHor*100.0/(float)Speed;
   LHor = (float)RPM* (float)InjQua*2.00/1000.0*60.00/1000.0/0.85;
   MAF =  ((MessageRx_PCM[n+22]*256)+MessageRx_PCM[n+23])/10;
   BoostPres =  ((MessageRx_PCM[n+24]*256)+MessageRx_PCM[n+25])/1000.0;
   RPM =  (MessageRx_PCM[n+35-7]*256)+MessageRx_PCM[n+36-7];
   EGRmg =  ((MessageRx_PCM[n+37-7]*256)+MessageRx_PCM[n+38-7])/10.0;
   BoostPresCom =  ((MessageRx_PCM[n+41-7]*256)+MessageRx_PCM[n+42-7])/1000.0;
   Speed =  ((MessageRx_PCM[n+47-7]*256)+MessageRx_PCM[n+48-7])/100;
   DesaInjQua =  ((MessageRx_PCM[n+53-7]*256)+MessageRx_PCM[n+54-7])/100.0;
   InjQua =  ((MessageRx_PCM[n+55-7]*256)+MessageRx_PCM[n+56-7])/100.0;
   StaDaliv =  ((MessageRx_PCM[n+57-7]*256)+MessageRx_PCM[n+58-7])/100.0;
   PumpRPM =  (MessageRx_PCM[n+59-7]*256)+MessageRx_PCM[n+60-7];
   EGRPul =  ((MessageRx_PCM[n+65-7]*256)+MessageRx_PCM[n+66-7])/100.0;
   SolenPul =  ((MessageRx_PCM[n+67-7]*256)+MessageRx_PCM[n+68-7])/100.0;
   SolenPre =  ((MessageRx_PCM[n+73-7]*256)+MessageRx_PCM[n+74-7])/100.0;
   DesInj =  ((MessageRx_PCM[n+75-7]*3)+(MessageRx_PCM[n+76-7])/100.0)+0.3;
   ActInj =  ((MessageRx_PCM[n+19-7]*3)+(MessageRx_PCM[n+20-7])/100.0)+0.3;
   //TempAir =  ((MessageRx_PCM[n+77-7]*26)-278)+MessageRx_PCM[n+78-7]/10.0;
   //Temp =  ((MessageRx_PCM[n+17-7]*26)-278)+MessageRx_PCM[n+18-7]/10.0;
   //TempOil =  ((MessageRx_PCM[n+21-7]*26)-278)+MessageRx_PCM[n+22-7]/10.0;
   //TempFuel =  ((MessageRx_PCM[n+61-7]*26)-278)+MessageRx_PCM[n+62-7]/10.0;
   //ниже идут расчетные формулы более точные чем те что закоментированы выше
   int A = 0;
   if  (MessageRx_PCM[n+77-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+77-7]==0x0B || MessageRx_PCM[n+77-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+77-7]>=0x0D) A = 279;
   double B = MessageRx_PCM[n+78-7]/10.0;
   double cel , drob ;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     TempAir =  ((MessageRx_PCM[n+77-7]*26)-A)+cel;
   
   if  (MessageRx_PCM[n+17-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+17-7]==0x0B || MessageRx_PCM[n+17-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+17-7]>=0x0D) A = 279;
   B = MessageRx_PCM[n+18-7]/10.0;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     Temp =  ((MessageRx_PCM[n+17-7]*26)-A)+cel;


   if  (MessageRx_PCM[n+21-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+21-7]==0x0B || MessageRx_PCM[n+21-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+21-7]>=0x0D) A = 279;
   B = MessageRx_PCM[n+22-7]/10.0;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     TempOil =  ((MessageRx_PCM[n+21-7]*26)-A)+cel;


   if  (MessageRx_PCM[n+61-7]<=0x0A) A = 277;
   if  (MessageRx_PCM[n+61-7]==0x0B || MessageRx_PCM[n+61-7]==0x0C) A = 278;
   if  (MessageRx_PCM[n+61-7]>=0x0D) A = 279;
   B = MessageRx_PCM[n+62-7]/10.0;
   drob = modf(B, &cel);
   if (drob>0.6) cel++;
     TempFuel =  ((MessageRx_PCM[n+61-7]*26)-A)+cel;   
     
  //----------------------------------------------------------
  //страниц HOME
  //----------------------------------------------------------
     
     //myGLCD.setBackColor(RED);
     myGLCD.setTextColor(WHITE, BLACK);
     //myGLCD.setBackColor(RED);
     if ((Speed != Speed_last) || reNew) {myGLCD.printNumI(Speed, 360, 7, 3); Speed_last=Speed;}
  if (currentPage == '0') {
     if ((LHor != LHor_last) || reNew) {myGLCD.printNumF(LHor, 1, 75, 40, '.',4); LHor_last=LHor;}
     if ((L100 != L100_last) || reNew) {myGLCD.printNumF(L100, 1, 225, 40,'.',4 ); L100_last=L100;}
     if ((L100M != L100M_last) || reNew) {myGLCD.printNumF(L100M, 1, 75, 75,'.',4 ); L100M_last=L100M;}
     if ((L100SR_TFT != L100SR_TFT_last) || reNew) {myGLCD.printNumF(L100SR_TFT, 1, 225, 75,'.',4 ); L100SR_TFT_last=L100SR_TFT;}
     if ((kmREFUELING != kmREFUELING_last) || reNew) {myGLCD.printNumI(kmREFUELING, 90, 110,3 ); kmREFUELING_last=kmREFUELING;} 
     //if (Fuel<53) 
     if ((Fuel != Fuel_last) || reNew) {myGLCD.printNumF(Fuel, 1, 225, 110,'.',4); Fuel_last=Fuel;}
     //else myGLCD.print("MAX", 210, 110); 
     if ((kmTrip != kmTrip_last) || reNew) {myGLCD.printNumF(kmTrip, 1, 60, 145,'.',5); kmTrip_last=kmTrip;}
     if ((FuelTrip != FuelTrip_last) || reNew) {myGLCD.printNumF(FuelTrip, 1, 210, 145,'.',5); FuelTrip_last=FuelTrip;}
     if ((PumpRPM != PumpRPM_last) || reNew) {myGLCD.printNumI(PumpRPM, 230, 180,4); PumpRPM_last=PumpRPM;}
     if ((RPM != RPM_last) || reNew) {myGLCD.printNumI(RPM, 230, 215,4); RPM_last=RPM;}
     if ((Fuel2 != Fuel2_last) || reNew) {myGLCD.printNumF(Fuel2, 1, 10, 215,'.',4); Fuel2_last=Fuel2;}      
     if ((Temp != Temp_last) || reNew) {myGLCD.printNumI(Temp, 415, 40, 3); Temp_last=Temp;}
     if ((TempOil != TempOil_last) || reNew) {myGLCD.printNumI(TempOil, 415, 75, 3); TempOil_last=TempOil;}
     if ((TempFuel != TempFuel_last) || reNew) {myGLCD.printNumI(TempFuel, 415, 110,3); TempFuel_last=TempFuel;} 
     if ((IntTemp != IntTemp_last) || reNew)   {myGLCD.printNumI(IntTemp, 415, 145 , 3); IntTemp_last=IntTemp;} 
     if ((t != t_last) || reNew) {myGLCD.printNumI(t, 415, 180, 3); t_last=t;}
     if ((TempAir != TempAir_last) || reNew) {myGLCD.printNumI(TempAir, 415, 215, 3); TempAir_last=TempAir;}
     reNew = 0; 
     }
   //----------------------------------------------------------
   //страниц INF1
   //----------------------------------------------------------
   if (currentPage == '1') {
     if ((StaDaliv != StaDaliv_last) || reNew) {myGLCD.printNumF(StaDaliv,1, 385, 40,'.', 4); StaDaliv_last=StaDaliv;}
     if ((DesInj != DesInj_last) || reNew) {myGLCD.printNumF(DesInj,1, 385, 75, '.', 4); DesInj_last=DesInj;}
     if ((ActInj != ActInj_last) || reNew) {myGLCD.printNumF(ActInj,1, 385, 110,'.', 4); ActInj_last=ActInj;} 
     if ((DesaInjQua != DesaInjQua_last) || reNew) {myGLCD.printNumF(DesaInjQua,1, 385, 145,'.', 4);DesaInjQua_last=DesaInjQua;}  
     if ((InjQua != InjQua_last) || reNew) {myGLCD.printNumF(InjQua,1, 385, 180,'.', 4); InjQua_last=InjQua;} 
     if ((MAF != MAF_last) || reNew) {myGLCD.printNumI(MAF, 170, 215, 4); MAF_last=MAF;}
     if ((h != h_last) || reNew) {myGLCD.printNumF(h, 1, 430, 215, 3); h_last=h;}
     reNew = 0; 
     }
   //----------------------------------------------------------
   //страниц INF2
   //----------------------------------------------------------
   if (currentPage == '2') {    
     if ((BoostPres != BoostPres_last) || reNew) {myGLCD.printNumF(BoostPres,1, 400, 40,'.', 4); BoostPres_last=BoostPres;}  
     if ((BoostPresCom != BoostPresCom_last) || reNew) {myGLCD.printNumF(BoostPresCom,1, 400, 75,'.', 4); BoostPresCom_last=BoostPresCom;} 
     if ((EGRmg != EGRmg_last) || reNew) {myGLCD.printNumI(EGRmg, 400, 110, 4); EGRmg_last=EGRmg;}  
     if ((EGRPul != EGRPul_last) || reNew) {myGLCD.printNumF(EGRPul,1, 400, 145,'.', 4); EGRPul_last=EGRPul;}
     if ((SolenPul != SolenPul_last) || reNew) {myGLCD.printNumF(SolenPul, 1, 400, 180,'.', 4); SolenPul_last=SolenPul;} 
     if ((SolenPre != SolenPre_last) || reNew) {myGLCD.printNumF(SolenPre, 0, 400, 215,'.', 4); SolenPre_last=SolenPre;}
     reNew = 0; 
     }
 //reNew = 0;
}



 void sendMessagePCM(const byte &command)
{
 #ifdef debugPCM                         
Serial.print (F("Send request "));  Serial.print (textRequest[command]); Serial.print (F(" to PCM  ")); Serial.println (millis());
 #endif
if (command != INIT) {NOanswer_timer = 1; prev_NOanswer = curmillis;}  //т.к. сейчас будем делать запрос, то запускаем таймер контроля неответов 
  byte size =  PCM_Message_TX[command][0];
  const byte siZe = size+4;
  byte Mes[siZe];
  byte Checksum = 0;
  for(byte i=0; i<siZe; i++) {
    if (i==0) {Mes[i]=size; bitWrite(Mes[i], 7 , 1);}
    if (i==1) Mes[i] = PCM_address;
    if (i==2) Mes[i] = DIAG_address;    
    if (i==3) {for (byte t=1; t<size+1; t++ ) {
           Mes[i]=PCM_Message_TX [command][t]; 
           Checksum+=Mes[i] ; 
           K_LINE_PCM.write (Mes[i]); 
           if (command == INIT) delay (5); else delay (1);  
           K_LINE_PCM.read(); 
           i++;}}
    if (i!=siZe-1) Checksum+=Mes[i];
    else Mes[i] = Checksum;    
    K_LINE_PCM.write (Mes[i]);
   if (command == INIT) delay (5); else delay (1);
    K_LINE_PCM.read();
                             }
}// end sendMessagePCM



void Trip () {
 
 if (flagkmAgeIGN){

 FuelTrip = FuelIGN - Fuel;                          
  if (kmAge>kmAgeIGN) kmTrip = kmAge - kmAgeIGN;
  if (kmAge<kmAgeIGN) kmTrip = 2000 - (kmAgeIGN - kmAge);  // 2000 это через сколько км у тебя суточный пробег сбрасывается на ноль, поменяй если другое число
  if (kmAge==kmAgeIGN) kmTrip = 0;


 //подсчет расхода на 100км за поездку
 L100M = ((float)FuelTrip*100.00)/(float)kmTrip;
  if (L100M<0) L100M = 0;
  if (L100M>99) L100M = 99;

 // ниже цикл считает среднеарифметический расход из еепром раз в пробег, указанный в переменной kmeeprom
  if (kmTrip-kmTFT>kmeeprom) {kmTFT = kmTrip; 

 // тут считаем среднеарифметический усредненного расход из ячеек еепром 
  for (int i = 0; i < 11; i++) L100SR_TFT+= EEPROM.read(i);
  //for (int i = 0; i < 11; i++) L100SR_TFT = L100SR_TFT +  L100_Eeprom [i];
  L100SR_TFT = (float)L100SR_TFT/110.00;
  if (L100SR_TFT<0) L100SR_TFT = 0;
  if (L100SR_TFT>99) L100SR_TFT = 99;}
 
 // ниже цикл считает расход топлива за пробег, указанный в переменной kmL, здесь же запись в ячейки еепром 
  if (kmTrip-km>kmL) {km=kmTrip; 
 L100SR = ((float)(Fuel_last-Fuel)*100.00)/(float)kmL; // расход/100км  - обновляется раз в 10км, меняется км в int kmL = 10;
 Fuel_last = Fuel;      // сохранение параметров с последнего измерениея 
  if (L100SR<0) L100SR = 0;
  if (L100SR>99) L100SR = 99;

 //расчет остатка километров в баке
 if (L100SR>0) kmREFUELING=((float)Fuel*100.0)/(float)L100SR; //если средний расход больше нуля, то расчитывать км в баке из него
 else kmREFUELING=((float)Fuel*100.00)/(float)L100SR_TFT;    //если ноль или ментше то расчитывать км в баке с устредненного расхода

 // тут записываем  L100SR последовательно в одну из 11 ячеек еепром
 //EEPROM.write (12,n_eeprom);      // ЗДЕСЬ ВНИМАТЕЛЬНО. ЗАГРУЗИТЬ ПРОШИВКУ С ЭТОЙ СТРОКОЙ ОДИН РАЗ, ПОТОМ ЗАКОМЕНТИРОВАТЬ И ЕЩЁ РАЗ ЗАГРУЗИТЬ
 n_eeprom = EEPROM.read (12);    // в ячейке 12 хранится № текущей ячейки для записи расхода, чтобы где остановился при выкл питания, от туда и продолжил
 EEPROM.write(n_eeprom, L100SR*10); 
 n_eeprom++; if (n_eeprom>10) n_eeprom=0;
 EEPROM.write (12,n_eeprom); 
 
 #ifdef debugTRIP
Serial.println (" I am heer:  if (kmTrip-km>kmL) {}  "); 
Serial.print (" L100SR = "); Serial.print (L100SR) ; Serial.println (" L/100km");
Serial.print (" kmREFUELING = "); Serial.print (kmREFUELING) ; Serial.println (" km");
#endif
 
 
 }
 
 #ifdef debugTRIP
Serial.print (" FuelTrip = "); Serial.print (FuelTrip); Serial.println (" L");
Serial.print (" kmTrip = "); Serial.print (kmTrip); Serial.println (" km");
Serial.print (" L100SR_TFT = "); Serial.print (L100SR_TFT); Serial.println (" L/100km");
#endif
 
 }}

void receiveGAUGE () {


static uint32_t prevRESETheaderGAUGE=0; // таймер сброса сообщения, если данные оборвались посередине сообщения 
static bool RESETheader_timerGAUGE;     // таймер сброса сообщения, если данные оборвались посередине сообщения  

static uint32_t prevNoconnect = 0;      // таймер периодической проверки наличия связи со щитком приборов
static byte NoconnectsGAUGE = 0 ;       // счетчик неответов от щитка приборов 
static byte message_sizeGAUGE = 0;      // размер тела сообщения
static byte jGAUGE = 3;                 // инкремент
static byte nGAUGE = 3;                 // количество старт байт
static int ChecksumGAUGE =0;            // байт контрольной суммы 
static byte InitGauge = 0;              // автомат состояния инита щитка приборов 
const byte bufsizeG = 100;              // размер буфера принятого сообщения
static byte MessageRx_GAUGE [bufsizeG] = {0};   // буфер принятого сообщения
byte PIDgauge[] = {0x02,0x11,0x00,0x13}; // запрос параметоров щитка приборов



 if (K_LINE_GAUGE.available() ){
    
 // первый старт байт
 if (headerGAUGE == 0){ MessageRx_GAUGE[0]=K_LINE_GAUGE.read();  
   if ((InitGauge ==1 && MessageRx_GAUGE[0]==0x55) || (InitGauge ==2 && MessageRx_GAUGE[0]!=0xFF && MessageRx_GAUGE[0]!=0x7F)
   || (InitGauge ==3 && MessageRx_GAUGE[0]==0x23)
      )
          {headerGAUGE = 1; RESETheader_timerGAUGE = 1; prevRESETheaderGAUGE = curmillis; 
               #ifdef debugGAUGE
                  Serial.print (F("Receive GAUGE: ")); printDebugRX(MessageRx_GAUGE[0]);
               #endif               
          }
                                    }                  

 // второй старт байт
 else if (headerGAUGE == 1){ MessageRx_GAUGE[1]=K_LINE_GAUGE.read(); 
 #ifdef debugGAUGE
      printDebugRX (MessageRx_GAUGE[1]);
 #endif
      if ( (InitGauge ==1 && MessageRx_GAUGE[1]==0x52)  ||     (InitGauge ==2 && (MessageRx_GAUGE[1]==0xA0 || MessageRx_GAUGE[1]==0xF0))  
      || (InitGauge == 3 && MessageRx_GAUGE[1]==0xA1)){ headerGAUGE = 2;} 
      else {
        #ifdef debugGAUGE 
        Serial.println(F(" GAUGE Message fail address")); 
        #endif
        headerGAUGE = 0; RESETheader_timerGAUGE = 0;}} 

 // третий старт байт
 else if (headerGAUGE == 2){ 
  
  MessageRx_GAUGE[2]=K_LINE_GAUGE.read(); 
  #ifdef debugGAUGE
  printDebugRX (MessageRx_GAUGE[2]);
  #endif
  if ((InitGauge ==2 && (MessageRx_GAUGE[2]==0x48 || MessageRx_GAUGE[2]==0x55 || MessageRx_GAUGE[2]==0xAA)) || (InitGauge == 3 && MessageRx_GAUGE[2]==0x04)){ message_sizeGAUGE = MessageRx_GAUGE[0]-2; prevRESETheaderGAUGE = curmillis;
       headerGAUGE = 4;  jGAUGE=3; nGAUGE=3;
      
       if (message_sizeGAUGE > bufsizeG) message_sizeGAUGE = bufsizeG;  ChecksumGAUGE = 0;} 
  else if (InitGauge ==1 && MessageRx_GAUGE[2]==0x80) {InitGauge = 2; K_LINE_GAUGE.write(0x7F); delay (2); K_LINE_GAUGE.read();  headerGAUGE = 0; RESETheader_timerGAUGE = 0; 
             #ifdef debugGAUGE
             Serial.println ("Gauge INIT is good!"); 
             #endif
                                                      }     
  else {headerGAUGE = 0; 
        #ifdef debugGAUGE 
        Serial.println(F("GAUGE Message fail address")); 
        #endif
        RESETheader_timerGAUGE = 0;}
  
                          }  

  // пишем тело сообщения 
 else if (headerGAUGE == 4 && jGAUGE< message_sizeGAUGE+nGAUGE+1) {
 MessageRx_GAUGE[jGAUGE] = K_LINE_GAUGE.read(); prevRESETheaderGAUGE = curmillis;
 if (jGAUGE<message_sizeGAUGE+nGAUGE-1) ChecksumGAUGE+= MessageRx_GAUGE[jGAUGE]; // подсчёт КС
 
 if (jGAUGE==message_sizeGAUGE+nGAUGE) headerGAUGE = 5; 
  
 #ifdef debugGAUGE
 printDebugRX(MessageRx_GAUGE[jGAUGE]);
 #endif  
 jGAUGE++;                                             } 
 }

 // сообщение приняли, действуем
 if (headerGAUGE == 5) {  
 #ifdef debugGAUGE
 Serial.println();
 #endif  
 
  
for(byte i = 0; i<nGAUGE; i++) ChecksumGAUGE+=MessageRx_GAUGE[i]; // прибавляем к контрольной сумме старт байты
int ChecksumG =  ( ( unsigned int )MessageRx_GAUGE[message_sizeGAUGE+nGAUGE-1] << 8 ) | MessageRx_GAUGE[message_sizeGAUGE+nGAUGE]; // парсинг контрольной суммы из 2 последних байт 
 // если контрольная сумма верна: 
if ( ChecksumGAUGE == ChecksumG) 
{  NoconnectsGAUGE = 0; // сбрасываем на 0 отсутствие связи с панелью
  #ifdef debugGAUGE
  Serial.print (F("Received message is OK! Checksum is correct!"));  Serial.print (F("  ")); Serial.println (millis()); // Если КС совпала, тут чёнибудь нужное делаем
  #endif

      if (MessageRx_GAUGE[1]== 0xA0 && MessageRx_GAUGE[2]== 0x48) {
           #ifdef debugGAUGE
           Serial.println ("ID panel receive! Send request PIDGauge"); 
           #endif
           InitGauge = 3; 
           for (byte i=0; i<sizeof(PIDgauge); i++) { K_LINE_GAUGE.write (PIDgauge[i]); delay (1); K_LINE_GAUGE.read();}
                                                                  }

       if (MessageRx_GAUGE[1]== 0xF0 && (MessageRx_GAUGE[2]== 0xAA || MessageRx_GAUGE[2]== 0x55)) {
           #ifdef debugGAUGE
           Serial.println ("receive present from Gauge. I send PID to Gauge"); 
           #endif
           InitGauge = 3; 
           for (byte i=0; i<sizeof(PIDgauge); i++) { K_LINE_GAUGE.write (PIDgauge[i]); delay (1); K_LINE_GAUGE.read();}
                                                                  }

                                                                  

      if (MessageRx_GAUGE[1]== 0xA1 && MessageRx_GAUGE[2]== 0x04) {
           #ifdef debugGAUGE
           Serial.println (" receive Datastream Gauge!");
           #endif
 Fuel2 = MessageRx_GAUGE[nGAUGE + 16]/2.0; 
 if (!flagFuelIGN) {  Fuel = MessageRx_GAUGE[nGAUGE + 16]/2.0;  kmREFUELING=((float)Fuel*100.00)/(float)L100SR_TFT;} //стартовая запись литров в баке для подсчета затраченных литро
 else Fuel = MessageRx_GAUGE[nGAUGE + 17]/2.0; //для усреднения болтания в баке закоментировать эту строку, а раскоментировать ниже
            
 //для усреднения болтания топлива в баке, раскоментировать, высчитывает среднее
 /*else { FuelZamer[ZamerNumber] = MessageRxGauge[17]/2.00;
 if (ZamerNumber==9) {
 Fuel = 0 ;
 for (int i = 0; i < 10; i++) Fuel = Fuel + FuelZamer[i];
 Fuel = (float)Fuel/10.0;}
 ZamerNumber++; if (ZamerNumber>9) ZamerNumber = 0;}
*/

  kmAge = (MessageRx_GAUGE[nGAUGE + 23]+(MessageRx_GAUGE[nGAUGE + 24]*256))/10.0; //суточный пробег с панели приборов

  //бак у меня на 59 литров, а датчик показывает максимально 53 литра. для этого эта формула
  //если у вас тоже датчик имеет лимит то подправте 53 на свой лимит. 
  //если ваш датчик показывает одинаково с полным баком то закоментировать три нижние строки. 
  if (Fuel<53){
  if (!flagkmAgeIGN) { kmAgeIGN = kmAge; flagkmAgeIGN =1;}
  if (!flagFuelIGN) { FuelIGN = Fuel; Fuel_last = Fuel; flagFuelIGN = 1;}}

#ifdef debugTRIP
Serial.print (" Fuel = "); Serial.print (Fuel); Serial.println (" L");
Serial.print (" kmAge = "); Serial.print (kmAge); Serial.println (" km");
#endif

           
                                                                  }
 }   

// если контрольная сумма не совпала: 
#ifdef debugGAUGE
  else Serial.println("CRC fail!!!" );
#endif
message_sizeGAUGE = 0; headerGAUGE=0; RESETheader_timerGAUGE = 0; jGAUGE=3; ChecksumGAUGE = 0;
}

// таймер сброса целостности сообщения (если данные оборвались посередине сообщения)
if (RESETheader_timerGAUGE && curmillis - prevRESETheaderGAUGE > 300) { 
  #ifdef debugGAUGE 
  Serial.println(F("Message fail timeout")); 
  #endif 
  RESETheader_timerGAUGE = 0; headerGAUGE = 0;}   

 if (curmillis - prevNoconnect > 500) {NoconnectsGAUGE ++ ; if (NoconnectsGAUGE>=8){
 #ifdef debugGAUGE 
  Serial.println (F("       Connect GAUGE failed!!! ")) ;
 #endif
  NoconnectsGAUGE = 0 ;InitGauge = 0 ; } prevNoconnect = curmillis; }
 
 InitBusGAUGE (InitGauge);
}// end receiveGAUGE


void InitBusGAUGE (byte &InitGauge) 
{
  uint32_t prevInitbusGauge = 0;   // таймер для инита щитка приборов
  
    if (InitGauge == 0){
#ifdef debugGAUGE 
  Serial.println ("Send startsession - address Gauge");
#endif   
  K_LINE_GAUGE.end();
   pinMode(TX_gauge, OUTPUT);
   digitalWrite (TX_gauge, HIGH);                                           // BUS IDLE
   InitGauge = 5; prevInitbusGauge = curmillis;
   }  
 if (InitGauge == 5 && curmillis - prevInitbusGauge>1500)  {InitGauge = 6;} // BUS IDLE
 if (InitGauge == 6)
 {    
   byte boudrate = 1000/BAUD;
   digitalWrite (TX_gauge, LOW);   delay (boudrate); // старт бит
   for (byte i=0; i<8; i++){digitalWrite (TX_gauge, bitRead(addressGUAGE, i)); delay (boudrate);} // биты тела адреса 
   digitalWrite (TX_gauge, HIGH);  delay (boudrate); // стоп бит
   K_LINE_GAUGE.begin(9600);
   InitGauge = 1; 
 }
}




#if defined debugPCM or defined debugGAUGE
void printDebugRX (const byte &inbyte) {if (inbyte<=15) Serial.print(F("0")); Serial.print (inbyte, HEX);  Serial.print (F(" "));}
#endif

#ifdef debugPCM
void printDebugRX_CSgood(){
if (MessageRx_PCM[n]==0xC1 && MessageRx_PCM[n+1]==0x6B && MessageRx_PCM[n+2]==0x8F) {Serial.println (F("   Initialization OK!!!!")); }
 else if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1]==0x00) {Serial.println (F("     NO DTC  "));}
 else if (MessageRx_PCM[n]==0x58 && MessageRx_PCM[n+1] >0x00) {Serial.println (F("     DTC is found!"));} 
 else if (MessageRx_PCM[n]==0x54 && MessageRx_PCM[n+1]==0xFF && MessageRx_PCM[n+2]==0x00){Serial.println (F("     DTC CLEARED  "));}
 else if (MessageRx_PCM[n]==0x61 && MessageRx_PCM[n+1]==0x01) {Serial.println (F("     Receive PCM DATAstream"));}}
#endif                          



void Menu () {
     TouchHOME();
    if (currentPage == '0') {
     
     TouchINF1();
     TouchINF2();
     TouchCHECK(); }
    if (currentPage == '1') { 
     
     TouchINF2();
     TouchCHECK(); }
    if (currentPage == '2') { 
     
     TouchINF1();
     TouchCHECK(); }
    if (currentPage == '3') { 
     
     TouchREAD();
     TouchERASE(); }}   
 
 
  void drawHomeScreen() {
    line() ;
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии и текста красный
    myGLCD.drawLine(295,35,295,248); // линия вертикальная
    myGLCD.drawLine(145,35,145,178); // линия вертикальная
    myGLCD.drawLine(80,178,80,247); // линия вертикальная
    myGLCD.print("L/H", 10, 40);
    myGLCD.print("L/A", 148, 40);
    myGLCD.print("L/V", 10, 75);
    myGLCD.print("L/M", 148, 75);
    myGLCD.print("D/K", 10, 110);
    myGLCD.print("D/L", 148, 110);
    myGLCD.print("V/K", 10, 145);
    myGLCD.print("V/L", 148, 145);
    myGLCD.print("PUMP  RPM", 82, 180);
    myGLCD.print("ENGI   RPM", 82, 215);
    myGLCD.print("D/L/A", 10, 180);
    myGLCD.print("Motor C", 300, 40);
    myGLCD.print("OIL     C", 300, 75);
    myGLCD.print("FUEL   C", 300, 110);
    myGLCD.print("FUERA  C", 300, 145);
    myGLCD.print("DENTRO  C", 300, 180);
    myGLCD.print("INTAIR  C", 300, 215);
    //myGLCD.setTextColor(RED); 
    myGLCD.drawRoundRect (15, 255, 145, 310);
    myGLCD.print("INF 1", 55, 270);
    myGLCD.drawRoundRect (175, 255, 305, 310);
    myGLCD.print("INF 2", 215, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("CHECK", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 7);
    myGLCD.print("Km/h", 410, 7);
    reNew = 1;
    Watch ();
  }
 //-------------------------------------------------
   void drawscreen_one() {
    line() ;
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии и текста красный
    myGLCD.print("Start of Delivery   *CA:", 10, 40);
    myGLCD.print("Desir inject Start  *CA:", 10, 75);
    myGLCD.print("Actua Inject Start  *CA:", 10, 110);
    myGLCD.print("Desir Inject Quan  mg/s:", 10, 145);
    myGLCD.print("Actu Inject Quant mg/s:", 10, 180);
    myGLCD.print("MAF  mg/s:", 10, 215);
    myGLCD.print("Humedad %:", 255, 215);
    //myGLCD.setTextColor(RED);
    myGLCD.drawRoundRect (175, 255, 305, 310);
    myGLCD.print("INF 2", 215, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("CHECK", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 7);
    myGLCD.print("Km/h", 410, 7);
    reNew = 1;
    Watch ();
    }
 //-------------------------------------------------
  void drawscreen_two() {
    line() ;
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии и текста красный
    myGLCD.print("Boost Press       Bar:", 10, 40);
    myGLCD.print("Boost Press Com  Bar:", 10, 75);
    myGLCD.print("EGR command     mg/s:", 10, 110);
    myGLCD.print("EGR Pulse Ratio      %:", 10, 145);
    myGLCD.print("Solenoide Pulse      %:", 10, 180);
    myGLCD.print("Solenoide Boost      %:", 10, 215);
    //myGLCD.setColor(RED);
    myGLCD.drawRoundRect (15, 255, 145, 310);
    myGLCD.print("INF 1", 55, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("CHECK", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 7);
    myGLCD.print("Km/h", 410, 7);
    reNew = 1;
    Watch ();
    }
 //----------------------------------------------------------------------------
  void drawscreen_three() {
    //myGLCD.print(":", 290, 5);
    myGLCD.print("/", 115, 7);
    myGLCD.print("/", 160, 7);
    myGLCD.setTextColor(RED, BLACK); // цвет линии красный
    myGLCD.drawLine(1,35,479,35); // линия горизонтальная
    myGLCD.drawLine(1,248,479,248); // линия горизонтальная
    //myGLCD.setTextColor(RED);
    myGLCD.drawRoundRect (15, 255, 145, 310);
    myGLCD.print("ERASE", 55, 270);
    myGLCD.drawRoundRect (335, 255, 465, 310);
    myGLCD.print("READ", 365, 270);
    myGLCD.drawRoundRect (1, 1, 77, 37);
    myGLCD.print("HOME", 10, 5);
    reNew = 1;
    Watch ();
   }

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//кнопки тач . координаты и переходы
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void TouchHOME(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {if (p.x > 140 && p.x < 320 && p.y > 140 && p.y < 260 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (1, 1, 77, 37);
        currentPage = '0';     
        request = PID; RequestPeriod = 10; prevRequest = curmillis; // на PCM в этом окне посылается запрос текущих параметров
        myGLCD.clrScr();             
        drawHomeScreen();
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchINF1(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
      if (p.x > 150 && p.x < 450 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (15, 255, 145, 310);
        currentPage = '1';    
        request = PID; RequestPeriod = 10; prevRequest = curmillis; // на PCM в этом окне посылается запрос текущих параметров       
        myGLCD.clrScr();             
        drawscreen_one();
        x = 0;
        y = 0;
        p.z = 0;}}}
    
void TouchINF2(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
    if (p.x > 450 && p.x < 680 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (175, 255, 305, 310);
        currentPage = '2';     
        request = PID; RequestPeriod = 600; prevRequest = curmillis; // на PCM в этом окне посылается запрос текущих параметров      
        myGLCD.clrScr();             
        drawscreen_two();
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchCHECK(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
if (p.x > 690 && p.x < 950 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (335, 255, 465, 310);
        currentPage = '3';  
  //     request = DTCREAD; RequestPeriod = 10; prevRequest = curmillis; // на PCM в этом окне посылается запрос чтения ошибок  
        myGLCD.clrScr();             
        drawscreen_three();
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchREAD(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
if (p.x > 690 && p.x < 950 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      { myGLCD.drawRoundRect (335, 255, 465, 310);
        request = DTCREAD; RequestPeriod = 300; prevRequest = curmillis; // на PCM при нажатии этой кнопки посылается запрос чтения ошибок  
        x = 0;
        y = 0;
        p.z = 0;}}}

void TouchERASE(){
TSPoint p = ts.getPoint();
    pinMode(XM, OUTPUT);
    pinMode(YP, OUTPUT);
if (p.z > 10 && p.z < 1000)
    {
if (p.x > 150 && p.x < 450 && p.y > 770 && p.y < 890 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
      {myGLCD.drawRoundRect (15, 255, 145, 310);
       request = DTCERASE; RequestPeriod = 300;  prevRequest = curmillis; // на PCM при нажатии этой кнопки посылается запрос удаления ошибок
       myGLCD.clrScr();
       drawscreen_three();
       myGLCD.print("DTC BORRADO", 180, 145);
       
        x = 0;
        y = 0;
        p.z = 0;}}}
 ////////////////////////////////////////////////////////////////////////////////////////
 //прорисовка линий
 ///////////////////////////////////////////////////////////////////////////////////////
 void line() {
    //myGLCD.setTextColor(RED); // цвет линии красный
    myGLCD.drawLine(1,35,479,35); // линия горизонтальная
    myGLCD.drawLine(1,73,479,73); // линия горизонтальная
    myGLCD.drawLine(1,108,479,108); // линия горизонтальная
    myGLCD.drawLine(1,143,479,143); // линия горизонтальная
    myGLCD.drawLine(1,178,479,178); // линия горизонтальная
    myGLCD.drawLine(1,212,479,212); // линия горизонтальная
    myGLCD.drawLine(1,248,479,248); // линия горизонтальная
             }


void Watch (){
   DateTime now = rtc.now();
   int minut = now.minute(); 
   int hour = now.hour();
   int mon = now.month();
   int date = now.day();
   int Year = now.year();
 static  int minut_last; 
 static  int hour_last;
 static  int mon_last;
 static  int date_last;
 static  int Year_last;
 myGLCD.setTextColor(WHITE, BLACK); //белый цвет цифры

 if (date != date_last || reNew){ myGLCD.printNumI(date, 85, 7, 2, '0'); date_last = date; }

 if (mon!=mon_last || reNew){myGLCD.printNumI(mon, 130, 7, 2, '0'); mon_last = mon; }  
 
 if (Year!=Year_last || reNew) {  myGLCD.printNumI(Year, 175, 7); Year_last = Year; }
   
 if (hour!=hour_last || reNew){ myGLCD.printNumI(hour, 255, 7, 2, '0'); hour_last = hour; } 
   
 if (minut!=minut_last || reNew ){ myGLCD.printNumI(minut, 300, 7, 2, '0'); minut_last = minut; }
   } 

void Temperature () { 

     static boolean p=0; // флаг работы: запрос температуры или её чтение
p=!p;
if (p) {ds.reset();      // сброс шины
        ds.write(0xCC);  // обращение ко всем датчикам
        ds.write(0x44);  // начать преобразование (без паразитного питания)  
       }
else   {
 
        int Temper_= 20;  byte buff[9];
        ds.reset();
        ds.select(DSaddress);    
        ds.write(0xBE); // Read Scratchpad (чтение регистров)  
        for (byte j = 0; j<9; j++) buff[j]= ds.read(); //читаем все 9 байт от датчика 
        ds.reset();
        if (OneWire::crc8(buff, 8) == buff[8]){        // если контрольная сумма совпадает
        Temper_ =  buff[0] | (buff[1]<<8);             // читаем температуру из первых двух байт (остальные были нужны для проверки CRC)
        Temper_ = Temper_ / 16;
        if  (Temper_ < 150 && Temper_ > -50 && Temper_ !=85 && Temper_!=-127)  IntTemp =  Temper_;
                 
                                              }
                                                      
}
   }

 

viki13viki
Offline
Зарегистрирован: 14.11.2016

вот лог

Send startsession - address Gauge
Receive GAUGE: 55 52 80 Gauge INIT is good!
Receive GAUGE: 2D A0 48 54 20 32 34 34 31 39 35 36 30 20 31 34 30 30 20 34 31 39 39 20 31 33 30 31 20 30 34 32 20 31 20 30 30 30 30 30 30 30 30 30 30 08 F0 
Received message is OK! Checksum is correct!  3412
ID panel receive! Send request PIDGauge
Receive GAUGE: 13 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 32 4D  GAUGE Message fail address
Receive GAUGE: 50 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 75 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BE 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 33 4D  GAUGE Message fail address
Receive GAUGE: 51 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 78 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BF 00  GAUGE Message fail address
Receive GAUGE: CF 92  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BE  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 39 4D  GAUGE Message fail address
Receive GAUGE: 53 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 06 80  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 68 3D 39 4D 53 00 00 00 CF 22 6A 92 04 76 01 00 00 23 A1 
CRC fail!!!
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BB  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 53 00  GAUGE Message fail address
Receive GAUGE: 00 CF  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 7E 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BE 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 39 4D  GAUGE Message fail address
Receive GAUGE: 53 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 76 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 6A 3D 3A 4D 53 00 00 00 CF 22 04 76 00 06 
CRC fail!!!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3A 53 00 CF 22 92 04 76 01 00 00 06 7E 23 A1 04 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BD  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3A 4D  GAUGE Message fail address
Receive GAUGE: 53 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 80 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 6A 3C  GAUGE Message fail address
Receive GAUGE: 3A 4D  GAUGE Message fail address
Receive GAUGE: 53 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 7E 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BF 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3A 4E  GAUGE Message fail address
Receive GAUGE: 53 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 6A 3D  GAUGE Message fail address
Receive GAUGE: 3A 4D  GAUGE Message fail address
Receive GAUGE: 53 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BF 00 FF 69 3D 3A 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  6819
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6A 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  6881
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BF 00 FF 69 3D 3B 4E 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  7032
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  7075
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  7175
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 69 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 81 
Received message is OK! Checksum is correct!  7278
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 68 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  7371
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 80 
Received message is OK! Checksum is correct!  7471
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 68 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  7570
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 69 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 81 
Received message is OK! Checksum is correct!  7665
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BF 00 FF 69 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  7840
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 80 
Received message is OK! Checksum is correct!  7867
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 6A 3D 3B 4E 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  7961
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 80 
Received message is OK! Checksum is correct!  8119
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3B 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  8158
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 6A 3D 3C 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  8257
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BF 00 FF 69 3D 3C 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  8427
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 6A 3D 3C 4E 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  8455
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  8553
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  8675
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6A 3D 3C 4E 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  8750
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4E 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  8851
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BF 00 FF 6A 3D 3C 4E 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 87 
Received message is OK! Checksum is correct!  8948
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 68 3D 3C 4E 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  9046
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BF 00 FF 69 3D 3C 4E 54 00 00 00 CF 22 6A 92 04 76 01 00 00 06 86 
Received message is OK! Checksum is correct!  9387
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 68 3D 3C 4D 54 00 00 00 CF 22 6A 92 04 76 01 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BA  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 54 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 80 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BD  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 6A 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 54 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 68 3B  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 68 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 80 
Received message is OK! Checksum is correct!  9804
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 68 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 80 
Received message is OK! Checksum is correct!  9831
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BF 00 FF 6A 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 88 
Received message is OK! Checksum is correct!  9930
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 68 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 80 
Received message is OK! Checksum is correct!  10082
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 86 
Received message is OK! Checksum is correct!  10126
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  10225
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 86 
Received message is OK! Checksum is correct!  10358
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  10422
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 86 
Received message is OK! Checksum is correct!  10519
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 86 
Received message is OK! Checksum is correct!  10619
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  10716
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  10815
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 68 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  10920
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  11011
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 68 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  11110
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  11217
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  11308
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  11462
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  11502
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  11600
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  11718
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  11796
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 86 
Received message is OK! Checksum is correct!  11895
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  12002
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 86 
Received message is OK! Checksum is correct!  12092
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  12193
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 86 
Received message is OK! Checksum is correct!  12291
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  12389
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  12487
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  12592
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 68 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  12682
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  12834
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 68 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  12877
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  12977
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 86 
Received message is OK! Checksum is correct!  13400
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  13416
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 
CRC fail!!!
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BE 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4C  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BE 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 06  GAUGE Message fail address
Receive GAUGE: 86 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 69 3D 4E 00 00 CF 6A 92 04 76 01 00 06 86 23 A1 04 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BE 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 23 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 55 00 00 CF 6A 92 04 76 00 00 06 83 23 A1 04 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  15168
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  15242
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  15347
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  15438
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  15590
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  15634
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  15735
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  15851
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  15931
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  16028
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  16134
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  16225
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  16324
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  16422
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  16520
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  16620
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3C 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 81 
Received message is OK! Checksum is correct!  16722
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  16816
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  16984
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  17010
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  17110
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 85 
Received message is OK! Checksum is correct!  17413
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4D 55 00 00 00 23 A1 04 00 00 00 00 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 67 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 06 82  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 23 A1 04 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3C  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 06 82  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 4E 55 00 CF 6A 92 76 00 06 85 23 A1 04 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 CF  GAUGE Message fail address
Receive GAUGE: 22 6A  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: 76 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 06 81  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  20794
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 81 
Received message is OK! Checksum is correct!  20854
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  20978
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 81 
Received message is OK! Checksum is correct!  21050
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  21392
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  21459
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3C 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 23 A1 
CRC fail!!!
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BD  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4C  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 80 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BD  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 00  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 06 84 23 A1 
CRC fail!!!
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BD  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 4D 00  GAUGE Message fail address
Receive GAUGE: 00 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 6A  GAUGE Message fail address
Receive GAUGE: 92 76  GAUGE Message fail address
Receive GAUGE: 01 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BD  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 00 CF  GAUGE Message fail address
Receive GAUGE: 22 6A  GAUGE Message fail address
Receive GAUGE: 92 04  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 CF  GAUGE Message fail address
Receive GAUGE: 22 6A  GAUGE Message fail address
Receive GAUGE: 76 01  GAUGE Message fail address
Receive GAUGE: 00 82  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 69 3D 3C 4E 55 00 00 00 CF 6A 92 04 76 01 00 00 06 85 23 A1 
CRC fail!!!
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BB  GAUGE Message fail address
Receive GAUGE: 00 01  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 06 81  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 23 A1 04 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 00 82  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  24759
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  24801
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  24891
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  25042
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 84 
Received message is OK! Checksum is correct!  25085
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 68 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 81 
Received message is OK! Checksum is correct!  25407
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3D 3C 4D 55 00 00 00 CF 23 A1 04 00 00 00 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BD  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 4D  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 CF  GAUGE Message fail address
Receive GAUGE: 22 6A  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 55  GAUGE Message fail address
Receive GAUGE: 00 CF  GAUGE Message fail address
Receive GAUGE: 22 92  GAUGE Message fail address
Receive GAUGE: 76 00  GAUGE Message fail address
Receive GAUGE: 00 84  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 23 A1 04 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BD  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 06 84  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  28767
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  28854
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  28934
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3C 3C 4E 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  29033
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 82 
Received message is OK! Checksum is correct!  29445
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3C 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 23 A1 04 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 85 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 04  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 06 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 06 82  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 69 3C 4D 00 00 22 6A 76 01 00 84 23 A1 04 00 00 00 00 00 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 80 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 84 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 80 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 92 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 6A  GAUGE Message fail address
Receive GAUGE: 92 76  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA FF  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 55  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 22 92  GAUGE Message fail address
Receive GAUGE: 76 01  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 69 3C 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 23 A1 
CRC fail!!!
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 06 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 06 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 4D 00  GAUGE Message fail address
Receive GAUGE: 00 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 04  GAUGE Message fail address
Receive GAUGE: 76 01  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 06 83  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 68 3D 3C 4D 55 00 00 00 CF 22 6A 92 04 76 01 00 00 06 83 
Received message is OK! Checksum is correct!  32691
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 69 3D 3C 4D 55 00 CF 22 04 76 01 00 00 06 82 23 A1 04 00 
CRC fail!!!
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 04  GAUGE Message fail address
Receive GAUGE: 10 BD  GAUGE Message fail address
Receive GAUGE: 00 FF  GAUGE Message fail address
Receive GAUGE: 67 3D  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 80 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 81 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BB 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 69 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BC 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3C  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 82 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 76  GAUGE Message fail address
Receive GAUGE: 01 00  GAUGE Message fail address
Receive GAUGE: 00 06  GAUGE Message fail address
Receive GAUGE: 83 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BA 00  GAUGE Message fail address
Receive GAUGE: 69 3D  GAUGE Message fail address
Receive GAUGE: 3C 4D  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 23  GAUGE Message fail address
Receive GAUGE: A1 04  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: 04 10  GAUGE Message fail address
Receive GAUGE: BD 00  GAUGE Message fail address
Receive GAUGE: 68 3C  GAUGE Message fail address
Receive GAUGE: 3C 4E  GAUGE Message fail address
Receive GAUGE: 55 00  GAUGE Message fail address
Receive GAUGE: 00 00  GAUGE Message fail address
Receive GAUGE: CF 22  GAUGE Message fail address
Receive GAUGE: 6A 92  GAUGE Message fail address
Receive GAUGE: 04 00  GAUGE Message fail address
Receive GAUGE: 00 83  GAUGE Message fail address
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 13 FF 3D 3C 55 00 Message fail timeout

остаток км в баке он не показал, может потому что в последние дни всегда была запись среднего расхода 0.0? по этому он сейчас не может расчитать?

вывел по старинке kmREFUELING=((float)Fuel*100.0)/(float)6.7  , записав средний раз в ручную, ведь должно было просто тупо от литров высчитать, но даже это не сработало, по прежнему показывает 0. чета не так, толи расчеты не ведутся вообще то ли их не выводит, хз

MaksVV
Offline
Зарегистрирован: 06.08.2015

поправил 2035. Сними опять лог панели и вверху скетча поменяй отладку на TRIP (я ее добавил). и тоже лог этой отладки

viki13viki
Offline
Зарегистрирован: 14.11.2016

Ок. Завтра утром

viki13viki
Offline
Зарегистрирован: 14.11.2016

лог GUAGE. отличный лог

Send startsession - address Gauge
Receive GAUGE: 55 52 80 Gauge INIT is good!
Receive GAUGE: 2D A0 48 54 20 32 34 34 31 39 35 36 30 20 31 34 30 30 20 34 31 39 39 20 31 33 30 31 20 30 34 32 20 31 20 30 30 30 30 30 30 30 30 30 30 08 F0 
Received message is OK! Checksum is correct!  3402
ID panel receive! Send request PIDGauge
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 29 3D 4D 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 A8 
Received message is OK! Checksum is correct!  5433
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 72 35 2A 3C 4D 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 A8 
Received message is OK! Checksum is correct!  5448
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 70 35 2A 3D 04 01 00 00 00 00 04 10 BB 00 FF 71 35 30 3D 
CRC fail!!!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 70 35 31 3D 4F 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  5585
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 72 35 31 3D 4F 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 AF 
Received message is OK! Checksum is correct!  5685
 receive Datastream Gauge!
Receive GAUGE: 23 A1 Message fail timeout
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 31 3D 4F 00 00 00 A4 B0 23 A1 04 00 00 00 00 00 00 
CRC fail!!!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 32 3D 4F 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B1 
Received message is OK! Checksum is correct!  6324
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 35 32 3D 4F 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  6374
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 32 3C 4F 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 AF 
Received message is OK! Checksum is correct!  6473
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 32 3D 4F 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  6603
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 72 35 32 3D 4F 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B1 
Received message is OK! Checksum is correct!  6670
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 32 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  6769
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 72 35 32 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  6870
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  6966
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  7066
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 70 35 33 3C 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  7175
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6F 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  7261
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BE 00 FF 6F 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  7360
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  7456
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  7556
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 72 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  7709
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6F 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  7753
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  7852
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  7980
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  8048
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 35 33 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  8147
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 33 3C 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B1 
Received message is OK! Checksum is correct!  8263
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 34 3C 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  8343
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  8442
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B6 
Received message is OK! Checksum is correct!  8550
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  8640
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B6 
Received message is OK! Checksum is correct!  8737
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  8835
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B6 
Received message is OK! Checksum is correct!  8933
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B6 
Received message is OK! Checksum is correct!  9058
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  9393
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  9410
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 
CRC fail!!!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  9686
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  9718
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  9817
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3C 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  9927
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  10013
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  10113
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  10212
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B6 
Received message is OK! Checksum is correct!  10309
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  10411
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  10516
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  10606
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  10703
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  10799
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  10905
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  11044
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B6 
Received message is OK! Checksum is correct!  11095
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  11194
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B6 
Received message is OK! Checksum is correct!  11324
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B1 
Received message is OK! Checksum is correct!  11390
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B6 
Received message is OK! Checksum is correct!  11492
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 70 35 34 3E 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  11589
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 6F 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  11686
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  11786
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  11892
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  11981
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  12081
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  12177
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  12276
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  12402
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  12471
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  12570
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  12677
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  12766
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  12865
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  12981
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  13063
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  13373
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6F 35 34 3D 50 00 00 00 1B 23 A1 04 00 00 00 00 00 00 00 
CRC fail!!!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 36 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  13553
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  13651
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  13748
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  13847
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  13974
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  14043
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  14144
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  14248
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  14338
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  14437
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6F 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  14535
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  14633
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  14733
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6F 35 34 3C 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  14841
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  14929
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 6F 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  15037
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  15124
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  15223
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  15370
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  15419
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  15518
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  15675
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  15715
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  15814
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  15952
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  16010
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  16109
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  16234
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  16307
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  16405
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  16501
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6F 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  16602
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  16726
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 6F 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  16797
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BA 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  16896
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  17002
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 35 34 3E 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  17376
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  17392
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 35 34 3D 50 00 00 01 00 00 05 B4 23 A1 04 00 00 00 00 
CRC fail!!!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  17584
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  17681
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  17779
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 6F 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  17923
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  17976
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  18075
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6F 33 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  18173
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  18272
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 6E 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  18371
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  18466
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 6F 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  18567
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B1 
Received message is OK! Checksum is correct!  18714
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  18763
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B2 
Received message is OK! Checksum is correct!  18863
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BC 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  18991
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 36 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  19059
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  19159
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 B9 00 FF 71 33 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B0 
Received message is OK! Checksum is correct!  19269
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B4 
Received message is OK! Checksum is correct!  19354
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BB 00 FF 71 34 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B3 
Received message is OK! Checksum is correct!  19453
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 35 34 3D 50 00 00 00 1B 25 A4 92 04 3C 01 00 00 05 B5 
Received message is OK! Checksum is correct!  19561
 receive Datastream Gauge!
Receive GAUGE: 23 A1 04 00 00 00 00 00 00 00 00 00 00 04 10 BD 00 FF 70 34 34 3D 50 00 00 00 1B 25 

лог TRIP, все как на панели

 Fuel = 26.50 L
 kmAge = 949.90 km
 FuelTrip = -0.50 L
 kmTrip = 0.90 km
 L100SR_TFT = 0.00 L/100km
 Fuel = 24.00 L
 kmAge = 949.90 km
 Fuel = 24.50 L
 kmAge = 949.90 km
 Fuel = 24.50 L
 kmAge = 949.90 km
 Fuel = 24.50 L
 kmAge = 949.90 km
 Fuel = 25.00 L
 kmAge = 949.90 km
 Fuel = 25.00 L
 kmAge = 949.90 km
 Fuel = 25.00 L
 kmAge = 949.90 km
 Fuel = 25.00 L
 kmAge = 949.90 km
 Fuel = 25.00 L
 kmAge = 949.90 km
 Fuel = 25.00 L
 kmAge = 949.90 km
 Fuel = 25.00 L
 kmAge = 949.90 km
 Fuel = 25.00 L
 kmAge = 949.90 km
 Fuel = 25.00 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 25.50 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 FuelTrip = 0.00 L
 kmTrip = 0.90 km
 L100SR_TFT = 0.00 L/100km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 FuelTrip = 0.00 L
 kmTrip = 0.90 km
 L100SR_TFT = 0.00 L/100km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 FuelTrip = 0.00 L
 kmTrip = 0.90 km
 L100SR_TFT = 0.00 L/100km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 FuelTrip = 0.00 L
 kmTrip = 0.90 km
 L100SR_TFT = 0.00 L/100km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 FuelTrip = 0.00 L
 kmTrip = 0.90 km
 L100SR_TFT = 0.00 L/100km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 FuelTrip = 0.00 L
 kmTrip = 0.90 km
 L100SR_TFT = 0.00 L/100km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km
 Fuel = 26.00 L
 kmAge = 949.90 km

по старинке else kmREFUELING=((float)Fuel*100.00)/(float)6.7; продолжает не работать

MaksVV
Offline
Зарегистрирован: 06.08.2015
if (L100SR>0) kmREFUELING=((float)Fuel*100.0)/(float)L100SR; //если средний расход больше нуля, то расчитывать км в баке из него
 else kmREFUELING=((float)Fuel*100.00)/(float)L100SR_TFT;    //если ноль или ментше то расчитывать км в баке с устредненного расхода

эти две строки начинают отрабатываться раз в  10 км пробега. 

А такто всё норм пока. нужно снять лог между 9 и 10 км пробега после включения зажигания - в логе должна появиться такая надпись    I am heer:  if (kmTrip-km>kmL)

 

viki13viki
Offline
Зарегистрирован: 14.11.2016

я вчера проехал домой 25 и сегодня на работу 25 , километры в баке остались на нуле так же и средний разход на нуле, показывал только средний разход за поездку. нуд допустим но ведь если я подставил 6.7 литров то оно должно было мгновенно подсчитать с литров в баке а нет, на нуле осталось

MaksVV
Offline
Зарегистрирован: 06.08.2015

дак я для этого лог и сделал. может он в эту часть программы просто не заходит. 

viki13viki
Offline
Зарегистрирован: 14.11.2016

 фигово у ноута батарея не держит, не смогу лог на ходу проверить. хз как это проверить

MaksVV
Offline
Зарегистрирован: 06.08.2015

ну засними лог хотябы просто по приезду, не выключая зажигание

viki13viki
Offline
Зарегистрирован: 14.11.2016

смогу снять так лог только завтра утром по приезду на работу будет 25 км. так и сделаю, утром отпишу

Sergei H.
Offline
Зарегистрирован: 17.11.2018

Извините ,что опять влезаю в вашу тему. Инициализация БК Obduino32 с моим авто прошла успешно ,просто в коде проставил протокол 14230.Не подскажите ,что нужно изменить в коде (ОН В ПОСТЕ 2002),чтобы в меню быстрее выводить значение стоимости литра бензина.Сейчас в коде стоимость в долларах ,по умолчанию стоит доллар с копейками точно не помню примерно $1,235. У нас стоимость за литр 42р. 25к. когда подстраиваешь меняются сотые доллара реально долго получается.Вместо значка доллара поставил P.

viki13viki
Offline
Зарегистрирован: 14.11.2016

поставь просто 42 рубля без сотых, 10 рублей на 40а литрах потеряешь из виду, но я так думаю не велика потеря. зато может быстро будет выводить. номер строки в коде скажи а то я упарюсь в 6000 строках искать

Sergei H.
Offline
Зарегистрирован: 17.11.2018

 854 строка я думаю. 42рубля можно и с сотыми набрать только долго получается,каждый клик кнопки увеличивает стоимость литра на одну сотую. Да код большой пытаюсь убрать лишнее.

  prog_char gasPrice[][10] PROGMEM={"-  %s\354 + ", CurrencyAdjustString}; // dual string for fuel price

viki13viki
Offline
Зарегистрирован: 14.11.2016

расчет идет сдесь

void get_cost(char *retbuf, byte ctrip)
{
  unsigned long cents;
  unsigned long fuel;
  char decs[16];
  params.gas_price;  // x/1000 = dollars
  fuel = params.trip[ctrip].fuel / 10000; //cL
  cents =  fuel * params.gas_price / 1000; //now have $$$$cc
  long_to_dec_str(cents, decs, 2);
  sprintf_P(retbuf, PSTR(CurrencyPrintString), decs);
}

а настройка если не ошибаюсь здесь

/**************************/
/* GASOLINE ENGINE CONFIG */
/**************************/
// [CONFIRMED] For gas car use 3355 (1/14.7/730*3600)*10000
#define GasConst 3355
#define GasMafConst 107310 // 14.7*730*10

тебе нужно заменить 3355 на 42250 что значит у низ 3.355  и у тебя 42.25

но это моя догадка, я не уверен пробуй

вторая строка это расчет газа, вроде.

viki13viki
Offline
Зарегистрирован: 14.11.2016

Макс идея не сработала, мы упустили из виду что при подключении к ноуту, и входу в монитор, бортовик перезагружается и все сбивается до стартовой позиции, обнуляется. Но.... по моей оплошности есть подсказка. я вчера забыл залить скетч без ручной подправки, залил с kmREFUELING=((float)Fuel*100.00)/(float)6.7; вместо kmREFUELING=((float)Fuel*100.00)/(float)L100SR_TFT;. и вечером в начале поездки и с утра в начале поездки было 0 км в баке но после первых 10 км показало километры в баке, что это нам дает? первое мы видим что он не показывает последнюю запись километров в баке при заводке, второе от чего нужно плясать и искат проблему это от L100SR_TFT и идти по цепочке назад . Лог не ставлю он безполезен, он обнуленный. Да и для размышления, средний разход за поездку работает. Получается что kmREFUELING не работает из за не работоспособности L100SR или L100SR_TFT.  один из двух виновник или в их расчетах или их записях. Но это мои догадки