-
-
Notifications
You must be signed in to change notification settings - Fork 896
Split Application and Driver #36
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
Conversation
changing few uint16 variables to uint8
NodeJsController sending Time broadcasts every few minutes. Sensor accepting not just Time messages addressed to the specific sensor.
ToSa27, why did you elect to remove the RF24_PA_LEVEL_GW from MyConfig.h https://github.com/mysensors/Arduino/pull/36/files#diff-4 ? We have seen cases where users need to use a different PA level for amplified high-gain radios on the gateway. |
Thanks for the PR. MQTT/Ethernet gateway uses other SS/CE gpios than serial and sensors (Ethernet library has "hardcoded" pins with conflicts with the default 9/10 we use). One proposal is to change the default pis used by the library so that we don't have any conflict with Ethernet any more. Only problem is if people have designed their own boards they have to change their MyConfig setting back to the old values. |
@bblacey For simplicity I would propose something like the defines below in “MyConfig.h” and then a check in the sketch that throws a compile error if e.g. in the serial gateway sketch the define is not “MYSENSORS_SERIAL_GATEWAY”… // pick ONE of these - other board layouts can be easily added this way #ifdef MYSENSORS_SENSOR #ifdef MYSENSORS_SERIAL_GATEWAY #ifdef MYSENSORS_ETHERNET_MQTT_GATEWAY #ifdef MYSENSORS_RF_NRF24 |
@hek The easiest way to keep these settings away from the real code would be a more complex MyConfig.h that takes care about different board layouts. We could even create separate header files for each “board layout” and then include the one appropriate for the given build process (similar to what Arduino IDE does). See code snippet in reply to @bblacey ... |
Adjusted all Gateway examples but only one sensor example so far (DallasTemperature). Other sensor examples should get the same three lines added (not mandatory but helps avoiding unnecessary debugging when selecting the wrong setup)
If we NOT should have the same pin-assignements for both ethernet and normal sensors (what is your opinion on this?) I think we at least could afford to have separate set of defines for the Ethernet+MQTT-gateways. People will most certainly forget to go into MyConfig and uncomment the right define-statement when compiling their gateways. Couldn't the MyDriverNRF24-constructor still take CS/CE arguments and default to RF24_CS_PIN /RF24_CE_PIN. But in Eth/MQTT they get overridden. Would it also make sense to move all the NRF-config to MyDriverNRF24.h? |
Have a look at the additional commit. The three lines in e.g. EthernetGateway.ino ensure that the define is updated accordingly - otherwise the compilation fails with an appropriate error that guides the user immediately to MyConfig: #ifndef MYSENSORS_ETHERNET_MQTT_GATEWAY https://github.com/ToSa27/Arduino/commit/2647345c4def221e19a7de67b5622ea5fa162533 |
Ahh ;) missed that one. |
Missed your second point - I'll move the nrf24 specific defines to the driver to reduce the complexity of the MyConfig.h file. |
Split Application and Driver to simplify integration of other radio modules
Slightly Reduced Bootloader Size
Accept Time Broadcasts