Skip to content

Latest commit

 

History

History
169 lines (134 loc) · 5.43 KB

README.md

File metadata and controls

169 lines (134 loc) · 5.43 KB

RaspiSensor

Another Control Panel / Dashboard for the Raspberry Pi with sensors.

Supported Sensors:

  • mcp3008 (AD Converter, 8 Channels)
  • Moisture Sensor (with mcp3008)
  • 1-Wire Temprature Sensor (tested with DS18S20)
  • 433mhz transmitter
  • Webcam

###Requirements

###Tutorials

###Updates For the first time i will change everything witout a comment. If you update your code it is possible you must reconfigure raspiSensor.

###Security (IMPORTANT) At the moment the dashboard has no login! To secure your dashboard you can use a client-cert or htaccess/htpasswd.

###Screenshots

###Install

  1. Install / Configureate all requirements (above)
  2. Copy all files in your http-dir. For Apache and Lighttpd: /var/www
  3. Create a MySQL Databse and import the default table from /var/www/_db/tabledb.sql
  4. Change the mysql login/passwort in /var/www/_py/config.json
  5. Create a cronjob (every 5 minutes) for the logger /var/www/_py/sensor.py
  6. edit sudo nano /var/www/_raspberry-remote/send.cpp. On line 17 you must change the PIN number (see http://wiringpi.com/pins/)
  7. Now run this command: cd /var/www/_raspberry-remote then make send
  8. Make modul config editable: sudo chmod 777 /var/www/_py/config.moduls.json

###Create new Sensor To create a new sensor edit _py/config.json. You can find the avaible sensor types in the next section ;)

{
    "mysql": {
		"host": "127.0.0.1",
		"port": "3306",
		"user": "root",
		"password": "root",
		"database": "rpi"
	},
	
	"sensors": [
		{
			"name": "moisture1",
			"displayName": "Erdf.",
			"type": "mcp3008",
			"arguments": {
					"channel": 0,
					"minDataRaw": 0,
					"maxDataRaw": 1023,
					"dataRefinedInvert": 1
			}
		},
		{
			"name": "test2",
			"displayName": "Test 2",
			"type": "ds18s20",
			"arguments": {
					"dirname": "10-000802292070"
			}
			
		}
	]
}

###Configurate Dashboard Open the index.php with your browser and click on "Config". You can change the order with Drag&Drop.

###Sensor Types MCP3008 (AD Converter, 8 Channels) Normaly the mcp3008 outputs a value from 0 to 1023, but some sensors have a other minimum and maximum. As example a moiture sensor has the minimum at 470 and the maximum at 1023. 470 means the soil es very wet and 1023 is dry. If the sensor outputs a value of 500 (wet): 500 / (1023/100) = 48% (wrong) (500-470) / ( (1023 - 470) / 100 ) = 5.42% (correct, but we need 94.58%, so we invert the result with: 100-5.42 = 94.58%)

"name": "moisture1",
"displayName": "Erdf.",
"type": "mcp3008",
"arguments": {
		"channel": 0,
		"minDataRaw": 0,
		"maxDataRaw": 1023,
		"dataRefinedInvert": 1
}

1-Wire Temprature Sensor (tested with DS18S20)

"name": "temp1",
"displayName": "Temp.",
"type": "ds18s20",
"arguments": {
		"dirname": "10-000802292070"
}

Replace 10-000802292070 with your sensor name. You list all connected 1-wire sensors with this command: dir /sys/bus/w1/devices/

###Webcam To display a webcam picture on the dashboard you need to save the captured image in your http-dir (e.g. /var/www/test.jpg). In the config of the webcamModul you must set the Image Source to test.jpg or any other URL of an webcam-image which is reachable over the internet. Personaly i use fswebcam to capture every 5 seconds a image of my home.

###Troubleshooting Webcam module doesn't display a image Check your configured "Image Source" in the Dashboard Config. If your image is saved in /var/www/ you must only use the image name e.g. test.jpg.

Can't save the Module Config Please make /var/www/_py/config.moduls.json editable ;)

How to style the gauge chart? Take a look at this options: https://developers.google.com/chart/interactive/docs/gallery/gauge#Configuration_Options Put this options in a json format and save them in the "Style Options" Field.

{
    "redFrom": 0,
    "redTo": 15,
    "yellowFrom": 15,
    "yellowTo": 20,
    "minorTicks": 5,
    "max": 100,
    "min": 0
}

Problem not solved? Open a issue: https://github.com/DevertNet/RaspiSensor/issues

###Credits Raspberry-Remote (https://github.com/xkonni/raspberry-remote) RC-Switch (https://github.com/r10r/rcswitch-pi)

###Todo

  • Installer
  • Manage Sensors over Dashboard
  • Chart classification
  • Configurate how many days/hours in the chart will displayed
  • Login Module
  • MVC...