Post by gb0101010101 on Mar 24, 2019 15:53:07 GMT -8
Was disappointed to see that OurWeather does not implement a generic MQTT client so I added one. This snowballed as the readings were not always in the correct units so I added Measurement Systems for UK, USA, and Europe (SI). This is a work in progress and will change. You can get the source from:
Units have been updated everywhere they are displayed EXCEPT for the individual REST variables. The FULL REST string has been updated. I will complete this but I have done too much coding this weekend and my butt is sore.
I made minor changes to Blynk and Weather Underground code. Do not use Blynk so not tested. Weather Underground is also not tested by the POST URL looks good.
Post by gb0101010101 on Mar 26, 2019 8:50:57 GMT -8
Will certainly write some docs once I am done making changes. Still want to add some missing data such as rainfall (hourly, daily). Also was to make MQTT user configurable without editing code. To do this I would like to save data to EEPROM. Could you please provide code to do this?
IP address: Can be 4 x 3 digits (uint8_t) OR 15 character string NNN.NNN.NNN.NNN Username & Password: Saved separately with length at least 12 characters each. Support any characters.
Post by gb0101010101 on Apr 2, 2019 15:17:02 GMT -8
I read up on EEPROM and determined the following. Please let me know if this is correct so I can implement MQTT save variables.
Each address in EEPROM can store a byte (of value 0-255) of information. So if I want to store and IP address I will need to write four bytes.
e.g. the numbers 192, 168, 1, 100 would written to four bytes.
For text, each character takes up a byte, so I have my 12 character char array for MQTT password and write each character.
Looking at EEPROM write code in Utils.h I see that the last written address is 349 for BlynkAuthCode. This is a String that does not have a set length and your code writes each character of the string. So how do you know what the next safe address is?
Should all strings be converted to fixed char array before being written so that you know the addresses it will use?
WeatherUnderground_StationID starts at address 200 and reads 15 bytes. What if someone enters a station ID that is 30 characters long? It looks like this will overwrite the address space used for WeatherUnderground_StationKey which starts at 215. There is nothing in aREST setWUSID() function or writeEEPROMstate function that limits the input length and and the max address it could write to.
Please let me know so I can understand this and finish the MQTT implementation.
Post by gb0101010101 on Apr 6, 2019 20:25:05 GMT -8
I know of Zabbix but have not used it. My location is remote and Internet can be spotty so I focus on local data storage with upload to Cloud when available. That is why I use OpenHAB and MQTT. Since I had OpenHAB already setup for home automation I quickly configured it to draw those graphs from MQTT data. There are other 'widgets' in OpenHAB for displaying weather related data, such as compass style wind direction, but I have not played with that yet.
I'm sure others love the Cloud but for me it is a constant problem.