Developing my weather station, Work in Progress
-
Using MQTT in two directions, from the sensor module to eGeoffrey and the other way around, turned out to be very simple.
During development and testing it is handy to control several aspects of each individual sensor.
The following aspects will be made adjustable from within eGeoffrey:-
on/off
-
operational data transmission interval
-
test data transmission interval
-
operational/test
-
adjust measurement level
To send all these parameters from within eGeoffrey a sensor control page is made.
On this page one widget is used to select the number of the sensor.
Than five widgets are used to select the aspect or set the value.
A last widget is used to sent an “acknowledgment” to the module.The sensor module receives the MQTT messages which are transmitted by eGeoffrey. As soon as the “ack” is received the data are processed and stored into EEPROM to be used from now on.
-
-
The idea explained above is working. eGeoffrey sends data to the sensor module and the module sends the requested data in return. That means that with the sensor control page from 12 sensors five aspects can be controlled with eGeoffrey.
To give you an impression of how that is achieved a little bit more detail is below.
eGeoffrey sending data
Topic structure
onshuis/sensor
onshuis/status
onshuis/opsinterval
onshuis/testinterval
onshuis/opstest
onshuis/adjust
onshuis/acksensors publishing with topic:
mesh-in/XXXX/onshuis/sensor
data: integer 0 .. 11mesh-in/XXXX/onshuis/status
data: integer 1 / 0mesh-in/XXXX/onshuis/opsinterval
data: integer 1 .. 60 (minutes)mesh-in/XXXX/onshuis/testinterval
data: integer 1 .. 20 (seconds)
mesh-in/XXXX/onshuis/opstest
data: integer 1 / 0mesh-in/XXXX/onshuis/adjust
data: float -5 .. 5mesh-in/XXXX/onshuis/ack
data: integer 1widgets:
onshuis/sensor
type: input boxonshuis/status
type: on/off switchonshuis/opsinterval
type: input boxonshuis/testinterval
type: input boxonshuis/opstest
type: on/off switchonshuis/adjust
type: slideronshuis/ack
type: on/off switchTo be sure that the data are received correctly the sensor module sends the data back to eGeoffrey.
Six widgets are used to display the data received from the module.eGeoffrey receiving data
sensors receiving with topic:
mesh-out/+/onshuis/sensor
data: stringmesh-out/+/onshuis/status
data: integer 1 / 0mesh-out/+/onshuis/opsinterval
data: integer 1 .. 60 (minutes)mesh-out/+/onshuis/testinterval
data: integer 1 .. 20 (seconds)mesh-out/+/onshuis/opstest
data: integer 1 / 0mesh-out/+/onshuis/adjust
data: float -5 .. 5widgets:
onshuis/sensor
type: display latest valueonshuis/status
type: display on/off statusonshuis/opsinterval
type: display latest valueonshuis/testinterval
type: display latest valueonshuis/opstest
type: display on/off statusonshuis/adjust
type: display latest valueAlso it is possible to interrogate a module and retrieve the settings from a sensor.
eGeoffrey retrieving sensor settings
Topic structure:
onshuis/retrieve
onshuis/acksensors publishing with topic:
mesh-in/XXXX/onshuis/retrieve
data: integer 0 .. 11mesh-in/XXXX/onshuis/ack
data: integer 1widgets:
onshuis/retrieve
type: input boxonshuis/ack
type: on/off switcheGeoffrey resetting sensor module
After finishing a test series it is handy to reset the module to the default values with only two actions.
Topic structure
onshuis/default
onshuis/acksensors publishing with topic:
mesh-in/XXXX/onshuis/default
data: integer 0 .. 11mesh-in/XXXX/onshuis/ack
data: integer 1widgets:
onshuis/default
type: input boxonshuis/ack
type: on/off switch
-
When one later on changes the "actuator" to "push" the data on the "configuration" tab are deleted.
Would be handy if these data would be retained and not deleted.Understand but when something is saved, I loose previous configuration so bot something easy to implement as for now
Surveying the CPU temperature is a good idea.
Very nice chart!
The idea explained above is working. eGeoffrey sends data to the sensor module and the module sends the requested data in return. That means that with the sensor control page from 12 sensors five aspects can be controlled with eGeoffrey.
Good! Just in case you want to share a screenshot of the page you have built once completed, I'd be really curious
-
Using the same technic it is also possible to turn all sensors on or off and to switch all sensors from test mode into operations mode. Last but not least the possibility to evoke a reboot of a module is added.
Result
A sensor module has several sensors.
Each sensor transmits data with an operational interval. For testing purposes each sensor can transmit data with a test interval. When the quantity measured changes rapidly above a "delta" value extra data is transmitted to catch this kind of rapid strong variations.
Furthermore the measured value of each sensor can be modified with a positive or negative float value. The aim is to move the curve representing the data of the sensor up and down on the screen.The values mentioned above are controlled by eGeoffrey. With eGeoffrey the following aspects of each sensor can be modified:
-
on/off
-
ops/test
-
ops interval
-
test interval
-
delta
-
adjustment value
When an aspect of a sensor is changed, the value of each aspect is displayed.
Next to that each sensor can be interrogated to transmit the value of it's aspects.
All values can be reset to their default values.All sensors together of each module can be switched:
-
on/off
-
from ops to test and vice versa
A module can be rebooted.
-
-
Some screenshots of the system as it is now:
On this part of the page one can select a sensor and change the values of the aspects. "kies sensor" is used to select a sensor.
"bevestig bericht" transmits an acknowledgement. On receipt the changes are performed.
"opvragen data" facilitates querying a sensor.
under "data" the value of all aspects are displayed."reset module" enforces resetting the aspects to their default values.
"totaal" designates the buttons to change settings of all sensors together
-
I like it a lot!
-
Where I have to recreate eGeoffrey for some reasons, I take the opportunity to re-work my documentation to come to a more general approach. I am also going to find out if some ideas which have popped-up along the way to come to a yet more smooth workflow are feasible.
The documentation will result in a "recipe" for myself to create the weather station in eGeoffrey from scratch.(just in case I would like to change in the future). It will not be a "step-by-step" description. When somebody did follow my "Howto" for a simple working system this recipe will be intelligible enough to come to a working weather station. When my station is operational and I have debugged it I will publish my updated document here.
-
I have some intermediate results which I am already rather satisfied with:
This is the weather station control page.
The first screenshot is the part where data to be adapted are inserted
I succeeded to change the colour of the text from black into blue. I like blue more because results in a more "pleasant" impression of the image.
This the part of the page where the data sent back by the weather station are displayed.
Here I do like the green colour because the clear signal of it. Only text from numerical values can be forced to green.
I did not succeed to change the colour of the fields above the rows on a page.
In general I would like the possibility to change the colour of the presentation of data from black in user selectable colour.
Furthermore I would like to have "AAN / UIT" in the green field "can/uit" instead of "0" or "1". I would also prefer "OPS / TEST" for the green field "ops/test" but that does not work yet.
I posted a different remark about that one.
-
I enjoy working with eGeoffrey.
I made some more adaptations to the display.
This is the status at the moment for my display windows:With each widget is now a short term to indicate which action is performed with the widget.
In general in green the feedback off the module on the ordered action is presented.By selecting "-1" for the module, the text in the info widget is blanked.
I like this result already very much!
Great system!Still some "details" to be solved.
-
I think I am getting there!
Controlling sensors
Controlling modules
I think only a few enhancements are left.
The first of which is the translation from "1" and "0" to other values.
The second one would be an overview of the possible colours.
The third one would be to know if it is possible to change the colour of the font of the text of data.
-
Very nice job first of all, in a short time the result is very compelling!
The first of which is the translation from "1" and "0" to other values.
Ok let me try to understand better. Is the post processing value not a viable option because you need to use the value somewhere else right? So just a "translation" which should happen in the presentation layer right?
The second one would be an overview of the possible colours.
The third one would be to know if it is possible to change the colour of the font of the text of data.Here you mean the colour of the row title? or the widget title?
-
Have a look to the row with five green widgets.
I would like to have the "1" being presented as "ops" and the "0" as "test".
I solved the issue for the time being with the explanatory text in the widget.Furthermore the only black text I could not change until now are the ones you see on the print screen.
If there is a way for the user to change the colour of the headings of the rows on a page also it would be the cherry on the cake and finish the lay-out.
-
Testing
During testing of the hardware it turned out that it was not possible to check why a widget did not react. The problem can have different causes. Therefore several parts of a data transfer path need to be checked.
To support de-bugging this issue plural tests are necessary:query each sensor individually with a dummy value in return
query all sensors simultaneously with a dummy value in return
blank all sensors simultaneously
query each sensor individually with a real sensor value in returnImplementation:
Extra widget before ack to select "settings, dummy, dummy all, blank all, sensor".
Topic:
onshuis/ackonshuis/retrieve/select
onshuis/retrieve/valueSensor:
mesh-out/XXXX/onshuis/retrieve/select
mesh-in/+/onshuis/retrieve/valueWidget:
mesh-out/onshuis/retrieve/select
mesh-in/onshuis/retrieve/valueOn the module page part "retrieve" the widget "retrieve select" between "sensor select" widget and "acknowledge" widget.
Next to them the widget "retrieve value".
Te result:
-
@eporocrail said in My weather station:
I would like to have the "1" being presented as "ops" and the "0" as "test".
This seems related to the transform discussion of the other thread right?
If there is a way for the user to change the colour of the headings of the rows on a page also it would be the cherry on the cake and finish the lay-out.
-
Yes, the transformation is one and the same issue.
Thanks for taking-up the colour remark.
-
I like to make as much as possible the same.
Sensor name and sensor topic e.g.
But this does NOT work with wildcard signs in the name of the sensor.
Apparently the stuff is saved correctly but a sensor is not created.I don't think it is a bug, just something for the user to be aware of.
-
The ESP6288MQTTmesh library seems to have a limit on the outgoing "topic" of 65 characters.
I have to adapt my topic structure accordingly.
-
The new topic structure is implemented in the software of the sensor module and in eGeoffrey. Adapting eGeoffrey is done with the "advanced editor" mainly. Once you know the conventions, it works like a charm. The first few tests are OK.
Today the detailed testing is planned. I'm curious which challenges pop up.
-
I have been testing the new GUI. It is working very well!
Software of the sensor module is now in line with eGeoffrey. Ofcourse several changes were required.
Detailed end test tomorrow.
-
The test regarding controlling the individual sensors is concluded successfully. Controlling the complete module still has some issues.