|Software apps and online services:|
RASP.ONE is a project for building a Raspberry node network that communicates with nodes or with central via subscription method. Looking at the Infrastructure and Process design, I'm ready to start the description.
I took a Raspberry node (A), and connected pin (6) to a PIR sensor (or temp sensor or gas sensor etc.).
When on Raspberry node (A), start one event on pin number (6), for example, the node calls the central DB (maria DB 10) and asks the subscriber through event node pin 6 to know what to do.
Node (B) is a particular node because it is a central node. In the network it is possible to have many central nodes and set up node (A) to send to all central subscribers the events present in the network.
NOTE 1: If you'd like, it is possible to have many Centrals (control panel) in the network all with the same information or each one with partial information or partial maps.
NOTE 2: Now, for a simple example, the subscriber is node (B), the Central node, but if you'd like, it is possible to have another normal node, node C for example, and not have signaling on the central control panel yet make a direct workflow without a central administration.
The central node is a special node because it has installed on it RASP.ONE CENTRAL edition software.
Rasp.one CENTRAL is a software uwp xaml and it is possible to install on Raspberry hardware or a normal personal computer. With this software it is possible to load a house map design and positioned over icons of components (PIR, light sensor, Raspberry, etc.).
It is possible drag and drop icons, or, for example, configure that the PIR sensor on node (A) works on pin (6), or configure that the node (B) subscribes an event on node (A) pin (6), or makes a rule to turn on a light via node (C) pin (26) when node (A) pin (6) goes on.
Now a Rasp.one Central software uses maria db 10 on Synology NAS to read Subscription, Rules, and network configuration to design a Central MAP.
But you can use a cloud mySQL service for the same results.
In the feature I want to study a compact client db to have an information node onboard and not based on a single point of failure = maria db.
In this mode all nodes know your information, and in order to know a network, rasp.one information must discover the network and send a discovery status message.
But not now. Now I have built a software and declared only the PIR sensor and relay components for the light, so the toolbar shows only these icons to add to the map.
But now I must finish a connection from the map and configuration with nodes and attach a finished sending winsock modules, then I must build an interface for declaring rules and engine to execute them.
Next step is to try to use the temperature sensor or water sensor and add them on the component toolbar.
When the project ends with this architecture it is possible to configure a Raspberry network and control GPIO pins and their connected components only with a central software based on subscriber and workflow rules.
The electronic schema information are inside the application and when i specify for exemple the PIR at this node work whit pin X is possible for the application show a GPIO graphics for explain the PIR connection
and now Relay connection , but have change a interface using my custom control for design in c# (xaml not work correctly with big page)
Please check the github project, and remenber the db schema are into project at
remember is mysql db, i discovery docker for raspberry have a mysql image, mmm any idea :)
NOTE : Googlee home arrived in Italy and now my rasp.one
Now xaml is very catastrofic when a have a big page then ok i write a dedicate control, and now a property panel are a separated object.
The mainpage code is sharp and I have 2 hour of time and implemente new component the IPcam, in my house have 2 IPCam (foscam) and is possible get a photo directly url end point and I have build another control that grab foto from url every 1 second. The ipcampopup is possible close or pause, is very important for me because not know a timer in xaml and now i know :)
Ok this is a video
First i have developer a StreamSocket system for comunicate between Central and NODE, but have a problem message lost and bla bla bla.
Now I have userd a Message Queue Telemetry Transport MQTT.net available as nuget dll and try to sobstiture NODE code for send and receive message .
Now when a Central start use my class and create MQTTServer, when click on lamp on central map for turn on lamp, the code send a message MQTT with Topic "RASP/IP_node" and in the message is a json of RaspaProtocol object.
All node when start use a my class MQTT and create a MQTTClient with subscription Topic "RASP/IP_node" and receive all message the central want send to specific node.
A node for send a response on Central Rasp send a Topic "RASP/Central" in this mode is possible have more Central and all have a information for process a correctli map on the screen.
PS: The comunication are protected using MQTT User a Pass but not cripted
OK this day is a great day for rasp.one, in the feature need to implement a RULES, but first I must to be clean a DB struture with a refuse.
NODE is a component developed on UWP c # platform that implements an MQTT client and is built with the sole purpose of guaranteeing to the central system a complete control of the raspberry and its GPIO.
Through MQTT it is controlled through messages sent by the control unit to which a node subscribes during the statup phase, but the client also performs grab operations of the system information, keeps the client's date time updated, communicating any variation of the gpio to the control panel.
Only in a second phase I will see to abolish the central node (or the central nodes) to overturn the client server in a reticular network where each raspberry and client and server of the whole ecosystem.
One of the issues that I think I have to keep under observation is the issue of frequent win iot crashes that register in the software debugging phase.
Probabilemnte will not happen so often with the software in the finished phase but I think it is necessary to have a system that monitors the constant functioning state of the nodes.
Great Week End
I have optimizzed sensor engine,mqtt engine i have only a problem with repetitive read but i think to solve easy.
In this new release i have add to project temperature sensor DHT11 e DHT22 , in the interface i have add a tool temperature and the config panels.
Then I have build a little code for configure Rules for automatize run action when sensor or combination of sensor give e signal, but i must work a lot for finish this parts.
Then i have change topic key message for mqtt and now the subsription permit to have many CENTRAL, one DB e one RULE SERVER.
For short I have design a network comunication schema for explain the comunication between NODE-gpioPIN-SENSOR , CENTRAL, SERVER RULES and DB MYSQL and MOSQUITTO MQTT.
For node,central and rules the server code is into Rasp.one Github project, DB Mysql and Mosquitto is disponible to install into Raspberry.
a video for demostrate temperature sensor and rules pannel
and now have a stable version for this.
Now i must build a c# library for read many sensor, but for arduino c++ or pyton and the linux word is simple found it, if I want found library for win iot c# is to hard to find.
If have a site that contains a c# script for add many sensor to my app write a comment to this project , thanks :)
I look for a site that have a simple class to interface a sensor but i think need study serial gpio pin and spi pin.
Anyway i must study alot.
Add schema electronic for Temperature sensor
Add code for control push button, that now play voice when push , but for the next release add bell control for play voice or mp3 for your bell configuration and must finish a rules for program a push button in this mode :
if push button ON
then bell kitchen play sound 1
and bell bathroom play sound 2
and bell garage play voice "finish to work have a family at dooor"
the next release must work to rules
ok the code is publish