Showing posts with label EmonCMS. Show all posts
Showing posts with label EmonCMS. Show all posts

March 01, 2020

emonCMS

Ubuntu 18.04 LTS

EmonScripts/readme.md at master · openenergymonitor/EmonScripts · GitHub

echo $USER' ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/$USER && sudo chmod 0440 /etc/sudoers.d/$USER


wget https://raw.githubusercontent.com/openenergymonitor/EmonScripts/stable/install/init.sh
chmod +x init.sh && ./init.sh


settings.ini in /var/www/emoncms/.

cd /opt/openenergymonitor/EmonScripts/install/
nano config.ini

Standard Setup Filepaths

Install location for code from OpenEnergyMonitor GitHub repository such as EmonScripts /opt/openenergymonitor
Install location for modules symlinked to www /opt/emoncms
Main code location /var/www/emoncms
Log file location /var/log/emoncms
Data directory /var/opt/emoncms

November 15, 2017

One-Wire Temperature collection, publishing to EmonCMS using OmegaOnion

I needed a quick solution to log the temperature of my hot water cylinder at home, had an Omega Onion lying about so used that.

OmegaOnion
OmegaOnion EXP Dock
2 x DS18B20 Sensors, wired together with a 5K7 pull-up resistor

From a factory reset:


  • echo "w1-gpio-custom bus0=0,19,0" > /etc/modules.d/55-w1-gpio-custom
  • reboot
  • Find the names of the sensors, "ls /sys/devices/w1_bus_master1/
  • opkg install curl
  • opkg install nano
  • nano temp.sh
#!/bin/ash
temp1=$(awk -F= '/t=/ {printf "%.03f\n", $2/1000}' /sys/devices/w1_bus_master1/28-000006560975/w1_slave)
temp2=$(awk -F= '/t=/ {printf "%.03f\n", $2/1000}' /sys/devices/w1_bus_master1/28-0000065711e6/w1_slave)
curl --data "data={temp1:$temp1,temp2:$temp2}" "http://192.168.1.129/emoncms/input/post.json?node=55&apikey=xxxxxxxxxxxx"
printf "\n"$temp1"\t"$temp2

  • Then all you need is to create a cron job, crontab -e
*/5 * * * * /root/temp.sh >/dev/null