Skip to content
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

[RF] handle 64 bits values (except for UNO) #698

Merged
merged 3 commits into from
Jul 18, 2020
Merged

Conversation

1technophile
Copy link
Owner

@1technophile 1technophile commented Jul 10, 2020

#693

This PR enables to handle 64 bits values except for Arduino UNO.
Why limiting it on UNO, mainly to reduce the sketch size. To handle 64 bits values we need to activate ARDUINOJSON_USE_LONG_LONG and this activation generate a too big sketch for the Uno when using the RF gateway.
Added to that I found also a limit on arduino boards, the usage of ·´strtoull´ function is not available. This function is not a lot used in the code. Only with the ´simpleReceiving` method.
This method is currently enable by default but the question of its relevantness is asked below :
https://community.openmqttgateway.com/t/vote-removing-simplereceiving-and-simplepublishing/1044
simpleReceiving and simplePublishing enables to receive and send with a lite payload (no json), it was the first data format supported by OpenMQTTGateway.
Now I suspect that json is the mostly i used format.
We could develop an ´strtoull´ for Arduino but before doing that I prefer to know the simpleReceiving usage.

@1technophile 1technophile linked an issue Jul 10, 2020 that may be closed by this pull request
@1technophile 1technophile changed the title [RF] handle 64 bits value [RF] handle 64 bits value (except for UNO) Jul 10, 2020
@1technophile 1technophile changed the title [RF] handle 64 bits value (except for UNO) [RF] handle 64 bits values (except for UNO) Jul 10, 2020
@1technophile 1technophile force-pushed the RF-64bits branch 3 times, most recently from 8bd7b6d to 0c98777 Compare July 11, 2020 01:02
@1technophile 1technophile added this to the v0.9.5 milestone Jul 11, 2020
Arduino UNO is not enough powerfull to handle properly uint64_t in terms of memory so differenciate the variable type depending on the board type
With this configuration ATMega will not be able to receive with simpleReceiving 64 bits values. Of course Json will work with 64 bits values for this board.
@1technophile
Copy link
Owner Author

@Legion2 As the poll goes into a little usage of simpleReceiving versus json I think this PR may be merged like that, minus your comments/suggestions.

Another PR would remove the simpleReceiving function when the poll is confirmed.

Copy link
Contributor

@Legion2 Legion2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you decided where to use the TYPE_UL_ULL type?

Copy link
Contributor

@Legion2 Legion2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. I don't like that we mix the types of the signals of the different gateways, but I don't know how to do it better.

@1technophile
Copy link
Owner Author

@Legion2 Thanks for the advices on this PR!

* rename TYPE_UL_ULL to SIGNAL_SIZE_UL_ULL
* build deduplication function only when the relevant gateways are built
* replace 2 dimensions array by a structure so as to handle the time with an uint32_t  when using an ESP (instead of a uint64_t)
* change storeValue and isAduplicate function names
* point to the rcswitch revision with the new 40 bits protocol
@1technophile 1technophile merged commit 6e9b170 into development Jul 18, 2020
@1technophile 1technophile deleted the RF-64bits branch July 18, 2020 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send 40-bit rf signal with some bits encoded incorrectly
2 participants