Add new GPS sensor and new diplay types

This commit is contained in:
norbert-walter 2024-03-23 14:06:57 +01:00
parent 136dd1fa30
commit c1d6a566aa
5 changed files with 50 additions and 33 deletions

View File

@ -3,7 +3,6 @@
#include <Arduino.h>
#include "OBP60Hardware.h"
#include <MCP23017.h>
#include <FastLED.h> // Driver for WS2812 RGB LED
#include <GxGDEW042T2/GxGDEW042T2.h> // 4.2" Waveshare S/W 300 x 400 pixel
#include <GxIO/GxIO_SPI/GxIO_SPI.h> // GxEPD lip for SPI display communikation

View File

@ -41,7 +41,7 @@
#define FONT3 "Ubuntu_Bold32pt7b"
#define FONT4 "DSEG7Classic_BoldItalic80pt7b"
// GPS (NEO-6M, NEO-M8N)
// GPS (NEO-6M, NEO-M8N, ATGM336H)
#define OBP_GPS_RX 2
#define OBP_GPS_TX 1
// 1Wire (DS18B20)

View File

@ -142,6 +142,19 @@ void sensorTask(void *param){
gps_ready = true;
}
}
if(String(gpsOn) == "ATGM336H"){
Serial2.begin(9600, SERIAL_8N1, OBP_GPS_TX, -1); // GPS RX unused in hardware (-1)
if (!Serial2) {
api->getLogger()->logDebug(GwLog::ERROR,"GPS modul ATGM336H not found, check wiring");
gps_ready = false;
}
else{
api->getLogger()->logDebug(GwLog::LOG,"GPS modul ATGM336H found");
NMEA0183.SetMessageStream(&Serial2);
NMEA0183.Open();
gps_ready = true;
}
}
// Settings for temperature sensors
String tempSensor = api->getConfig()->getConfigItem(api->getConfig()->useTempSensor,true)->asString();

View File

