Closed lovefool closed 8 months ago
Looking into espSoftwareSerial, esp32SoftSerial but not found the cause. And then looking into E220 library, found the reason. In LoRa_E220.h, ESP32 and some device can use only Hardware Serial. When I modify this line, at least compile succeed.
#define ACTIVATE_SOFTWARE_SERIAL
#define HARDWARE_SERIAL_SELECTABLE_PIN
I added espSoftwareSerial library and modified LoRa_E220.h, a configuration program can communicte with E220 over SoftwareSerial.
I made a small test environment of E220 library with Wemos D1 mini (8266) and SoftwareSerial, and this works great. Then I wanted to use Wemos D1 mini ESP32. For using same schmetic, I added espSoftSerial library (not harware Serial1,2).
When I compile program, and got this error. It seems espSoftware Serial return value differs from original SoftwareSerial.
I try to cast "byte", "unsigned char" and "uint8_t" not work. Any work around for this?
Original code that works with 8266 Code SoftwareSerial mySerial(E220_rxd, E220_txd); LoRa_E220 e220ttl(&mySerial, E220_aux, E220_m0, E220_m1); Error error: invalid conversion from 'EspSoftwareSerial::UART' {aka 'EspSoftwareSerial::BasicUART '} to 'byte' {aka 'unsigned char'} [-fpermissive]
LoRa_E220 e220ttl(&mySerial, E220_aux, E220_m0, E220_m1);
Error when CASTING to byte Code SoftwareSerial mySerial(E220_rxd, E220_txd); LoRa_E220 e220ttl((unsighned)&mySerial, E220_aux, E220_m0, E220_m1); Error error: cast from 'SoftwareSerial' {aka 'EspSoftwareSerial::BasicUART '} to 'byte' {aka 'unsigned char'} loses precision [-fpermissive]