ArduinoModbus depends on the ArduinoRS485 library

WVESP32
Posts: 2
Joined: Thu Feb 07, 2019 9:45 am

ArduinoModbus depends on the ArduinoRS485 library

Postby WVESP32 » Thu Feb 07, 2019 10:24 am

Hi guys,
i'm new in Espressif forum. :P
My order was: "ESP32: include a Modbus TCP server application"

My Platform for Arduino "ESP32-EVB" is: PlatFormIO ( newest: Home 2.0.0 ), and VisualStudioCode
platform.io:
[env:xxxxxxx]
platform = espressif32
board = esp32-evb
framework = arduino
board_build.partitions = default.csv
...

What i'm doing (after reading some examples) inside PlatFormIO:
1. append the new library "ArduinoModbus"
... compiling: he said missing "ArduinoRS485" ...
2. so i append the new library "ArduinoRS485"

3. i'm appending "lib_ldf_mode = deep+" in my platform.io, because installed libs are in:
"...\.platformio\lib\ArduinoModbus_ID5816"
"...\.platformio\lib\ArduinoRS485_ID5814"

My source modification is only 2 includes in a new cpp-file:

#include <ArduinoRS485.h> // ArduinoModbus depends on the ArduinoRS485 library
#include <ArduinoModbus.h>

the compiler said:
....
D:\orcad\spb_data\.platformio\lib\ArduinoRS485_ID5814\src\RS485.cpp: In member function 'virtual void RS485Class::begin(long unsigned int)':
D:\orcad\spb_data\.platformio\lib\ArduinoRS485_ID5814\src\RS485.cpp:33:29: warning: large integer implicitly truncated to unsigned type [-Woverflow]
begin(baudrate, SERIAL_8N1);
^
D:\orcad\spb_data\.platformio\lib\ArduinoRS485_ID5814\src\RS485.cpp: At global scope:
D:\orcad\spb_data\.platformio\lib\ArduinoRS485_ID5814\src\RS485.cpp:169:18: error: 'SERIAL_PORT_HARDWARE' was not declared in this scope
RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS845_DEFAULT_DE_PIN, RS845_DEFAULT_RE_PIN);
^
In file included from D:\orcad\spb_data\.platformio\lib\ArduinoRS485_ID5814\src\RS485.cpp:20:0:
D:\orcad\spb_data\.platformio\lib\ArduinoRS485_ID5814\src\RS485.h:35:30: error: 'A6' was not declared in this scope
#define RS845_DEFAULT_DE_PIN A6
^
D:\orcad\spb_data\.platformio\lib\ArduinoRS485_ID5814\src\RS485.cpp:169:62: note: in expansion of macro 'RS845_DEFAULT_DE_PIN'
RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS845_DEFAULT_DE_PIN, RS845_DEFAULT_RE_PIN);
^
D:\orcad\spb_data\.platformio\lib\ArduinoRS485_ID5814\src\RS485.h:36:30: error: 'A5' was not declared in this scope
#define RS845_DEFAULT_RE_PIN A5
^
D:\orcad\spb_data\.platformio\lib\ArduinoRS485_ID5814\src\RS485.cpp:169:84: note: in expansion of macro 'RS845_DEFAULT_RE_PIN'
RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS845_DEFAULT_DE_PIN, RS845_DEFAULT_RE_PIN);
^

Searching google for 'SERIAL_PORT_HARDWARE', found a: #define SERIAL_PORT_HARDWARE Serial1
but that makes no sense !!

Is there any way to solve this ???
Please help ....

Who is online

Users browsing this forum: No registered users and 8 guests