MakeMagazinDE / LoRaWAN

Templates, Listings und anderes zum Make Special LoRaWAN
2 stars 1 forks source link

Examples for all ELV modules #3

Open SirFiChi opened 1 month ago

SirFiChi commented 1 month ago

It would be great if there were sample codes for all ELV modules. Possibly even in combination.

For example, so that you can build a visitor counter that transmits the number of trips on a pin, or on the contact interface (https://de.elv.com/p/elv-contact1-applikationsmodul-kontakt-interface-elv-am-ci1-P158054/?itemId=158054), to the TTN via LoraWAN, but the values can also be read on the display (https://de.elv.com/p/elv-applikationsmodul-display-1-elv-am-dsp1-P158915/?itemId=158915).

Thank you very much. (=

Meadowtec commented 1 month ago

While I really support your idea since it would save some time (I'm a hardware engineer, my programming skills are quite limmited), keep in mind, it's just C after all. If you have some C coding experience, it's not so difficult. The template has a lot of code in it which you can copy and reuse. The magazine is excellent and has a lot of details about the embedded hardware. I had to read it several times to discover all the info :-) The STM32WL5 datasheet also has a lot of comprehensive information in it.

Regarding your example: You could reuse the GPIO initialization and debounce code from the user-button to implement the counter. There is a CPU tick available to calculate counts per minute. Again code from the user-button handling to initiate a LoraWan transmission. All of that can run in an endless loop in app_init(). I don't know the display but if you know the model number, you can google for a tutorial code for the STM Cube IDE and implement it. My guess is that it is a I2C connected display and a I2C driver is available in the template. It's even used for the temp-hum module in the magazine.

In short, keep tinkering ! That's what it is all about. You will fail and learn - a lot !