@ -176,7 +176,7 @@
"name": "distanceFormat",
"label": "Distance Format",
"type": "list",
"default": "m",
"default": "nm",
"description": "Distance format [m|km|nm]",
"list": [
"m",
@ -192,7 +192,7 @@
"name": "speedFormat",
"label": "Speed Format",
"type": "list",
"default": "m/s",
"default": "kn",
"description": "Distance format [m/s|km/h|kn]",
"list": [
"m/s",
@ -208,7 +208,7 @@
"name": "windspeedFormat",
"label": "Wind Speed Format",
"type": "list",
"default": "m/s",
"default": "kn",
"description": "Wind speed format [m/s|km/h|kn|bft]",
"list": [
"m/s",
@ -241,7 +241,7 @@
"name": "dateFormat",
"label": "Date Format",
"type": "list",
"default": "GB",
"default": "DE",
"description": "Date format [DE|GB|US] DE: 31.12.2022, GB: 31/12/2022, US: 12/31/2022",
"list": [
"DE",
@ -257,12 +257,13 @@
"name": "useGPS",
"label": "GPS Sensor",
"type": "list",
"default": "off",
"default": "ATGM336H",
"description": "Use internal GPS module type [off|NEO-6M|NEO-M8N]",
"list": [
"off",
"NEO-6M",
"NEO-M8N"
"NEO-M8N",
"ATGM336H"
],
"category": "OBP60 Hardware",
"capabilities": {
@ -273,7 +274,7 @@
"name": "useEnvSensor",
"label": "Env. Sensor",
"type": "list",
"default": "off",
"default": "BMP280",
"description": "Use internal or external environment sensor via I2C bus [off|BME280|BMP280|SHT21]",
"list": [
"off",
@ -687,7 +688,7 @@
"name": "flashLED",
"label": "Flash LED Mode",
"type": "list",
"default": "Off",
"default": "Limit Violation",
"description": "Settings for flash LED",
"list": [
"Off",
@ -771,7 +772,7 @@
"check": "checkMinMax",
"min": 1,
"max": 10,
"default":"5",
"default":"10",
"category":"OBP60 Pages",
"capabilities": {
"obp60":"true"
@ -854,7 +855,7 @@
"name": "page2type",
"label": "Type",
"type": "list",
"default": "ApparentWind",
"default": "WindRose",
"description": "Type of page for page 2",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 2",
@ -976,7 +977,7 @@
"name": "page4type",
"label": "Type",
"type": "list",
"default": "OneValue",
"default": "TwoValues",
"description": "Type of page for page 4",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 4",
@ -989,7 +990,7 @@
"name": "page4value1",
"label": "Field 1",
"type": "boatData",
"default": "AWS",
"default": "STW",
"description": "The display for field one",
"category": "OBP60 Page 4",
"capabilities": {
@ -1001,7 +1002,7 @@
"name": "page4value2",
"label": "Field 2",
"type": "boatData",
"default": "",
"default": "DBT",
"description": "The display for field two",
"category": "OBP60 Page 4",
"capabilities": {
@ -1037,7 +1038,7 @@
"name": "page5type",
"label": "Type",
"type": "list",
"default": "OneValue",
"default": "ThreeValues",
"description": "Type of page for page 5",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 5",
@ -1050,7 +1051,7 @@
"name": "page5value1",
"label": "Field 1",
"type": "boatData",
"default": "AWS",
"default": "COG",
"description": "The display for field one",
"category": "OBP60 Page 5",
"capabilities": {
@ -1062,7 +1063,7 @@
"name": "page5value2",
"label": "Field 2",
"type": "boatData",
"default": "",
"default": "STW",
"description": "The display for field two",
"category": "OBP60 Page 5",
"capabilities": {
@ -1074,7 +1075,7 @@
"name": "page5value3",
"label": "Field 3",
"type": "boatData",
"default": "",
"default": "DBT",
"description": "The display for field 3",
"category": "OBP60 Page 5",
"capabilities": {
@ -1098,7 +1099,7 @@
"name": "page6type",
"label": "Type",
"type": "list",
"default": "OneValue",
"default": "FourValues",
"description": "Type of page for page 6",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 6",
@ -1111,7 +1112,7 @@
"name": "page6value1",
"label": "Field 1",
"type": "boatData",
"default": "AWS",
"default": "AWA",
"description": "The display for field one",
"category": "OBP60 Page 6",
"capabilities": {
@ -1123,7 +1124,7 @@
"name": "page6value2",
"label": "Field 2",
"type": "boatData",
"default": "",
"default": "AWS",
"description": "The display for field two",
"category": "OBP60 Page 6",
"capabilities": {
@ -1135,7 +1136,7 @@
"name": "page6value3",
"label": "Field 3",
"type": "boatData",
"default": "",
"default": "COG",
"description": "The display for field 3",
"category": "OBP60 Page 6",
"capabilities": {
@ -1147,7 +1148,7 @@
"name": "page6value4",
"label": "Field 4",
"type": "boatData",
"default": "",
"default": "STW",
"description": "The display for field 4",
"category": "OBP60 Page 6",
"capabilities": {
@ -1159,7 +1160,7 @@
"name": "page7type",
"label": "Type",
"type": "list",
"default": "OneValue",
"default": "FourValues2",
"description": "Type of page for page 7",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 7",
@ -1172,7 +1173,7 @@
"name": "page7value1",
"label": "Field 1",
"type": "boatData",
"default": "AWS",
"default": "AWA",
"description": "The display for field one",
"category": "OBP60 Page 7",
"capabilities": {
@ -1184,7 +1185,7 @@
"name": "page7value2",
"label": "Field 2",
"type": "boatData",
"default": "",
"default": "AWS",
"description": "The display for field two",
"category": "OBP60 Page 7",
"capabilities": {
@ -1196,7 +1197,7 @@
"name": "page7value3",
"label": "Field 3",
"type": "boatData",
"default": "",
"default": "COG",
"description": "The display for field 3",
"category": "OBP60 Page 7",
"capabilities": {
@ -1208,7 +1209,7 @@
"name": "page7value4",
"label": "Field 4",
"type": "boatData",
"default": "",
"default": "STW",
"description": "The display for field 4",
"category": "OBP60 Page 7",
"capabilities": {
@ -1220,7 +1221,7 @@
"name": "page8type",
"label": "Type",
"type": "list",
"default": "OneValue",
"default": "Clock",
"description": "Type of page for page 8",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 8",
@ -1281,7 +1282,7 @@
"name": "page9type",
"label": "Type",
"type": "list",
"default": "OneValue",
"default": "RollPitch",
"description": "Type of page for page 9",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 9",
@ -1342,7 +1343,7 @@
"name": "page10type",
"label": "Type",
"type": "list",
"default": "OneValue",
"default": "Battery2",
"description": "Type of page for page 10",
"list":["OneValue","TwoValues","ThreeValues","FourValues","FourValues2","ApparentWind","WindRose","Voltage","DST810","Clock","WhitePage","BME280","RudderPosition","KeelPosition","Battery","Battery2","RollPitch","Solar","Generator"],
"category": "OBP60 Page 10",

View File

@ -33,6 +33,10 @@ lib_deps =
build_flags=
-DTIME=$UNIX_TIME
-D BOARD_OBP60S3
-D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm
# -D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm
# -D DISPLAY_GYE042A8 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm
# -D DISPLAY_SE0420NQ04 #alternativ E-Ink display from SID Technology, R10 2.2 ohm
${env.build_flags}
upload_port = /dev/ttyACM0
upload_protocol = esptool