-
-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MinorChanges: SoftwareSerial for RS485 #1300
Comments
Thanks for your suggestion. AVR (and maybe others) already use soft serial for rs485 by default, so there is no need to introduce a new define.
Could you describe which software serial you mean?
Do you mean https://github.com/plerup/espsoftwareserial ? (There are multiple libraries matching that name and it would be good if we knew which one to use.) For reference, AltSoftSerial (which is currently used if a RS485 node or gateway is compiled for ESP8266/ESP32 with MySensors) provides this output during compilation:
|
sorry, no experiences with Altsoftserial, except the same you had (and had no motivation to read that part of the code too) SoftwareSerial: i have read the discussions (some months ago) with the changes in the source too, its really not important WHICH of them to be used. just keep in mind that ESP's need another one then the AVR's |
I've created #1510 which implements the suggest fix. This enables RS485 communication on any compatible pin pair while keeping the default Please let me know if there is anything that needs to be adjusted to make it compatible with the project standards and concepts. Thanks! |
Todo:
+) include SoftwareSerial to drivers
+) include espsoftwareserial to drivers
Changes in File MySensors.h
replace line 372 with
#if defined(MY_RS485_SWSERIAL) #if defined(ESP8266) || defined(ESP32) #include "drivers/ESPSoftwareSerial/SoftwareSerial.cpp" #elif #include "drivers/SoftwareSerial/SoftwareSerial.cpp" #endif #elif #include "drivers/AltSoftSerial/AltSoftSerial.cpp" #endif
File hal/transport/RS485/MyTransportRS485.cpp
replace line 90 with:
#if defined(MY_RS485_SWSERIAL) SoftwareSerial& _dev = MY_RS485_SWSERIAL; #elif #include "drivers/AltSoftSerial/AltSoftSerial.cpp" #endif
thank you! (sorry for the formating)
The text was updated successfully, but these errors were encountered: