From df84066b58b202d56c24fcfadda1c7625f020de0 Mon Sep 17 00:00:00 2001 From: free-x Date: Sat, 30 Apr 2022 09:59:36 +0200 Subject: [PATCH 1/5] Fix ArduinoJson library deps for platformio --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index c0c0101..9627f84 100644 --- a/platformio.ini +++ b/platformio.ini @@ -22,7 +22,7 @@ framework = arduino lib_deps = ttlappalainen/NMEA2000-library @ 4.17.2 ttlappalainen/NMEA0183 @ 1.7.1 - bblanchon/ArduinoJson@6.18.5 + ArduinoJson@6.18.5 ottowinter/ESPAsyncWebServer-esphome@2.0.1 fastled/FastLED @ 3.4.0 board_build.embed_files = From ca7af513e471e48b2efa8b6f4704243bad0fe7a2 Mon Sep 17 00:00:00 2001 From: free-x Date: Sat, 30 Apr 2022 17:38:48 +0200 Subject: [PATCH 2/5] Pining espressif32 platform --- platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 9627f84..314b345 100644 --- a/platformio.ini +++ b/platformio.ini @@ -17,12 +17,12 @@ extra_configs= lib/*task*/platformio.ini [env] -platform = espressif32 +platform = espressif32 @ 3.4.0 framework = arduino lib_deps = ttlappalainen/NMEA2000-library @ 4.17.2 ttlappalainen/NMEA0183 @ 1.7.1 - ArduinoJson@6.18.5 + ArduinoJson @ 6.18.5 ottowinter/ESPAsyncWebServer-esphome@2.0.1 fastled/FastLED @ 3.4.0 board_build.embed_files = From 4087311922039815fa78bc6ba492e0fc27dcacc8 Mon Sep 17 00:00:00 2001 From: free-x Date: Sat, 25 Jun 2022 08:24:51 +0200 Subject: [PATCH 3/5] Add rs232 atom board --- lib/hardware/GwHardware.h | 23 +++++++++++++++++++++++ platformio.ini | 10 ++++++++++ 2 files changed, 33 insertions(+) diff --git a/lib/hardware/GwHardware.h b/lib/hardware/GwHardware.h index 08a6a8f..15776e5 100644 --- a/lib/hardware/GwHardware.h +++ b/lib/hardware/GwHardware.h @@ -57,6 +57,29 @@ //brightness 0...255 #define GWLED_BRIGHTNESS 64 #endif + +#ifdef BOARD_M5ATOM_RS232_CANUNIT +#define ESP32_CAN_TX_PIN GPIO_NUM_26 +#define ESP32_CAN_RX_PIN GPIO_NUM_32 +//if using rs232 +#define GWSERIAL_TX 19 +#define GWSERIAL_RX 22 +#define GWSERIAL_MODE "BI" +#define GWBUTTON_PIN GPIO_NUM_39 +#define GWBUTTON_ACTIVE LOW +//if GWBUTTON_PULLUPDOWN we enable a pulup/pulldown +#define GWBUTTON_PULLUPDOWN +//led handling +//if we define GWLED_FASTNET the arduino fastnet lib is used +#define GWLED_FASTLED +#define GWLED_TYPE SK6812 +//color schema for fastled +#define GWLED_SCHEMA GRB +#define GWLED_PIN GPIO_NUM_27 +//brightness 0...255 +#define GWLED_BRIGHTNESS 64 +#endif + #ifdef BOARD_M5STICK_CANUNIT #define ESP32_CAN_TX_PIN GPIO_NUM_32 #define ESP32_CAN_RX_PIN GPIO_NUM_33 diff --git a/platformio.ini b/platformio.ini index 1d576e2..e85fdb1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -59,6 +59,16 @@ build_flags = upload_port = /dev/esp32 upload_protocol = esptool +[env:m5stack-atom-rs232-canunit] +board = m5stack-atom +lib_deps = ${env.lib_deps} +build_flags = + -D BOARD_M5ATOM_RS232_CANUNIT + ${env.build_flags} +upload_port = /dev/esp32 +upload_protocol = esptool + + [env:m5stickc-atom-canunit] board = m5stick-c lib_deps = ${env.lib_deps} From a4731e67d77ad6082ab1aed260ff516658b08958 Mon Sep 17 00:00:00 2001 From: free-x Date: Sat, 25 Jun 2022 08:29:49 +0200 Subject: [PATCH 4/5] Add rs485 atom board --- lib/hardware/GwHardware.h | 23 +++++++++++++++++++++++ platformio.ini | 9 +++++++++ 2 files changed, 32 insertions(+) diff --git a/lib/hardware/GwHardware.h b/lib/hardware/GwHardware.h index 15776e5..8b6dd9f 100644 --- a/lib/hardware/GwHardware.h +++ b/lib/hardware/GwHardware.h @@ -80,6 +80,29 @@ #define GWLED_BRIGHTNESS 64 #endif +#ifdef BOARD_M5ATOM_RS485_CANUNIT +#define ESP32_CAN_TX_PIN GPIO_NUM_26 +#define ESP32_CAN_RX_PIN GPIO_NUM_32 +//if using rs232 +#define GWSERIAL_TX 19 +#define GWSERIAL_RX 22 +#define GWSERIAL_MODE "UNI" +#define GWBUTTON_PIN GPIO_NUM_39 +#define GWBUTTON_ACTIVE LOW +//if GWBUTTON_PULLUPDOWN we enable a pulup/pulldown +#define GWBUTTON_PULLUPDOWN +//led handling +//if we define GWLED_FASTNET the arduino fastnet lib is used +#define GWLED_FASTLED +#define GWLED_TYPE SK6812 +//color schema for fastled +#define GWLED_SCHEMA GRB +#define GWLED_PIN GPIO_NUM_27 +//brightness 0...255 +#define GWLED_BRIGHTNESS 64 +#endif + + #ifdef BOARD_M5STICK_CANUNIT #define ESP32_CAN_TX_PIN GPIO_NUM_32 #define ESP32_CAN_RX_PIN GPIO_NUM_33 diff --git a/platformio.ini b/platformio.ini index e85fdb1..d6d1109 100644 --- a/platformio.ini +++ b/platformio.ini @@ -68,6 +68,15 @@ build_flags = upload_port = /dev/esp32 upload_protocol = esptool +[env:m5stack-atom-rs485-canunit] +board = m5stack-atom +lib_deps = ${env.lib_deps} +build_flags = + -D BOARD_M5ATOM_RS485_CANUNIT + ${env.build_flags} +upload_port = /dev/esp32 +upload_protocol = esptool + [env:m5stickc-atom-canunit] board = m5stick-c From 62a715f53e514383e4fa34cb74467b33269c4062 Mon Sep 17 00:00:00 2001 From: free-x Date: Sat, 25 Jun 2022 08:52:00 +0200 Subject: [PATCH 5/5] Add documentation about rs232 and rs485 kits --- doc/Hardware.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/Hardware.md b/doc/Hardware.md index 79209a0..988c8d6 100644 --- a/doc/Hardware.md +++ b/doc/Hardware.md @@ -50,6 +50,20 @@ M5 Atom CAN with M5 RS485 Module With this set up you get basically all the features from the plain AtomCAN and the Tal485 combined. You still can connect via USB but have the NMEA0183 connection in parallel. +M5 Atom RS485 with M5 CAN Unit +-------------------------------- +* Hardware: [ATOM RS485](https://docs.m5stack.com/en/atom/atomic485) + [CAN Unit](http://docs.m5stack.com/en/unit/can) +* Prebuild Binary: m5stack-atom-rs485-canunit-all.bin +* Build Define: BOARD_M5ATOM_RS485_CANUNIT +* Power: 12V via RS485 Module or via USB + +M5 Atom RS232 with M5 CAN Unit +-------------------------------- +* Hardware: [ATOM RS232](https://docs.m5stack.com/en/atom/atomic232) + [CAN Unit](http://docs.m5stack.com/en/unit/can) +* Prebuild Binary: m5stack-atom-rs232-canunit-all.bin +* Build Define: BOARD_M5ATOM_RS232_CANUNIT +* Power: 12V via RS232 Module or via USB + M5 Stack Atom Canunit --------------------- * Hardware: [M5_ATOM](http://docs.m5stack.com/en/core/atom_lite) + [CAN Unit](http://docs.m5stack.com/en/unit/can)